The Research Report
Semantic Gravity Wells: Why Telling AI What Not to Do Makes It Do Exactly That
Ask any language model "What is the capital of France?" and it will say Paris. Ask it "What is the capital of France? Do not use the word Paris" and, remarkably often, it still says Paris. The instruction makes things worse. Not sometimes. Predictably. Measurably. Mechanistically.
A new paper gives us the first deep look inside the machine to explain why. The answer is not that models fail to understand negation. The answer is that naming a forbidden word activates it. The instruction is a loaded gun, and it fires backward.
The Paper
"Semantic Gravity Wells: Why Negative Constraints Backfire" by Shailesh Rana, published January 2026 on arXiv (2601.08070), is the first comprehensive mechanistic investigation of why negative instructions fail in language models. The paper introduces a concept called semantic pressure, runs 40,000 stochastic generations, traces attention patterns through every layer, identifies two distinct failure modes, and confirms causality with activation patching. It is one of the cleanest mechanistic interpretability papers I have seen.
All experiments use Qwen2.5-7B-Instruct. The paper studies a single model because open weights are required for the internal analysis. The findings should generalize, though the authors are careful to note this is not proven.
The Setup
The researchers built 2,500 prompts designed to elicit single-word completions with one obvious answer. "Spill the " targets "beans." "The capital of France is " targets "Paris." "Water freezes at zero degrees _" targets "Celsius." Five categories. Each prompt validated by GPT-5.2 for uniqueness, low ambiguity, and no answer leakage.
Each prompt runs under two conditions. Baseline: "Answer with one word. Question: [prompt]." Negative instruction: "Answer with one word. Do not use the word '[X]' in your answer. Question: [prompt]."
They generate 16 samples per prompt under the negative condition, temperature 1.0, top-p 0.9. That gives 40,000 total samples with precise violation rate estimates.
Semantic Pressure: The Key Idea
Here is the central concept. Every prompt exerts a pull on the model toward its natural completion. "The capital of France is " pulls hard toward "Paris." "The color of the sky at noon is typically " pulls hard toward "blue." This pull exists before you add any constraint. It reflects the statistical regularities baked into the model during training.
The paper calls this pull semantic pressure (P₀). It is defined as the model's probability of producing the target word when no constraint is applied. A prompt where the model assigns 0.9 probability to "Paris" has P₀ = 0.9. A prompt where the model assigns 0.1 probability to the target has P₀ = 0.1.
This is not a vague metaphor. It is a precise number computed from the model's output distribution. And it predicts failure with startling accuracy.
The Logistic Curve
The paper's headline finding: violation probability follows a tight logistic function of semantic pressure.
At P₀ = 0.1 (low pressure), only 9% of samples violate the constraint. At P₀ = 0.9 (high pressure), violations exceed 46%. The logistic fit explains 78% of the variance in violation rates. A single number, computed before the constraint is even applied, predicts whether the model will comply.
The logistic regression gives slope β₁ = +2.27 (95% CI: [2.21, 2.33]). The confidence interval excludes zero by a wide margin. This is not a weak trend. It is a structural relationship.
Think about what this means. Violations are not random errors. They are lawful consequences of how strongly the model wants to say the word. If you know P₀, you can predict the failure rate. The constraint does not erase the model's prior. It wrestles with it. And often loses.
The gravity well metaphor in the paper's title is apt. A massive object curves spacetime around it. The model's training creates a probability landscape with deep wells at natural completions. The negative instruction is a force pushing outward. But the deeper the well, the stronger the pull back in.
Suppression Is Real But Asymmetric
One might assume that when a negative constraint fails, the model simply ignores it. The paper shows this is wrong.
The negative instruction does suppress target probability. It reduces it by 22.8 percentage points on average in successful cases. But in failures, suppression is only 5.2 points. A 4.4× difference. The model tries to comply in both cases. It just fails to comply enough.
This is a crucial finding. The model is not disregarding the instruction. It is processing it. The suppression signal exists. But it competes with semantic pressure, and semantic pressure often wins.
Two Failure Modes
The paper identifies two mechanistically distinct ways that negative constraints fail.
Priming failure (87.5% of violations). The instruction's explicit mention of the forbidden word activates rather than suppresses the target representation. When you say "Do not use the word Paris," the word "Paris" appears in the instruction. The model attends to it. And in 87.5% of failures, it attends to that word more than it attends to "do not." The Priming Index, defined as Target-Mention Focus minus Negation Focus, is positive. The instruction meant to suppress the target instead primes it.
This is the paper's most devastating finding. The act of naming the forbidden word is itself the problem. You cannot tell a model not to think about Paris without saying "Paris," and saying "Paris" activates the very representation you want to suppress. It is the pink elephant problem made mathematical.
Override failure (12.5% of violations). In a smaller but important fraction of cases, suppression exists and is strong, but late-layer feed-forward networks overwhelm it. The paper traces this through the model's layers. At layer 27, FFN contributions toward the target are +0.39 in failures versus +0.10 in successes. Nearly 4× larger. The model's internal feedforward circuits push the target word forward even after earlier layers successfully suppress it.
One override example from the paper: "The official currency of Brazil is _" with target "Real." The constraint achieves ΔP = 0.92 suppression. That is massive. But the final probability still reaches 0.82. The FFN override at layer 27 contributes +0.34, overwhelming the suppression.
Where It Happens: Layers 23-27
The paper uses activation patching to establish causality. The technique is elegant in concept: take the residual stream activations from a baseline run (no constraint) and transplant them into a negative-instruction run, layer by layer. If patching a layer changes the output probability, that layer is causally involved.
Results show a clear crossover at layer 23. Layers 0 through 22: patching baseline activations into these layers decreases target probability. The baseline activations at these layers support suppression. Layers 24 through 27: patching baseline activations increases target probability. The baseline activations at these late layers push toward the target.
Layers 23-27 are the danger zone. This is where the model's internal processing flips from trying to suppress the forbidden word to promoting it. The FFN contributions in these layers are the mechanism for override failures. And even in priming failures, these layers play a role, because the primed representation flows through them on its way to the output.
Why This Challenges "Guardrails Beat Guidance"
Two weeks ago I wrote about the Zhang et al. finding that negative constraints (guardrails) outperform positive directives (guidance) in coding agents. That paper found that "do not" rules improve agent performance while "do this" rules mostly add noise. The recommendation was to rewrite your positive directives as negative constraints.
The Semantic Gravity Wells paper complicates this picture considerably. The Rana paper shows that negative constraints have a built-in failure mode. The very act of naming what you forbid primes the model to produce it. This is not a minor edge case. It accounts for 87.5% of violations.
These findings are not contradictory. The Zhang et al. paper measured task completion in coding agents. The Rana paper measured word-level constraint compliance. Different tasks, different metrics, different models. But the tension is real. Negative constraints work better than positive directives for coding agents, in aggregate. Yet negative constraints also carry a self-defeating priming mechanism that the positive directives do not have.
The resolution is nuanced. Negative constraints are structurally better than positive directives for the reasons Zhang et al. describe. They define hard boundaries rather than soft preferences. They remove search space rather than diluting attention. But they also carry a cost that positive directives do not: the priming effect. When the constraint names a specific forbidden token, it activates that token.
The practical takeaway is not to abandon negative constraints. It is to avoid naming the specific thing you want to forbid when possible.
What to Do Instead
The paper's taxonomy of failure modes points toward concrete interventions.
Avoid naming the forbidden word. Since 87.5% of failures are priming failures caused by the explicit mention of the target, the most impactful intervention is to rephrase constraints to avoid naming the target. Instead of "Do not use the word Paris," say "Do not mention any cities." Instead of "Do not say beans," say "Avoid common idiomatic completions." The paper explicitly recommends category-level constraints, positive reframing, and circumlocution as alternatives.
Expect failure for natural completions. Constraints against the most obvious answer are inherently the hardest to satisfy. If the model assigns 0.9 probability to the word you are forbidding, expect a violation rate above 46%. No amount of prompt engineering will fully overcome the model's training.
Use post-generation filtering for critical cases. Generation-time constraints alone are insufficient for high-pressure cases. Combine them with output filtering. This is especially relevant for safety applications where a specific harmful output must never appear.
Consider semantic pressure as a diagnostic. If you can measure P₀ before applying constraints, you can predict failure rates with surprising accuracy. This enables risk-aware deployment. For low-pressure cases, negative constraints work reasonably well. For high-pressure cases, you need additional safeguards.
The Deeper Point
The paper's title is more than a metaphor. A semantic gravity well is a region of probability space where the model's training has created a deep basin of attraction. The word "Paris" after "capital of France" is not just the most likely completion. It is embedded in the model's weights as a strong attractor, reinforced by millions of training examples. The negative instruction adds a repulsive force, but the well is still there.
This has implications beyond negative constraints. Any instruction that competes with strong pre-trained priors faces the same dynamic. The model's training creates gravity wells at natural completions, idiomatic expressions, common patterns, stereotypical associations. Instructions operate on top of this landscape. They can redirect the model, but they cannot erase the wells.
The mechanistic evidence supports this. The late-layer FFN override is a structural feature of how transformer models process information. The feedforward networks in the final layers have the last word, literally. They can amplify or suppress signals from earlier layers. When they amplify a high-pressure target, no amount of earlier suppression can prevent the violation.
This is why negative constraints fail in the specific way they do. The instruction says "not Paris." The model processes "Paris" from the instruction. The word activates its representation. The representation flows through layers 23-27. And the FFN contributions in those layers, trained on millions of examples where "Paris" follows "capital of France," push the probability back up.
The gravity well wins.
The Numbers
Some numbers worth sitting with:
- 40,000 samples across 2,500 prompts
- Violation rate ranges from 9% (P₀ = 0.1) to 46%+ (P₀ = 0.9)
- Logistic fit slope: 2.27 (CI: [2.21, 2.33]), R² = 0.78
- Suppression in successes: 22.8 percentage points
- Suppression in failures: 5.2 percentage points
- 4.4× asymmetry between successes and failures
- 87.5% of violations are priming failures
- 12.5% of violations are override failures
- FFN contribution at layer 27: +0.39 in failures vs. +0.10 in successes
- Causal crossover at layer 23
- Layers 23-27 confirmed as causally responsible
These are not effect sizes that require careful statistics to detect. The signal is large, consistent, and mechanistically traced from input to output.
Citations
- Rana, S. (2026). "Semantic Gravity Wells: Why Negative Constraints Backfire." arXiv:2601.08070. https://arxiv.org/abs/2601.08070
- Zhang, X., Wang, G., Cui, Y., Qiu, W., Li, Z., Zhu, B., & He, P. (2026). "Do Agent Rules Shape or Distort? Guardrails Beat Guidance in Coding Agents." arXiv:2604.11088. https://arxiv.org/abs/2604.11088
- Kassner, N. & Schütze, H. (2020). "Negated and Misprimed Probes for Pretrained Language Models: Birds Can Talk, But Cannot Fly." arXiv:2005.02119.
- Hossain, M., et al. (2022). "Analysis with Large Language Models." Findings of ACL.
- nostalgebraist (2020). "Interpreting GPT: The Logit Lens." https://www.lesswrong.com/posts/AcKRB8wDpdaN6v6rY/
- Geva, M., et al. (2022). "Transformer Feed-Forward Layers Are Key-Value Memories." EMNLP.
- Meng, K., et al. (2022). "Locating and Editing Factual Associations in GPT." NeurIPS.
- Wang, K., et al. (2023). "Interpretability in the Wild." ICML.
- Ouyang, L., et al. (2022). "Training language models to follow instructions with human feedback." NeurIPS.
- Wei, J., et al. (2022). "Finetuned language models are zero-shot learners." ICLR.
Suggested Title
Semantic Gravity Wells: Why Negative Constraints Backfire
Word Count
2,268
Fact-Check Notes
- The paper uses Qwen2.5-7B-Instruct exclusively. All numerical results come from this single model. Generalization to other models, especially much larger ones, is not established.
- The 87.5% / 12.5% split between priming and override failures is specific to the priming index classification. The paper defines priming failure as Priming Index > 0 OR ΔP < 0, and override failure as ΔP > 0.1 with large FFN contributions. The specific threshold choices affect these percentages.
- The logistic regression (slope 2.27, intercept -2.40, R² = 0.78) is fit to binned data across 40,000 samples. The 95% CI for the slope is [2.21, 2.33]. I have not independently verified these numbers from the raw data.
- The activation patching results show layers 23-27 are causally responsible in Qwen2.5-7B-Instruct (a 28-layer model). Layer numbers would differ for other model sizes. The qualitative pattern (early layers support suppression, late layers override) may generalize, but specific layer numbers do not.
- The override failure example I cite (Brazil/Real, ΔP = 0.92, final P(X) = 0.82, FFN +0.34) comes directly from the paper's Section 6.2. I have not verified this independently.
- The "guardrails beat guidance" comparison in the discussion section references the Zhang et al. paper (arXiv:2604.11088). The comparison is between different experimental settings (coding agent task completion vs. single-word constraint compliance) and should not be read as a direct contradiction. I have framed it as a tension, not a refutation.
- The paper's suggestion of alternative phrasings (category-level constraints, positive reframing, circumlocution) is presented as a principled expectation rather than experimentally validated. The authors note that systematic evaluation of alternative phrasings is future work.