Learning the Wrong Lessons: Syntactic-Domain Spurious Correlations in Language Models

Chantal Shaib, Vinith M. Suriyakumar, Levent Sagun, Byron C. Wallace, Marzyeh Ghassemi · DOI

Introduction

Large Language Models (LLMs) are expected to process prompts based on their semantic meaning and the relevant subject matter. However, recent research suggests that these models often rely on "syntactic-domain spurious correlations"—shortcuts where the grammatical structure of a query (its "syntactic skin") is used to predict the topic, potentially overriding the actual instructions. This reliance leads to brittle performance when sentence structures vary and creates significant security vulnerabilities.

Methodology and Framework

To investigate this phenomenon, researchers formalized the concept of "Template-Domain Spurious Correlation." They utilized a multi-step approach to isolate the effects of syntax from semantics.

Quasi-Synthetic Dataset

Using the TRex knowledge base derived from Wikipedia, a controlled environment was constructed where specific syntactic templates (sequences of Part-of-Speech tags) were uniquely assigned to particular domains, such as "Geography" or "Cuisine."

Prompt Perturbations

To test the models' reliance on these templates, five types of variations were introduced:

  • EXACT: The original training structure.
  • SYNONYM/PARAPHRASE: Semantic meaning is preserved while changing words or sentence structures.
  • ANTONYM/DISFLUENT: The meaning is intentionally broken or rendered nonsensical, yet the underlying syntactic template remains intact.
Overview of prompt perturbations and their relationship to semantics, syntax, and domain.

Benchmarking and Security Analysis

The study extended to "in-the-wild" models by partitioning datasets like Sentiment140, E-SNLI, and Newsroom into "in-domain" and "cross-domain" categories based on likely fine-tuning templates. Finally, a security case study evaluated whether benign syntactic structures (e.g., from math problems) could be used to bypass safety filters for harmful requests.

Key Insights: The Dominance of Syntax

The research revealed that the "how" of a prompt frequently overrides the "what." In "Disfluent" settings—where a question is nonsensical but matches a known domain-specific syntax—models often still provide answers relevant to that domain.

The "Jailbreak" Skin

A critical finding is that safety filters are often domain-specific, learning to refuse "harmful" topics. However, if a harmful request is reformatted to match the syntax of a "safe" domain, such as a Chain-of-Thought reasoning task, the model’s reliance on that safe syntax can bypass refusal mechanisms.

Scale and Memorization

Surprisingly, increasing model scale (tested up to 13B parameters) and instruction tuning did not eliminate these correlations; in some cases, they were reinforced. The authors distinguish this behavior from simple memorization (e.g., "Paris = France"), noting that the model uses the structure of the sentence to determine the category of the expected answer.

Experimental Results

The impact of these spurious correlations is measurable across both synthetic and real-world benchmarks.

  • Performance Degradation: In synthetic experiments, presenting a familiar entity within a template from a different domain caused performance to drop by approximately 40% to 60%.
  • Real-World Benchmarks: On the Sentiment140 dataset, OLMo-2-7B's accuracy plummeted from 0.85 (in-domain) to 0.48 (cross-domain) when using synonyms, indicating a heavy reliance on specific training templates.
  • Security Vulnerabilities: By applying a "Chain-of-Thought" syntactic template as a prefix, researchers reduced the refusal rate for harmful requests in OLMo-2-7B-Instruct from 40% to just 2.5%. Similar results were observed with GPT-4o-mini.
Comparison of model responses to harmful prompts wrapped in in-domain vs. cross-domain syntactic templates.

Limitations and Future Directions

While the study provides strong evidence of syntactic shortcuts, it faces constraints with closed-source models like GPT-4o, where exact training data is unknown. Additionally, the newest class of "reasoning" models (e.g., OpenAI's o1) remains to be evaluated.

To address these vulnerabilities, the authors propose two primary shifts in LLM development:

  1. Syntactic Diversity: Training data must be intentionally diversified to prevent any single syntax from becoming a proxy for a domain.
  2. Robust Evaluation: Benchmarks should incorporate syntactic perturbations to ensure models are learning underlying logic rather than superficial templates.

Summary updated

BibTeX
@inproceedings{shaib2025learning,
  author = {Chantal Shaib and Vinith M. Suriyakumar and Levent Sagun and Byron C. Wallace and Marzyeh Ghassemi},
  title = {{Learning the Wrong Lessons: Syntactic-Domain Spurious Correlations in Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=oBikm5Rshc},
}
Figure