arXiv:2610.19685cs.LGOct 2026

Manuscript Offprint

arXiv:2610.19685

Beyond Distribution Matching: Selective Margin Preservation for Supervised Fine-Tuning

Yuxuan Wang, Guangxiang Zhao, Xinyu Tan, Yahui Han, Xinxiang Yin, Zhonghai Wu, Xiangzheng Zhang, Lin Sun, Tong Yang

Abstract

Supervised fine-tuning (SFT) changes logit margins among non-target tokens at teacher-forced prefixes. Matching a local reference distribution keeps those probabilities and also penalizes margin expansions. We ask whether a soft auxiliary can preserve selected local non-target margin relations without freezing that distribution. We introduce Selective Rank-Preserving SFT (SRP-SFT), a soft margin target: a hinge on reference-scaled lower bounds for pairs from the reference's top-K non-target tokens, applied at fixed teacher-forced prefixes. The hinge stops once the requested bound is met. We derive the KL cost of violating a margin, characterize the feasible region and its conditional utility, and give a finite-step condition for reducing aggregate violations. In one-epoch experiments on Qwen3-4B-Base and UltraFeedback, this target raises MATH-500 and code-generation scores over CE and LP-SFT at all three training seeds. At seed 1234, MATH-500 pass@1 rises from 49.56% to 54.56% and the four-metric code mean rises from 65.91% to 69.50% relative to LP-SFT. Ranking controls, held-out cache diagnostics, sensitivity sweeps, and six additional backbones show where these score changes appear.

1 Introduction

Supervised fine-tuning (SFT) adapts pretrained language models to downstream tasks such as instruction following, reasoning, and code generation. At each training position, cross-entropy (CE) increases the probability of the observed next token but does not explicitly preserve the relative preferences among other tokens, potentially weakening or reversing preferences learned during pretraining.

One approach is to keep the fine-tuned model close to a frozen reference model. LP-SFT, our closest comparator, does so by matching the reference’s probability distribution over a set of plausible non-target tokens (Wang et al., 2026). However,

What should fine-tuning preserve?

(a) Cross Entropy Fits the target y.

No explicit protection for token-pair gaps.

Figure

(b) LP-SFT Match local probabilities.

Figure

qS≠qT⇒KL>0q^S \neq q^T \Rightarrow KL > 0

Keeping token order

can still be penalized.

(c) SRP-SFT (ours) Protects gaps.

lij=max⁡(0,ρΔijT−ΔijS)l_{ij} = \max(0, \rho \Delta_{ij}^T - \Delta_{ij}^S)

Compare the two gaps (e.g., ρ=0.5\rho = 0.5).

A-B · Too small

4

A B

max(0, 1 × 4 - 1)

Loss = 3

A-C · Expansion

1

A C

max(0, 1 × 1 - 3)

Loss = 0

Reference(T)

Student(S)

y: Target

Figure 1: The three objectives preserve different local quantities. CE fits the observed token by maximizing its likelihood. LP-SFT matches a reference distribution. SRP-SFT imposes selected margin lower bounds and stops penalizing a pair once its bound is met.

probability matching is more restrictive than preference preservation: if the reference prefers token A over token B, a student that strengthens this preference is still penalized because its probabilities differ from the reference.

This raises a natural question:

Can we preserve the reference model’s preferences without requiring the student to reproduce its exact probability distribution?

Preserving only the ordering of non-target to-kens is insufficient, since the ranking can remain unchanged even as the gap between tokens approaches zero. We therefore seek a middle ground that prevents excessive preference weakening while allowing stronger preferences during adaptation.

Motivated by this idea, we propose Selective Rank-Preserving SFT (SRP-SFT), which preserves selected preference relationships through soft margin constraints. At each fixed teacher-forced prefix, a frozen reference identifies plausible non-target alternatives and provides their pairwise logit margins. Rather than matching their full probability distribution, SRP-SFT applies a one-sided hinge penalty only when a student margin falls below a reference-scaled threshold. Once the threshold is met, no further penalty is imposed, allowing additional separation. The threshold can be adjusted to permit limited contraction or encourage stronger preferences, while the standard CE objective continues to fit the observed target token.

We study the theoretical properties and empirical behavior of this selective preservation objective, characterizing how margin constraints differ from KL-based distribution matching, what changes they permit, and under what conditions the auxiliary penalty can reduce margin violations. In one-epoch experiments on Qwen3-4B-Base and UltraFeedback, SRP-SFT improves reasoning and code-generation scores over CE and LP-SFT across three matched training seeds. Held-out diagnostics further show that, although LP-SFT achieves lower local KL divergence, SRP-SFT exhibits less margin contraction and fewer ranking inversions. Comparisons with alternative ranking objectives and parameter sensitivity studies reveal that stronger preference preservation does not always translate into better task performance. Experiments on six additional backbones illustrate both the benefits and limitations of the proposed objective.

Our contributions are threefold. First, we introduce SRP-SFT, a selective margin-based objective that protects local non-target preference relationships without requiring exact distribution matching. Second, we establish theoretical properties of this objective, including the KL cost of margin violations, the geometry of its feasible region, a conditional utility bound, and conditions for reducing aggregate violations during optimization. Third, we conduct extensive evaluations with matched multi-seed comparisons, alternative ranking objectives, held-out structural diagnostics, sensitivity analyses, and six additional backbones.

References (16)