Mechanistic Interpretability of Emotion Inference in Large Language Models

Ala N. Tak, Amin Banayeeanzade, Anahita Bolourani, Mina Kian, Robin Jia +1 more
2/8/2025
cs.CLcs.AI

No official code found. Best implementation: aminbana/emo-llm (12 stars, last commit 2025-09-29).

Abstract

Large language models (LLMs) show promising capabilities in predicting human emotions from text. However, the mechanisms through which these models process emotional stimuli remain largely unexplored. Our study addresses this gap by investigating how autoregressive LLMs infer emotions, showing that emotion representations are functionally localized to specific regions in the model. Our evaluation includes diverse model families and sizes and is supported by robustness checks. We then show that the identified representations are psychologically plausible by drawing on cognitive appraisal theory, a well-established psychological framework positing that emotions emerge from evaluations (appraisals) of environmental stimuli. By causally intervening on construed appraisal concepts, we steer the generation and show that the outputs align with theoretical and intuitive expectations. This work highlights a novel way to causally intervene and precisely shape emotional text generation, potentially benefiting safety and alignment in sensitive affective domains.

View on arXivView PDF

Code Implementations(1)

aminbana/emo-llmCommunity64%

Official Repo for "Mechanistic Interpretability of Emotion Inference in Large Language Models"

129Python, Jupyter NotebookFeb 8, 20251 years ago

Similar Papers

Cite this paper

@article{tak2025mechanistic,
  title  = {Mechanistic Interpretability of Emotion Inference in Large Language Models},
  author = {Ala N. Tak and Amin Banayeeanzade and Anahita Bolourani and Mina Kian and Robin Jia and Jonathan Gratch},
  year   = {2025},
  eprint = {2502.05489},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.05489v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.05489.svg)](https://codeofpaper.com/paper/2502.05489)

Discussion