Rho-1: Not All Tokens Are What You Need

Zhenghao Lin, Zhibin Gou, Yeyun Gong, Xiao Liu, Yelong Shen, Ruochen Xu, Chen Lin, Yujiu Yang, Jian Jiao, Nan Duan, Weizhu Chen · OpenReview

Abstract

Previous language model pre-training methods have uniformly applied a next-token prediction loss to all training tokens. Challenging this norm, we posit that "Not all tokens in a corpus are equally important for language model training". Our initial analysis examines token-level training dynamics of language model, revealing distinct loss patterns for different tokens. Leveraging these insights, we introduce a new language model called Rho-1. Unlike traditional LMs that learn to predict every next token in a corpus, Rho-1 employs Selective Language Modeling (SLM), which selectively trains on useful tokens that aligned with the desired distribution. This approach involves scoring pretraining tokens using a reference model, and then training the language model with a focused loss on tokens with higher scores. When continual pretraining on 15B OpenWebMath corpus, Rho-1 yields an absolute improvement in few-shot accuracy of up to 30% in 9 math tasks. After fine-tuning, Rho-1-1B and 7B achieved state-of-the-art results of 40.6% and 51.8% on MATH dataset, respectively - matching DeepSeekMath with only 3% of the pretraining tokens. Furthermore, when pretraining on 80B general tokens, Rho-1 achieves 6.8% average enhancement across 15 diverse tasks, increasing both efficiency and performance of the language model pre-training.

Introduction

Standard Large Language Model (LLM) pre-training relies on Causal Language Modeling (CLM), where the model calculates a loss for every single token in a massive dataset. However, even "cleaned" datasets contain significant amounts of noise, redundant information, or content that is too complex for the model to learn effectively at its current stage. Training on these low-utility tokens wastes compute and can degrade final performance. Rho-1 addresses this by introducing Selective Language Modeling (SLM), a training objective that prioritizes tokens aligned with a high-quality target distribution.

Selective Language Modeling (SLM)

The core innovation of Rho-1 is the transition from predicting every token to selecting the most informative ones. The SLM pipeline consists of three primary steps:

  1. Reference Modeling: A small "Reference Model" (RM) is trained on a curated, high-quality dataset representing the desired output distribution (e.g., clean mathematical reasoning).
  2. Token Scoring: This RM scores tokens in a larger, noisier corpus using Excess Loss ($L_\Delta$). This is defined as the difference between the training model's loss and the reference model's loss ($L_\Delta = L_{\theta} - L_{RM}$).
  3. Focused Training: During pre-training, the model only computes gradients and updates weights for tokens that rank in the top $k\%$ of excess loss, effectively ignoring noise and already-learned patterns.
Comparison between Causal Language Modeling (CLM) and Selective Language Modeling (SLM).

Token Training Dynamics

Analysis of token-level loss trajectories revealed that tokens fall into four distinct categories based on how their loss changes during training:

  • $L \to L$ (51%): Tokens already mastered by the model early on.
  • $H \to L$ (26%): High-utility tokens where significant learning occurs.
  • $H \to H$ (11%): Persistently hard tokens, often representing noise or aleatoric uncertainty.
  • $L \to H$ (12%): Tokens where the model's performance actually degrades.

SLM surgically targets the $H \to L$ category, ensuring that training compute is spent where it yields the most significant performance gains while avoiding the noise of $H \to H$ tokens.

Key Results

Rho-1 demonstrates remarkable efficiency across both specialized and general domains.

Extreme Data Efficiency in Mathematics

When trained on the 15B token OpenWebMath corpus, Rho-1-7B matched the performance of DeepSeekMath-7B, which required 500B tokens. This represents a nearly 33x reduction in required data (using only 3% of the tokens). Rho-1-1B also set a new benchmark for small models, approaching GPT-4 level performance on specific reasoning tasks.

Few-shot accuracy on 1B and 7B models, showing Rho-1 achieving baseline performance up to 10x faster.

General Domain Performance

Beyond mathematics, Rho-1 was evaluated on an 80B token general-purpose mix. It achieved a 6.8% average improvement across 15 diverse benchmarks, including MMLU and ARC, proving that the selective approach is broadly applicable and not just limited to formal logic or math.

Conclusion

Rho-1 proves that "more data" is not always the answer; rather, "better token selection" is. By focusing on tokens that align with high-quality distributions, SLM achieves state-of-the-art results with a fraction of the compute and data. Future work will explore the application of SLM to even larger scales and multimodal datasets where noise ratios are typically higher.

Summary updated

BibTeX
@inproceedings{lin2024rho,
  author = {Zhenghao Lin and Zhibin Gou and Yeyun Gong and Xiao Liu and Yelong Shen and Ruochen Xu and Chen Lin and Yujiu Yang and Jian Jiao and Nan Duan and Weizhu Chen},
  title = {{Rho-1: Not All Tokens Are What You Need}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=0NMzBwqaAJ},
}
Figure