How Do LLMs Generate Contrastive Sentiments? A Mechanistic Perspective

Van Bach Nguyen, Jörg Schlötterer, Christin Seifert


Abstract
This paper presents a mechanistic investigation of how large language models (LLMs) generate contrastive sentiments. We define this task as transforming the sentiment of a given text (e.g., from positive to negative) while making minimal changes to its content. We identify two core mechanisms: (1) a preservation mechanism that maintains the sentiment of the input text, primarily mediated by specific attention heads, and (2) a sentiment transformation mechanism, which integrates a representation of the target sentiment label with the original valenced words using a circuit containing both MLP and attention layers. Building on these findings, we propose and validate a novel mechanistic intervention. By modifying key attention heads, we steer the LLM toward more effective contrastive generation, increasing the sentiment flip rate without sacrificing the minimality of changes. Our work not only deepens the understanding of the mechanisms underlying contrastive sentiment generation in LLMs, but also introduces a promising new direction to steer LLM behavior via targeted, mechanistic interventions.
Anthology ID:
2026.eacl-long.311
Volume:
Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
March
Year:
2026
Address:
Rabat, Morocco
Editors:
Vera Demberg, Kentaro Inui, Lluís Marquez
Venue:
EACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
6619–6635
Language:
URL:
https://preview.aclanthology.org/ingest-eacl/2026.eacl-long.311/
DOI:
Bibkey:
Cite (ACL):
Van Bach Nguyen, Jörg Schlötterer, and Christin Seifert. 2026. How Do LLMs Generate Contrastive Sentiments? A Mechanistic Perspective. In Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6619–6635, Rabat, Morocco. Association for Computational Linguistics.
Cite (Informal):
How Do LLMs Generate Contrastive Sentiments? A Mechanistic Perspective (Nguyen et al., EACL 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-eacl/2026.eacl-long.311.pdf