LLMR: Knowledge Distillation with a Large Language Model-Induced Reward

Dongheng Li, Yongchang Hao, Lili Mou

Abstract

Large language models (LLMs) have demonstrated remarkable performance across various natural language processing (NLP) tasks but remain computationally expensive and difficult to deploy in resource-constrained environments. Traditional knowledge distillation (KD) methods, which train smaller "student" models to mimic these "teacher" LLMs, often suffer from exposure bias. We propose LLMR, a novel KD method that utilizes a reward function induced directly from a teacher LLM's internal probabilities. By training the student via Reinforcement Learning (RL), LLMR allows the model to explore its own generation process, effectively mitigating exposure bias. Empirical results across dialogue generation and summarization tasks show that LLMR consistently outperforms traditional KD baselines in both output quality and diversity.

Introduction

While models like GPT-4 offer state-of-the-art capabilities, their massive parameter counts necessitate significant computational resources. Knowledge Distillation (KD) typically addresses this by using a teacher model to supervise a smaller student. However, standard supervised KD relies on "teacher forcing," where the student is trained only on ground-truth or teacher-provided prefixes. This leads to exposure bias: during real-world inference, the student must rely on its own potentially erroneous previous tokens, often leading to a compounding "death spiral" of nonsensical text.

Methodology: Reward Induction and RL

LLMR shifts the distillation paradigm from supervised imitation to reinforcement learning. Instead of forcing the student to match the teacher's distribution word-for-word, the teacher acts as a judge, providing a reward signal for the student's sampled sequences.

The LLMR framework: Reward induction from teacher logits guides student reinforcement learning.

The Reward Function

The core innovation of LLMR is the derivation of a dense reward function without requiring human feedback or a separate reward model. The researchers treat the teacher LLM's logits (raw output scores) as q-values, which represent the expected utility of taking a specific action (predicting a word) in a given state (the current context). Using the Bellman optimality equation, they derive a reward $R_{LLM}$ that evaluates the "goodness" of each token $y_t$ relative to the context $y_{<t}$.

Student Training

The student model generates sequences through sampling, and the teacher provides a reward for every token. The student is then updated using the REINFORCE algorithm to maximize the expected reward. Because the student trains on its own generated sequences rather than just teacher-provided prefixes, the discrepancy between training and inference is eliminated.

Experimental Setup

The authors evaluated LLMR by distilling a T5-Base (220M parameters) student from a T0-3B teacher. The method was tested on three major datasets:

  • DailyDialog: High-quality human conversations.
  • OpenSubtitles: Large-scale movie dialogue.
  • CNN/DailyMail: A standard benchmark for news summarization.

Results and Discussion

Performance and Diversity

LLMR consistently outperformed traditional KD methods such as SeqKD and KL-divergence. For instance, on the DailyDialog dataset, LLMR achieved a BLEU2 score of 7.00, surpassing both the teacher's prompting performance (5.57) and standard SeqKD (6.19). Furthermore, LLMR produced significantly more diverse text. In "Distinct n-gram" tests, LLMR avoided the repetitive, "dull" responses common in models trained with standard cross-entropy losses.

Mitigating Exposure Bias

A critical metric in this study is the "Excess Error Percentage" (ExError), which measures how error rates grow as the generated sequence length increases.

Comparison of Excess Error (ExError) across sequence lengths, demonstrating LLMR's resilience to exposure bias.

As shown in the experimental data, traditional methods like KL and RKL see their error rates skyrocket as sequences get longer. In contrast, LLMR maintains a remarkably stable and low error rate, proving its resilience to the compounding errors typical of exposure bias.

Conclusion and Future Work

LLMR demonstrates that an LLM's internal confidence scores contain a mathematically valid reward signal that can be leveraged for more robust distillation. While RL-based training is more computationally intensive and requires an initial "warm-up" phase via standard distillation, the resulting models are more diverse and reliable for long-form generation. Future research may explore inducing rewards from "black-box" APIs where internal logits are not directly accessible, further expanding the utility of the LLMR framework.

Summary updated

BibTeX
@inproceedings{li2024llmr,
  author = {Dongheng Li and Yongchang Hao and Lili Mou},
  title = {{LLMR: Knowledge Distillation with a Large Language Model-Induced Reward}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=n4Zxl0Npkm},
}
Figure