Abstract
Recent advances show that the world knowledge in the Instruction Fine-Tuning (IFT) dataset, which is incompatible with LLMs’ internal knowledge, can greatly hurt the IFT performance. However, the effective integration and balancing of the internal knowledge of LLMs, acquired during pre-training, with existing IFT datasets remains a largely underexplored area of research. To address this gap, this work introduces NILE, a novel framework to optimize the effectiveness of IFT by adjusting IFT datasets through carefully aligning the world and internal knowledge. NILE employs a three-stage pipeline to effectively quantify and adjust consistency with the internal knowledge of target LLMs. Our analysis provides compelling evidence that balancing such consistency with pre-trained internal knowledge is pivotal for unleashing LLM potential, and confirms that NILE can systematically contribute to these substantial performance improvements. Experimental results demonstrate that NILE-aligned IFT datasets sharply boost LLM performance across multiple LLM ability evaluation datasets, achieving up to 66.6% gain on Arena-Hard and 68.5% on Alpaca-Eval V2.
Introduction: The Internal Consistency Bottleneck
Instruction Fine-Tuning (IFT) is the standard process for transforming a raw, pre-trained Large Language Model (LLM) into a functional assistant. Traditionally, research has focused on increasing the diversity or quality of IFT datasets. However, a growing body of evidence suggests a hidden bottleneck: Internal Consistency.
When an IFT dataset contains "world knowledge" that conflicts with the "internal knowledge" a model acquired during its massive pre-training phase, the model struggles to reconcile the two. Instead of learning the underlying logic of a task, the model may resort to mimicking the style of the response, leading to "blind guesses" or hallucinations when faced with new queries. The challenge lies in systematically identifying and resolving these knowledge mismatches for specific models.
The NILE Framework
To bridge the gap between a model's memory and its training data, the authors propose NILE, a three-stage pipeline designed to align IFT datasets with the target model's internal knowledge.
- Internal Knowledge Extraction (IKE): Before training, the model is prompted to externalize its existing knowledge regarding a specific instruction. NILE utilizes a retrieval-based (BM25) few-shot strategy to help the model express its internal knowledge clearly and consistently.
- Knowledge-aware Sample Revision (KSR): A revisor agent (such as GPT-4) takes the original dataset answer and the model's extracted internal knowledge to create a blended response. This revised answer is factually grounded in the dataset while remaining "comfortable" for the target model's internal logic.
- Internal Consistency Filtering (ICF): To ensure only beneficial revisions are kept, the authors introduced the Internal Consistency Index (ICI). This metric calculates the ratio of the model's probability of generating the revised answer with internal knowledge versus without it. If the internal knowledge does not significantly aid the model in predicting the answer, the sample is discarded or reverted to avoid over-fitting to redundant data.
Key Insights
- The "Goldilocks" Zone of Consistency: The research indicates that merely maximizing internal consistency is insufficient. There is a critical balance: if data is too consistent, the model learns nothing new; if it is too inconsistent, the model becomes confused. NILE’s filtering step (ICF) is essential for finding this middle ground.
- Unlocking Latent Potential: NILE does not necessarily teach models new facts; rather, it aligns the fine-tuning process with the knowledge the model already possesses. This suggests that many LLMs have significant latent intelligence that standard fine-tuning fails to activate.
- Model-Specific Alignment: Because IKE extracts knowledge directly from the target model (e.g., Mistral or Llama), the resulting dataset is custom-tailored to that specific model's "brain," making the fine-tuning process significantly more efficient.
Experimental Results
The researchers evaluated NILE using two primary IFT datasets—Alpaca (GPT-4 version) and a 50,000-sample subset of OpenOrca—across multiple model families including Mistral, Llama-3.1, and Qwen2.5.
Performance gains were substantial across all benchmarks:
- Arena-Hard: Llama-3.1-8B saw a 66.6% relative improvement (moving from 3.60 to 6.00 points) when trained on NILE-aligned OpenOrca data.
- Alpaca-Eval V2: Mistral-7B achieved a 68.5% gain in win rate (from 12.73 to 21.63) using the NILE framework.
- Reasoning (BBH): NILE consistently outperformed both "Vanilla" fine-tuning and "Sample Revision" (revising without internal knowledge), proving that the source and alignment of knowledge are critical.
- Generalization: Even on knowledge-intensive tasks like MMLU and SQuADv2, NILE-aligned models showed improved accuracy, indicating that internal alignment enhances broader comprehension.
Limitations and Future Work
While NILE demonstrates impressive results, it introduces computational overhead during the extraction and revision phases. Currently, the framework relies on a strong external revisor like GPT-4; future research could explore using the target model itself as the revisor to create a self-contained alignment loop. Additionally, scaling NILE to datasets with millions of samples remains an open engineering challenge.
Summary updated