mlsanityData to 14 Oct 2026

LLaMAs Have Feelings Too: Unveiling Sentiment and Emotion Representations in LLaMA Models Through Probing

arXiv 2505.16491 ↗First posted 22 May 2025cs.CL cs.AIcited by 15

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) have rapidly become central to NLP, demonstrating their ability to adapt to various tasks through prompting techniques, including sentiment analysis. However, we still have a limited understanding of how these models capture sentiment-related information. This study probes the hidden layers of Llama models to pinpoint where sentiment features are most represented and to assess how this affects sentiment analysis. Using probe classifiers, we analyze sentiment encoding across layers and scales, identifying the layers and pooling methods that best capture sentiment signals. Our results show that sentiment information is most concentrated in mid-layers for binary polarity tasks, with detection accuracy increasing up to 14% over prompting techniques. Additionally, we find that in decoder-only models, the last token is not consistently the most informative for sentiment encoding. Finally, this approach enables sentiment tasks to be performed with memory requirements reduced by an average of 57%. These insights contribute to a broader understanding of sentiment in LLMs, suggesting layer-specific probing as an effective approach for sentiment tasks beyond prompting, with potential to enhance model utility and reduce memory requirements.

Key facts. Cited by 15 papers in the map (data through 14 Oct 2026). Builds on 36 of its 79 references that are in the map. First posted on arXiv 22 May 2025.

Builds on

36 of 79 references.

References · 36

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2024The Llama 3 Herd of Modelscited by 14,715
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  6. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  7. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  8. 2019Optuna: A Next-generation Hyperparameter Optimization Frameworkcited by 2,501
  9. 2019Language Models as Knowledge Bases?cited by 1,936
  10. 2016Understanding intermediate layers using linear classifier probescited by 1,353
  11. 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,336
  12. 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,302
24 more
  1. 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,254
  2. 2014Convolutional Neural Networks for Sentence Classificationcited by 1,127
  3. 2022Discovering Latent Knowledge in Language Models Without Supervisioncited by 767
  4. 2023The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasetscited by 712
  5. 2023Is ChatGPT a General-Purpose Natural Language Processing Task Solver?cited by 488
  6. 2023Larger language models do in-context learning differentlycited by 394
  7. 2019FinBERT: Financial Sentiment Analysis with Pre-trained Language Modelscited by 385
  8. 2023Sentiment Analysis in the Era of Large Language Models: A Reality Checkcited by 268
  9. 2020Probing Pretrained Language Models for Lexical Semanticscited by 156
  10. 2022TweetNLP: Cutting-Edge Natural Language Processing for Social Mediacited by 71
  11. 2023Eliciting Latent Knowledge from Quirky Language Modelscited by 62
  12. 2023Probing LLMs for hate speech detection: strengths and vulnerabilitiescited by 52
  13. 2024Designing Heterogeneous LLM Agents for Financial Sentiment Analysiscited by 48
  14. 2024A Language Model's Guide Through Latent Spacecited by 43
  15. 2024Probing the Emergence of Cross-lingual Alignment during LLM Trainingcited by 39
  16. 2023Towards Understanding In-Context Learning with Contrastive Demonstrations and Saliency Mapscited by 35
  17. 2023Transforming Sentiment Analysis in the Financial Domain with ChatGPTcited by 25
  18. 2023Zero- and Few-Shot Prompting with LLMs: A Comparative Study with Fine-tuned Models for Bangla Sentiment Analysiscited by 20
  19. 2023Is Bigger and Deeper Always Better? Probing LLaMA Across Scales and Layerscited by 20
  20. 2019Probing for Semantic Classes: Diagnosing the Meaning Content of Word Embeddingscited by 15
  21. 2023Do PLMs Know and Understand Ontological Knowledge?cited by 13
  22. 2025Do LLMs Memorize Recommendation Datasets? A Preliminary Study on MovieLens-1Mcited by 12
  23. 2025Reassessing the Role of Chain-of-Thought in Sentiment Analysis: Insights and Limitationscited by 3
  24. 2024Do LLMs Think Fast and Slow? A Causal Study on Sentiment Analysiscited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 14.

15 papers.

Sort:

By area:

  1. 2026Rethinking LLM-as-a-Judge: Representation-as-a-Judge with Small Language Models via Semantic Capacity Asymmetrycited by 8
  2. 2026Eliciting Numerical Predictive Distributions of LLMs Without Autoregressioncited by 6
  3. 2026Do Emotions Influence Moral Judgment in Large Language Models?cited by 2
  4. 2026How Tokenization Limits Phonological Knowledge Representation in Language Models and How to Improve Themcited by 1
  5. 2026Why Are Some Emotions Harder for LLMs? Uncovering the Causal Mechanisms of Emotion Inference via Sparse Autoencoderscited by 1
  6. 2026STEREODISCO: Discovering Stereotypicality in LLMscited by 1
  7. 2026Exploring Diversity, Novelty, and Popularity Bias in ChatGPT's Recommendationscited by 0
  8. 2026Exploring Approaches for Detecting Memorization of Recommender System Data in Large Language Modelscited by 0
  9. 2025Do You Trust Me? Cognitive-Affective Signatures of Trustworthiness in Large Language Modelscited by 0
  10. 2026A BERTology View of LLM Orchestrations: Token- and Layer-Selective Probes for Efficient Single-Pass Classificationcited by 0
  11. 2026RUVA: Personalized Transparent On-Device Graph Reasoningcited by 0
  12. 2026Are Emotion and Rhetoric Neurons in LLM? Neuron Recognition and Adaptive Masking for Emotion-Rhetoric Prediction Steeringcited by 0
3 more
  1. 2026Some Emotions Run Deeper: Layer-wise Probing and Causal Intervention in Large Language Modelscited by 0
  2. 2026Interpretable Symptom Vectors for Depression in a Large Language Modelcited by 0
  3. 2026Usage-Modulated Sentiment Representations in Large Language Modelscited by 0