Elamur Research⌕
☰
home / papers / 2025 / LLaMAs Have Feelings Too: Unveiling Sentiment and Emotion Representations in LLaMA Models Through Probing

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

Paper · 2025 · Dario Di Palma, Alessandro De Bellis, Giovanni Servedio et al.

Summary

This paper asks where Llama models internally store information about sentiment and emotion. It also asks whether that information can be used more directly than through prompting. The authors adapt a concept-detection framework and train probe classifiers on hidden representations from every layer of Llama-3 models with 1B, 3B and 8B parameters. They compare six ways of pooling token states into a sentence vector, rather than relying only on the final token. The tasks are binary polarity and six-way emotion detection (joy, sadness, anger, fear, love, surprise).

Polarity signals peak in the middle layers, while emotion signals are clearest in early layers. Larger models produce richer representations. Building on these findings, the authors present SentriLlama. It keeps the network only up to the best layer and replaces the language-modeling head with a small classifier. This outperforms zero-shot, few-shot and Chain-of-Thought prompting while using far less memory and running faster. The work shows how a decoder LLM can become an efficient sentiment classifier, and the code is publicly released.

Key points

  • Probing outperforms prompting by up to 14% in detection accuracy and reduces memory requirements by about 57% on average.
  • The final token is not reliably the best sentence representation. Concatenating max, min and mean pooling often works better.
  • SentriLlama inference speedups over the Instruct versions are 45.5% (3.2 1B), 71.9% (3.2 3B) and 85.9% (3.1 8B). DeBERTa and RoBERTa-large are slower than SentriLlama.
  • One limitation is that all layers before the selected one must be retained, so mid-layer variants can still be larger than DeBERTa or RoBERTa.
  • The study does not cover domain-specific or multilingual sentiment data.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

Also on the byline: Polytechnic University of Bari.

 Fields, topics and concepts

Cite

Cite as Dario Di Palma, Alessandro De Bellis, Giovanni Servedio, Vito Walter Anelli, Fedelucio Narducci and Tommaso Di Noia. 2025. LLaMAs Have Feelings Too: Unveiling Sentiment and Emotion Representations in LLaMA Models Through Probing. Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2025.acl-long.306

@inproceedings{palma2025llamas,
  title = {{LLaMAs Have Feelings Too: Unveiling Sentiment and Emotion Representations in LLaMA Models Through Probing}},
  author = {Dario {Di Palma}, Alessandro {De Bellis}, Giovanni Servedio, Vito Walter Anelli, Fedelucio Narducci and Tommaso {Di Noia}},
  booktitle = {Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  year = {2025},
  doi = {10.18653/v1/2025.acl-long.306},
  url = {https://doi.org/10.18653/v1/2025.acl-long.306}
}

References

78 references, 28 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Rabbia Ahmed, Sadaf Abdul-Rauf, and Seemab Latif. 2024. Leveraging large language models and prompt settings for context-aware financial sentiment analysis. In ICACS, pages 1–9. IEEE. find
  2. Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. 2019. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining.
  3. Kamla Al-Mannai, Hanan Alshikhabobakr, Sabih Bin Wasi, Rukhsar Neyaz, Houda Bouamor, and Behrang Mohit. 2014. Cmuq-hybrid: Sentiment classification by feature engineering and parameter tuning. In SemEval@COLING, pages 181–185. The Association for Computer Linguistics. find
  4. Guillaume Alain and Yoshua Bengio. 2017. Understanding intermediate layers using linear classifier probes. In ICLR (Workshop). OpenReview.net. find
  5. Vito Walter Anelli, Giovanni Maria Biancofiore, Alessandro De Bellis, Tommaso Di Noia, and Eugenio Di Sciascio. 2022. Interpretability of BERT latent space through knowledge graphs. In Proceedings of the 31st ACM International Conference on Information & Knowledge Management, Atlanta, GA, USA, Octob… find
  6. Dogu Araci. 2019. Finbert: Financial sentiment analysis with pre-trained language models. CoRR, abs/1908.10063. find
  7. A. Arditi and O. B. Obeso. 2023. Refusal mechanisms: Initial experiments with llama-2-7b-chat. https://www.lesswrong.com/posts/ pYcEhoAoPfHhgJ8YC. Accessed: 2024-11-18. ↗
  8. Amos Azaria and Tom M. Mitchell. 2023. The internal state of an LLM knows when it’s lying. In EMNLP (Findings), pages 967–976. Association for Computational Linguistics.
  9. Yinhao Bai, Zhixin Han, Yuhua Zhao, Hang Gao, Zhuowei Zhang, Xunzhi Wang, and Mengting Hu. 2024. Is compound aspect-based sentiment analysis addressed by LLMs? In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 7836–7861, Miami, Florida, USA. Association for Computationa… find
  10. Giovanni Maria Biancofiore, Dario Di Palma, Claudio Pomo, Fedelucio Narducci, and Tommaso Di Noia. 2025. Conversational user interfaces and agents. In Human-Centered AI: An Illustrated Scientific Quest, pages 399–438. Springer. find
  11. Monali Bordoloi and Saroj K. Biswas. 2023. Sentiment analysis: A survey on design framework, applications and future scopes. Artif. Intell. Rev., 56(11):12505– 12560. find
  12. Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, and Jared Kaplan et al. 2020. Language models are few-shot learners. In NeurIPS.
  13. Collin Burns, Haotian Ye, Dan Klein, and Jacob Steinhardt. 2023. Discovering latent knowledge in language models without supervision. In ICLR. Open-Review.net. find
  14. José Camacho-Collados, Kiamehr Rezaee, Talayeh Riahi, Asahi Ushio, and Daniel Loureiro et al. 2022. Tweetnlp: Cutting-edge natural language processing for social media. In EMNLP (Demos), pages 38–49. Association for Computational Linguistics. find
  15. Pimwadee Chaovalit and Lina Zhou. 2005. Movie review mining: a comparison between supervised and unsupervised classification approaches. In HICSS. IEEE Computer Society. find
  16. Nuo Chen, Ning Wu, Shining Liang, Ming Gong, Linjun Shou, Dongmei Zhang, and Jia Li. 2023. Is bigger and deeper always better? probing llama across scales and layers. CoRR, abs/2312.04333. — [arXiv:2312.04333](https://arxiv.org/abs/2312.04333) find
  17. Gladson de Araujo, Tiago de Melo, and Carlos Mauricio S. Figueiredo. 2024. Is chatgpt an effective solver of sentiment analysis tasks in portuguese? A preliminary study. In PROPOR, pages 13–21. Association for Computational Lingustics. find
  18. Alessandro De Bellis, Vito Walter Anelli, Tommaso Di Noia, and Eugenio Di Sciascio. 2024. PRONTO: prompt-based detection of semantic containment patterns in mlms. In ISWC (2), volume 15232 of Lecture Notes in Computer Science, pages 227–246. Springer. find
  19. Xiang Deng, Vasilisa Bashlovkina, Feng Han, Simon Baumgartner, and Michael Bendersky. 2023. Llms to the moon? reddit market sentiment analysis with large language models. In WWW (Companion Volume), pages 1014–1019. ACM. find
  20. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies,…
  21. Dario Di Palma. 2023. Retrieval-augmented recommender system: Enhancing recommender systems with large language models. In RecSys, pages 1369– 1373. ACM. find
  22. Dario Di Palma, Felice Antonio Merra, Maurizio Sfilio, Vito Walter Anelli, Fedelucio Narducci, and Tommaso Di Noia. 2025. Do llms memorize recommendation datasets? a preliminary study on movielens-1m. In Proceedings of the 48th International ACM SIGIR Conference on Research and Development in Inform… find
  23. Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, and Angela Fan et al. 2024. The llama 3 herd of models. CoRR, abs/2407.21783.
  24. Georgios Fatouros, John Soldatos, Kalliopi Kouroumali, Georgios Makridis, and Dimosthenis Kyriazis. 2023. Transforming sentiment analysis in the financial domain with chatgpt. Machine Learning with Applications, 14:100508. find
  25. Yusra Ghafoor, Shi Jinping, Fernando H. Calderon, Yen-Hao Huang, Kuan-Ta Chen, and Yi-Shin Chen. 2023. find
  26. TERMS: textual emotion recognition in multidimensional space. Appl. Intell., 53(3):2673–2693. find
  27. Wes Gurnee and Max Tegmark. 2024. Language models represent space and time. In ICLR. OpenReview.net. find
  28. Md. Arid Hasan, Shudipta Das, Afiyat Anjum, Firoj Alam, Anika Anjum, Avijit Sarker, and Sheak Rashed Haider Noori. 2024. Zero- and few-shot prompting with llms: A comparative study with fine-tuned models for bangla sentiment analysis. In LREC/COLING, pages 17808–17818. ELRA and ICCL. find
  29. Vasileios Hatzivassiloglou and Kathleen R. McKeown. 1997. Predicting the semantic orientation of adjectives. In ACL, pages 174–181. Morgan Kaufmann Publishers / ACL. find
  30. Pengcheng He, Jianfeng Gao, and Weizhu Chen. 2023. Debertav3: Improving deberta using electra-style pre-training with gradient-disentangled embedding sharing. In ICLR. OpenReview.net.
  31. Khairullah Khan, Baharum Baharudin, Aurangzeb Khan, and Ashraf Ullah. 2014. Mining opinion components from unstructured reviews: A review. J. King Saud Univ. Comput. Inf. Sci., 26(3):258–275. find
  32. Siwon Kim, Sangdoo Yun, Hwaran Lee, Martin Gubri, Sungroh Yoon, and Seong Joon Oh. 2023. Propile: Probing privacy leakage in large language models. In Advances in Neural Information Processing Systems, volume 36, pages 20750–20762. Curran Associates, Inc. find
  33. Yoon Kim. 2014. Convolutional neural networks for sentence classification. In EMNLP, pages 1746– 1751. ACL.
  34. Filip Klubicka and John D. Kelleher. 2022. Probing with noise: Unpicking the warp and weft of embeddings. In BlackboxNLP@EMNLP, pages 404–417. Association for Computational Linguistics. find
  35. Jan Ole Krugmann and Jochen Hartmann. 2024. Sentiment analysis in the age of generative ai. Customer Needs and Solutions, 11(1):3. find
  36. Kenneth Li, Oam Patel, Fernanda B. Viégas, Hanspeter Pfister, and Martin Wattenberg. 2023. Inference-time intervention: Eliciting truthful answers from a language model. In NeurIPS.
  37. Shuying Lin, Huosheng Xie, Liang-Chih Yu, and K. Robert Lai. 2017. Sentinlp at IJCNLP-2017 task 4: Customer feedback analysis using a bi-lstm-cnn model. In IJCNLP (Shared Tasks), pages 149–154. Asian Federation of Natural Language Processing. find
  38. Fuxiao Liu, Paiheng Xu, Zongxia Li, Yue Feng, and Hyemi Song. 2023. Towards understanding in-context learning with contrastive demonstrations and saliency maps. arXiv preprint arXiv:2307.05052. — [arXiv:2307.05052](https://arxiv.org/abs/2307.05052) find
  39. Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized BERT pretraining approach. CoRR, abs/1907.11692.
  40. Zhiheng Lyu, Zhijing Jin, Fernando Gonzalez Adauto, Rada Mihalcea, Bernhard Schölkopf, and Mrinmaya Sachan. 2024. Do llms think fast and slow? a causal study on sentiment analysis. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 9353–9372. find
  41. Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. 2011. Learning word vectors for sentiment analysis. In ACL, pages 142–150. The Association for Computer Linguistics.
  42. Alex Mallen and Nora Belrose. 2023. Eliciting latent knowledge from quirky language models. CoRR, abs/2312.01037. — [arXiv:2312.01037](https://arxiv.org/abs/2312.01037) find
  43. Francesco Manigrasso, Stefan F. Schouten, Lia Morra, and Peter Bloem. 2024. Probing llms for logical reasoning. In NeSy (1), volume 14979 of Lecture Notes in Computer Science, pages 257–278. Springer. find
  44. Samuel Marks and Max Tegmark. 2023. The geometry of truth: Emergent linear structure in large language model representations of true/false datasets. CoRR, abs/2310.06824.
  45. Tomás Mikolov, Wen-tau Yih, and Geoffrey Zweig. 2013. Linguistic regularities in continuous space word representations. In HLT-NAACL, pages 746– 751. The Association for Computational Linguistics.
  46. Roser Morante and Eduardo Blanco. 2012. *sem 2012 shared task: Resolving the scope and focus of negation. In *SEM@NAACL-HLT, pages 265–274. Association for Computational Linguistics. nostalgebraist. 2020. Interpreting gpt: The logit lens. https://www.lesswrong.com/posts/ AcKRB8wDpdaN6v6ru. ↗
  47. OpenAI. 2023. GPT-4 technical report. abs/2303.08774.
  48. CoRR, Bo Pang and Lillian Lee. 2005. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In Proceedings of the ACL.
  49. Bo Pang, Lillian Lee, and Shivakumar Vaithyanathan. 2002. Thumbs up? sentiment classification using machine learning techniques. In EMNLP, pages 79– 86.
  50. Vincenzo Paparella, Dario Di Palma, Vito Walter Anelli, and Tommaso Di Noia. 2023. Broadening the scope: Evaluating the potential of recommender systems beyond prioritizing accuracy. In RecSys, pages 1139– 1145. ACM. find
  51. Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, and Mathieu Blondel et al. 2011. Scikit-learn: Machine learning in python. J. Mach. Learn. Res., 12:2825–2830. find
  52. Fabio Petroni, Tim Rocktäschel, Sebastian Riedel, Patrick S. H. Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander H. Miller. 2019. Language models as knowledge bases? In EMNLP/IJCNLP (1), pages 2463–2473. Association for Computational Linguistics.
  53. Paulo Pirozelli, Marcos Menon José, Paulo de Tarso P. Filho, Anarosa A. F. Brandão, and Fábio Gagliardi Cozman. 2024. Assessing logical reasoning capabilities of encoder-only transformer models. In NeSy (1), volume 14979 of Lecture Notes in Computer Science, pages 29–46. Springer. find
  54. Chengwei Qin, Aston Zhang, Zhuosheng Zhang, Jiaao Chen, Michihiro Yasunaga, and Diyi Yang. 2023. Is chatgpt a general-purpose natural language processing task solver? In EMNLP, pages 1339–1384. Association for Computational Linguistics.
  55. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. find
  56. Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21:140:1–140:67.
  57. N. Rimsky. 2023. Reducing sycophancy and improving honesty via activation steering. https://www.lesswrong.com/posts/zt6hRsDE84HeBKh7E. ↗
  58. Sarthak Roy, Ashish Harshavardhan, Animesh Mukherjee, and Punyajoy Saha. 2023. Probing llms for hate speech detection: strengths and vulnerabilities. In EMNLP (Findings), pages 6116–6128. Association for Computational Linguistics. find
  59. Elvis Saravia, Hsien-Chi Toby Liu, Yen-Hao Huang, Junlin Wu, and Yi-Shin Chen. 2018. CARER: contextualized affect representations for emotion recognition. In EMNLP, pages 3687–3697. Association for Computational Linguistics.
  60. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Y. Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, pages 1631–1642. ACL.
  61. Anders Søgaard. 2011. Semi-supervised condensed nearest neighbor for part-of-speech tagging. In ACL (2), pages 48–52. The Association for Computer Linguistics. find
  62. William Stigall, Md Abdullah Al Hafiz Khan, Dinesh Chowdary Attota, Francis Nweke, and Yong Pei. 2024. Large language models performance comparison of emotion and sentiment classification. In ACM Southeast Regional Conference, pages 60–68. ACM. find
  63. Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurélien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. 2023. Llama: Open and efficient foundation language models. CoRR, ab…
  64. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NIPS, pages 5998–6008.
  65. Dimitri von Rütte, Sotiris Anagnostidis, Gregor Bachmann, and Thomas Hofmann. 2024. A language model’s guide through latent space. In ICML. Open-Review.net. find
  66. Ivan Vulić, Edoardo Maria Ponti, Robert Litschko, Goran Glavaš, and Anna Korhonen. 2020. Probing pretrained language models for lexical semantics. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7222–7240, Online. Association for Computationa…
  67. Hetong Wang, Pasquale Minervini, and Edoardo M. Ponti. 2024. Probing the emergence of cross-lingual alignment during LLM training. In ACL (Findings), pages 12159–12173. Association for Computational Linguistics. find
  68. Jerry Wei, Jason Wei, Yi Tay, Dustin Tran, Albert Webson, Yifeng Lu, Xinyun Chen, Hanxiao Liu, Da Huang, Denny Zhou, et al. 2023. Larger language models do in-context learning differently. arXiv preprint arXiv:2303.03846.
  69. Jiaxin Wen, Pei Ke, Hao Sun, Zhexin Zhang, Chengfei Li, Jinfeng Bai, and Minlie Huang. 2023. Unveiling the implicit toxicity in large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 1322– 1338, Singapore. Association for Computational…
  70. Janyce Wiebe. 2000. Learning subjective adjectives from corpora. In AAAI/IAAI, pages 735–740. AAAI Press / The MIT Press. find
  71. Weiqi Wu, Chengyue Jiang, Yong Jiang, Pengjun Xie, and Kewei Tu. 2023. Do PLMs know and understand ontological knowledge? In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3080–3101, Toronto, Canada. Association for Computationa… find
  72. Qingrong Xia, Bo Zhang, Rui Wang, Zhenghua Li, Yue Zhang, Fei Huang, Luo Si, and Min Zhang. 2021. A unified span-based approach for opinion mining with syntactic constituents. In NAACL-HLT, pages 1795– 1804. Association for Computational Linguistics. find
  73. Frank Xing. 2024. Designing heterogeneous llm agents for financial sentiment analysis. ACM Transactions on Management Information Systems. find
  74. Yadollah Yaghoobzadeh, Katharina Kann, Timothy J. Hazen, Eneko Agirre, and Hinrich Schütze. 2019. Probing for semantic classes: Diagnosing the meaning content of word embeddings. In ACL (1), pages 5740–5753. Association for Computational Linguistics. find
  75. Lin Yao, Chengjie Sun, Lu Li, Zhixin Hao, and Xiaolong Wang. 2010. Hybrid learning of syntactic and semantic dependencies. Comput. Inf. Sci., 3(4):187– 199. find
  76. Wenxuan Zhang, Yue Deng, Bing Liu, Sinno Jialin Pan, and Lidong Bing. 2024. Sentiment analysis in the era of large language models: A reality check. In NAACL-HLT (Findings), pages 3881–3906. Association for Computational Linguistics.
  77. Kaiyuan Zheng, Qinghua Zhao, and Lei Li. 2025. Reassessing the role of chain-of-thought in sentiment analysis: Insights and limitations. arXiv preprint arXiv:2501.08641. — [arXiv:2501.08641](https://arxiv.org/abs/2501.08641) find
  78. Andy Zou, Long Phan, Sarah Chen, James Campbell, Phillip Guo, Richard Ren, and Alexander Pan et al. 2023. Representation engineering: A top-down approach to AI transparency. CoRR, abs/2310.01405.

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/palma-2025-llamas-have-feelings-too-unveiling/