TL;DR
This paper introduces a novel training objective for large language models (LLMs) that leverages token-level uncertainty to improve both in-distribution and out-of-distribution performance. By focusing training on tokens with high epistemic uncertainty (masked MLE) and then regularizing with self-distillation on less uncertain tokens, they achieve significant gains across various LLM architectures and datasets, mitigating overfitting while enhancing adaptability.
What Problem Does This Paper Address?
Training large language models (LLMs) using the standard maximum likelihood estimation (MLE) objective, which predicts the next token, has been highly successful. However, during the post-training (fine-tuning) phase, LLMs can suffer from overfitting to the training data, leading to issues like hallucinations and reduced performance on unseen tasks. This overfitting is exacerbated by the limited size and diversity of post-training datasets. The paper addresses this by proposing a more nuanced approach to training that considers the varying levels of uncertainty associated with individual tokens within a sequence, rather than treating all tokens equally.
Methods
The core of the paper's contribution lies in its proposed "uncertainty-aware" training objective. They connect token-level uncertainty to two key concepts:
- Masked Maximum Likelihood (Masked MLE): Instead of calculating the loss on all tokens, this method focuses the loss computation and gradient updates on a subset of tokens identified as having high "epistemic uncertainty." Epistemic uncertainty, in this context, refers to the model's uncertainty about its own predictions, which can be reduced with more data or a better model. The paper shows that using predictive loss as a proxy for epistemic uncertainty is effective.
- Self-Distillation: To combat the overfitting that can arise from solely focusing on high-uncertainty tokens, the authors incorporate a self-distillation objective. This involves using a "teacher" model (a version of the model already fine-tuned with vanilla MLE) to guide the training of the "student" model on tokens with lower epistemic uncertainty. This helps preserve information about the data's inherent randomness (aleatoric uncertainty) and improves generalization.
The combined objective, Masked MLE + Distillation, aims to leverage the benefits of both approaches. They also propose that the model's predictive loss can serve as a practical proxy for epistemic uncertainty during training, avoiding the computational cost of full ensemble methods.
Datasets
The paper uses a variety of datasets for training and evaluation:
- Training Datasets: Alpaca, ShareGPT, GSM8K.
- Evaluation Benchmarks: AlpacaEval, IF-Eval, GSM8K.
The paper also mentions toy models (linear regression and MNIST classification) for theoretical exploration and validation of uncertainty concepts.
Key Insights and Ideas
- Token-level uncertainty is crucial: Treating all tokens equally during LLM fine-tuning is suboptimal. Different tokens carry different levels of uncertainty, and exploiting this heterogeneity can lead to better training.
- Masked MLE as an automatic curriculum: Focusing training on high-epistemic-uncertainty tokens acts as a natural, token-level curriculum, guiding the model to learn more challenging or surprising examples first.
- Overfitting is a real concern with masked MLE: While masked MLE improves in-distribution performance, it can lead to overfitting and degrade out-of-distribution capabilities.
- Self-distillation is a powerful regularizer: Combining masked MLE with self-distillation effectively mitigates overfitting and improves generalization to unseen tasks.
- Predictive loss as a proxy for epistemic uncertainty: The paper demonstrates that a model's predictive loss is a good indicator of epistemic uncertainty, making it a practical choice for training without expensive ensemble methods.
Key Results
The proposed Masked MLE + Distillation objective demonstrated significant performance gains across multiple LLM architectures (Gemma, LLaMA, Phi) and diverse datasets.
- In-distribution performance: Masked MLE alone showed substantial improvements on tasks like AlpacaEval compared to vanilla MLE.
- Out-of-distribution performance: While masked MLE alone led to overfitting and decreased OOD performance (e.g., on IF-Eval), the combined Masked MLE + Distillation objective not only maintained in-distribution gains but also improved or preserved out-of-distribution performance.
- The paper shows concrete examples of performance gains in figures, with normalized gains often in the range of 5-10% or more for the combined objective compared to the baseline.
Limitations and Future Work
- Data Selection Granularity and Computational Savings: While token-level selection offers fine-grained control, its computational benefits are limited compared to document-level selection due to transformer architecture. Future architectures with more efficient sparse attention could improve this.
- Data Curriculum and Model Curriculum: The current method demonstrates an emergent data curriculum. Future work could explore jointly optimizing data distribution and model complexity for a more comprehensive curriculum.
- Hyperparameter Tuning: The paper notes that the choice of the quantile for masked MLE (e.g., 25%) was arbitrary and tuning this hyperparameter could potentially lead to even stronger performance.
- Exploration of other uncertainty estimation methods: While they use Monte Carlo Dropout, other methods for uncertainty estimation could be explored.
Summary updated