arXiv:2504.03790cs.CLcs.LG2025-04被引 24

用采样替代搜索,让语言模型在测试时更精准对齐。

Sample, Don't Search: Rethinking Test-Time Alignment for Language Models

  • 通过马尔可夫链蒙特卡洛采样,逐步逼近最优对齐分布。
  • 在GSM8K等数学推理任务上优于最佳n选一和多数投票方法。
  • 无需修改模型或访问原始输出,适合无训练权限的场景使用。

测试时计算量增加已成为提升语言模型性能的有前景方向,尤其在微调不可行的情况下。然而,现有基于奖励模型(RM)的测试时搜索方法随计算资源增加反而性能下降,因奖励代理本身存在缺陷导致过度优化。本文提出QAlign,一种新的测试时对齐方法。随着测试时计算量增长,QAlign收敛于每个提示的最优对齐分布采样。借助文本生成中最新的马尔可夫链蒙特卡洛进展,该方法无需修改底层模型或获取原始对数概率即可实现更优对齐输出。在使用特定任务奖励模型时,QAlign在数学推理基准(GSM8K 和 GSM-Symbolic)上持续优于最佳n选一和多数投票方法。当结合更现实的、基于Tulu 3偏好数据集训练的奖励模型时,QAlign在多个数据集(GSM8K、MATH500、IFEval、MMLU-Redux、TruthfulQA)上表现超越直接偏好优化(DPO)、最佳n选一、多数投票及加权多数投票。该方法为不依赖额外训练即可利用额外计算提升现成语言模型能力提供了实用方案。

原文摘要 · Abstract (English)

Increasing test-time computation has emerged as a promising direction for improving language model performance, particularly in scenarios where model finetuning is impractical or impossible due to computational constraints or private model weights. However, existing test-time search methods using a reward model (RM) often degrade in quality as compute scales, due to the over-optimization of what are inherently imperfect reward proxies. We introduce QAlign, a new test-time alignment approach. As we scale test-time compute, QAlign converges to sampling from the optimal aligned distribution for each individual prompt. By adopting recent advances in Markov chain Monte Carlo for text generation, our method enables better-aligned outputs without modifying the underlying model or even requiring logit access. We demonstrate the effectiveness of QAlign on mathematical reasoning benchmarks (GSM8K and GSM-Symbolic) using a task-specific RM, showing consistent improvements over existing test-time compute methods like best-of-n and majority voting. Furthermore, when applied with more realistic RMs trained on the Tulu 3 preference dataset, QAlign outperforms direct preference optimization (DPO), best-of-n, majority voting, and weighted majority voting on a diverse range of datasets (GSM8K, MATH500, IFEval, MMLU-Redux, and TruthfulQA). A practical solution to aligning language models at test time using additional computation without degradation, our approach expands the limits of the capability that can be obtained from off-the-shelf language models without further training.

测试时对齐采样优化奖励模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。