From Encoding to Generation: Towards Empathetic Large Language Models
Abstract
Empathetic interaction involves two distinguishable capacities: representing another person's emotional state (cognitive empathy) and generating an appropriate response to that state (affective empathy). We apply this distinction to examine how emotion-related information is internally organized, selectively attended to, and carried through response generation in Llama-3.2-3B-Instruct across 10 emotion categories from the EmpatheticDialogues dataset. Layer-wise linear probing revealed a broad middle-layer region of peak emotion-category decodability, with the layer-11 L2 probe achieving 63.6% held-out accuracy against a 10% chance level and a 54.6% TF-IDF lexical baseline. During response generation, emotion-related user tokens received 1.89 times as much attention per token as other utterance tokens, concentrated across layers 10-15. Target-emotion alignment then decreased from a mean cosine similarity of 0.239 for input representations to 0.125 for generated responses, with positive drift in 77% of examples and the largest shifts for angry and furious. Emotion-category representation, attention allocation, and response-level alignment therefore emerge as distinguishable components of model processing that can be analyzed through a functional cognitive-affective empathy framework. These findings provide a foundation for monitoring emotion representations during generation and leveraging models' existing affective structure to support more naturally empathetic responses without relying on external prompting or explicit emotion conditioning.
Figures & tables
| Emotion | Emotion description |
|---|---|
| Afraid | I was scared when I saw a mountain lion at night right in front of me. I ran to my tent. |
| Angry | Someone broke my window with a soccer ball. |
| Anxious | I drank all the coffee this morning and didn’t share the whole pot with anyone. Now I feel very strange. |
| Devastated | Passing of my mother. |
| Lonely | My boyfriend went out of town for a few days, leaving me all alone at the apartment. I didn’t have many friends here. |
| Sad | I just got laid off from my job. I need the paycheck, so this is not a good situation. |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Emotion | First utterance |
|---|---|
| Afraid | I have a solo trip coming up. I’m going to Colorado to climb Mt. Elbert Solo. It’s the tallest mountain in the United States. |
| Angry | On my way to work, a goose stole the toupee I needed to impress the new secretary, Christy. |
| Anxious | I have an important exam tomorrow and feel that something bad will happen. |
| Devastated | I had the worst night last night. I found out my uncle hit my cat with his car. It happened two weeks ago, and he never told me! |
| Lonely | I’m an over-the-road trucker. Man, it gets boring in the evenings. |
| Sad | Hello, yesterday was my birthday and my wife completely forgot! |
| Emotion pair | Hidden state | TF–IDF | Gain |
|---|---|---|---|
| Afraid–terrified | 60.3 | 61.4 | |
| Angry–furious | 60.9 | 57.2 | |
| Devastated–sad | 75.5 | 66.7 | |
| Lonely–furious | 98.8 | 92.7 | |
| Angry–lonely | 98.3 | 91.7 | |
| Furious–grateful | 98.0 | 87.5 |
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 64 papers