NILE: Internal Consistency Alignment in Large Language Models

Minda Hu, Qiyuan Zhang, Yufei Wang, Bowei He, Hongru Wang, Jingyan Zhou, Liangyou Li, Yasheng Wang, Chen Ma, Irwin King · DOI

TL;DR

This paper introduces NILE, a novel framework that aligns instruction-tuning datasets with the internal knowledge of Large Language Models (LLMs). By extracting an LLM's existing knowledge and using it to revise and filter training data, NILE significantly boosts LLM performance on various benchmarks, demonstrating the critical importance of internal consistency for effective LLM training.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly fine-tuned using Instruction Fine-Tuning (IFT) datasets to align them with human intentions. However, a significant challenge arises when the "world knowledge" present in these IFT datasets conflicts with the "internal knowledge" the LLM acquired during its extensive pre-training. This inconsistency can hinder the LLM's learning process, leading to suboptimal performance. Existing IFT approaches often focus on data quantity and diversity, overlooking this crucial aspect of internal consistency. The paper aims to bridge this gap by proposing a method to effectively integrate and balance an LLM's pre-trained knowledge with external IFT data.

Methods

NILE is a three-stage framework designed to optimize IFT datasets by aligning them with an LLM's internal knowledge:

  1. Internal Knowledge Extraction (IKE): This stage leverages in-context learning to elicit the target LLM's internal knowledge relevant to specific instructions. It involves constructing a demonstration dataset by prompting a strong LLM (like GPT-4) to generate knowledge snippets for sample instructions. Then, for a given instruction, it retrieves similar examples from this demonstration set and uses them to prompt the target LLM to generate its internal knowledge.
  2. Knowledge-aware Sample Revision (KSR): Here, the extracted internal knowledge is used to revise the answers in the original IFT dataset. A revisor LLM agent is prompted to infuse the sampled internal knowledge into the instruction-answer pairs, aiming to create revised answers that are more consistent with the LLM's internal knowledge.
  3. Internal Consistency Filtering (ICF): A novel metric, the Internal Consistency Index (ICI), is introduced to quantify the alignment between a revised answer and the LLM's internal knowledge. This metric helps filter out low-quality revisions, ensuring that the final training dataset has a high degree of consistency with the LLM's pre-trained knowledge. A threshold parameter (β) controls the strictness of this filtering.

Datasets

The paper utilizes the following datasets:

  • Alpaca: A dataset of 52,000 instruction-following data points, generated using the Self-Instruct technique and further augmented with GPT-4.
  • OpenOrca: A large-scale dataset built upon the Flan 2022 Collection, featuring query-response pairs augmented with detailed explanations from GPT-4.

The authors also mention using these datasets for training and evaluating their framework.

Key Insights and Ideas

  • Internal consistency is paramount: The paper strongly emphasizes that simply increasing the quantity or diversity of IFT data is insufficient. The alignment between the external knowledge in the dataset and the LLM's internal, pre-trained knowledge is a critical factor for unlocking LLM capabilities.
  • LLM's own knowledge is a valuable resource: Instead of relying solely on external data or human supervision, NILE effectively harnesses the LLM's own internal knowledge to improve its training data.
  • A balanced approach is key: While maximizing internal consistency is beneficial, the paper suggests that an overly strict filtering (high β in ICF) might discard useful information. Finding the right balance is crucial for optimal performance.
  • Each component matters: Ablation studies confirm that each stage of the NILE framework (IKE, KSR, ICF) contributes significantly to the overall performance gains.

Key Results

NILE-aligned IFT datasets demonstrated substantial improvements in LLM performance across various benchmarks:

  • Arena-Hard: Up to 66.6% gain.
  • Alpaca-Eval V2: Up to 68.5% gain.
  • Experiments on MISTRAL-7B-v0.3 and META-LLAMA-3.1-8B showed significant improvements on Arena-Hard, Alpaca-Eval V2 LCWR, MTBench, and BBH benchmarks when using NILE-processed datasets compared to vanilla settings. For instance, on the Orca dataset with MISTRAL-7B-v0.3, NILE increased the Arena-Hard score by 26.4% and Alpaca-Eval V2 LCWR by 68.5%.
  • The framework also showed consistent improvements across different LLM families and sizes, including QWEN2.5-7B and QWEN2.5-14B.

Limitations and Future Work

  • Dataset Size: The experiments used a subset of the OpenOrca dataset (50,000 samples) due to time and computational constraints. Future work could explore using the full dataset.
  • ICF Strategy: The current ICF implementation reverts to the original answer when a sample is filtered out. Future research could investigate more advanced data selection techniques for the ICF process.
  • Iterative Refinement: The current framework uses a single revision pass. Exploring iterative instruction refinement could further enhance capabilities.
  • External Knowledge-Intensive Tasks: While NILE shows promise, an additional experiment on SQuADv2 (a reading comprehension benchmark) indicated a slight dip in accuracy with the SR baseline, suggesting that further investigation into handling external knowledge-intensive tasks might be beneficial.

Summary updated

BibTeX
@inproceedings{hu2025nile,
  author = {Minda Hu and Qiyuan Zhang and Yufei Wang and Bowei He and Hongru Wang and Jingyan Zhou and Liangyou Li and Yasheng Wang and Chen Ma and Irwin King},
  title = {{NILE: Internal Consistency Alignment in Large Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=JgfEeIgkBB},
}
Figure