Min-of-K (MoK) training is widely used to train models that produce diverse outputs from random noise. For each target, it draws K outputs from the model and backpropagates only through the one closest to the target. However, MoK generally does not make the generated distribution match the data distribution. In this paper, we analyze the MoK bias across all values of K and show that tuning K shifts between failure modes, from mode dropping at small K to distribution flattening at large K. We further prove that every nontrivial loss based only on target-candidate distances fails to recover some data distribution, since these distances do not reveal how the candidates are placed relative to each other. Based on these analyses, we propose mirrored MoK (MMoK), a drop-in modification of MoK training that draws one extra sample from the model, applies the closest-candidate selection rule against it, and subtracts the resulting distance. Since this distance is measured between samples of the model, it provides additional information about how the candidates are placed relative to each other. We prove that MMoK can in principle recover data distributions that MoK cannot. We empirically validate MMoK on five scenarios, namely synthetic mixtures, pedestrian and vehicle trajectory prediction, tropical cyclone forecasting, robotic policy learning, and ambiguous medical image segmentation. The results confirm the effectiveness and generality of MMoK in both distribution learning and task performance.
Figures & tables
Figure 1: Top: MoK pulls the candidate closest to the data point ( ★ ) toward it (red); MMoK additionally pushes the candidate closest to an extra model sample (dashed) away from it (blue). Bottom: MoK drops the rare mode at small K and flattens the distribution at large K , while MMoK matches the data (gray).
Figure 2: Generator samples at K=8 during training, with MoK in the top row and MMoK in the bottom row. Printed numbers are the mode weights, counting the samples within five standard deviations of each mode center.
Figure 3: W2 to the ground truth during training (mean ± maximum deviation over three seeds). The dashed line marks the sampling floor, the mean W2 between independent ground-truth sample sets of the same size.
Figure 4: Endpoint distributions on NGSIM US-101 ( K=20 ), relative to the position reached at the last observed velocity. Inner and outer contours enclose 50% and 90% of each distribution.
Figure 5: Segmentation scores against the number S of samples per test image. Lines and bands show the mean and standard deviation over three seeds on LIDC-IDRI and over 15 runs (five folds times three seeds) on QUBIQ.
Figure 6: LIDC-IDRI (left) and QUBIQ (right) test examples at K=8 . Boundaries are zoomed into the dashed region, and error maps mark the pixels where the shares of raters and of 64 samples differ by more than 0.25 . LIDC-IDRI shows two nodules marked by one of four raters and one marked by all four, and QUBIQ shows the images where MMoK reduces the error-pixel count the most.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 7: Learned distributions of MoK and MMoK after 100 k training steps. Each panel prints the measured mode weights, the predicted weights (largest, middle, rare mode), and the W2 to the ground truth. The predictions are from Prop. 2 for MoK at K≤20 , from Prop. 1 for MoK at K=48 , and from Thm. 3 for MMoK.
Figure 8: Two successful rollouts of the MMoK policy on UR3 BlockPush ( ϵ=0.03 , K=20 , seed 0 , epoch 150 ), one for each mode. In the top views, the shaded circles are the goal regions, and red and blue mark the two blocks.
Language models are increasingly used to sample from a specified distribution, for instance, to simulate survey respondents or generate synthetic data. Instruction-tuned models can state such a distribution correctly and still fail to sample from it. Prompting and changes to decoding reduce this mismatch only partly, which motivates training with policy optimization. Group relative policy optimization (GRPO) is a natural fit for this problem because it already samples a group of rollouts per prompt, and the group's empirical distribution can be compared with the target. However, scoring the group as a whole gives every rollout the same reward. Group-relative centering then sets all advantages to zero, and the model receives no learning signal. To give each rollout its own signal, we introduce the witness advantage, a per-rollout advantage derived from maximum mean discrepancy (MMD). It trains a model to match a target distribution over a finite set of outcomes. The MMD between the model's distribution and the target has a witness function that measures how over- or under-produced each outcome is. Each rollout's advantage estimates the negative witness at its outcome, so a rollout is rewarded for an outcome the group under-produces and penalized for one it over-produces. The witness advantage is computed in closed form from the group's outcome counts, and we use it as the reward in GRPO. On unseen target distributions, training with the witness advantage substantially reduces the total variation distance to the target while largely preserving the model's general capabilities.
Reinforcement learning (RL) is widely used in language-model post-training to maximize rewards assigned to individual model outputs, such as scores from binary verifiers or reward models trained on human feedback. However, applications such as synthetic-data generation, fairness-related constraint satisfaction, and policy exploration require controlling the distribution of outputs across model generations rather than only maximizing expected reward. We propose a general RL-based framework for Distribution Matching allowing matching the distribution of a latent categorical attribute of model outputs to a specified target distribution. Empirically, we demonstrate that dominant post-training recipes such as Group Relative Policy Optimization (GRPO) reduce output diversity by concentrating policy probability towards a single mode. Entropy regularization and sampling temperature can improve the spread of the distribution but have constrained effectiveness, limited to apply only in token space and toward uniform distributions. We show that prior work in this area is a specific case of Distribution Matching involving the L2 divergence. We then propose reward functions for other divergences such as KL and Jensen-Shannon and motivate them with theoretical justification. Finally, we demonstrate the effectiveness of our approach on a set of experiments involving mathematical reasoning and programming.
Sourabh Kulkarni, Ksheeraj Sai Vepuri, Basar Demir +8
In this work, we propose a unified framework for training algorithms across different stages of modern large language model development, based on the perspective of distribution matching. We show that a broad class of language model training algorithms can be interpreted as minimizing a certain divergence between the current model and a target distribution, and that characterizing the properties of this target distribution provides substantial insight into the behavior of the corresponding training algorithms. By analyzing specific forms of the target distribution, we establish that On-Policy Distillation (OPD) enjoys an advantage over classical Knowledge Distillation (KD) when the current model distribution is close to the target distribution, while exhibiting a disadvantage when the two distributions are far apart. Furthermore, when the target distribution itself depends on the model being optimized, we show that the accumulation of estimation variance can induce a deterministic degradation of the target distribution. These results provide a theoretical explanation, at least in part, for the long-term behavior of existing Reinforcement Learning (RL) algorithms. With this intuition we further designed Conditional KL (CKL) regularization for mitigating the degradation of the target distribution. CKL can effectively preserve mode diversity while relaxing the constraint imposed by classical KL regularization on reward improvements. We believe this theoretical perspective can bring some new understanding of language model training algorithms and provide useful guidance for future research.
Yanxing Huang, Bingzhang Yan, Zihan Tang +3
Qiuzhen College, Tsinghua University, Beijing, China · Institute for AI Industry Research (AIR), Tsinghua University, Beijing, China · Weiyang College, Tsinghua University, Beijing, China +2