Abstract
Aligning Small Language Models (SLMs) with human preferences is a critical challenge in modern AI development. While Direct Preference Optimization (DPO) has become a standard for model alignment, its reliance on binary (win/loss) feedback provides a coarse signal that often fails to guide smaller models through complex reasoning tasks. We present Teacher Value-based Knowledge Distillation (TVKD), a novel framework that extracts the internal value functions of large teacher models to provide fine-grained, token-level guidance to student models. By utilizing Potential-based Reward Shaping (PBRS), TVKD ensures that the student model optimizes for human preferences while benefiting from the teacher's dense reward signals. Our results demonstrate that TVKD consistently outperforms standard DPO and existing distillation methods across multiple benchmarks, including MT-Bench and AlpacaEval, without the computational overhead of online data generation.
Introduction
The alignment of Large Language Models (LLMs) with human values typically involves Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO). DPO, in particular, has gained popularity due to its stability and simplicity. However, DPO operates on a pairwise preference structure that only indicates which of two responses is superior, rather than quantifying the margin of superiority or identifying specific high-value segments within a response.
This "coarse-grained" feedback is particularly problematic for Small Language Models (SLMs). With limited parameter capacity, SLMs require more precise signals to learn the nuances of helpfulness and reasoning. Existing distillation techniques often attempt to bridge this gap by forcing the student to mimic the teacher's probability distribution (KL-divergence), but this can lead to conflicts with the underlying preference data and result in compounding errors. TVKD addresses these issues by shifting the focus from mimicking the teacher's output to internalizing the teacher's underlying value logic.
Methodology
Extracting the Value Function
TVKD treats a teacher model, previously aligned via DPO, as a soft-optimal agent. Within this framework, we can derive a "soft value function" ($V_\phi$) from the teacher's internal logits. This value function represents the expected cumulative reward of a given state, where a state is defined as a partial sequence of tokens. Unlike standard DPO, which only evaluates the final outcome, the value function provides a metric for the quality of the sequence at any given point.
Potential-based Reward Shaping (PBRS)
To integrate the teacher's value function into the student's training without distorting the original optimization goal, we employ Potential-based Reward Shaping (PBRS). We define an auxiliary reward, $\psi$, as the difference in the teacher's value between two consecutive states:
$$\psi = V_\phi(s_{t+1}) - V_\phi(s_t)$$
This approach offers a significant mathematical advantage: the rewards "telescope." Over the course of an entire sentence, the intermediate values cancel out, leaving only the difference between the start and end states. This ensures policy invariance, meaning the student model is guided by the teacher's "play-by-play" logic while still being required to reach the destination defined by the human preference data.
Offline Integration
One of the primary strengths of TVKD is its efficiency. It is an offline method, meaning it does not require the student model to generate new responses (rollouts) during the training process. Instead, it computes the value-based signals on existing preference datasets, making it compatible with standard DPO pipelines and significantly less computationally expensive than online RLHF methods.
Experimental Setup
Training and Evaluation
We evaluated TVKD using several high-quality preference datasets, including DPO-MIX-7K and HelpSteer2. For the student models, we utilized the LLaMA-3.2 family (ranging from 0.5B to 3B parameters), initialized with Deita-10k-V0 for supervised fine-tuning (SFT).
Performance was measured across a diverse set of benchmarks:
- MT-Bench: Evaluates multi-turn conversation quality.
- AlpacaEval (AE): Measures head-to-head win rates against baseline models.
- Open LLM Leaderboard (OLL): Tests reasoning (GSM8K) and common sense (Hellaswag).
- RewardBench (RM): Assesses how well the model's internal scoring aligns with human judgment.
Key Insights
- Magnitude Matters: By leveraging the teacher's value function, the student learns the magnitude of preference. It can distinguish between a marginal win and a significant one, allowing for more nuanced weight updates during training.
- Token-Level Attribution: TVKD provides a signal at every token. This allows the model to identify specific words or phrases (e.g., a crucial step in a mathematical proof) that contribute most to the overall quality of the response.
- Mitigating Length Bias: Because the value function relies on a telescoping sum of differences rather than simple log-probability averages, TVKD is naturally more robust against the length bias often found in standard DPO.
Results
TVKD demonstrated superior performance across all tested model sizes. On the 1B parameter LLaMA-3.2 student, TVKD achieved an MT-Bench score of 3.97, compared to 3.70 for standard DPO. In AlpacaEval, TVKD reached a win rate of 52.18%, surpassing other state-of-the-art distillation methods like ADPA (50.00%) and GKD.
Furthermore, the method proved robust across different teacher architectures. Whether using a 7B Mistral or an 8B LLaMA model as the teacher, the student models consistently showed improvement, indicating that the value-based signal is a generalizable property of aligned LLMs.
Conclusion
Teacher Value-based Knowledge Distillation (TVKD) represents a significant step forward in the alignment of small language models. By moving beyond binary win-or-loss signals and providing dense, value-based guidance, TVKD allows SLMs to achieve higher performance with greater efficiency. Future work will explore the application of TVKD in online settings and its effectiveness when using "weak" teachers or mismatched architectures.
Summary updated