Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Nudging: Inference-time Alignment of LLMs via Guided Decoding

About

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/ .

Yu Fei, Yasaman Razeghi, Sameer Singh• 2024

Related benchmarks

TaskDatasetResultRank
Math ReasoningGSM8K
Accuracy79.5
254
Commonsense ReasoningARC Challenge
Accuracy89.6
243
Commonsense ReasoningCommonsenseQA
Accuracy (pass@1)79.3
108
Mathematical ReasoningMATH 500
Accuracy (pass@1)57.8
88
Math ReasoningSVAMP
Accuracy87.3
85
Math ReasoningMATH (test)
Accuracy13.6
59
Open-ended generationNoveltyBench, WildChat, and Narrative-Discourse Average (test)
Lexical Dominance9.3
7
Instruction FollowingNOVELTYBENCH
Lexical Dominance6.8
7
Novelty EvaluationNOVELTYBENCH
Overall Dominance5.5
5
DialogueWildChat
Lexical Coverage43
4
Showing 10 of 11 rows

Other info

Follow for update