Research
Utility-Diversity Aware Online Batch Selection for LLM Supervised Fine-tuning
Overview Research area: Machine learning — data curation and data-efficient supervised fine-tuning (SFT) of large language models, specifically online batch selection. Technical level: Intermediate. T
- arXiv
- 2510.16882
- Published
- 2025-10-19
- Authors
- Heming Zou, Yixiu Mao, Yun Qu, Qi Wang, Xiangyang Ji
AI summary
Overview
Research area: Machine learning — data curation and data-efficient supervised fine-tuning (SFT) of large language models, specifically online batch selection.
Technical level: Intermediate. The paper combines an accessible high-level idea (score samples by logits, pick the best ones) with linear-algebra machinery (nuclear norm, singular values, Johnson–Lindenstrauss embeddings via subsampled randomized Fourier transforms).
Scope: The paper proposes and empirically evaluates UDS (Utility-Diversity Sampling), an online batch selection framework that scores candidate training samples using the nuclear norm of their logits matrix plus a low-dimensional diversity distance to recent history, and compares it against five baselines on four benchmarks with two backbone models.
What This Paper Is About
Fine-tuning a large language model on an entire dataset is computationally expensive and can overfit or amplify bias, so researchers increasingly try to train on only the "most valuable" examples. This paper tackles the online version of that problem, where samples are scored and filtered during training rather than in a separate offline pass. The authors argue that existing online selectors look only at data utility (loss or gradient magnitude), ignore diversity, often need external resources like a reference model or validation set, and can even be slower than full-dataset training — and they build a method intended to fix all three issues at once.
Key Contributions
-
A nuclear-norm criterion for intra-sample value. The authors use the nuclear norm (sum of singular values) of a sample's logits matrix — the N × V matrix of per-token logits over the vocabulary — as a single score that reflects both optimization utility (potential loss reduction) and intra-sample diversity (how varied the model's token-level predictions are within one sequence).
-
A cheap inter-sample diversity estimator. They project logits into a compact embedding using a structured bilinear random projection (Γ₁ over the vocabulary dimension, Γ₂ over the sequence dimension) that provably approximates a Johnson–Lindenstrauss embedding, then compute average Euclidean distance against a first-in-first-out memory buffer of previously selected samples. This reduces projection complexity from O(NVd) to O((N+V)d log(NV)) and avoids storing a prohibitive N·V × d matrix.
-
A practical framework meeting three stated desiderata. UDS scores samples using only forward-pass outputs, needs no reference model or validation set, and adds no extra backpropagation, so it reduces training time relative to full-dataset SFT while improving accuracy.
-
Broad empirical validation. Experiments across MMLU, ScienceQA, GSM8K, and HumanEval on Llama-3.1-8B and Qwen-2.5-7B show UDS outperforming MaxLoss, MaxGrad, RHO-Loss, and GREATS across varying data budgets.
Main Findings
-
UDS leads on every benchmark and backbone tested. With Qwen-2.5-7B, UDS reaches 63.34 ± 0.36 on MMLU versus GREATS at 58.19 ± 0.49 (a stated +5.15 gap), 95.19 ± 0.22 versus 94.17 ± 0.62 on ScienceQA, 79.91 ± 0.23 versus 78.61 ± 0.41 on GSM8K, and 46.28 ± 0.35 versus 45.04 ± 0.59 on HumanEval. With Llama-3.1-8B, UDS reaches 40.16 ± 0.58 (MMLU), 94.33 ± 0.28 (ScienceQA), 58.98 ± 0.24 (GSM8K), and 30.96 ± 0.69 (HumanEval), again above GREATS (39.04, 93.68, 57.03, 28.56).
-
Both components of the score matter. Ablations with Qwen-2.5-7B against a Random baseline (54.26 / 93.28 / 77.69 / 40.20) show that nuclear norm alone gives 58.35 / 94.19 / 79.22 / 44.18 (gains of +4.09 / +0.91 / +1.53 / +3.98 percentage points) and diversity distance alone gives 57.75 / 93.98 / 78.96 / 43.84 (+3.49 / +0.70 / +0.67 / +3.64), while the full UDS combination reaches 63.34 / 95.19 / 79.91 / 46.28 (+9.08 / +1.91 / +2.22 / +6.08). The combined score therefore exceeds either component used singly.
-
Higher throughput than full-dataset training on the evaluated models. On Qwen-2.5-7B, UDS achieves 3.41 samples/s on MMLU and 6.81 on HumanEval, compared with full-dataset ("Regular") training at 2.27 and 6.24. UDS also sustains higher throughput than full-dataset training on Llama-3.1-8B while producing better accuracy.
-
Simple heuristics either help little or cost too much. MaxLoss trains quickly (2.75 samples/s on Llama MMLU) but yields only marginal accuracy gains (35.62 versus 38.24 for Regular), while MaxGrad slows training dramatically (0.29 samples/s on Llama MMLU, 0.31 on Qwen MMLU) with no significant benefit. GREATS is accurate but consistently slower than UDS.
-
Empirical correlations justify the nuclear-norm choice. Using Qwen-2.5-7B on MMLU, the paper reports strong linear correlation between loss reduction (−δℓ) and nuclear norm, between rank of the logits matrix and nuclear norm, and between loss reduction and Frobenius norm. The theoretical link is the bound ‖L‖F ≤ ‖L‖* ≤ √(min(N,V)) · ‖L‖_F (Lemma 3.1), where the lower bound is tight for rank-1 matrices (repetitive predictions) and the upper bound for full-rank matrices with equal singular values (diverse predictions).
-
Prior methods fail at least one desideratum. The paper's Table 1 classifies Max Loss and Max Grad as lacking intra- and inter-sample diversity, RHO-Loss as additionally requiring external resources and increasing training time, and GREATS as requiring external resources and increasing training time; only UDS satisfies all five columns.
-
Projection and buffer settings matter modestly to memory. Figure 4 reports that accuracy improves as d₁, d₂, and buffer size M increase while peak memory rises only slightly. Full logits storage is described as prohibitive: roughly 74 GB for 1024 samples under Qwen-2.5-7B, the same figure quoted for an explicit down-projection matrix if d = 1024.
-
Training configuration. All runs use LoRA with rank 8, batch size B = 8, default buffer size M = 1024, d₁ = 128, d₂ = 8, zero-shot evaluation, four random seeds, and an NVIDIA GeForce RTX 3090 for throughput measurement. The specific α (trade-off) values per backbone/dataset combination are said to be reported in the paper's Table 6, which is not included in the provided content.
Methodology in Plain English
The core idea is to let the model itself decide which examples are worth learning from, at the moment it sees them.
For each candidate example in a training batch, the method runs a forward pass and captures the logits matrix — the model's raw scores over the vocabulary at every position in the sequence. From that matrix it computes two numbers.
The first number is the nuclear norm, the sum of the matrix's singular values. The authors argue, and empirically show, that this quantity rises both when a sample is "hard" in a productive way (large prediction errors that translate into large loss reductions after a training step) and when the model's per-token predictions are spread across many different vocabulary items rather than collapsing onto one repeated token. So one number captures both "this sample teaches the model something" and "this sample is internally varied."
The second number measures how different the sample is from what the model has recently trained on. To get it cheaply, the logits matrix is compressed into a short vector using two small random projection matrices — one compressing the vocabulary axis, one compressing the sequence-length axis — rather than one giant projection matrix. These projections are built in a subsampled randomized Fourier transform style, which theory says approximately preserves pairwise distances (a Johnson–Lindenstrauss guarantee). The compressed vectors for recently selected samples sit in a fixed-size FIFO buffer, and each candidate's diversity score is its average Euclidean distance to everything in that buffer. Because the buffer is much larger than a batch, this captures redundancy over a longer stretch of training rather than just within the current batch.
The two scores are added together with a trade-off weight α, and the top-K scoring examples in the batch are used for the parameter update. The rest are discarded for that step. Because everything is computed from forward-pass outputs and a lightweight distance computation, there is no reference model, no held-out validation set, and no extra backward pass for scoring.
Why This Matters
Impact on research. The paper reframes online batch selection as a joint utility-and-diversity problem and supplies a concrete, computationally cheap scoring signal that satisfies all three of its stated desiderata. It also gives a theoretical account (via the nuclear-norm/Frobenius-norm bound and the Johnson–Lindenstrauss projection theorem) of why a single logits-derived scalar can stand in for both sample difficulty and within-sample variety, which is a different angle from the loss- and gradient-based heuristics that dominate prior work. It joins a broader line of evidence that a small, well-chosen subset can beat full-dataset fine-tuning.
Real-world applications. The benchmarks tested point to concrete uses:
- Building domain-specific assistants for general knowledge and exam-style question answering (MMLU).
- Fine-tuning scientific question-answering models for education or research support (ScienceQA).
- Training math reasoning assistants that need to boot-strap multi-step problem solving (GSM8K).
- Producing code-generation models from instruction data (CodeAlpaca-20k training, HumanEval evaluation).
Industry relevance. The throughput results matter for practitioners: on both backbones UDS reports higher samples/second than full-dataset training while also reporting higher accuracy, which means less GPU time for a better model. The method requires no reference model or held-out validation set, both of which can be unavailable or awkward to maintain in production settings, and it drops into an existing SFT pipeline as a plug-and-play selection module.
Future Directions
-
Scaling the evaluation. The paper notes that additional evaluations appear in its appendices covering full SFT, larger batch sizes, instruction-tuned models, Long-CoT settings, and out-of-distribution datasets. Broadening these checks to more model families and larger backbones would test whether the reported gains generalize.
-
Choosing α systematically. The authors state that the optimal trade-off factor α depends heavily on both the backbone and the dataset, with values listed in a table. A principled or adaptive way to set α — rather than tuning it per combination — is a natural open problem.
-
Richer or learned memory representations. The current diversity signal is an average Euclidean distance in a randomly projected space with a fixed-capacity FIFO buffer. Whether learned projections, different buffer eviction policies, or explicit deduplication would improve selection quality is untested here.
-
The intra-batch diversity term. The paper includes an optional intra-batch diversity term in the score equation but omits it, arguing that batch sizes are much smaller than the buffer and that data are shuffled, with a supporting experiment referenced in its appendix. The conditions under which that omission breaks down remain an open question.
Target Audience
This paper is most useful for machine learning researchers and engineers working on LLM post-training, data selection, or data-efficient fine-tuning — particularly those who already understand supervised fine-tuning pipelines and want a selection method that adds no external dependencies or extra backward passes. It also suits practitioners optimizing fine-tuning cost on limited GPU budgets, and readers interested in how spectral properties of model outputs can be repurposed as training signals. A reader without background in linear algebra (norms, singular values, random projections) will find Section 3 harder going than the experiments and motivation.
Authors’ abstract
Supervised fine-tuning (SFT) is a commonly used technique to adapt large language models (LLMs) to downstream tasks. In practice, SFT on a full dataset is computationally expensive and sometimes suffers from overfitting or bias amplification. This facilitates the rise of data curation in SFT, which prioritizes the most valuable data to optimze. This work studies the online batch selection family that dynamically scores and filters samples during the training process. However, existing popular methods often (i) rely merely on the utility of data to select a subset while neglecting other crucial factors like diversity, (ii) rely on external resources such as reference models or validation sets, and (iii) incur extra training time over full-dataset training. To address these limitations, this work develops UDS (Utility-Diversity Sampling), a framework for efficient online batch selection in SFT. UDS leverages the nuclear norm of the logits matrix to capture both data utility and intra-sample diversity, while estimating inter-sample diversity through efficient low-dimensional embedding comparisons with a lightweight memory buffer of historical samples. Such a design eliminates the need for external resources and unnecessary backpropagation, securing computational efficiency. Experiments on multiple benchmarks demonstrate that UDS consistently outperforms state-of-the-art online batch selection methods under varying data budgets, and significantly reduces training time compared to full-dataset fine-tuning. Code is available at https://github.com/gfyddha/UDS.