Group-wise Data Ordering: Enhancing Instruction Tuning of Large Language Models via Embedding Proximity

Yiwen Ye, Boyuan Jiang, Xiaobin Hu, Shengzhi Wang, Xiaozhong Ji, Jinghao Lin, Deli Yu, Jiale Chen, Kai Wu, Haihua Yang, Yong XiaICML 2026

Instruction tuning (IT) is the critical mechanism that aligns large language models (LLMs) with human intent. In standard practice, the training dataset is simply shuffled randomly. While this approach is robust and serves as a surprisingly strong baseline, it overlooks the latent structure of the data—such as domain specificity and reasoning depth.

Randomly interleaving heterogeneous objectives is akin to trying to learn a new language, a complex math theorem, and a cooking recipe simultaneously, switching contexts every few seconds. In machine learning, this creates gradient conflicts, where parameter updates for one type of data cancel out updates for another. This "high-conflict" environment diminishes effective optimization progress and holds the model back from reaching its full potential.

Introducing EP-Order

To address these inefficiencies, researchers have proposed EP-Order (Embedding-Proximity-based Ordering), a novel data-ordering paradigm for the instruction tuning of LLMs. Unlike previous curriculum learning methods that derive training order from per-example scores (e.g., token length or individual loss), EP-Order explicitly accounts for inter-sample correlations by operating in the representation space.

The EP-Order pipeline consists of four primary stages:

  1. Warm-up: The model is initially trained on a small, random subset of the data (e.g., 10%) to learn basic representations.
  2. Embedding & Clustering: This warm-up model generates embeddings for the entire training dataset. These embeddings are then compressed using UMAP and grouped into semantically coherent clusters using HDBSCAN.
  3. Compactness Ranking: Clusters are ranked based on their "compactness"—a measure of how similar the items are within the group. Training begins with the most compact clusters and progressively moves toward more diverse ones.
  4. Smoothing Transitions: Training sequentially on distinct clusters can lead to sharp gradient spikes and "catastrophic forgetting" (where the model forgets previous clusters). To stabilize learning, EP-Order introduces Mixed Regions that interleave samples from the previous, current, and next clusters. A small Replay Buffer of previously learned samples is also maintained.

Key Insights and Theoretical Backing

A major contribution of this work is the introduction of the Efficiency Ratio (ER), a theoretical metric that measures how well gradients align within a training batch. The researchers found that EP-Order increases the ER from 0.54 (under random shuffling) to 0.71. This indicates that the model spends significantly less time "fighting itself" and more time moving efficiently toward the optimization goal.

Furthermore, EP-Order proves highly effective in hybrid "thinking" scenarios. Modern datasets often mix Chain-of-Thought (CoT) reasoning data with standard, direct responses. Randomly mixing these distinct data styles often degrades performance due to gradient interference. EP-Order’s group-wise approach successfully isolates and mitigates this interference, allowing the model to learn both response styles effectively.

Experimental Results

The researchers evaluated EP-Order on a massive scale, utilizing training sets like LLaVA-1.5 (665K multimodal samples), Tulu-3-SFT (text-only), and OpenR1-Math. The evaluation spanned 14 benchmarks (comprising 22 sub-benchmarks) across vision-language, text-only, and reasoning tasks.

EP-Order consistently outperformed random shuffling and other sophisticated ordering techniques:

  • Vision-Language: On LLaVA-Vicuna-7B, EP-Order achieved an average score of 66.30, compared to 64.88 for random shuffling.
  • Text-Only Scaling: When applied to Qwen3-4B, the average score improved significantly from 74.81 to 79.51.
  • Optimization Speed & Robustness: Visualizations of loss trajectories demonstrated that EP-Order leads to faster, more stable loss reduction. These gains remained consistent across different model sizes (from 0.6B to 14B parameters) and fine-tuning methods (Full fine-tuning vs. LoRA).

Limitations and Future Directions

While EP-Order offers a clear upgrade over random shuffling, it does come with trade-offs. The preprocessing overhead—specifically the warm-up training phase and clustering step—adds approximately 35% extra time to the total pipeline. Furthermore, the success of the method is heavily dependent on the quality of the embeddings generated by the warm-up model; if the warm-up is too short or the data is excessively noisy, the resulting clusters may lack meaningful structure.

Currently, EP-Order relies on a static ordering fixed before the main training phase begins. The authors suggest that exploring dynamic ordering—where clusters and rankings adaptively shift as the model learns—could be a highly promising direction for future research.

Summary updated

BibTeX
@inproceedings{ye2026group,
  author = {Yiwen Ye and Boyuan Jiang and Xiaobin Hu and Shengzhi Wang and Xiaozhong Ji and Jinghao Lin and Deli Yu and Jiale Chen and Kai WU and Haihua Yang and Yong Xia},
  title = {{Group-wise Data Ordering: Enhancing Instruction Tuning of Large Language Models via Embedding Proximity}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=cLzxIWy7EU},
}
Figure