Learning from Failures: When Contrastive Post-Training Beats Success Conditioning

Soutrik Sarangi, Gaurav SinhaarXiv 2026

TL;DR

When fine-tuning language models on pass/fail outcomes, practitioners often mix supervised training on the "wins" with contrastive learning that pushes away the "losses." It works great in practice, yet we’ve lacked a solid theory explaining why—or when it might actually backfire. This paper cracks open the math behind these combined recipes, revealing exactly how your base model's initial instincts and your choice of hyperparameters determine whether learning from failures actually beats learning from successes alone.

What Problem Does This Paper Address?

Imagine training a language model on math problems or document retrieval where an outcome is strictly binary: 1 for success, 0 for failure. You have two standard post-training recipes:

  1. Success Conditioning (SFT): Throw away the failures and maximize the likelihood of the successful outputs. We already know theoretically that this safely improves upon your starting model (the "base policy").
  2. Contrastive Learning: Pair up successes and failures, training the model to widen the probability gap between them (similar to DPO).

In the trenches, engineers frequently glue these two losses together and get state-of-the-art results. But mathematically, this hybrid approach has been flying blind. A margin-based contrastive loss might rank two answers in the right order while accidentally lowering the overall probability of picking good answers. So, when does adding failures to the mix provably beat training on successes alone?

Methods

The authors model language model post-training as contextual bandits (single-step decisions, like generating a complete response to a prompt) and finite-horizon MDPs (multi-step sequential decisions) with binary rewards.

Rather than inventing a new algorithm, their novelty lies in analyzing the exact population minimizers of two established hybrid loss families. Both combine a weighted SFT term (controlled by weight $\lambda$) with a hinge-based contrastive margin ($\delta$):

  • Unweighted ($\mathcal{L}_{\text{unw}}$): Applies a margin directly to the new policy’s log-probabilities between winning and losing actions.
  • Reference-reweighted ($\mathcal{L}_{\text{rw}}$): Applies the margin to log-likelihood ratios relative to the base policy $\pi_0$ (a cousin to DPO). Mathematically, this acts as an adaptive margin that demands even greater separation when the base policy already favors the winning action.

They evaluate the resulting policies on both standard expected reward ("value") and swap-monotone ranking metrics (like Recall@$k$ and Precision@$k$, where swapping a better item above a worse one never hurts the score).

Datasets

  • MS MARCO: A massive real-world benchmark of 8.84 million passages used for generative retrieval experiments. Here, a BART-large model generates document identifiers for text queries, and a frozen Qwen3-Reranker-0.6B model provides soft relevance rewards.
  • Semi-synthetic Contextual Bandits: Used in the appendix to directly dial the alignment between the base policy and true rewards up or down to verify theoretical edge cases.

Key Insights and Ideas

  • Small margins can actively hurt you: If your contrastive margin $\delta$ is too small, stochasticity in rewards creates "misdirectional labels." If a decent base policy already separates good and bad actions by more than $\delta$, the unweighted contrastive loss will actually shrink that gap, making the new model worse than the one you started with!
  • Big $\lambda$ and $\delta$ unlock strict gains (with a catch): In contextual bandits, if both the SFT weight $\lambda$ and margin $\delta$ pass specific thresholds, both hybrid losses beat pure SFT. The catch: this only yields a strict improvement if the "winning" actions have varying probabilities of success. With a purely deterministic verifier (where every good answer succeeds 100% of the time), hybrid training just collapses back to standard SFT.
  • Know thy base model's alignment: Reference-reweighting ($\mathcal{L}_{\text{rw}}$) is a safety net—it always improves over the base policy, even in multi-step MDPs. Moreover, if your base model is already "aligned" (assigning higher probabilities to better actions), reweighted contrastive learning beats unweighted. If your base model is anti-aligned, unweighted wins.
  • Ranking $\neq$ Expected Reward: A loss configuration (like low margin, low SFT weight) can produce great document rankings (high Recall@100) while tanking expected reward. High margins paired with the right SFT weight give you the sweet spot of both.

Key Results

Testing on MS MARCO across three checkpoints of an increasingly aligned base model (Early, Midpoint, and Final), the theory held up remarkably well:

  • Contrastive hybrids win overall: At the Final checkpoint, the reference-reweighted policy ($\pi_{\text{rw}}$) achieved the highest expected reward at 0.7225 (and unweighted $\pi_{\text{unw}}$ hit 0.7204), comfortably beating the base policy (0.6308), pure Reward-SFT (0.6951), DPO (0.6510), and SimPO (0.6198).
  • Retrieval ranking: Pure Reward-SFT actually degraded practical beam-slot reward compared to the base policy (dropping from 0.4743 to 0.4539 at the Final checkpoint), whereas $\pi_{\text{rw}}$ boosted it to 0.5148.
  • Alignment widens the gap: As the base model became better aligned from Early to Final checkpoints, $\pi_{\text{rw}}$ pulled further ahead of $\pi_{\text{unw}}$ across both reward metrics, validating the alignment theorem in the wild.

Limitations and Future Work

  • Bandit guarantees break in sequential MDPs: Through clever mathematical counterexamples, the authors prove that their best bandit guarantees do not generalize to multi-step MDPs. Because future state values depend on the changing policy itself, minimizing state-wise contrastive losses can leave hybrid policies strictly worse than simple SFT across all finite $\lambda$ and $\delta$.
  • Population-level focus: The theoretical proofs analyze exact population minimizers—isolating the geometry of the loss functions themselves rather than accounting for finite-sample noise or neural network optimization quirks.
  • Dynamic post-training: The authors hint at an intriguing future direction: dynamically switching or adapting contrastive loss functions along a post-training trajectory as the model shifts from unaligned to aligned.

Summary updated

BibTeX
@misc{sarangi2026learning,
  author = {Soutrik Sarangi and Gaurav Sinha},
  title = {{Learning from Failures: When Contrastive Post-Training Beats Success Conditioning}},
  year = {2026},
  eprint = {2611.39411},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.39411},
}
Figure