Abstract
As the demand for emotional intelligence in large language models (LLMs) grows, a key challenge lies in understanding the internal mechanisms that give rise to emotional expression and in controlling emotions in generated text. This study addresses three core questions: (1) Do LLMs contain context-agnostic mechanisms shaping emotional expression? (2) What form do these mechanisms take? (3) Can they be harnessed for universal emotion control? We first construct a controlled dataset, SEV (Scenario-Event with Valence), to elicit comparable internal states across emotions. Subsequently, we extract context-agnostic emotion directions that reveal consistent, cross-context encoding of emotion (Q1). We identify neurons and attention heads that locally implement emotional computation through analytical decomposition and causal analysis, and validate their causal roles via ablation and enhancement interventions. Next, we quantify each sublayer's causal influence on the model's final emotion representation and integrate the identified local components into coherent global emotion circuits that drive emotional expression (Q2). Directly modulating these circuits achieves 99.65% emotion-expression accuracy on the test set, surpassing prompting- and steering-based methods (Q3). To our knowledge, this is the first systematic study to uncover and validate emotion circuits in LLMs, offering new insights into interpretability and controllable emotional intelligence.
Abstract (translated)
随着对大型语言模型(LLM)中情感智能需求的增长,一个关键的挑战在于理解产生情感表达的内部机制以及控制生成文本中的情感。本研究针对三个核心问题进行了探讨:(1) LLMs 是否包含不受上下文影响的情感表达形成机制?(2) 这些机制的形式是什么?(3) 它们是否可以被利用来实现普遍的情感控制? 首先,我们构建了一个受控数据集 SEV(情景-事件带效价),用于在不同情绪中激发可比较的内部状态。接着,我们提取了不受上下文影响的情绪方向,这些方向揭示了一致的跨上下文情感编码(问题1)。通过解析分解和因果分析,我们识别出局部实现情感计算的神经元和注意力头,并通过消融和增强干预验证它们的因果作用。 接下来,我们将量化每个子层对模型最终情绪表示的因果影响,并将所确定的本地组件整合为驱动情绪表达的整体情绪回路(问题2)。直接调节这些电路在测试集上实现了 99.65% 的情感表达准确率,超过了基于提示和引导的方法(问题3)。 据我们所知,这是首次系统地揭露并验证 LLM 中的情绪回路的研究,为可解释性和可控性的情感智能提供了新的见解。
URL
https://arxiv.org/abs/2510.11328