Lune

ACL2025Top-tier venue

Stochastic Chameleons: Irrelevant Context Hallucinations Reveal Class-Based (Mis)Generalization in LLMs

Ziling Cheng, Meng Cao, Marc-Antoine Rondeau, Jackie CK Cheung

Abstract

The widespread success of large language models (LLMs) on NLP benchmarks has been accompanied by concerns that LLMs function primarily as stochastic parrots that reproduce texts similar to what they saw during pre-training, often erroneously. But what is the nature of their errors, and do these errors exhibit any regularities? In this work, we examine irrelevant context hallucinations, in which models integrate misleading contextual cues into their predictions. Through behavioral analysis, we show that these errors result from a structured yet flawed mechanism that we term class-based (mis)generalization, in which models combine abstract class cues with features extracted from the query or context to derive answers. Furthermore, mechanistic interpretability experiments on Llama-3, Mistral, and Pythia across 39 factual recall relation types reveal that this behavior is reflected in the model's internal computations: (i) abstract class representations are constructed in lower layers before being refined into specific answers in higher layers, (ii) feature selection is governed by two competing circuits -one prioritizing direct query-based reasoning, the other incorporating contextual cues -whose relative influences determine the final output. Our findings provide a more nuanced perspective on the stochastic parrot argument: through form-based training, LLMs can exhibit generalization leveraging abstractions, albeit in unreliable ways based on contextual cues -what we term stochastic chameleons. 1

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Can LLMs Reason Abstractly Over Math Word Problems Without CoT? Disentangling Abstract Formulation From Arithmetic Computation cites Large Language Models Can Be Easily Distracted by Irrelevant Context
  • Can LLMs Reason Abstractly Over Math Word Problems Without CoT? Disentangling Abstract Formulation From Arithmetic Computation cites Locating and Editing Factual Associations in GPT
  • Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling cites Extracting Training Data from Large Language Models
  • Do LLMs Know Tool Irrelevance? Demystifying Structural Alignment Bias in Tool Invocations cites Locating and Editing Factual Associations in GPT
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Can LLMs Reason Abstractly Over Math Word Problems Without CoT? Disentangling Abstract Formulation From Arithmetic ComputationZiling Cheng, Meng Cao, Leila Pishdad, Yanshuai Cao et al.EMNLP 2025 · 6 citations
  2. Do LLMs Know Tool Irrelevance? Demystifying Structural Alignment Bias in Tool InvocationsYilong Liu, Xixun Lin, Pengfei Cao, Ge Zhang et al.ACL 2026

Builds on30

  1. Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
  2. Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
  3. Pythia: A Suite for Analyzing Large Language Models Across Training and ScalingStella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley et al.ICML 2023 · 1,822 citations
  4. Large Language Models Can Be Easily Distracted by Irrelevant ContextFreda Shi, Xinyun Chen, Kanishka Misra, Nathan Scales et al.ICML 2023 · 970 citations
  5. Climbing towards NLU: On Meaning, Form, and Understanding in the Age of DataEmily M. Bender, Alexander KollerACL 2020 · 914 citations

Related papers

  1. Mechanistic Understanding and Mitigation of Language Model Non-Factual HallucinationsLei Yu, Meng Cao, Jackie C. K. Cheung, Yue DongEMNLP Findings 2024 · 11 citations
  2. Sources of Hallucination by Large Language Models on Inference TasksNick McKenna, Tianyi Li, Liang Cheng, Mohammad Javad Hosseini et al.EMNLP Findings 2023 · 142 citations
  3. Why LLMs Hallucinate on Structured Knowledge: A Mechanistic Analysis of Reasoning over Linearized RepresentationsShanghao Li, Jinda Han, Yibo Wang, Yuanjie Zhu et al.ACL 2026
  4. The Curious Case of Hallucinatory (Un)answerability: Finding Truths in the Hidden States of Over-Confident Large Language ModelsAviv Slobodkin, Omer Goldman, Avi Caciularu, Ido Dagan et al.EMNLP 2023 · 11 citations
  5. Lookback Lens: Detecting and Mitigating Contextual Hallucinations in Large Language Models Using Only Attention MapsYung-Sung Chuang, Linlu Qiu, Cheng-Yu Hsieh, Ranjay Krishna et al.EMNLP 2024 · 18 citations
Dusk over the sea between two cliffs drawn in fine vertical lines