Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMs

Tushaar Gangavarapu, Jiping Li, Christopher Vattheuer, Zhangyang Wang, Baharan MirzasoleimanarXiv 2026

TL;DR

Sharpness-Aware Minimization (SAM) significantly improves large language model (LLM) generalization but is computationally brutal, requiring up to 6x more training time. This paper reveals that SAM succeeds by mitigating "simplicity bias"—the tendency of models to learn easy features before complex ones. By leveraging this insight, the authors show you can achieve SAM-like generalization gains using standard, cheap optimizers (like AdamW or Muon) simply by upsampling difficult training examples identified early on by a tiny proxy model.

What Problem Does This Paper Address?

When training LLMs, different optimizers lead to solutions with vastly different generalization capabilities. A functional variant of Sharpness-Aware Minimization (f-SAM) has recently been shown to drastically boost LLM performance. However, f-SAM is incredibly expensive, requiring double the memory and massive training times compared to standard AdamW.

Comparison of resource usage between AdamW and f-SAM

The authors set out to answer two core questions:

  1. Why does SAM find more generalizable solutions in transformer architectures?
  2. Can we alter the training data distribution to make cheaper gradient-based methods (like AdamW or Muon) mimic SAM's superior training dynamics?

Methods

The authors first tackle the problem theoretically by analyzing a multi-head linear self-attention model trained for in-context linear regression. They prove that standard Gradient Descent (GD) suffers from severe Simplicity Bias (SB), meaning it sequentially activates attention heads to learn the easiest data features first, creating a step-like drop in training loss. SAM, conversely, uniformizes this process, slowing down the learning of simple features and accelerating the acquisition of complex ones.

Driven by this theoretical insight, they introduce a lightweight, data-centric approach to reduce simplicity bias without changing the optimizer:

  1. Identify Easy vs. Difficult Examples: They train a tiny proxy model (Pythia-70M) for just a fraction of an epoch (e.g., 1/3 of an epoch) and track the loss values across a few early checkpoints to create a "loss trajectory" for every training example.
  2. Clustering: Examples with rapidly decreasing losses are clustered as "easy" (containing simple features), while examples with stubbornly high losses are clustered as "difficult."
  3. Targeted Data Modification: They amplify the difficult cluster either by upsampling (duplicating) the hard examples or using an LLM to synthetically rephrase them (Variational Problem Synthesis).
  4. Target Training: The actual target LLM is trained on this modified data distribution using computationally cheap optimizers like AdamW or Muon.
Loss drops over time for GD, Upsampling, and SAM

Datasets

Models were fine-tuned using the MathInstruct dataset, a large and diverse math corpus containing over 262,000 instruction-response pairs.

To evaluate generalization across diverse mathematical reasoning tasks, the models were tested on six distinct benchmarks:

  • GSM8K
  • MATH
  • NumGLUE
  • SVAMP
  • DeepMind
  • MMLU-Math

Key Insights and Ideas

  • SAM's Mechanism Unlocked: This work provides the first theoretical proof that SAM's generalization edge in language models stems directly from its ability to uniformize feature learning speed and counteract simplicity bias.
  • Data as an Optimizer Lever: Instead of altering the mathematical formulation of the optimizer—which incurs heavy computational overhead—regularization can be effectively engineered directly into the data distribution.
  • Cross-Model Difficulty Transfer: Remarkably, a tiny 70M parameter proxy model can successfully identify difficult examples for a 2.7B parameter target model. This implies that the inductive biases determining what makes a feature "simple" or "complex" are highly preserved across model scales.

Key Results

  • Substantial Performance Gains: Fine-tuning target LLMs (including Qwen3-0.6B-Base, Llama3.2-1B, Gemma3-1B-PT, and Phi2-2.7B) on the targeted upsampled datasets yielded relative accuracy gains of up to 18% on mathematical reasoning tasks.
  • Optimizer Agnostic: The strategy successfully boosted performance for both standard AdamW and the newer, hardware-efficient Muon optimizer.
  • Trajectories Matter More Than Checkpoints: Clustering data based on the entire early loss trajectory consistently outperformed clustering based only on the final proxy checkpoint loss, proving that the path a model takes to learn an example reveals more about feature complexity than a single snapshot.
Main accuracy improvements across different models

Limitations and Future Work

  • Generative Quality Control: While synthetically rephrasing hard problems (Variational Problem Synthesis) showed promise, analysis revealed that only about 50% of the LLM-generated variants remained genuinely "hard." Future work will require advanced prompt tuning or rejection sampling to ensure synthetic data retains high complexity.
  • Domain Constraints: The empirical validation in this paper focused heavily on mathematical reasoning. Whether these exact loss-trajectory dynamics translate cleanly to other domains like code generation or creative writing remains to be fully explored.
  • Theoretical Simplifications: The mathematical proofs rely on a simplified transformer architecture (linear self-attention without softmax). Extending these proofs to include full softmax attention is an open theoretical challenge.

Summary updated

BibTeX
@misc{gangavarapu2026data,
  author = {Tushaar Gangavarapu and Jiping Li and Christopher Vattheuer and Zhangyang Wang and Baharan Mirzasoleiman},
  title = {{Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMs}},
  year = {2026},
  eprint = {2602.00576},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.00576},
}
Figure