Stance detection is the natural language processing task of determining whether the author of a text is in favor of, against or neutral toward a given target, such as a policy, a claim, a public figure or a product. Within Speech & language AI, it sits next to sentiment analysis but answers a different question: not how the writer feels in general, but what position the writer takes on a named topic.
The task is defined by a text-target pair. The same sentence can carry different stances toward different targets, so a model must reason about the relationship between the text and the target, often when the target is never mentioned explicitly. This makes stance detection a core component of misinformation research, opinion mining and argument analysis.
How stance detection models reason
A stance detection model receives a text and a target and outputs a label from a small fixed set, most often favor, against and none. Modern systems encode both inputs together with a transformer, so that attention layers can link words in the text to the meaning of the target.
The difficulty lies in implicit stance. A tweet saying “Finally, cleaner air for our kids” supports a coal plant closure without naming it. The model must infer the stance through world knowledge and pragmatic cues such as irony, rhetorical questions and the framing of consequences.
Earlier systems relied on n-gram features, sentiment lexicons and support vector machines, which worked only for targets seen in training. Current approaches use cross-encoders that read the target and the text as one sequence, separated by a special token, and some add external knowledge from knowledge graphs or retrieved background articles. Context also matters on social platforms: the stance of a reply often depends on the parent post in the conversation thread, so thread-aware models concatenate earlier messages before classification. For long documents, systems split the text into passages, classify each passage and then aggregate passage-level stances into one document label.
The following table shows how one text yields different labels depending on the target.
| Text | Target | Stance |
|---|---|---|
| “Remote work saved my sanity.” | Remote work | Favor |
| “Remote work saved my sanity.” | Return-to-office mandates | Against |
| “Remote work saved my sanity.” | Electric vehicles | None |
| “Is this vaccine really tested enough?” | Vaccine safety | Against (implied doubt) |
Task variants and label schemes
Stance detection has several formulations that differ in how targets are given and what counts as a stance. Choosing the right variant determines the dataset, the label set and the evaluation protocol.
| Variant | Input | Typical labels |
|---|---|---|
| Target-specific | Text plus one fixed target | Favor, against, none |
| Cross-target | Train on one target, test on a related one | Favor, against, none |
| Zero-shot stance | Text plus an unseen target | Favor, against, neutral |
| Rumor stance | Reply plus a source claim | Support, deny, query, comment |
| Claim verification stance | Evidence plus a headline | Agree, disagree, discuss, unrelated |
The rumor stance scheme known as SDQC is widely used for social media threads, while the agree, disagree, discuss, unrelated scheme comes from fake news challenge work in which a headline is compared with an article body.
Stance detection compared with related tasks
Stance detection is often confused with sentiment analysis, but the two are only weakly correlated. A writer can express negative sentiment while favoring a target, for example “I am furious that people still oppose this excellent law.”
| Task | Question answered | Needs a target |
|---|---|---|
| Stance detection | Which position does the author take? | Yes |
| Sentiment analysis | Is the tone positive or negative? | No |
| Aspect-based sentiment analysis | How is each product aspect rated? | Yes, an aspect |
| Textual entailment | Does one text logically follow from another? | Yes, a hypothesis |
| Toxicity detection | Is the text abusive or harmful? | No |
In practice, textual entailment models are a strong starting point for zero-shot stance, because the target can be phrased as a hypothesis such as “The author supports a carbon tax.”
Building and evaluating a stance classifier
A typical project starts with target definition and annotation guidelines. Annotators label text-target pairs, and inter-annotator agreement measured with Cohen’s or Krippendorff’s kappa often lands between 0.6 and 0.8, which signals that stance is subjective even for humans.
The standard metric is the macro-averaged F1 of the favor and against classes, introduced with the SemEval-2016 benchmark. It ignores the frequent “none” class so that a model cannot score well by predicting neutrality everywhere.
| Approach | Data needed | Best suited for |
|---|---|---|
| Fine-tuned encoder | Thousands of labeled pairs | Stable targets, high accuracy |
| Entailment-based zero-shot | No task labels | New or fast-changing targets |
| Prompted large language model | A few examples | Exploration and rare targets |
| Graph or user-aware model | Interaction networks | Social media with author history |
Pitfalls and ethical considerations
Stance classifiers degrade quickly under domain and target shift. A model trained on tweets about abortion transfers poorly to forum posts about immigration, so evaluation on the deployment domain is essential.
- Sarcasm and irony reverse the literal stance and remain a leading error source.
- Class imbalance toward “none” inflates accuracy while hiding weak favor and against recall.
- Spurious cues such as hashtags let models shortcut the task instead of reading the text.
- Profiling risk arises when stance scores are aggregated per person to infer political views.
Because stance often reveals political or religious opinion, which counts as sensitive personal data in many jurisdictions, responsible teams analyze aggregated trends rather than individuals and document the intended use.
A non-technical view
Imagine reading a pile of letters about a new park. You do not just ask whether each letter sounds happy or angry. You ask a sharper question: is this person for the park or against it?
Stance detection teaches a computer to answer that question. It reads a text and a topic. Then it decides for, against or neither. An angry letter can still support the park. A polite one can still oppose it. That is why stance is about position, not mood.
A concrete example
A city council plans a congestion charge for its center and opens a three-week public consultation. It receives about 18,000 comments through an online form, email and social media. Staff cannot read every comment in time for the vote.
Analysts fine-tune a multilingual transformer on 2,500 comments labeled by two reviewers, with the target “the proposed congestion charge”. On a held-out set, the model reaches a macro F1 of about 0.74 on favor and against. It then classifies all comments and groups them by neighborhood. The analysis shows strong opposition in outer districts and support near the center, and reviewers read the opposing comments in detail. The council adds exemptions for residents before the vote, and the final report explains the method and its error rate.