IN THIS BREAKDOWN · 10 SECTIONS
You can read 19% of this breakdown.
The paper in one minute
Chat models are fine-tuned on conversations wrapped in a fixed template. For Llama-3-Instruct, a user turn begins with <|start_header_id|>user<|end_header_id|>. The authors noticed that if you send the model only that opening and let it continue, it writes a user's message: a question or request of the kind it saw during alignment. Send that message back in the normal way and it answers. That is Magpie: no seed questions, no prompt engineering, just the template.
With Llama-3-8B-Instruct they generated 3 million instruction-response pairs (Magpie-Air) in 206 A100 hours; with Llama-3-70B-Instruct, 1 million (Magpie-Pro) in 614. At cloud prices that is about $0.12 and $1.1 per thousand pairs. They then score each instruction for quality and difficulty with Llama-3-8B, compute each one's distance to its nearest neighbor in embedding space to drop near-duplicates, and score responses with a reward model, and select 300,000.
Extensions follow from the same trick: a system prompt describing a math tutor or a Chinese assistant steers what the model asks; appending the template again after a response produces multi-turn conversations; and sampling five responses per instruction and keeping the reward model's best and worst gives preference pairs for DPO.
Fine-tuning Llama-3-8B on 300K filtered pairs beat every public dataset they tested on AlpacaEval 2 and Arena-Hard, beat a public SFT-plus-DPO pipeline, and on AlpacaEval 2 beat Llama-3-8B-Instruct, which was trained on over 10 million examples. With Magpie's own DPO data added, the model passed GPT-4-Turbo on AlpacaEval 2. It lagged on math and knowledge tests until a reasoning-focused add-on was mixed in.
Research notes: the problem, approach and results
approximate cloud cost per 1,000 Magpie-Pro instruction-response pairs from Llama-3-70B-Instruct, on 4 A100s
AlpacaEval 2 length-controlled win rate after SFT on Magpie-Pro filtered versus the best public dataset tested (WildChat)
GSM8K after SFT on Magpie-Pro filtered, against 71.72 for Llama-3-8B-Instruct; a 150K reasoning add-on raised it to 63.08
Instruction-tuning data is either written by people (slow, costly) or generated by prompting a model with seed questions, which narrows what it produces. The data behind open models like Llama-3-Instruct is not public.
Send an aligned open model only its chat template's pre-query part, the tokens that begin a user message. It completes a plausible user instruction; send that back to get the response. Repeat millions of times, filter by quality, difficulty, near-duplicates and reward, and optionally build preference pairs from best and worst responses.
Llama-3-8B fine-tuned on 300K filtered Magpie-Pro pairs scores 25.08 length-controlled win rate on AlpacaEval 2, above every public dataset tested (best 14.62), above UltraChat plus DPO (18.36) and above Llama-3-8B-Instruct (22.92). It trails the official model on Arena-Hard (18.9 vs 20.6) and on GSM8K (47.92 vs 71.72).
Why it matters to an FDE
Customers who want to fine-tune often have no instruction data at all, or cannot send their data to an external API to generate it. Magpie needs only an open-weight chat model running on their own GPUs. Nothing leaves the building, and there is no seed set to write first.
It is cheap and fast. About $1 per thousand pairs with a 70B model; a million responses took 150 hours on four A100s. A domain-specific set of 50,000 pairs is a weekend job.
It can be steered. The paper's system prompts ("you are an assistant for math problems") changed what kind of questions the model invented. A customer can describe their domain the same way: a support assistant for their product, an analyst for their reports.
It inherits the generator's habits. The questions are the kind the generating model expects users to ask; over half were information-seeking in Magpie-Pro, and reasoning tasks were rare enough that math scores fell. The answers are only as good as the model writing them: swapping the answer writer from Llama-3-8B to Qwen2-7B cut the win rate from 22.66 to 15.01. And the generator's license terms on using its outputs to train other models apply, which the paper does not discuss.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 149 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
What the filters, size and generator contributed, preference data, and three misreadings
Free account - 04How it works
The two-step pipeline, filters, the multi-turn and preference extensions, and the training setup
Premium - 05The numbers that matter
Cost, SFT and DPO results, Qwen transfer, benchmarks beyond chat, ablations and trust results
Premium - 06Try it yourself
Recompute costs and claims, see near-duplicate filtering work, and size preference sampling
Premium - 07Where it breaks
Generator dependence, weak reasoning data, judge-based evaluation, safety drift and slips
Premium - 08Using it on a deployment
Generating a domain instruction set on site, filtering it, and checking what it misses
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
