CogSteer: Cognition-Inspired Selective Layer Intervention for Efficiently Steering Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Xintong, Pan, Jingheng, Ding, Liang, Wang, Longyue, Jiang, Longqin, Li, Xingshan, Biemann, Chris
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915314565906432
author Wang, Xintong
Pan, Jingheng
Ding, Liang
Wang, Longyue
Jiang, Longqin
Li, Xingshan
Biemann, Chris
author_facet Wang, Xintong
Pan, Jingheng
Ding, Liang
Wang, Longyue
Jiang, Longqin
Li, Xingshan
Biemann, Chris
contents 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 Mistral-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.
format Preprint
id arxiv_https___arxiv_org_abs_2410_17714
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle CogSteer: Cognition-Inspired Selective Layer Intervention for Efficiently Steering Large Language Models
Wang, Xintong
Pan, Jingheng
Ding, Liang
Wang, Longyue
Jiang, Longqin
Li, Xingshan
Biemann, Chris
Computation and Language
Artificial Intelligence
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 Mistral-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.
title CogSteer: Cognition-Inspired Selective Layer Intervention for Efficiently Steering Large Language Models
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2410.17714