Hostname: page-component-89b8bd64d-dvtzq Total loading time: 0 Render date: 2026-05-11T19:18:38.114Z Has data issue: false hasContentIssue false

Stay Tuned: Improving Sentiment Analysis and Stance Detection Using Large Language Models

Published online by Cambridge University Press:  17 December 2025

Max Griswold*
Affiliation:
Economics, Sociology, and Statistics Department, RAND Corporation, USA
Michael W. Robbins
Affiliation:
Economics, Sociology, and Statistics Department, RAND Corporation, USA
Michael S. Pollard
Affiliation:
Economics, Sociology, and Statistics Department, RAND Corporation, USA
*
Corresponding author: Max Griswold; Email: griswold@rand.org
Rights & Permissions [Opens in a new window]

Abstract

Sentiment analysis and stance detection are key tasks in text analysis, with applications ranging from understanding political opinions to tracking policy positions. Recent advances in large language models (LLMs) offer significant potential to enhance sentiment analysis techniques and to evolve them into the more nuanced task of detecting stances expressed toward specific subjects. In this study, we evaluate lexicon-based models, supervised models, and LLMs for stance detection using two corpuses of social media data—a large corpus of tweets posted by members of the U.S. Congress on Twitter and a smaller sample of tweets from general users—which both focus on opinions concerning presidential candidates during the 2020 election. We consider several fine-tuning strategies to improve performance—including cross-target tuning using an assumption of congressmembers’ stance based on party affiliation—and strategies for fine-tuning LLMs, including few shot and chain-of-thought prompting. Our findings demonstrate that: 1) LLMs can distinguish stance on a specific target even when multiple subjects are mentioned, 2) tuning leads to notable improvements over pretrained models, 3) cross-target tuning can provide a viable alternative to in-target tuning in some settings, and 4) complex prompting strategies lead to improvements over pretrained models but underperform tuning approaches.

Information

Type
Article
Creative Commons
Creative Common License - CCCreative Common License - BYCreative Common License - NC
This is an Open Access article, distributed under the terms of the Creative Commons Attribution-NonCommercial licence (https://creativecommons.org/licenses/by-nc/4.0), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the original article is properly cited. The written permission of Cambridge University Press must be obtained prior to any commercial use.
Copyright
© The Author(s), 2025. Published by Cambridge University Press on behalf of The Society for Political Methodology
Figure 0

Figure 1 Distribution of estimated stance scores by subject for politician texts.

Figure 1

Figure 2 Estimated mean stance score by political affiliation and target subject (left) and correlation between party affiliation and estimated stance scores by target subject (right).

Figure 2

Figure 3 Correlation of estimated stance scores with human-coded stance scores, by target subject and number of target subjects.

Figure 3

Figure 4 Correlation of estimated stance scores with party affiliation (politician data) and human-coded stance scores (user data), by method, tuning approach, target subject, and number of subjects.

Figure 4

Figure 5 Correlation of binary stance scores with party affiliation (politicians dataset) and human-coded stance scores (users dataset), by method tuning approach, target subject, and number of subjects.

Figure 5

Figure 6 Correlation of continuous stance scores with party affiliation (politicians dataset) and hand-coded stance scores (user dataset), by prompt, method, target subject, and number of subjects.

Supplementary material: File

Griswold et al. supplementary material

Griswold et al. supplementary material
Download Griswold et al. supplementary material(File)
File 2.3 MB