Abstract
This paper challenges the prevailing "bigger is better" philosophy in Large Language Model (LLM) training by quantifying data alignment—the mathematical similarity between training and evaluation datasets. Utilizing a Task2Vec-based alignment coefficient, the researchers demonstrate a powerful negative correlation ($r^2$ up to 0.96) between data alignment and model perplexity. The results prove that small, highly aligned datasets can significantly outperform much larger, poorly aligned ones, particularly in precision-heavy tasks like autoformalization.
Introduction
The AI community has historically focused on "Scaling Laws," positing that increasing dataset size is the primary lever for improving LLM performance. However, this focus on quantity often neglects the qualitative aspect of data alignment. This research addresses a fundamental gap: the need for a quantitative measure of "data quality" that reliably predicts downstream performance.
The study focuses on Autoformalization—the translation of natural language into formal, machine-verifiable code. Because this task requires extreme precision, it serves as an ideal testbed for evaluating the impact of specific data alignment versus raw data volume.
Methodology
The researchers employed a 51M-parameter GPT-2 architecture across two experimental interventions:
- Pre-training Intervention: Models were pre-trained on diverse corpora (e.g., PubMed, USPTO patents) and evaluated on various target sets (e.g., NIH grants, Hacker News) to observe how general alignment affects performance.
- Fine-tuning Intervention: Models were fine-tuned on datasets with varying degrees of relevance to Autoformalization.
The core metric used is the Task2Vec-based alignment coefficient. By embedding datasets into a vector space using the Task2Vec framework, the researchers calculated alignment as $1$ minus the distance between these embeddings. This provides a rigorous, quantitative metric for similarity that transcends simple keyword matching.
The Alignment-Performance Law
A central finding of this study is the remarkably consistent linear relationship between alignment and performance. As the alignment coefficient between training and test data increases, the model's loss (perplexity) drops predictably.
In pre-training experiments, alignment was a significant driver of performance, with an $r^2$ of approximately 0.84. For instance, training and validating on the same domain (e.g., USPTO) resulted in significantly lower cross-entropy loss compared to cross-domain training.
Fine-tuning and Structural Alignment
The correlation became even more pronounced during fine-tuning for specialized tasks. In experiments involving proof datasets, the $r^2$ value reached 0.96.
Key insights from these experiments include:
- Quality Trumps Quantity: A tiny, highly aligned dataset of 1.4k tokens achieved a perplexity of 32.42, vastly outperforming a larger, less aligned dataset of 4.1k tokens (perplexity 69.06).
- Structure is Alignment: The "AF-split" experiment demonstrated that breaking the relational link between natural language and code caused a 21.7% drop in alignment and a corresponding collapse in performance. This indicates that alignment encompasses the relational structure of the data, not just the topic.
Conclusion and Future Work
The study concludes that a 0.1 increase in the alignment coefficient correlates to a roughly 7.4-point decrease in perplexity (slope $\approx -74.4$). While these results are robust for a 51M-parameter model, future work is needed to determine if these linear correlations persist at the scale of hundreds of billions of parameters. Additionally, exploring these metrics for subjective tasks like creative writing remains an open area for research.
Ultimately, this work advocates for a shift from indiscriminate data scraping to the mathematical selection of task-relevant data.
Summary updated