Knowledge Distillation in Practice: The Full Pipeline from a Trillion-Parameter Model to a 9B Model
This article walks through a real-world knowledge distillation case in which a ~9B-parameter model reached the top of an open-source model community's trend chart by inheriting the capabilities of a trillion-parameter teacher model. It breaks down the complete pipeline stage by stage—teacher-generated reasoning samples, supervised fine-tuning (SFT), and lightweight reinforcement learning—and then covers a targeted refusal-behavior adjustment performed through activation-based weight editing. Readers will learn how data distillation differs from training from scratch, why preserving full reasoning traces matters, which metrics (accuracy, tokens-per-correct-answer, refusal rate, KL divergence, and format compliance) best reveal whether a distillation succeeded, and how to apply these techniques with proper evaluation and rollback safeguards.
1. A Top-Ranking Small Model Raises a Question
Recently, a derivative model with only about 9 billion parameters climbed to the top of an open-source model community’s trend chart. Its name carries traces of both “large model” and “open-source base,” yet it was not trained from scratch. Instead, the capabilities of a trillion-parameter-scale model were distilled into a small model less than one-hundredth of its size.
What’s notable is that the top-ranking version was not a single transformation, but the result of two steps completed by community developers. First, they used an ultra-large teacher model to generate problem-solving samples and ran a targeted fine-tune on an open-source 9B base model. Second, on top of those inference-specialized weights, they further adjusted the model’s “refusal behavior.” Each step had its own focus, and each came with its own set of results.
The value of this case lies not in the fact that it reached the top, but in how clearly it demonstrates a feasible engineering path for transferring the capabilities of a top-tier large model to a small model at low cost. Below, we unpack this entire pipeline.
2. What Is Large Model Distillation
The core idea of knowledge distillation is to let a small model (the student) learn the output distribution or behavior patterns of a large model (the teacher). Traditional distillation directly fits the teacher’s logits as soft labels. In the large-model era, however, the more mainstream approach is “data distillation”: the teacher generates a large volume of high-quality samples, which are then used as a supervision signal to fine-tune the student model.
Compared with pre-training from scratch, distillation offers clear advantages:
- Low cost: The student only needs to fine-tune on a limited set of high-quality data, without repeating the long, drawn-out pre-training process.
- Fast results: The student directly inherits the teacher’s problem-solving habits and reasoning style on the target task.
- Tailorable: You can distill toward a specific capability dimension (such as math or STEM reasoning) rather than pursuing an “all-around” model.
3. Breaking Down the Full Pipeline
Stage 1: The Teacher Generates High-Quality Reasoning Samples
The developers had a teacher model with a total of roughly 1.6 trillion parameters generate about 250,000 math and STEM samples under an intensive reasoning mode. The key to these samples is not the answers themselves, but that they fully record the chain of thought—where to start, how to break the problem down, how to derive step by step, and the final conclusion.
Reasoning trajectories are typically organized in a structure like the one below:
{"prompt": "...math/STEM problem...","reasoning": "Step 1: Identify the problem type and goal;\nStep 2: Break it into sub-problems;\nStep 3: Derive each formula and verify...","answer": "final answer","meta": { "mode": "deep-reasoning", "domain": "stem" }}
There is a practical point worth emphasizing here: distillation quality depends heavily on the completeness of the reasoning process in the samples. If you keep only question-answer pairs, the student can learn only the “results”; if you keep the full reasoning trajectory, the student can learn “how to think.”
Stage 2: Supervised Fine-Tuning (SFT)
With these samples in hand, the developers used them to run supervised fine-tuning on an open-source 9B base model, having the student imitate the teacher’s problem-solving process token by token. The following pseudocode illustrates the idea (it is illustrative only and not tied to a specific framework):
# Illustrates data construction and the training objective onlysamples = load_distilled_samples(n=250_000) # Reasoning trajectories generated by the teachermodel = load_base_model("open-source-9b") # Open-source student basetrain_sft(model, samples, loss="token_level_ce") # Token-level cross-entropy supervision
Stage 3: Lightweight Reinforcement Learning Polish
After SFT, the developers added another round of lightweight policy-optimization reinforcement learning. SFT solves “learning to imitate,” while reinforcement learning further aligns the model toward “answering better and more efficiently.” According to the model documentation, both the SFT and reinforcement learning stages focused on math and STEM reasoning, and neither introduced any coding data—which suggests that the more focused the task boundary of a distillation, the purer the capability transfer tends to be.
At this point, the first transformation was complete: the student’s scores on STEM reasoning and its inference cost had both been evaluated.
4. Targeted Adjustment of Refusal Behavior
The top-ranking version was a further “behavioral fine-tuning” applied on top of the distilled weights, aimed at adjusting the model’s refusal tendency toward specific prompts.
The method used falls into the category of weight editing based on internal activation analysis. Its approach can be summarized as:
- Collect the model’s internal activations (intermediate-layer representations) when it processes different types of prompts.
- Compare samples the model is “willing to answer” with those it is “inclined to refuse,” and locate the activation signals strongly correlated with refusal behavior.
- Modify the weights of certain model layers to weaken the influence of those signals on the final output.
This kind of method usually does not require retraining; instead, it adjusts behavior through weight editing across a small number of layers. In this case, the configuration limited the scope of adjustment to several layers in the middle-to-late portion (for example, the range from layer 9 to layer 24). Behind this lies a general lesson: not all layers are strongly correlated with a given behavior, and precisely locating the layer range can both improve the adjustment’s effectiveness and reduce its disruption to the model’s overall capabilities.
It’s important to emphasize that adjusting refusal behavior is a double-edged sword. It can bring down overly conservative refusals, but without accompanying safety-boundary controls, it may also weaken the model’s protection against genuinely sensitive content. In engineering terms, such adjustments must be paired with clear evaluation and rollback mechanisms.
5. Evaluation: What Metrics Measure the Success of a Distillation
The two rounds of changes produced two different sets of results, and the evaluation dimensions differed accordingly.
1. Problem-Solving Accuracy
To measure whether the student truly learned the teacher’s problem-solving ability, the core metric is answer correctness. In this case, the distilled model answered more questions correctly in the STEM tests, showing a visible improvement in accuracy.
2. Inference Cost (Tokens Consumed per Correct Answer)
This is an easily overlooked but extremely important metric. Looking at accuracy alone can be misleading, because a model can “trade long reasoning for correctness.” A more sensible measure is how many inference tokens are consumed per correct answer on average. In this case, the distilled model reduced the inference tokens consumed per correct answer by about 36.1%, meaning it not only answered more accurately but also more efficiently.
The evaluation logic can be expressed with the following pseudocode:
def evaluate(model, prompts):correct = total_tokens = refusals = 0for p in prompts:out, tokens = model.generate(p)if is_refusal(out):refusals += 1continueif check_answer(out, p.gold):correct += 1total_tokens += tokensreturn {"accuracy": correct / len(prompts),"tokens_per_correct": total_tokens / max(correct, 1), # lower is better"refusal_rate": refusals / len(prompts),}
3. Refusal Rate
For the behavioral adjustment, refusal changes need to be evaluated specifically. In this case, when facing the same set of 100 prompts, the original distilled version refused nearly all of them, while the adjusted derivative refused only 3.
4. Output Distribution Shift (KL Divergence)
Behavioral adjustment changes the model’s output probability distribution, so KL divergence is used to measure the difference in distribution before and after the adjustment. In this case, a KL divergence of 0.0422 was reported; the smaller the value, the more “restrained” the change and the smaller the disruption to the original capabilities. This provides a quantitative basis for judging whether the adjustment “went too far.”
5. Output Format Compliance Rate
In engineering practice, whether a model can reliably output in the specified format (such as JSON or structured steps) is equally important. In this case, the derivative followed the required format in nearly 97% of outputs.
6. Practical Advice for Developers
Based on the pipeline above, here are a few transferable engineering lessons:
- Prioritize data distillation over training from scratch: Having a teacher model generate high-quality reasoning trajectories is the shortest path to obtaining a strong small model at low cost.
- Keep the full chain of thought: Samples must include the “how to derive it” process, not just the final answer.
- Keep the task boundary focused: As in this case—only math and STEM, with no coding data mixed in—a clear boundary often leads to purer transfer.
- Watch both accuracy and cost: Treat “inference tokens consumed per correct answer” as a first-class metric, and avoid trading compute for correctness.
- Be cautious and quantify behavioral adjustments: When using activation-analysis-based weight editing, precisely locate the layer range and monitor the magnitude of disruption with KL divergence.
- Establish controlled evaluation and rollback: Any behavioral adjustment must have a controlled experiment using the same test set, and a path to roll back to the original weights must be preserved.
7. Conclusion
A 9B small model reaching the top is essentially a victory of “capability transfer”: the teacher model generates high-quality reasoning samples, supervised fine-tuning teaches the student to solve problems, lightweight reinforcement learning makes the answers better and more efficient, and activation-analysis-based weight editing fine-tunes behavioral details such as refusal. This pipeline is instructive for most teams—you don’t need to train from scratch, nor do you need to keep piling on parameters. As long as you design the teacher’s capabilities, the data construction, the training stages, and the evaluation metrics properly, you can approximate, or in some dimensions even surpass, the massive original model with less than one-hundredth of its size.
