CANCEL your weekend plans.
You NEED to:
• Build a RAG system that cites sources with page numbers
• Implement hybrid search (dense + sparse) for better retrieval
• Add reranking with cross-encoders for top-10 accuracy
• Set up chunking strategies (500 tokens, 50 overlap minimum)
• Build query expansion for better recall
• Add metadata filtering for scoped retrieval
• Implement citation grounding to prevent hallucinations
• Create an eval harness with 50+ golden test cases
• Track retrieval metrics: hit rate, MRR, NDCG
• Add fallback to web search when confidence is low
• Build query rewriting for ambiguous questions
• Implement parent document retrieval for context
• Add embedding caching to reduce latency 80%
• Use colbert or late interaction for better accuracy
• Build a RAG dashboard showing retrieval quality
• Test with adversarial queries that should return nothing
• Document your chunking strategy and why it works
• Benchmark against naive RAG and show improvement
You have way too much to do.
Bookmark & Repost.
Anthropic accidentally leaked their entire source code yesterday. What happened next is one of the most insane stories in tech history.
> Anthropic pushed a software update for Claude Code at 4AM.
> A debugging file was accidentally bundled inside it.
> That file contained 512,000 lines of their proprietary source code.
> A researcher named Chaofan Shou spotted it within minutes and posted the download link on X.
> 21 million people have seen the thread.
> The entire codebase was downloaded, copied and mirrored across GitHub before Anthropic's team had even woken up.
> Anthropic pulled the package and started firing DMCA takedowns at every repo hosting it.
> That's when a Korean developer named Sigrid Jin woke up at 4AM to his phone blowing up.
> He is the most active Claude Code user in the world with the Wall Street Journal reporting he personally used 25 billion tokens last year.
> His girlfriend was worried he'd get sued just for having the code on his machine.
> So he did what any engineer would do.
> He rewrote the entire thing in Python from scratch before sunrise.
> Called it claw-code and Pushed it to GitHub.
> A Python rewrite is a new creative work. DMCA can't touch it.
> The repo hit 30,000 stars faster than any repository in GitHub history.
> He wasn't satisfied. He started rewriting it again in Rust.
> It now has 49,000 stars and 56,000 forks.
> Someone mirrored the original to a decentralised platform with one message, "will never be taken down."
> The code is now permanent. Anthropic cannot get it back.
Anthropic built a system called Undercover Mode specifically to stop Claude from leaking internal secrets. Then they leaked their own source code themselves. You cannot make this up.
𝗧𝗵𝗶𝘀 𝗶𝘀 𝘁𝗵𝗲 𝗼𝗻𝗲 𝗿𝗲𝗽𝗼 𝗲𝘃𝗲𝗿𝘆 𝗔𝗜 𝗲𝗻𝗴𝗶𝗻𝗲𝗲𝗿 𝗺𝘂𝘀𝘁 𝗸𝗻𝗼𝘄.
Not because it’s trending.
But because it shows how RAG actually works in the real world.
The NirDiamant/RAG_Techniques repository isn’t a tutorial dump.
It’s a complete RAG engineering handbook.
𝗪𝗵𝗮𝘁’𝘀 𝘀𝗽𝗲𝗰𝗶𝗮𝗹 𝗮𝗯𝗼𝘂𝘁 𝘁𝗵𝗶𝘀 𝗿𝗲𝗽𝗼 👇
→ It goes far beyond “vector DB + prompt”
→ Covers 40+ RAG techniques, from fundamentals to production-grade systems
→ Every technique is explained with clear intuition + runnable code
→ Designed for engineers building serious GenAI systems, not demos
𝗪𝗵𝗮𝘁 𝘆𝗼𝘂’𝗹𝗹 𝗮𝗰𝘁𝘂𝗮𝗹𝗹𝘆 𝗹𝗲𝗮𝗿𝗻 👇
↳ Foundational RAG done right
↳ Chunk sizing, proposition chunking, reliable RAG
↳ The basics most people skip and later regret
If you’re building copilots, internal search, agents, or production GenAI systems. This repo should already be bookmarked.
𝗚𝗶𝘁𝗛𝘂𝗯 → https://t.co/JJ2Gxl0TMR
Cc : Author
You can now parse any document with one 1.7B parameter model.
It’s called dots-ocr. One system that handles text, tables, formulas, images, and PDFs across 100+ languages.
No separate OCR pipeline.
No task-specific models.
Grateful for the recognition at RelevanceLab. Staying focused on continuous growth and driving technical rigor.
Committed to maintaining high standards and delivering impactful solutions.
Hugging Face has released a 214-page
MASTERCLASS on how to train LLMs
> it’s called The Smol Training Playbook
> and if want to learn how to train LLMs,
> this GIFT is for you
> this training bible walks you through the ENTIRE pipeline
> covers every concept that matters from why you train,
> to what you train, to how you actually pull it off
> from pre-training, to mid-training, to post-training
> it turns vague buzzwords into step-by-step decisions
> architecture, tokenization, data strategy, and infra
> highlights the real-world gotchas
> instabilities, scaling headaches, debugging nightmares
> distills lessons from building actual
> state-of-the-art LLMs, not just toy models
how modern transformer models are actually built
> tokenization: the secret foundation of every LLM
> tokenizer fundamentals
> vocabulary size
> byte pair encoding
> custom vs existing tokenizers
> all the modern attention mechanisms are here
> multi-head attention
> multi-query attention
> grouped-query attention
> multi-latent attention
> every positional encoding trick in the book
> absolute position embedding
> rotary position embedding
> yaRN (yet another rotary network)
> ablate-by-frequency positional encoding
> no position embedding
> randomized no position embedding
> stability hacks that actually work
> z-loss regularization
> query-key normalization
> removing weight decay from embedding layers
> sparse scaling, handled
> mixture-of-experts scaling
> activation ratio tuning
> choosing the right granularity
> sharing experts between layers
> load balancing across experts
> long-context handling via ssm
> hybrid models: transformer plus state space models
data curation = most of your real model quality
> data curation is the main driver of your model’s actual quality
> architecture alone won’t save you
> building the right data mixture is an art,
> not just dumping in more web scrapes
> curriculum learning, adaptive mixes, ablate everything
> you need curriculum learning:
> design data mixes hat evolve as training progresses
> use adaptive mixtures that shift emphasis
> based on model stage and performance
> ablate everything: run experiments to systematically
> test how each data source or filter impacts results
> smollm3 data
> the smollm3 recipe: balanced english web data,
> broad multilingual sources, high-quality code, and diverse math datasets
> without the right data pipeline,
> even the best architecture will underperform
the training marathon
> do your preflight checklist or die
> check your infrastructure,
> validate your evaluation pipelines,
> set up logging, and configure alerts
> so you don’t miss silent failures
> scaling surprises are inevitable
> things will break at scale in ways they never did in testing
> vanishing throughput? that usually means
> you’ve got a hidden shape mismatch or
> batch dimension bug killing your GPU utilization
> sudden drops in throughput?
> check your software stack for inefficiencies,
> resource leaks, or bad dataloader code
> seeing noisy, spiky loss values?
> your data shuffling is probably broken,
> and the model is seeing repeated or ordered data
> performance worse than expected?
> look for subtle parallelism bugs
> tensor parallel, data parallel,
> or pipeline parallel gone rogue
> monitor like your GPUs depend on it (because they do)
> watch every metric, track utilization, spot anomalies fast
> mid-training is not autopilot
> swap in higher-quality data to improve learning,
> extend the context window if you want bigger inputs,
> and use multi-stage training curricula to maximize gains
> the difference between a good model and a failed run is
> almost always vigilance and relentless debugging during this marathon
post-training
> post-training is where your raw base model
> actually becomes a useful assistant
> always start with supervised fine-tuning (sft)
> use high-quality, well-structured chat data and
> pick a solid template for consistent turns
> sft gives you a stable, cost-effective baseline
> don’t skip it, even if you plan to go deeper
> next, optimize for user preferences
> direct preference optimization (dpo),
> or its variants like kernelized (kto),
> online (orpo), or adversarial (apo)
> these methods actually teach the model
> what “better” looks like beyond simple mimicry
> once you’ve got preference alignment,go on-policy:
> reinforcement learning from human feedback (rlhf)
> or on-policy distillation, which lets your model learn
> from real interactions or stronger models
> this is how you get reliability and sharper behaviors
> the post-training pipeline is where
> assistants are truly sculpted;
> skipping steps means leaving performance,
> safety, and steerability on the table
infra is the boss fight
> this is where most teams lose time,
> money, and sanity if they’re not careful
> inside every gpu
> you’ve got tensor cores and cuda cores for the heavy math,
> plus a memory hierarchy (registers, shared memory, hbm)
> that decides how fast you can feed data to the compute units
> outside the gpu, your interconnects matter
> pcie for gpu-to-cpu,
> nvlink for ultra-fast gpu-to-gpu within a node,
> infiniband or roce for communication between nodes,
> and gpudirect storage for feeding massive datasets
> straight from disk to gpu memory
> make your infra resilient:
> checkpoint your training constantly,
> because something will crash;
> monitor node health so you can kill or restart
> sick nodes before they poison your run
> scaling isn’t just “add more gpus”
> you have to pick and tune the right parallelism:
> data parallelism (dp), pipeline parallelism (pp), tensor parallelism (tp),
> or fully sharded data parallel (fsdp);
> the right combo can double your throughput,
> the wrong one can bottleneck you instantly
to recap
> always start with WHY
> define the core reason you’re training a model
> is it research, a custom production need, or to fill an open-source gap?
> spec what you need: architecture, model size, data mix, assistant type
> transformer or hybrid
> set your model size
> design the right data mixture
> decide what kind of assistant or
> use case you’re targeting
> build infra for the job, plan for chaos, pick your stability tricks
> build infrastructure that matches your goals
> choose the right GPUs
> set up reliable storage
> and plan for network bottlenecks
> expect failures, weird bugs,
> and sudden bottlenecks at scale
> select your stability tricks in advance:
> know which techniques you’ll use to fight loss spikes,
> unstable gradients, and hardware hiccups
closing notes
> the pace of LLM development is relentless,
> but the underlying principles never go out of style
> and this PDF covers what actually matters
> no matter how fast the field changes
> systematic experimentation is everything
> run controlled tests, change one variable at a time, and document every step
> sharp debugging instincts will save you
> more time (and compute budget) than any paper or library
> deep knowledge of both your software stack
> and your hardware is the ultimate unfair advantage;
> know your code, know your chips
> in the end, success comes from relentless curiosity,
> tight feedback loops, and a willingness to question everything
> even your own assumptions
if i had this two years ago, it would have saved me so much time
> if you’re building llms,
> read this before you burn gpu months
happy hacking