Distilling Large Models into Small Models: Inference Efficiency and Refusal Calibration
Transferring the capabilities of large language models to smaller-parameter models is becoming a key route for optimizing inference costs. This article abstracts a general technical problem from a real-world case of a 9B derivative model trained on reasoning trajectories generated by a larger teacher model: how to train a small model with high-quality process data from a teacher model, how to improve accuracy while reducing inference overhead, how to calibrate over-refusal behavior, and how to build an evaluation framework that does not compromise safety boundaries. It covers teacher trajectory generation, data filtering, supervised fine-tuning, lightweight reinforcement learning, refusal behavior calibration, and a unified evaluation matrix, along with practical engineering recommendations and risk boundaries.
Distilling Large Models into Small Models: Inference Efficiency and Refusal Calibration
Transferring the capabilities of large language models into small-parameter models is becoming an important route for optimizing inference costs. Public model trend lists have featured a class of 9B-scale derivative models: trained on science and math problem-solving trajectories generated by a larger-parameter teacher model, first through supervised fine-tuning, then lightweight reinforcement learning, and finally calibration of refusal behavior. This article does not focus on any specific product. Instead, it abstracts this phenomenon into a general technical problem: how to train a small model with high-quality process data from a teacher model, how to improve accuracy while reducing inference overhead, how to calibrate over-refusal, and how to build an evaluation framework that does not damage safety boundaries.
1. Background: Small Models Need More Than Just “Answers”
Traditional distillation often uses the teacher model’s output answers as labels, training the student model to fit final results. This approach is simple to implement, but it easily loses the problem-solving process: the student learns “what to answer” without learning “where to start, how to decompose the problem, how to derive each step, and when to verify.” In math and STEM reasoning tasks, process quality directly affects generalization ability and reasoning stability.
A more viable route, therefore, is “process distillation”: have the teacher model generate step-by-step problem-solving trajectories, filter them for quality, and use them for supervised fine-tuning of the student model; then apply lightweight reinforcement learning to optimize correctness and inference efficiency; and finally calibrate refusal behavior. Example experiments disclosed in public materials show: the teacher model generated roughly 250,000 math and STEM samples, and the student model had 9B parameters. After two-stage training, accuracy on STEM tests improved slightly, and the number of inference tokens consumed per correctly answered question dropped by 36.1%. These figures only represent specific test sets and configurations and cannot be directly extrapolated, but they demonstrate the combined value of “process data + behavior calibration.”
2. Technical Route Overview
The overall pipeline can be broken down into five steps:
- Teacher trajectory generation: use a large-parameter teacher model to generate detailed reasoning processes and final answers for each problem.
- Data filtering and verification: filter out low-quality samples using rule-based verifiers, answer checking, deduplication, and difficulty stratification.
- Supervised fine-tuning: train the student model to learn the joint distribution of “process + answer.”
- Lightweight reinforcement learning: perform preference optimization around correctness, step completeness, and inference overhead.
- Refusal behavior calibration and evaluation: locate internal signals related to refusal, make small-range weight adjustments, and verify safety boundaries with multi-dimensional evaluation.
The following pseudocode illustrates the logic only and does not represent any specific API:
def build_distill_dataset(teacher, prompts, max_samples):samples = []for prompt in prompts:trace = teacher.generate(prompt, detailed_steps=True)if verify_answer(trace.answer) and check_steps(trace.steps):samples.append({"prompt": prompt,"steps": trace.steps,"answer": trace.answer})if len(samples) >= max_samples:breakreturn deduplicate_and_balance(samples)def train_pipeline(base_model, dataset):sft_model = supervised_finetune(base_model, dataset)rl_model = lightweight_rl(sft_model, reward_fn)calibrated_model = calibrate_refusal(rl_model, layers=range(9, 25))return calibrated_model
3. Teacher Trajectory Generation: Data Quality Sets the Ceiling
250,000 samples are not simply about volume. Math and STEM data need to cover different difficulty levels, problem types, and reasoning lengths, while retaining verifiable answers. Engineering efforts should focus on four points:
- Verifiable answers: prioritize problems with deterministic answers or executable verification, reducing the chance that incorrect trajectories enter the training set.
- Readable steps: trajectories should include problem decomposition, key formulas, derivation steps, and conclusions, rather than only the final answer.
- Difficulty stratification: sample in layers according to short-chain, medium-chain, and long-chain reasoning, avoiding a student model that only adapts to a single length.
- Deduplication and leak prevention: perform semantic deduplication on problems and check for test set contamination to avoid inflated evaluation results.
Teacher models have large parameter counts and high generation costs, so data generation requires budget control. A strategy of “prioritizing high-value problem types, putting verifiers first, and early-stopping low-quality samples” can reduce wasted generation. The core value of the 250,000 samples in the example experiment lies not in the quantity itself, but in the fact that each sample carries a learnable reasoning structure.
4. Supervised Fine-Tuning and Lightweight RL: Accuracy and Efficiency Together
In the supervised fine-tuning stage, the student model learns the mapping from problem to reasoning process to answer. The loss function is typically still token-level cross-entropy, but data organization is critical: training samples should preserve complete steps rather than truncating the process into isolated answers, and the reasoning length distribution should be controlled to prevent the model from learning verbose but ineffective reasoning.
In the lightweight reinforcement learning stage, a combination of correctness rewards, step completeness rewards, and length penalties can be used for optimization. Public materials note that the example experiment focused on math and STEM reasoning and did not use programming data. This boundary indicates that capability gains are limited to the task domain: improvement on STEM tests does not imply equivalent gains in coding, multi-turn dialogue, or open-domain question answering. In engineering practice, the training domain should match the target domain, and out-of-domain regression sets should be retained.
For evaluation, accuracy alone is not enough. A 36.1% reduction in inference tokens per correctly answered question means the inference cost per correct result has dropped; but if accuracy improves only slightly while length drops substantially, you need to check for a “short but sloppy” degradation. It is recommended to track accuracy, average output tokens, tokens per correct answer, format compliance rate, and refusal rate simultaneously.
5. Refusal Behavior Calibration: Calibrate Over-Refusal, Not Remove Safety
The derivative version described in public materials uses an internal activation comparison approach: compare the model’s internal activations when processing different types of prompts, identify signals associated with refusal behavior, then modify the weights of certain model layers to weaken the influence of these signals on responses. The example configuration sets the adjustment range to layers 9 through 24 and reports a KL divergence of about 0.0422, used to describe the change in output probability distribution before and after adjustment.
It must be emphasized: the goal of refusal behavior calibration is to reduce “over-refusal” and “false refusal,” not to remove safety policies. Reasonable practices include:
- Preserve high-risk refusals: requests involving illegal activity, harm, or privacy leaks must still receive clear refusals.
- Layered calibration: evaluate separately by task type, risk level, and prompt intent, avoiding a one-size-fits-all approach.
- KL constraints: monitor output distribution drift with KL divergence, set a threshold, and roll back if the threshold is exceeded.
- Human review: manually sample cases where the refusal rate changed, distinguishing “should have answered but didn’t” from “should not have answered but did.”
In the example experiment, facing the same set of 100 prompts, the initial distilled version refused all of them, while the calibrated derivative version refused only 3. This result shows a significant change in refusal behavior, but it does not directly prove the model is safer or more accurate in all scenarios. The same question set must be used to retest STEM accuracy, inference overhead, and format compliance, supplemented with a safety red-team set, to confirm that necessary refusals have not been weakened.
6. Evaluation Matrix: Combine the Two Report Cards
The two rounds of changes produce two report cards: the initially trained version is measured on problem-solving accuracy and overhead, while the calibrated version is measured on refusal behavior changes. In engineering, these should be merged into a unified evaluation matrix:
| Dimension | Metrics | Purpose |
|---|---|---|
| Correctness | STEM accuracy, accuracy by problem type | Determine whether capability improved |
| Efficiency | Average output tokens, tokens per correct answer | Determine whether inference overhead dropped |
| Behavior | Refusal rate, false refusal rate, necessary refusal retention rate | Determine whether behavior calibration is reasonable |
| Stability | KL divergence, output distribution drift | Determine whether weight adjustment was too aggressive |
| Format | Ratio of outputs following the required format | Determine usability |
Public materials also mention a format compliance ratio close to 97%, which is a usability metric: the model must not only answer correctly but also output in the specified format to enter automated pipelines. If the format compliance rate falls below the threshold, it should be fixed through template constraints, post-processing validation, or a small amount of format fine-tuning, rather than further expanding the scope of refusal calibration.
7. Engineering Recommendations
- Build dual evaluation sets: separate the capability set from the safety set. The capability set measures accuracy and token overhead; the safety set measures necessary refusals and false refusals.
- Validate data before training: teacher trajectories must pass answer verification, step checking, and deduplication to prevent incorrect processes from being amplified.
- Release in stages: start with a small-traffic canary release, observe refusal rate, format compliance, and user feedback, then scale up traffic.
- Retain rollback weights: refusal calibration involves layer weight modifications, so original weights and KL thresholds must be preserved for fast rollback in case of anomalies.
- Monitor inference cost: evaluate by tokens per correct answer rather than total tokens alone, preventing false optimizations of “short output but high error rate.”
- Define capability boundaries clearly: when training does not cover domains such as coding or multi-turn dialogue, documentation should state the applicable tasks to avoid over-promising.
8. Risks and Boundaries
The main risks of process distillation include: students imitating incorrect teacher trajectories, insufficient verifier coverage leading to false positives, test set contamination causing inflated evaluation results, refusal calibration weakening safety boundaries, and KL drift causing abrupt changes in output style. The countermeasures are “data validation + multiple evaluation sets + manual spot checks + canary rollback.” At the same time, a 9B model still has a capacity ceiling on complex long-chain reasoning. The accuracy improvement in the example experiment is a “slight improvement” and should not be interpreted as a full replacement for large models. A more reasonable positioning is: on specific STEM reasoning tasks, provide acceptable accuracy at lower inference cost, and improve usability through behavior calibration.
9. Conclusion
The key to distilling large models into small models is not copying the answers, but migrating the “problem-solving process, verification mechanism, and behavior boundaries” together. Teacher trajectory generation determines the data ceiling; supervised fine-tuning and lightweight reinforcement learning determine capability and efficiency; refusal behavior calibration determines usability and safety boundaries. Only by placing accuracy, token overhead, refusal rate, KL divergence, and format compliance in the same evaluation matrix can you judge whether a 9B derivative model is truly ready for production. The case from the public trend list provides a reusable engineering paradigm: train capability first, then calibrate behavior, and finally retest with unified evaluation — rather than looking only at a single top-of-the-leaderboard score.
