Inference-Time Nash Alignment

Hadi Hosseini, Debmalya Mandal, Duohan Zhang

TL;DR

This paper introduces a new framework for aligning large language models (LLMs) at inference time under generalized, pairwise human preferences rather than restrictive scalar rewards. By modeling alignment as a two-player zero-sum game, the authors propose two algorithms—Best-of-Nash (BoN) and Nash Mirror Descent (NMD)—that match theoretical performance lower bounds and achieve win-rates comparable to fully fine-tuned models without altering a single model weight.

What Problem Does This Paper Address?

Standard preference alignment methods like RLHF (Reinforcement Learning from Human Feedback) and DPO (Direct Preference Optimization) require white-box access to modify model parameters, alongside massive computational resources. This is impractical for state-of-the-art models hidden behind black-box APIs (e.g., GPT-4, Claude).

While inference-time decoding methods like "Best-of-N" sampling offer a cheaper alternative by ranking generated outputs, they traditionally rely on scalar reward models built on the Bradley-Terry assumption. This assumption assumes human preferences are transitive, whereas real-world aggregated group preferences are often non-transitive or cyclic. This paper tackles the challenge of performing black-box, inference-time alignment under generalized preferences (where a model directly predicts the probability that response $y$ beats $y'$), bypassing the limitations of scalar rewards.

Methods

The authors frame inference-time alignment as finding the Nash Equilibrium of a two-player zero-sum game between generation policies, evaluated by an imperfect preference oracle. They introduce two distinct algorithms to solve this:

  1. Best-of-Nash (BoN): This algorithm samples $N$ candidate responses from a base model, constructs an empirical pairwise preference matrix by querying the preference oracle, and uses Linear Programming (LP) to compute a minimax optimal distribution over those samples.
  2. Nash Mirror Descent (NMD): Because solving an LP can be computationally expensive as $N$ grows, NMD serves as a faster, self-play alternative. It iteratively updates two coupled policies using closed-form, KL-regularized mirror descent steps.

The authors prove theoretically that both algorithms achieve an optimal duality gap of $O(\varepsilon(x)C_{uni}(x))$, where $\varepsilon(x)$ represents the preference oracle's error and $C_{uni}(x)$ measures the coverage of the base policy.

Datasets

The algorithms were evaluated using three widely adopted LLM alignment datasets:

  • TLDR: A text summarization dataset.
  • HelpSteer2: A dataset focused on general-purpose helpfulness.
  • UltraFeedback: A large-scale instruction-following dataset.

The experiments utilized popular open-source base models (LLaMA3-SFT, Mistral-Instruct, and Gemma-SFT) paired with preference oracles like LLaMA3-PM and PairRM.

Key Insights and Ideas

  • The Hardness of General Preferences: A key theoretical finding reveals that alignment under general preferences is fundamentally harder than reward-based alignment. The duality gap scales linearly with universal coverage ($C_{uni}(x)$), whereas reward-based alignment scales with the square root of coverage ($\sqrt{C^{\pi^*}(x)}$). Poor coverage from the base model hurts much more when preferences are complex and non-transitive.
  • LP vs. Iterative Updates: While BoN and NMD share identical query complexities and theoretical guarantees, NMD scales significantly better in practice. BoN's post-query complexity scales rapidly due to its interior-point LP solver, while NMD's closed-form updates keep its runtime nearly flat as sample size increases.
  • Hyperparameter Robustness: NMD's performance remains remarkably stable across different values of its regularization parameter ($\beta$), eliminating the tedious hyperparameter tuning often required by alignment algorithms.

Key Results

Both BoN and NMD substantially outperformed the baseline supervised fine-tuned (SFT) models across all three evaluation datasets.

Expected win-rate (EWR) comparison across TLDR, HelpSteer2, and UltraFeedback datasets.

As shown in the results, the proposed methods yielded an approximate 10% win-rate improvement on TLDR and a massive ~24% boost on HelpSteer2 and UltraFeedback. Remarkably, on the TLDR dataset, these training-free inference-time methods matched the win-rate of a fully fine-tuned LLaMA3-DPO model.

Limitations and Future Work

Despite the strong results, the authors highlight several limitations:

  • Oracle Dependency: The alignment quality is strictly bound to the accuracy of the preference oracle ($\varepsilon(x)$). If the oracle is biased or performs poorly on out-of-distribution prompts, the final policy will inherit those flaws.
  • Coverage Constraints: Inference-time alignment can only re-weight responses that the base model is actually capable of generating. If the base model has zero probability of generating a high-quality response, these algorithms cannot recover it.
  • Query Cost: Both algorithms require $O(N^2)$ pairwise queries to the preference oracle, which can become expensive. The authors suggest that integrating active selection strategies to reduce the number of required pairs is a vital direction for future work.

Summary updated

BibTeX
@inproceedings{hosseini2026inference,
  author = {Hadi Hosseini and Debmalya Mandal and Duohan Zhang},
  title = {{Inference-Time Nash Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=JKuHvi1fHD},
}
Figure