Abstract
With the widespread applications of large language models (LLMs), aligning LLMs with human values has emerged as a critical challenge. For alignment, we always expect LLMs to be honest, positive, harmless, etc. And LLMs appear to be capable of generating the desired outputs after the alignment tuning process, such as the preference tuning via reinforcement learning from human feedback (RLHF). However, it also raises a question about after alignment, do LLMs genuinely obtain a value distinction between positives and negatives, beyond the generation of positive outputs? In this work, we start by investigating this question from the token distribution perspective. Our findings reveal that compared to the unaligned versions, LLMs after alignment exhibit a larger logits gap between positive and negative tokens at each generation step, which suggests that LLMs do obtain a value distinction of positives and negatives after alignment. Meanwhile, it also motivates us to achieve alignment by directly constructing such value distinction, thus alleviating the excessive reliance on computational resources required by training-time alignment. Specifically, we propose a representation editing method that intervenes the last hidden representation by amplifying the logits difference between positive and negative tokens (defined as anchor words). Experimental results demonstrate that the proposed method not only achieves effective alignment, but also requires fewer computational resources compared to training-time alignment methods.
Introduction
Aligning Large Language Models (LLMs) with human values—ensuring they are honest, harmless, and helpful—is a cornerstone of modern AI safety. Current state-of-the-art methods like Reinforcement Learning from Human Feedback (RLHF) and Direct Preference Optimization (DPO) have proven effective at steering model outputs. However, these techniques are computationally intensive and often treated as "black boxes" regarding the internal changes they induce.
A fundamental question remains: does alignment merely teach a model to mimic surface-level patterns of "good" behavior, or does it instill a deeper internal "value distinction"? This research investigates the internal representation of values in LLMs and proposes Anchor Words Tuning (AWOT), a lightweight inference-time method that achieves alignment by explicitly constructing this value distinction.
The Value Distinction Hypothesis
The authors hypothesize that alignment tuning creates a measurable gap in how models represent and prioritize positive versus negative concepts. By analyzing the token distribution of aligned versus base models, they discovered a significant "logits gap."
The Logits Gap Discovery
In aligned models, the difference in logits (raw prediction scores) between positive and negative "anchor words" (e.g., "excellent" vs. "terrible") is substantially larger—often up to 50 times greater—than in their unaligned counterparts. This suggests that even if a model does not explicitly output these anchor words, its internal scoring mechanism strongly differentiates between them.
Visual analysis using Principal Component Analysis (PCA) further supports this. In aligned models, "harmful" and "harmless" queries cluster into distinct, separable regions of the representation space. In contrast, these concepts appear "entangled" in base models, indicating a lack of clear internal value boundaries.
Anchor Words Tuning (AWOT)
Building on the discovery of the internal value distinction, the researchers developed Anchor Words Tuning (AWOT). AWOT is a representation editing technique that operates during inference (test-time) without modifying the model's billions of parameters.
How AWOT Works
- Anchor Word Selection: The method identifies sets of "positive" and "negative" tokens. These can be manually curated for specific tasks or automatically extracted by comparing a base model with an aligned reference model.
- Representation Editing: AWOT intervenes at the final hidden layer ($h_t$) at each generation step. It performs a few iterations of gradient ascent to update $h_t$ to maximize the logits gap between the positive and negative anchor words.
- Steering without Retraining: By amplifying this internal distinction, the model is "steered" toward generating aligned content. This process is significantly more efficient than full fine-tuning or RLHF.
Experimental Evaluation
The researchers evaluated AWOT across several domains, including Controlled Sentiment Generation (using IMDB reviews) and general safety/helpfulness (using the HH-RLHF dataset).
Key Results
- Performance: In sentiment tasks, AWOT consistently outperformed other test-time methods like Best-of-N (BoN) sampling. It effectively narrowed the performance gap between base models and fully fine-tuned "Chat" versions.
- Safety: On the HH-RLHF benchmark, AWOT improved the win rate of LLaMA2-7B from 16% to 30% when judged by GPT-4o, surpassing the effectiveness of standard safety system prompts.
- Efficiency: AWOT adds only marginal overhead to inference time. For LLaMA3-8B, the computational cost was negligible compared to the alignment gains achieved.
Discussion and Limitations
While AWOT offers a promising path toward efficient alignment, several challenges remain. The study observed a "forgetting" phenomenon where the internal value distinction decays during long-form generation, suggesting that alignment goals may fade as the sequence length increases.
Furthermore, AWOT currently requires "white-box" access to the model's internal hidden states, making it inapplicable to closed-source models accessed via API. Future work will focus on stabilizing the value distinction over long sequences and refining the selection of anchor words for complex ethical nuances.
Summary updated