Emotion Is Not External Knowledge: Internal Attention Signals for Affective State Reasoning
Organizations: Nagoya University, Nagoya, Aichi, Japan · National Institute of Informatics, Tokyo, Japan
Abstract
Large Language Models (LLMs) increasingly operate in multi-turn interactions that require maintaining latent conversational states, not only explicit facts. We study affective state as an implicit state inferred from sparse contextual cues that remain relevant after topic shifts, and ask whether LLMs expose internal attention signals for routing such evidence at inference time. Prior attention interventions rely on labeled in-domain head profiles and externally specified target spans, limiting transfer across affective-evidence distributions. We propose Self-targeted Internal Attention Boosting (SIAB), which localizes sparse affective heads via causal localization (in detail activation patching) on synthetic minimal pairs and boosts, at the answer position, the content tokens these heads already attend to; both edited heads and target tokens are derived from the model's own behavior, enabling the same head set to be reused across tasks.We evaluate on ECC and GoEmotions across three LLMs and multiple prompting settings. Across settings, SIAB improves prompt-matched baselines by up to +10.3 macro-F1 on ECC and +5.5 on GoEmotions. Combined with PASTA-style external supervision, it achieves up to +13.84 accuracy points and +12.51 macro-F1 points, while mechanistic analyses trace the gains to sparse, emotion-enriched heads and show that layer proximity affects additivity.
Figures & tables
| ECC benchmark | GoEmotions benchmark | ||||||||
| Model | Config | Acc. | Macro-F1 | Macro-F1 | Top-1 | ||||
| Gemma3 ( Gemma Team, 2025 ) | ZS | 50 . 29 | 52 . 26 | — | — | 27 . 17 | 34 . 37 | — | — |
| ZS+SIAB | 59 . 62 | 59 . 93 | +9 . 32 | +7 . 67 | 30 . 45 | 38 . 15 | +3 . 28 | +3 . 78 | |
| Mid | 56 . 48 | 55 . 51 | +6 . 19 | +3 . 25 | 30 . 55 | 33 . 45 | +3 . 38 | 0 . 92 | |
| Mid+SIAB | 59 . 90 | 60 . 15 | +9 . 61 | +7 . 89 | 32 . 65 | 36 . 68 | +5 . 47 | +2 . 30 | |
| High | 60 . 66 | 58 . 27 | +10 . 37 | +6 . 01 | 28 . 72 | 32 . 24 | +1 . 55 | 2 . 14 | |
| Head set | Gemma3 | Qwen3 | LLaMA3 |
| ( ) | ( ) | ( ) | |
| Selected | 1.575 | 1.370 | 1.384 |
| Random Late | 1.373 | 1.064 | 1.195 |
| Random Middle | 1.346 | 1.157 | 1.228 |
| Random Early | 1.224 | 1.083 | 1.092 |
| Group | Gemma3 | Qwen3 | LLaMA3 |
| POS | |||
| NEG | |||
| HARD |
| Group | |||
| POS | |||
| NEG | — | — | |
| EASY | — | — | |
| HARD |
| Model | Sink | Sink | |
| mass | suppression | ||
| Gemma3 | |||
| Qwen3 | |||
| LLaMA3 |
| Model | PASTA dist. to SIAB | Additivity (Acc / F1) | ||
| Gemma3 | Near | / | ||
| Gemma3 | Far | / | ||
| Qwen3 | Near | / | ||
| Qwen3 | Far | / | ||
| LLaMA3 | Near | / | ||
| LLaMA3 | Far † | / | ||
| Hyperparameter | Role | Value | How set |
| Direct-effect threshold | 0.05 | ( Wang et al., 2023 ) | |
| Attention-vs.-value weight in | 0.5 | Equal-weighting | |
| Heads in | 4, 10, 20 | saturation, Fig. 3 | |
| Boost-applied query positions | 4 | ECC dev | |
| Top fraction of attended content tokens | 0.3 | A priori | |
| Pre-softmax bias magnitude | Tab 9 | Per model |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Selected (layer, head) indices |
| Gemma3 ( , ) | (24,4), (17,2), (22,6), (17,0) |
| Qwen3 ( , ) | (22,5), (18,30), (23,10), (20,9), (29,3), (26,27), (29,0), (7,3), (25,9), (24,15) |
| LLaMA3 ( , ) | (18,0), (16,10), (19,9), (16,26), (21,26), (6,20), (22,1), (13,10), (15,26), (21,24), (15,14), (19,11), (14,24), (15,20), (20,9), (13,12), (17,28), (24,21), (28,25), (17,20) |
| Shots | Qwen3 | LLaMA3 | Gemma3 |
| 0 | ( 5, 0.10) | ( 3, 0.10) | ( 6, 0.05) |
| 5 | ( 3, 0.20) | ( 3, 0.10) | ( 7, 0.05) |
| 10 | ( 2, 0.20) | ( 3, 0.10) | (10, 0.05) |
| 15 | ( 7, 0.08) | ( 3, 0.10) | ( 3, 0.03) |
| 27 | ( 3, 0.15) | ( 2, 0.15) | ( 7, 0.05) |
| Comparison | Top-1 [95% CI] | F1 [95% CI] |
| ZS ZS+ SIAB | [-1pt] | [-1pt] |
| Mid Mid+ SIAB | [-1pt] | [-1pt] |
| High High+ SIAB | [-1pt] | [-1pt] |
| PASTA-ECC vs. ZS | [-1pt] | [-1pt] |
| PASTA-GoE vs. ZS | [-1pt] | [-1pt] |
| PASTA - vs. ZS | [-1pt] | [-1pt] |
| Comparison | Top-1 [95% CI] | F1 [95% CI] |
| ZS ZS+ SIAB | [\makebox[32.00002pt][r]{+7.84},\makebox[32.00002pt][r]{+10.61}] | [\makebox[32.00002pt][r]{+6.33},\makebox[32.00002pt][r]{+8.98}] |
| Mid Mid+ SIAB | [\makebox[32.00002pt][r]{+2.01},\makebox[32.00002pt][r]{+4.79}] |
Emotion Representation in Language Models
Emotion representation in language models studies how models encode, interpret, and use affective concepts such as valence, arousal, and empathy.
See all 63 papers