Metropolis-Hastings Dominates Importance Resampling for Policy Composition

Alexey Kurennoy, Ramil Yarullin, Fergal Reid
10/2/2026
cs.LG

No confident code implementation found for this paper.

Abstract

Post-training a large language model (LLM) often requires exploring trade-offs between multiple rewards, but retraining for each trade-off is expensive. Decoding-time policy composition allows these trade-offs to be adjusted by combining reward-specific policies at inference time.

Show full abstract

This composition targets a weighted product of the policies' probabilities over complete responses, but standard implementations combine their next-token probabilities, generally introducing sampling bias. We analyze a known iterative correction based on independence Metropolis-Hastings (MH). Our main result shows that, for every rollout budget, MH produces an output distribution at least as close to the target as sampling-importance-resampling (SIR) with the same budget, as measured by every convex f-divergence. We also derive a lower bound on MH's improvement over the uncorrected decoder in a consensus objective measuring agreement with the supplied policies. We further characterize the correction's sampling error in two asymptotic regimes: when the reward-specific policies approach agreement, and when the log ratio between target and uncorrected-decoder probabilities fluctuates increasingly widely, as can happen for long responses. We complement our analysis with experiments in enumerable and LLM-scale settings.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kurennoy2026metropolishastings,
  title  = {Metropolis-Hastings Dominates Importance Resampling for Policy Composition},
  author = {Alexey Kurennoy and Ramil Yarullin and Fergal Reid},
  year   = {2026},
  eprint = {2610.03480},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.03480v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.03480.svg)](https://codeofpaper.com/paper/2610.03480)

Discussion