NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Linear Alignment: A Closed-form Solution for Aligning Human Preferences without Tuning and Feedback

Songyang Gao, Qiming Ge, Wei Shen, Shihan Dou, Junjie Ye, Xiao Wang, Rui Zheng, Yicheng Zou, Zhi Chen, Hang Yan, Qi Zhang, Dahua Lin

Abstract

Traditional alignment of Large Language Models (LLMs) via Reinforcement Learning from Human Feedback (RLHF) is computationally intensive and difficult to scale. We present Linear Alignment, a novel framework that achieves preference alignment through a closed-form mathematical update to output distributions during inference. By leveraging Self-Contrastive Decoding (SCD) and a first-order Taylor expansion of the reward function, Linear Alignment bypasses iterative training and expensive data annotation. Experimental results demonstrate that our method achieves performance comparable to or exceeding PPO and DPO across multiple benchmarks and model scales.

Introduction: The RLHF Scalability Wall

The standard pipeline for developing helpful and harmless AI assistants relies heavily on RLHF, typically implemented through algorithms like Proximal Policy Optimization (PPO). Despite its success, RLHF presents significant challenges: it requires extensive human preference labeling, the training of auxiliary reward models, and a complex, resource-heavy optimization process. This complexity creates a "scalability wall," making it impractical to frequently re-align models for niche user preferences or evolving constitutional principles. The authors sought a way to achieve the benefits of alignment—shifting the model's behavior toward desired traits—without the overhead of model training.

Methodology: Alignment as Inference-Time Nudging

Linear Alignment shifts the paradigm from weight-space optimization to logit-space adjustment. The core innovation lies in two components:

1. Closed-form Policy Optimization

Rather than iteratively updating model weights, the authors treat alignment as a constrained optimization problem on the model's output logits (the raw scores for each possible next word). By applying a first-order Taylor expansion to the reward function and incorporating divergence constraints (to maintain the base model's reasoning logic), they derive a mathematical formula for a "one-step update." This formula directly calculates the optimal aligned distribution.

2. Self-Contrastive Decoding (SCD)

To provide a direction for the logit shift without a pre-trained reward model, the framework utilizes "principle prompts." The model processes a query twice: once normally and once with a specific behavioral principle (e.g., "be more helpful" or "talk like a child"). The difference between these outputs provides a gradient direction, which Linear Alignment then amplifies to produce the final response.

Experimental Setup

The method was evaluated using several key benchmarks:

  • Anthropic-RLHF-HH: A standard benchmark for general helpfulness and harmlessness.
  • Personalized Preference Dataset: A new dataset of 536 samples covering domains like Technology, Career Planning, and Health Care to test adaptation to specific user personas.
  • OpenCompass Benchmarks: Used to ensure alignment does not degrade core reasoning capabilities (MMLU, GSM8K).

Key Results and Performance

Linear Alignment demonstrates significant gains in alignment quality without the overhead of traditional training.

Superior Win Rates

On the Vicuna-7B model, Linear Alignment achieved a 22% increase in win rate over the base SFT model. As shown in the comparative analysis, it performs on par with PPO and frequently outperforms Direct Preference Optimization (DPO) and Best-of-N sampling strategies.

Win rates of Linear Alignment (Ours) against various baselines on Vicuna and Mistral models.

Personalization and Efficiency

In personalized preference tests, Linear Alignment on Mistral-7B outperformed proprietary models like ChatGPT in specific domains, with total scores jumping from 66.1 to 77.2. While the method requires approximately 2x the computation of a standard inference pass (due to the dual-prompt processing), this cost is negligible compared to the weeks of GPU time required for RLHF training. Furthermore, these passes can be batched to optimize hardware utilization.

Discussion and Limitations

The success of Linear Alignment suggests that LLMs already possess the latent knowledge required for alignment; they simply require a mathematical "push" to manifest it. However, the method relies on the base model's ability to interpret principle prompts. If the base model is too weak to understand the instruction, the alignment direction becomes unclear. Additionally, while much cheaper than training, the inference-time overhead remains a factor for high-throughput applications.

Conclusion

Linear Alignment offers a mathematically grounded, training-free alternative to RLHF. By transforming alignment into a single-step logit adjustment, it enables rapid, scalable personalization and behavioral steering of LLMs, paving the way for more flexible and efficient AI alignment strategies.

Summary updated

BibTeX
@inproceedings{gao2024linear,
  author = {Songyang Gao and Qiming Ge and Wei Shen and Shihan Dou and Junjie Ye and Xiao Wang and Rui Zheng and Yicheng Zou and Zhi Chen and Hang Yan and Qi Zhang and Dahua Lin},
  title = {{Linear Alignment: A Closed-form Solution for Aligning Human Preferences without Tuning and Feedback}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=Y4wxCICbD0},
}
Figure