
Causal Tracing for Sycophantic Behavior in Large Language Models
Raina Gao
02/09/2026
Sycophancy in large language models (LLMs) refers to the tendency of a model to uncritically align with a user’s stated beliefs, preferences, or opinions, regardless of their truth or validity. Present sycophantic behavior in LLMs is often dangerous when refusing to correct misinformation or supporting malicious thoughts from users. To study where this behavior arises inside the model, we adapt items from Anthropic’s NLP Survey sycophancy dataset into paired prompts that differ by a single-token cue and retain 30 pairs that produce non-sycophantic and sycophantic results. Using causal tracing via activation patching, we patch activations from the clean (non-sycophantic) run into the corrupt (sycophantic) run at every token-layer position of the Hugging Face Qwen/Qwen3-4B checkpoint, which contains 36 transformer layers indexed from Layer 0 through Layer 35, and measure changes in the next-token logit difference. The results indicate that cue-related restoration is concentrated primarily in early layers, while the strongest upper-layer effect is localized to the final prompt token. The strongest effects appeared in the first layers (0–5), where tokens tied to disagreement cues (“Do”, “you”, “disagree”) shifted the model’s trajectory when patched. Middle layers (10–18) showed additional pockets of influence around tokens such as “claim”, “private”, and “influence”. By contrast, cue-related positions in later layers produced little restoration. The one upper-layer exception is the final prompt token, where restoration likely reflects that position's direct role in next-token readout rather than the formation of a new stance.