TL;DR
LESSER (Last-layer Error Signals for Scalable Example Ranking) is a drop-in wrapper for gradient-based data selection that replaces expensive full-parameter gradients with cheap output-layer gradients. By computing features during a single forward pass, LESSER reduces computation costs by up to 9.7× while maintaining downstream performance nearly identical to state-of-the-art full-gradient methods.
What Problem Does This Paper Address?
Post-training—including Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL)—is essential for aligning Large Language Models (LLMs). However, the quality of the data used matters more than the quantity. Researchers have turned to gradient-based data selection, which ranks training samples based on how well their gradients align with a target task's validation set.
The bottleneck is cost. Calculating a full-parameter gradient requires a backward pass for every single candidate sample in a potentially massive pool. For large-scale data selection, the cost of selecting the data can actually exceed the cost of training on it. The authors ask: can we approximate these high-quality gradient features at a fraction of the cost?
Methods
The authors introduce LESSER, which simplifies the feature extraction process by focusing exclusively on the gradients of the model's output layer.
The key technical insight is that for standard SFT and RL objectives, the output-layer gradient can be computed directly from quantities already available during a standard forward pass: the last-layer hidden states and the output probabilities (prediction residuals). This eliminates the need for a costly backward pass through the entire network.
To make these features manageable, LESSER uses a two-sided random projection to compress the high-dimensional output-layer gradients into a compact vector (e.g., 8,192 dimensions). This compressed feature is then used with standard selection rules, such as round-robin matching for SFT or top-k ranking for RL.
Datasets
The authors evaluated LESSER across three distinct post-training regimes:
- SFT: Used a candidate pool of ~197k samples from Tulu V2. Evaluation tasks included TyDiQA (multilingual QA), MMLU-Pro (reasoning), GSM8K (math), Codex (code), and BBH (logic).
- RL: Targeted the Countdown task using a mixed-domain pool including WebInstruct and DAPO problems.
- Distillation: Evaluated teacher selection for GSM8K and MATH tasks.
Experiments were conducted across several model families, including Llama-2-7B, Llama-3.2-3B, Qwen3-4B-Base, and OLMo3-7B.
Key Insights and Ideas
- Forward-Pass Gradients: The paper proves (Proposition 1) that output-layer gradients are simply the outer product of the hidden state and the prediction residual. This makes feature extraction "forward-only."
- Batch Alignment vs. Sample Alignment: Interestingly, LESSER and full-gradient methods (like LESS) often rank individual samples differently. However, they tend to select batches of data that, in aggregate, produce training updates aligned in the same direction. This explains why LESSER works so well despite being an approximation.
- Early Gains: The authors found that the benefits of targeted data selection are concentrated in the very early stages of training (the first ~10 updates).
- Signal Preservation: Compared to simple hidden-state features (like RDS+), output-layer gradients preserve much more of the optimization signal because they are directly tied to the model's loss function.
Key Results
LESSER achieves significant efficiency gains without sacrificing much performance:
- Efficiency: It reduces feature-extraction FLOPs by 9.7× for SFT and 3.0× for RL. In wall-clock time on an A100 GPU, SFT extraction was 17.8× faster (3.16 hours vs. 56.16 hours for the full pool).
- SFT Performance: Across 60 different model-task-budget combinations, the performance gap between LESSER and the full-gradient LESS method averaged only 1.3 points.
- RL Robustness: In RL settings with corrupted rewards, LESSER was nearly as effective as full gradients at avoiding "noisy" problems, selecting only 29.7% corrupted samples compared to 27.3% for full gradients (random selection would pick 50%).
Limitations and Future Work
The authors acknowledge several areas for further exploration:
- Training Trajectories: The study focuses primarily on training effects near initialization. It is unclear how output-layer gradient signals evolve or lose effectiveness over very long training runs.
- Pipeline Differences: The SFT comparison involved complete pipelines (e.g., LESSER uses the base model, while LESS uses LoRA checkpoints), which introduces variables beyond just the gradient features.
- Predictive Diagnostics: Future work could involve developing tools to predict when output-layer gradients will be sufficient for a given task before running the full selection process.
Summary updated