C og S teer: Cognition-Inspired Selective Layer Intervention for Efficiently Steering Large Language Models (2025)

Abstract: Large Language Models (LLMs) achieve remarkable performance through pretraining on extensive data. This enables efficient adaptation to diverse downstream tasks. However, the lack of interpretability in their underlying mechanisms limits the ability to effectively steer LLMs for specific applications. In this work, we investigate the intrinsic mechanisms of LLMs from a cognitive perspective using eye movement measures. Specifically, we analyze the layer-wise correlation between human cognitive indicators and LLM representations. Building on these insights, we propose a heuristic approach for selecting the optimal steering layer to modulate LLM semantics. To this end, we introduce an efficient selective layer intervention based on prominent parameter-efficient fine-tuning methods, which conventionally adjust either all layers or only the final layer. Additionally, we present an implicit layer contrastive intervention during inference to steer LLMs away from toxic outputs. Extensive experiments on natural language understanding, reasoning, and generation tasks, conducted on GPT-2, LLaMa2-7B, and Mixtral-7B, demonstrate the effectiveness and efficiency of our approach. As a model-agnostic framework, it enhances the interpretability of LLMs while improving efficiency for safe deployment.

## introduction large language models (llms) @xcite @xcite have demonstrated strong capabilities in natural language understanding and reasoning @xcite @xcite @xcite through pretraining on large datasets, followed by instruction tuning and alignment with human values @xcite . consequently, llms achieve excellent performance on downstream tasks with fine-tuning. for an n-layer llm, we first heuristically find the optimal layer m for semantic intervention. the upper block represents an adapter that is fine-tuned and inserted into the frozen layer m. the bottom block illustrates the operation of the attention module in m to steer the semantic direction towards safer outputs during inference. however, their lack of interpretability and transparency limits the development of efficient finetuning and inference methods. to understand intrinsic mechanisms of llms, previous work has introduced various interpretability methods, including training linear classifiers as probes on top of hidden representations @xcite , projecting representations into vocabularies @xcite , and intervening in the computation path, such as knowledge neurons @xcite and circuits @xcite . however, these methods, which focus on a limited set of predefined classes, concepts, or prompts, have practical limitations in terms of scalability and generalization. in this work, we introduce a novel interpretability analysis method that leverages eye movement data @xcite @xcite collected by cognition researchers to study human reading behaviors. through correlation experiments, we find that llm hidden states exhibit a strong correlation with human gaze, peaking in the middle layers. using eye movement measures such as fixation and regression @xcite as human-interpretable indicators, we observe a hierarchical progression in llms, from initial syntactic and semantic processing to deeper integration and final prediction. additionally, a comparison of correlation results between natural reading and task-specific reading suggests that the upper layers of llms are more capable of reasoning. furthermore, advanced llms such as llama, which incorporate instruction tuning and reinforcement learning from human feedback (rlhf), demonstrate enhanced reasoning capabilities, even in the middle layers. llm intervention @xcite refers to fine-tuning or applying inference methods to steer their semantics to align with specific tasks and data distributions. in addition to enhancing the understanding of llm behavior, our interpretability analysis reveals that different layers serve distinct functions, with middle layers playing a crucial role in deeper syntactic and semantic processing. this enables us to first identify the most suitable layer for intervention, thereby improving task-specific performance. based on these insights, we propose a heuristic approach for selecting the optimal steering layer for semantic intervention. to achieve this, we refine prominent parameter-efficient fine-tuning (peft) methods, which traditionally adjust either all layers or only the last layer. as shown in figure 1 , our proposed cogsteer framework first identifies the most suitable layer m for semantic intervention based on the task. instead of fine-tuning all layers or only the last layer, our method fine-tunes only the selected layer, enabling llms to better adapt to specific tasks and datasets. the number of learnable parameters in cogsteer is significantly reduced, requiring only 1/n of the parameters in llms, thereby improving parameter efficiency. furthermore, we propose an implicit layer contrastive intervention method during inference, which efficiently identifies and steers semantics toward safer generation directions to evaluate the effectiveness of our proposed selective layer intervention. through extensive evaluations across diverse tasks and datasets, we demonstrate that the proposed selective layer intervention method achieves comparable or even superior performance with fewer parameters compared to the full-layer intervention baseline. specifically, we observed an average absolute improvement of +1.7 on the glue benchmark for llama2-7b, and an average absolute improvement of +5.8 on the glue benchmark for mistral-7b, with only 3.1% of the parameters involved in full-layer fine-tuning. moreover, in experiments on generation tasks, language toxification @xcite , and detoxification @xcite , our method achieves a +1.85% improvement in toxification compared to full-layer intervention and a +13.45% improvement in detoxification as compared to last-layer intervention. our main contributions are as follows: ## related work interpretability research is essential for uncovering the mechanisms of llms and ensuring their safe and trustworthy deployment as foundation models. various studies have analyzed how knowledge is stored in llms @xcite @xcite @xcite , focusing on concepts such as knowledge neurons @xcite and circuits @xcite . moreover, @xcite reveal that gpt-2 predicts tokens more similarly to humans than shallow language models but lacks engagement with llms. @xcite analyzes how model scale and training data influence surprisalbased predictions of reading time. @xcite investigates the alignment between model and human attention. unlike previous works, our method investigates the interpretability of llms through human-interpretable indicators based on eye movement theory, enabling a more precise understanding and control of model behavior (see § 3 and 4.1). parameter-efficient semantic steering peft @xcite , including adapter @xcite and @xcite , has gained popularity due to its ability to maintain a large number of frozen parameters in llms for generality while introducing only a small number of trainable parameters per task. our method for semantic steering via fine-tuning enhances peft methods by incorporating a selective layer intervention strategy, reducing computational costs while achieving superior performance (see § 4.2). furthermore, steering semantics during inference offers an even more efficient approach. contrastive decoding @xcite @xcite guides the generation process by comparing two output distributions. in contrast, our proposed implicit layer contrastive intervention efficiently identifies and steers the semantics of llms toward safe directions during inference (see § 4.3). ## from human gaze to llm behavior recent studies @xcite suggest that feed-forward networks (ffns) function similarly to neural memory networks, capturing syntactic and semantic features as well as factual knowledge @xcite . meanwhile, research in cognitive science @xcite has shown that eye movement measures provide insights into the time required for human readers to process syntax, semantics, and integrate information. motivated by these findings, we leverage eye movement measures to analyze their correlation with the hidden states of ffns across different layers of llms. ## conclusion in this paper, we introduce an efficient semantic steering method for llms using selective layer intervention. our approach is motivated by correlation analysis with eye movement measures, making it both interpretable and understandable. extensive experiments demonstrate that selective layer intervention achieves comparable or even superior performance while significantly reducing training time and the number of parameters required. overall, our proposed method represents an important step toward improving the interpretability of llms and contributes to their safe and efficient deployment.