Replay-buffer mix for domain SFT: how much general data, and from where?
A team is SFT'ing a 7B model on a narrow legal-summarisation corpus and watching MMLU drop 4 points by step 5k. They want to add a replay buffer of general instruction data to slow the forgetting. Specify a starting recipe: what general source to pull from, what mix ratio to start with, how to tune it, and the failure modes at both extremes of the ratio.
Mix a small slice of general instruction data, around 10%, into your domain SFT batches and tune the ratio against MMLU until forgetting stays inside tolerance.
Imagine teaching someone to write only legal contracts for six months. After a while they get great at contracts but start fumbling everyday emails. To prevent that, every day you sneak in one ordinary email task between the contract drills. Not too many, or the contract skill stalls. Not too few, or the email skill keeps slipping away. You watch two report cards each week, one for contracts and one for general writing, and slide the daily mix up or down until both numbers look healthy. The same idea works for a model. A small refresh of general examples mixed into every batch reminds the network of what it used to know, while most of the practice still pushes it toward the new specialty.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 min: framing forgetting as a two-loss tradeoff + source choice + row-level interleaving + starting ratio + pilot loop with held-out MMLU + failure modes at both extremes + when replay cannot help.
Real products, models, and research that use this idea.
- DeepSeek V4 and Qwen 3.5 post-training mix general instruction data into domain SFT stages to limit forgetting on broad reasoning benchmarks.
- Meta's Llama 4 Maverick fine-tuning recipes interleave general instruction batches when teams adapt the model to narrow verticals like legal or medical text.
- Hugging Face TRL and Axolotl expose dataset-mixing weights as a first-class config, so teams can blend a domain corpus with Tulu 3 or UltraChat-200k in one YAML.
- Open-source legal and medical adapter projects on Hugging Face commonly publish a 10 to 15% Tulu replay slice alongside their domain split in 2026 model cards.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you decide the replay ratio if you cannot run multiple pilot fine-tunes?
QWhy does row-level interleaving beat concatenating a general block before the domain block?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Concatenating one block of general data before the domain block. The model sees the general examples first, then forgets them anyway during the long domain tail. Interleave at the row level instead.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.