arXiv:2610.01170cs.CLOct 2026

Manuscript Offprint

arXiv:2610.01170

HeadEdit: Calibrating Language Model Behavior Through the Frozen Unembedding Matrix

Zirui He, Haiyan Zhao, Jingyu Hu, Yinghao Wu, Chenxi Yuan, Yingcong Li, Yandong Bai, Mengnan Du

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Alignment does not eliminate behavioral errors in language models. Models may still refuse benign requests, call unnecessary tools, or yield to false user claims. Current methods mitigate such errors as a computation problem, and rarely explore if the desired behavior is already encoded in the model's representation. Motivated by the observation that behavior-relevant information remains linearly decodable from the final hidden state even when the resulting logits produce the undesired behavior, we introduce HeadEdit, a gradient-free method that calibrates model behavior through the unembedding matrix. HeadEdit extracts a low-rank behavioral subspace from paired completions and uses each prompt's coordinates within it to generate a vocabulary-wide correction, thereby implementing implicitly adaptive steering without manually specified target tokens or parameter updates. HeadEdit improves all nine experimental settings across three tasks and three model families, with negligible inference overhead and no systematic loss of general capabilities. It also reveals a connection to gradient-based alignment. HeadEdit's low-dimensional representation partly predicts how preference tuning changes output logits on unseen prompts. The subspace learned from the model can also be reused after tuning, improving performance without re-extracting or retuning. These results show that HeadEdit provides a practical, lightweight, and interpretable way to calibrate model behavior through the unembedding matrix.

1 INTRODUCTION

Large language models have shown strong capabilities across a wide range of tasks. Post-training alignment is essential for turning pretrained language models into reliable systems (Ouyang et al., 2022; Rafailov et al., 2023; Ethayarajh et al., 2024). It enables models to follow instructions, respect safety constraints, and act appropriately across diverse contexts. However, these aligned models can still make errors across safety, tool use, and factual reliability (Cui et al., 2025; Sharma et al., 2024; Sun et al., 2026). Precisely correcting such errors while preserving existing capabilities and already-correct behavior remains an important challenge for behavioral alignment.

Although various methods have been proposed to address these alignment issues, they still suffer from several limitations. Preference optimization changes behavior through gradient-based parameter updates and requires a new optimization run for each objective (Rafailov et al., 2023; Ethayarajh et al., 2024; Meng et al., 2024). Activation steering keeps model parameters fixed, but requires model-specific layer selection and residual stream interventions that pass through subsequent computation (Turner et al., 2023; Zou et al., 2023; Rimsky et al., 2024). Decoding-time alignment methods act directly on token selection, but often rely on heuristic search, explicit reward functions, or auxiliary models evaluated throughout generation, adding inference cost and deployment complexity (Liu et al., 2021; Yang & Klein, 2021; Huang et al., 2025). From another perspective, the unembedding layer itself can be a bottleneck. During training, it projects vocabulary-wide gradients into the much smaller hidden space, suppressing much of the learning signal that reaches the rest of the model (Godey & Artzi, 2026). At inference time, the unembedding can fail to turn information in the final hidden state into the right token scores (Li et al., 2023; Sunnam et al., 2026). Glitch tokens show a related gap from the vocabulary side, where a token can exist in the output space without being reliably connected to the model's learned representations (Land & Bartolo, 2024; Tang et al., 2026). These findings show that the final readout creates a gap between what model represents and what it outputs.

Motivated by this observation, we ask whether behavior-relevant information in the final hidden state can be used to correct residual behavioral errors through the model's unembedding layer. To this end, we introduce HEADEDIT, a gradient-free method that identifies a low-rank behavioral subspace from paired desirable and undesirable completions. At inference time, HEADEDIT projects the final hidden state onto this subspace and maps the projected component through the frozen unembedding layer to produce a vocabulary-wide logit correction. The correction varies with the prompt rather than imposing a fixed token bias, and the operation is equivalent to a low-rank modification of the effective unembedding layer without changing the stored matrix. This combines the model-internal signal used by activation steering with the locality of an output-stage intervention.

We evaluate HEADEDIT across three behavioral domains and three model families, and further compare it with LoRA-DPO to study how unembedding editing relates to parameter-based alignment. Although the two methods produce different logit changes, HEADEDIT's low-dimensional coordinates retain predictive information about LoRA-DPO's updates on unseen prompts, suggesting that the two methods use related behavioral signals in different ways.

Overall, our main contributions are summarized as follows:

• We introduce HEADEDIT, a gradient-free method for correcting residual behavioral errors through the unembedding layer. It converts low-rank behavioral signals into prompt-specific, vocabulary-wide logit corrections without manually selecting target tokens or updating model parameters.

• HEADEDIT achieves the strongest overall performance among the compared gradient-free methods in all nine settings across three behavioral tasks and three model families. HEADEDIT maintains its robustness across model scales and data sizes, with negligible inference overhead and minimal degradation of general capabilities.

• We show that the extracted subspaces contain behavior-relevant information before generation and predict part of LoRA-DPO's logit updates on held-out prompts. HeadEdit can also be applied to LoRA-DPO without extracting a new subspace or retuning hyperparameters, improving performance in six of the nine settings.