One Algorithm, Two Goals: Dual Scoring for Parameter and Data Selection in LLM Fine-Tuning

Xinrui Chen, Liu Yang, Ou WuNeurIPS 2026

TL;DR

When fine-tuning large language models on a budget, researchers usually pick which parameters to update and which training data to use via two completely separate processes. This paper shows that mathematically, these two choices are literally rows and columns of the exact same underlying gradient matrix. Using this symmetry, the authors build DualSFT—a single, fast pass that picks the best data and the best parameters simultaneously, boosting new skills while keeping the model from forgetting old ones.

What Problem Does This Paper Address?

Adapting a massive language model to a new task is expensive, so engineers usually cut costs along two axes: Parameter Selection (freezing most weights and updating a tiny fraction to save memory) and Data Selection (cherry-picking the most useful training examples to save compute time).

Historically, these two worlds evolved separately. If you want to do both, you typically glue two distinct algorithms together sequentially—running one to filter data, and another to mask parameters. Not only does this duplicate heavy gradient computations, it creates a "coordination gap." If you score a training example's usefulness assuming all parameters will update, that score becomes inaccurate the moment you freeze 95% of the network! The authors ask: Can one algorithm serve both goals through a shared scoring rule?

Methods

The authors frame both parameter and data selection as bilevel optimization problems aiming at a single goal: minimizing loss on a target validation set while preserving pre-trained knowledge. Because solving this exactly is impossible at LLM scales, they approximate training updates at a shared checkpoint using Taylor expansions.

Here is where the magic happens: under first- and second-order approximations, a single conceptual Gradient Interaction Matrix ($N \text{ samples} \times D \text{ parameters}$) emerges. Summing across a row gives the utility score of a training sample; summing down a column gives the importance score of a parameter.

Overview of the DualSFT framework showing how parameter importance and data utility emerge as column and row aggregations of a single gradient interaction matrix.

Building on this, DualSFT executes a four-step pipeline:

  1. Pilot Warmup: Train briefly on 5% of the data to get past noisy initial gradients, yielding a stable checkpoint and an AdamW second-moment buffer (repurposed cleanly as a diagonal curvature proxy).
  2. Corpus-Free Preservation (CWSD): To prevent catastrophic forgetting without needing the original pre-training corpus, they introduce Confidence-Weighted Self-Distillation. It measures KL-divergence between the frozen base model (teacher) and warmup model (student) on held-out anchor inputs, upweighting tokens where the teacher is confident.
  3. Streaming Dual Scoring: Rather than materializing an impossible $N \times D$ matrix in memory, DualSFT builds a shared projection vector combining target validation gradients, the CWSD preservation direction, and curvature corrections. Two lightweight streaming passes (using Ghost Dot Products to avoid storing per-sample gradients) extract both top-$k$ parameter and top-$b$ data masks.
  4. Restricted Fine-Tuning: Reset to the original pre-trained weights and fine-tune only the chosen parameters on only the chosen data.

Datasets

No new benchmarks are introduced; the authors evaluate on established datasets to measure both Plasticity (learning the target task) and Stability (retaining general capabilities):

  • Fine-Tuning Datasets: Magicoder (code generation), MetaMathQA (math reasoning), and Alpaca-GPT4 (instruction tuning, detailed in the appendix). Each reserves 1,024 validation samples and 2,048 disjoint anchor samples for CWSD.
  • Evaluation Benchmarks: HumanEval (code), GSM8K (math), and out-of-domain stability checks ARC-C, PIQA, and MMLU.

Key Insights and Ideas

  • Row-Column Duality & Shapley Values: Data utility and parameter importance aren't just conceptually similar—they are exact row and column sums of one interaction matrix. Furthermore, the authors prove these closed-form scores equal the exact Shapley values (a game-theoretic measure of fair credit) in localized surrogate games.
  • Second-Order Curvature Matters: Dropping the second-order diagonal curvature correction causes the single largest drop in overall performance (3.01 points), proving that accounting for local loss-landscape geometry is vital for both retention and adaptation.
  • Where the Selected Parameters Live: In Llama-3.2-3B, parameter importance is heavily concentrated near the output—the top five layers house 42.4% of the selected weights (a $2.38\times$ enrichment), and FFN down_proj modules are disproportionately favored ($1.44\times$).
  • Smart Data, Not Just "Hard" Data: DualSFT doesn't just grab high-loss outliers. Selected subsets maintain average loss and diversity similar to the full pool, while more than doubling alignment with validation gradients.

Key Results

Tested on Llama-3.2-3B, Gemma-3-4B-PT, and Qwen-3.5-9B-Base under strict budgets ($b=10\%$ data, $k=5\%$ parameters):

  • Joint-Budget Dominance: On Magicoder (Llama-3.2-3B), full DualSFT hits 43.70% on HumanEval—beating the strongest sequential hybrid baseline (SPICE + NanoAdam) by 4.27 points on coding and 2.46 to 3.22 points in Overall score across all three model families.
  • Minimal Forgetting: Standard full fine-tuning tanks out-of-domain Stability by 5.65–6.44 points across backbones. DualSFT keeps Stability within 0.35–1.14 points of the untouched pre-trained models.
  • Efficiency Frontier: On Llama-3.2-3B, DualSFT-Param achieves the highest Overall score (47.13) with the lowest peak fine-tuning memory (19.3 GB, vs. 74.9 GB for Standard SFT). Full DualSFT finishes end-to-end in 7.4 GPU-hours (vs. 23.6h for Standard SFT).
Efficiency frontier comparing DualSFT against data-selection and hybrid baselines in GPU-hours, memory, and overall score.

Limitations and Future Work

  • Unmodeled Cross-Mask Dependencies: Because DualSFT picks both masks in one shot before applying either restriction, scores still contain minor noise from frozen weights and excluded samples. Re-selecting one side after fixing the other improves Overall score by at most 0.14 points, though it inflates end-to-end compute costs by 5%–41%.
  • Linear Auxiliary Memory: Parameter scoring holds full-model vectors in memory ($O(D)$ state), which scales linearly with model size (though sharding or blockwise processing can mitigate this).
  • Short-Horizon Surrogates: The local Taylor approximation naturally loses ranking fidelity over longer optimization horizons. Extending coupled data-parameter selection to longer training runs and post-training pipelines (like RLHF) remains open future work.

Summary updated

Abstract

In Large Language Model (LLM) fine-tuning, parameter and data selection are common strategies for reducing fine-tuning cost, yet they are typically driven by separate scoring mechanisms. When a parameter mask and data subset jointly determine restricted fine-tuning, this separation incurs redundant overhead and makes coordinated selection difficult. We cast parameter and data selection as two bilevel selection problems under a common validation objective and derive a shared local response-surrogate scoring rule. Under first- and second-order validation-improvement approximations, parameter importance and data utility emerge as column-wise and row-wise aggregations of a single gradient interaction matrix, yielding a closed-form row--column correspondence for co-extracting both signals. Building on this structure, we propose $\textbf{DualSFT}$ ($\textbf{Dual}$-$\textbf{S}$election $\textbf{F}$ine-$\textbf{T}$uning), a one-shot dual-scoring algorithm that produces a parameter mask and data subset from shared gradient statistics. On 3B$-$9B LLMs, single-axis DualSFT variants strengthen target-task performance and stability--plasticity trade-offs within their comparison groups, while full DualSFT yields a more favorable joint-constrained trade-off than sequential hybrid baselines under matched budgets.
BibTeX
@inproceedings{chen2026one,
  author = {Xinrui Chen and Liu Yang and Ou Wu},
  title = {{One Algorithm, Two Goals: Dual Scoring for Parameter and Data Selection in LLM Fine-Tuning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=rkcG6vtYfa},
}
Figure