Principled Top- k Selection for Language Models with Hybrid Gradients
cs.LG, cs.CL
Submitted: 2026-10-03
Updated: 2026-10-03
License: http://creativecommons.org/licenses/by/4.0/
The gist: Selecting the best k items out of m candidates is a critical component of modern large language model systems, such as document selection in Retrieval-Augmented Generation (RAG) and expert routing in
Abstract
Selecting the best k items out of m candidates is a critical component of modern large language model systems, such as document selection in Retrieval-Augmented Generation (RAG) and expert routing in Mixture-of-Experts (MoEs). However, training these selection modules remains challenging due to weak gradient signals and suboptimal exploration-exploitation tradeoffs. Furthermore, prior works often rely on heuristics, lacking principled objectives and approaches that explicitly model and solve the top- k selection problem. In this work, we propose a principled objective for training selection modules, whose gradient naturally provides richer training signals in a hybrid form---containing a supervised-gradient component and a policy-gradient component. We show that the selection problem becomes harder as m increases, and our algorithm converges at rate O(1/sqrt T), with the optimal upper bound achieved by balancing between bias and variance. Practically, we apply our method to a set of tasks involving top- k selection, including synthetic regression problems, RAG, and MoE systems, showing that our method outperforms the baselines in next-token prediction perplexity and QA accuracy.
Sources
- Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer
- Sparse Backpropagation for MoE Training
- Dense Backpropagation Improves Training for Sparse Mixture-of-Experts
- MoEs Are Stronger than You Think: Hyper-Parallel Inference Scaling with RoE
- GRIN: GRadient-INformed MoE
- LapSum -- One Method to Differentiate Them All: Ranking, Sorting and Top-k Selection
- Differentiable Fast Top-K Selection for Large-Scale Recommendation
- Routing Networks: Adaptive Selection of Non-linear Functions for Multi-Task Learning
- Conditional Computation in Neural Networks for faster models
- Multi-Stage Document Ranking with BERT
- Passage Re-ranking with BERT
- R3-RAG: Learning Step-by-Step Reasoning and Retrieval for LLMs via Reinforcement Learning
- A Statistical Framework for Data-dependent Retrieval-Augmented Models
- GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
- Mixtral of Experts
- Estimating Gradients for Discrete Random Variables by Sampling without Replacement
- Routing Networks and the Challenges of Modular and Compositional Computation
- Gaussian Error Linear Units (GELUs)
- Searching for Activation Functions
- The Llama 3 Herd of Models
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks