TL;DR
This paper introduces REAR (REAlignment Reward), a novel, training-free method to align Large Language Models (LLMs) with user preferences at inference time. By decomposing the LLM's internal reward into question-answering and preference components, REAR dynamically adjusts their balance to generate more aligned outputs, significantly outperforming existing test-time methods on various benchmarks.
What Problem Does This Paper Address?
Large Language Models (LLMs) are increasingly powerful, but aligning them with diverse and personalized human preferences remains a significant challenge. Traditional methods like Reinforcement Learning from Human Feedback (RLHF) require extensive data and costly retraining. While Test-Time Scaling (TTS) offers a training-free alternative, its application has been mostly limited to tasks with objective correctness (like math or coding). Adapting LLMs to subjective preferences at inference time, without retraining, is difficult because the model's inherent reward function might not capture nuanced user desires. This paper tackles how to effectively guide LLMs at inference time to satisfy complex, subjective user preferences.
Methods
The core innovation is the REAlignment Reward (REAR). REAR decomposes the LLM's implicit reward into two parts:
- Question-related reward ($r_q$): How well the response answers the prompt.
- Preference-related reward ($r_p$): How well the response aligns with the user's stated preferences.
REAR then introduces a tunable coefficient ($\lambda$) to rescale the preference component, allowing for dynamic control over the trade-off between answering the question and satisfying the preference. This recalibrated reward, REAR, is formulated as a linear combination of token-level policy log-probabilities, making it computationally efficient and derivable directly from the base LLM.
This REAR score is then integrated into two Test-Time Scaling (TTS) algorithms:
- Best-of-N (BoN) sampling: Generates N candidate responses and selects the one with the highest REAR score.
- Diverse Verifier Tree Search (DVTS): Uses REAR scores to guide a more sophisticated tree search for optimal responses.
Datasets
The paper evaluates REAR on several benchmarks:
- PrefEval: A benchmark for evaluating personalized responses in multi-turn conversations, covering explicit preference, implicit choice, and implicit preference tasks.
- Multifaceted Bench: Assesses instance-specific responses tailored to user preferences.
- Ping-Pong Bench: Evaluates role-playing capabilities, viewed as preference alignment to a persona.
- Mathematical Reasoning Benchmarks: MATH500, AIME24, AIME25, and AMC23, used to test generalization to tasks with verifiable answers.
- MMHal-Bench: Used for multimodal hallucination detection, testing grounding in images.
The base LLMs used include Qwen2.5-7B-Instruct, Qwen3-4B-Instruct-2507, Qwen3-VL-8B-Instruct, and Llama-3.1-8B-Instruct.
Key Insights and Ideas
- Decomposing Reward is Key: The fundamental insight is that the LLM's internal reward can be broken down into distinct components (question vs. preference). This allows for targeted manipulation at inference time.
- Test-Time Control is Powerful: REAR demonstrates that significant preference alignment can be achieved without any retraining, simply by adjusting a reward signal during generation. This is a major advantage for deployment and adaptability.
- $\lambda$ as a Preference Strength Dial: The coefficient $\lambda$ acts as a flexible knob to control how strongly the LLM adheres to user preferences, allowing for fine-tuning the balance between helpfulness and preference satisfaction.
- Generalization Beyond Explicit Preferences: REAR isn't limited to explicitly stated preferences. By injecting task-relevant "preference" text (e.g., "act as a mathematician"), it can improve performance on tasks like mathematical reasoning and visual grounding.
- Robustness to Context: REAR's reliance on the base model's internal probabilities makes it robust to long-context inputs, outperforming methods that struggle with extended context.
Key Results
- Superior Performance: REAR-guided BoN and DVTS consistently outperform baselines like greedy decoding, BoN with GenRM, Amulet, and Linear Alignment on PrefEval, Multifaceted Bench, and Ping-Pong Bench. For instance, DVTS with REAR improves over greedy decoding by 11.6% on average across metrics.
- Efficiency: REAR is significantly faster than methods requiring external reward models or extensive per-token modifications. BoN with REAR is 1.4x faster than BoN with GenRM and 1.7x faster than BoN with an external RM.
- Generalization: REAR shows strong performance gains on mathematical tasks and multimodal hallucination detection when appropriate preference text is provided.
- Robustness: REAR demonstrates consistent performance gains across different LLM families (Qwen and Llama) and is robust to long-context inputs.
- Optimal $\lambda$ is Stable: While $\lambda$ can be tuned, a default value of $\lambda=20$ generally yields robust performance across tasks, and validation-based selection confirms its stability.
Limitations and Future Work
- Single Tunable Knob: REAR, like other TTS methods, has a single tunable parameter ($\lambda$). While $\lambda=20$ is a robust default, settings with substantially different preference distributions might benefit from a small validation sweep.
- Computational Cost of TTS: While REAR itself is efficient, the TTS methods it's integrated with (like DVTS) can still incur significant computational costs, especially with large sampling budgets. Future work could focus on identifying optimal TTS strategies that minimize computational overhead while maximizing performance.
Summary updated