Constrain Alignment with Sparse Autoencoders

Qingyu Yin, Chak Tou Leong, Hongbo Zhang, Min Zhu, Hanqi Yan, Qiang Zhang, Yulan He, Wenjie Li, Jun Wang, Yue Zhang · DOI

Abstract

The alignment of large language models (LLMs) with human preferences remains a key challenge. While post-training techniques like Reinforcement Learning from Human Feedback (RLHF) and Direct Preference Optimization (DPO) have achieved notable success, they often introduce computational inefficiencies and training instability. In this paper, we propose Feature-level constrained Preference Optimization (FPO), a novel method designed to simplify the alignment process while ensuring stability. FPO leverages pre-trained Sparse Autoencoders (SAEs) and introduces feature-level constraints, allowing for efficient, sparsity-enforced alignment. Our approach enjoys efficiency by using sparse features activated in a well-trained sparse autoencoder and the quality of sequential KL divergence by using the feature-level offline reference. Experimental results on benchmark datasets demonstrate that FPO achieves a 5.08% absolute improvement in win rate with much lower computational cost compared to state-of-the-art baselines, making it a promising solution for efficient and controllable LLM alignments.

Introduction: The Stability vs. Efficiency Trade-off

Aligning Large Language Models (LLMs) with human preferences is a critical final step in model development. While Direct Preference Optimization (DPO) simplified the complex RLHF pipeline, it introduced a persistent trade-off between stability and efficiency.

Reference-free methods like SimPO offer efficiency but often suffer from training instability and reduced generation diversity. Conversely, methods like TDPO improve stability by enforcing token-level Kullback-Leibler (KL) divergence constraints. However, calculating these constraints across massive vocabularies (e.g., 256k tokens for Gemma) at every training step creates significant computational and memory overhead. FPO addresses this by asking: Can we achieve the stability of fine-grained constraints without the overhead of token-level calculations?

Methodology: Feature-level constrained Preference Optimization (FPO)

FPO shifts the alignment constraint from the output token space to the internal feature space of the model using Sparse Autoencoders (SAEs).

Comparison of preference optimization losses and the two-phase FPO architecture.

The FPO framework consists of two main phases:

  1. Phase 1: Offline Caching: The reference model's features and log-probabilities are pre-computed and stored. This eliminates the need to load a second "reference" model into VRAM during training, drastically reducing memory usage.
  2. Phase 2: FPO Training: Instead of token-level KL divergence, FPO calculates the Mean Squared Error (MSE) between the sparse feature activations of the current policy and the cached reference features.

The core innovation is the Feature-Level MSE Constraint. The authors theoretically prove that minimizing this MSE effectively bounds the KL divergence. By focusing only on the $k$ most significant features (Top-k Sparsity), the model ignores noise and focuses on the most semantically relevant internal representations.

Key Insights: Sparsity and Interpretable Control

The effectiveness of FPO stems from the realization that a model's "essence" is captured by a small number of sparse features rather than the entire vocabulary.

The long-tail distribution of feature activation values demonstrates the extreme sparsity that FPO exploits for efficiency.

Beyond efficiency, FPO enables Interpretable Control. Because SAE features are often monosemantic (e.g., representing "JSON formatting" or a specific language), researchers can selectively manipulate constraints on specific features to suppress or enhance particular behaviors without retraining the entire model.

Experimental Results

The authors evaluated FPO using Gemma-2-2B and Gemma-2-9B models across several benchmarks, including UltraFeedback, AlpacaEval-2, and Arena-Hard.

  • Performance: FPO achieved a 5.08% absolute improvement in win rate on AlpacaEval-2 compared to standard DPO for the 2B model.
  • Efficiency: FPO reduced computational overhead by 17.6% compared to TDPO2, maintaining a memory footprint comparable to reference-free methods while providing superior stability.
  • Diversity: The method maintained higher generation entropy than baselines, successfully avoiding "mode collapse."
  • Layer Selection: Ablation studies indicated that applying constraints to deeper layers (e.g., layer 25) is most effective, as these layers contain richer semantic information.

Conclusion and Future Work

FPO demonstrates that sparse feature-level constraints are a mathematically sound and computationally efficient proxy for traditional token-level regularization. While the method showed diminishing returns when scaling to the 9B model—likely due to SAE width limitations—it opens new avenues for controllable alignment. Future research will explore training SAEs specifically for alignment tasks and utilizing multi-layer constraints to further refine model behavior.

Summary updated

BibTeX
@inproceedings{yin2025constrain,
  author = {Qingyu Yin and Chak Tou Leong and Hongbo Zhang and Min Zhu and Hanqi Yan and Qiang Zhang and Yulan He and Wenjie Li and Jun Wang and Yue Zhang},
  title = {{Constrain Alignment with Sparse Autoencoders}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=BCKSxOFX85},
}
Figure