Aligning Instruction Tuning with Pre-training

Yiming Liang, Tianyu Zheng, Xinrun Du, Ge Zhang, Jiaheng Liu, Xingwei Qu, Wenqiang Zu, Xingrun Xing, Chujie Zheng, Lei Ma, Wenhu Chen, Guoyin Wang, Zhaoxiang Zhang, Wenhao Huang, Xiang Yue, Jiajun Zhang · OpenReview

TL;DR

This paper introduces AITP, a novel method to improve instruction tuning for Large Language Models (LLMs) by aligning instruction datasets with the broader distribution of pre-training data. By identifying and rewriting underrepresented data from pre-training corpora into high-quality instruction-response pairs, AITP significantly enhances LLM performance across various benchmarks.

What Problem Does This Paper Address?

Instruction tuning is crucial for making LLMs follow human instructions effectively. However, existing instruction-tuning datasets, whether manually curated or synthetically generated, tend to be narrowly focused. This narrowness leads to a misalignment with the vast and diverse data distribution learned during pre-training, hindering the LLM's ability to generalize and fully leverage its pre-trained knowledge. Essentially, the instruction-tuning data doesn't fully represent the "world" the LLM learned about during pre-training, creating a performance bottleneck.

Methods

AITP tackles this problem through a three-stage process:

  1. Difference Set Generation: This stage identifies data points from the pre-training corpus that are underrepresented or absent in the existing instruction-tuning (SFT) dataset. This is achieved by:
  2. Data Representation: Representing data points as vectors derived from model embeddings and then reducing their dimensionality (e.g., using PCA) for visualization and comparison.
  3. Density Estimation: Employing Kernel Density Estimation (KDE) to estimate the density of data points in both the pre-training and SFT datasets.
  4. Identification: Points in the pre-training corpus with low density in the SFT dataset are flagged as belonging to the "difference set."
  5. Data Transformation: The identified "difference set" data (raw text) is then transformed into high-quality instruction-response pairs. This involves:
  6. Query Generation: Using a prompt to guide an LLM to generate relevant questions from the raw text.
  7. Query Scoring: Employing another prompt to evaluate the quality and difficulty of the generated queries, filtering out low-quality ones.
  8. Answer Generation: Using a final prompt to generate detailed and accurate answers to the high-quality queries.
  9. Training: The rewritten instruction-response pairs are integrated with the original SFT dataset. The LLM is then fine-tuned on this combined, enriched dataset. This ensures that the model learns from both the original, task-specific instructions and the newly synthesized data that bridges the gap with pre-training distributions.

Datasets

  • Pre-training Corpora: Dolma, Matrix, and The Pile were used.
  • SFT Datasets: TuluV2, Neo-SFT, and OpenHermes-2.5 were used as baselines.
  • Evaluation Benchmarks: The paper evaluated performance across eight benchmarks, including IFEval, i2b2, MMLU, ARC-c, GPQA-d, HumanEval, MBPP, and HellaSwag.

Key Insights and Ideas

  • The "Distributional Gap" is Real and Detrimental: The visualizations clearly show that standard SFT datasets often occupy distinct, sometimes sparse, regions compared to the dense, broad distribution of pre-training data. This gap directly impacts LLM generalization.
  • Pre-training Data is a Rich Source for Improvement: Instead of solely relying on manually curated or synthetically generated instruction data, leveraging the vast pre-training corpus as a reference is key.
  • Targeted Rewriting is More Effective: AITP doesn't just add more data; it strategically identifies what data is missing and rewrites it. This targeted approach is more efficient than simply increasing dataset size.
  • Quality over Quantity (to an Extent): While AITP increases data diversity, the ablation studies suggest that the quality of the rewritten data is crucial. Over-reliance on potentially lower-quality rewritten data can degrade performance.

Key Results

  • Consistent Performance Gains: AITP achieved consistent performance improvements across three fully open LLMs (OLMO, MAP-Neo, Pythia) on eight benchmarks, with average improvements of 3.8, 1.1, and 0.9 respectively.
  • Cost-Effective Improvement: The method demonstrated significant gains even when incorporating a small percentage (less than 10%) of rewritten data, making it a practical and cost-effective solution.
  • Robustness: AITP proved robust across different embedding models and difference set generation settings.
  • Ablation Studies Highlight Key Components: Adaptive data selection, controlled rewriting, and balanced integration were all shown to be beneficial.

Limitations and Future Work

  • Quality of Rewritten Data: The paper notes that the quality of the rewritten data might be lower than the original SFT data, which can lead to performance degradation if the ratio of rewritten data is too high. This suggests a need for more sophisticated rewriting techniques.
  • Computational Cost: While the method is effective, the data transformation phase can be computationally intensive.
  • Future Work: The authors suggest further exploring techniques to improve the quality of rewritten data and optimizing the integration process. They also highlight that AITP can be applied to closed-source models or those with open-access weights, indicating broader applicability.

Summary updated

BibTeX
@misc{liang2025aligning,
  author = {Yiming Liang and Tianyu Zheng and Xinrun Du and Ge Zhang and Jiaheng Liu and Xingwei Qu and Wenqiang Zu and Xingrun Xing and Chujie Zheng and Lei Ma and Wenhu Chen and Guoyin Wang and Zhaoxiang Zhang and Wenhao Huang and Xiang Yue and Jiajun Zhang},
  title = {{Aligning Instruction Tuning with Pre-training}},
  year = {2025},
  eprint = {2501.09368},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.09368},
}
Figure