从语法到情感:对LLM中情感推理的机制分析
Why Are Some Emotions Harder for LLMs? Uncovering the Causal Mechanisms of Emotion Inference via Sparse Autoencoders
AI总结:
本文通过稀疏自编码器研究LLM内部情感识别机制,发现情感特征在最终阶段出现,包含共享和特定情感特征,并提出可解释的因果特征引导方法提升情感识别性能。
摘要:
大型语言模型(LLMs)在情感敏感的人工智能应用中日益普及,但其内部情感识别机制尚不明确。本文通过稀疏自编码器(SAEs)研究LLM内部情感识别的机制。通过分析各层稀疏特征激活,我们发现了一种一致的三阶段信息流,其中情感相关特征仅在最终阶段出现。我们进一步表明,情感表示包含跨情感的共享特征和特定情感特征。通过分阶段因果追溯,我们识别出一组对情感预测影响显著的特征,并显示其数量和因果影响因情感而异;特别是厌恶情绪比其他情绪更弱和分散。最后,我们提出了一种可解释且数据高效的因果特征引导方法,显著提升了多个模型的情感识别性能,同时在很大程度上保留了语言建模能力,并证明这些改进在多个情感识别数据集中都能泛化。总体而言,我们的发现提供了对LLM内部情感识别机制的系统分析,并引入了一种高效、可解释且可控的方法来提高模型性能。
英文摘要:
Large language models (LLMs) are increasingly used in emotionally sensitive human-AI applications, where reliable emotion detection is essential. However, their emotion recognition abilities remain uneven: models often perform well on some emotions while consistently struggling with others. Although recent work has explored emotion mechanisms in LLMs, little is known about why models are weaker on some emotions than others from a mechanistic interpretability perspective. In this work, we investigate emotion-specific biases through the causal mechanisms of emotion inference using sparse autoencoders (SAEs). We systematically identify causal sparse emotion features that drive emotion inference and analyze their sparse causal organization within and across emotions. We show that some emotions, such as surprise and fear, rely on highly concentrated feature sets, whereas disgust exhibits a more distributed sparse causal organization: its causal features are generally weaker, frequently co-activate with features for other emotions, and are often overshadowed by causal features for anger. These representational differences provide a mechanistic explanation for why LLMs struggle more with certain emotions. Finally, we conduct two intervention experiments: targeted steering of weaker causal features to mitigate emotion-specific failures, and global optimization of a steering vector over the identified causal features to improve overall emotion recognition performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。