arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.09300cs.CLcs.AIcs.LG
收藏

Nudging:通过引导式解码实现大语言模型的推理时对齐

Nudging: Inference-time Alignment of LLMs via Guided Decoding

Department of Computer Science University of California Irvine(计算机科学系,加州大学伊文斯顿分校)

Yu Fei, Yasaman Razeghi, Sameer Singh

AI总结:

本文提出无需训练的推理时对齐算法 NUDGING,利用小型对齐模型在基础模型不确定时生成引导 token 来指导解码,以极小开销实现与大型对齐模型相当甚至更优的零样本性能,并支持跨模型家族协作。

摘要:

大语言模型(LLMs)需要对齐才能有效且安全地遵循用户指令。这一过程要求为每个基础模型训练一个对齐版本,导致显著的计算开销。在本工作中,我们提出 NUDGING,一种简单、无需训练的算法,可在推理时使用一个小型对齐模型来对齐任意基础模型。NUDGING 的动机来自近期发现:对齐主要改变模型在一小部分风格化 token(例如话语标记)上的行为。我们发现基础模型在生成这些 token 时显著更加不确定。基于这一见解,NUDGING 在基础模型不确定性较高时,使用一个小型对齐模型生成引导 token 来指导基础模型的解码输出,仅带来很小的额外推理开销。我们在 3 个模型家族上、跨多种开放指令任务评估 NUDGING。在没有任何训练的情况下,用一个比基础模型小 7 倍到 14 倍的对齐模型来引导大型基础模型,可获得与大型对齐模型相当、有时甚至超越其表现的零样本性能。通过在 token 级别上运行,NUDGING 实现了不同模型家族之间的即用型协作。例如,用 Llama-2-7b-chat 引导 Gemma-2-27b,在多种任务上优于 Llama-2-70b-chat。总体而言,我们的工作为 LLM 对齐提供了一种模块化且成本高效的解决方案。我们的代码和演示可在以下地址获取:https://fywalter.github.io/nudging/。

英文摘要:

Large language models (LLMs) require alignment to effectively and safely follow user instructions. This process necessitates training an aligned version for every base model, resulting in significant computational overhead. In this work, we propose NUDGING, a simple, training-free algorithm that aligns any base model at inference time using a small aligned model. NUDGING is motivated by recent findings that alignment primarily alters the model's behavior on a small subset of stylistic tokens (e.g., discourse markers). We find that base models are significantly more uncertain when generating these tokens. Building on this insight, NUDGING employs a small aligned model to generate nudging tokens to guide the base model's output during decoding when the base model's uncertainty is high, with only a minor additional inference overhead. We evaluate NUDGING across 3 model families on a diverse range of open-instruction tasks. Without any training, nudging a large base model with a 7x-14x smaller aligned model achieves zero-shot performance comparable to, and sometimes surpassing, that of large aligned models. By operating at the token level, NUDGING enables off-the-shelf collaboration between model families. For instance, nudging Gemma-2-27b with Llama-27b-chat outperforms Llama-2-70b-chat on various tasks. Overall, our work offers a modular and cost-efficient solution to LLM alignment. Our code and demo are available at: https://fywalter.github.io/nudging/ .

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑