Code over Words: Overcoming Semantic Inertia via Code-Grounded Reasoning
On the map: LLM reasoning → Reasoning benchmarks and evaluation
Abstract (arXiv)
LLMs struggle with Semantic Inertia: the inability to inhibit pre-trained priors (e.g., "Lava is Dangerous") when dynamic, in-context rules contradict them. We probe this phenomenon using Baba Is You, where physical laws are mutable text rules, enabling precise evaluation of models' ability to override learned priors when rules change. We quantatively observe that larger models can exhibit inverse scaling: they perform worse than smaller models when natural language reasoning requires suppressing pre-trained associations (e.g., accepting "Lava is Safe"). Our analysis attributes this to natural language encoding, which entangles descriptive semantics and logical rules, leading to persistent hallucinations of familiar physics despite explicit contradictory rules. Here we show that representing dynamics as executable code, rather than descriptive text, reverses this trend and enables effective prior inhibition. We introduce Code-Grounded Vistas (LCV), which fine-tunes models on counterfactual pairs and identifies states with contradictory rules, thereby forcing attention to logical constraints rather than visual semantics. This training-time approach outperforms expensive inference-time search methods in both efficiency and accuracy. Our results demonstrate that representation fundamentally determines whether scaling improves or impairs contextual reasoning. This challenges the assumption that larger models are universally better, with implications for domains that require dynamic overriding of learned priors.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in Reasoning benchmarks and evaluation, one of 17 directions in LLM reasoning. Builds on 9 of its 50 references that are in the map. First posted on arXiv 26 Jan 2026.
Builds on
9 of 50 references.
Closest ancestors · 3
Same direction, newest first
- 2025Can LLMs Reconcile Knowledge Conflicts in Counterfactual Reasoning15 Jun
- 2025Pitfalls of Scale: Investigating the Inverse Task of Redefinition in Large Language Models18 Feb
- 2023From Word Models to World Models: Translating from Natural Language to the Probabilistic Language of Thought22 Jun
Other references · 6
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2023LLM+P: Empowering Large Language Models with Optimal Planning Proficiencycited by 496
- 2023Ghost in the Minecraft: Generally Capable Agents for Open-World Environments via Large Language Models with Text-based Knowledge and Memorycited by 288
- 2025Synthesizing world models for bilevel planningcited by 13
- 2024Baba Is AI: Break the Rules to Beat the Benchmarkcited by 10
- 2025Baba is LLM: Reasoning in a Game with Dynamic Rulescited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025Rethinking the Chain-of-Thought: The Roles of In-Context Learning and Pre-trained Priors
- 2025LLMs Lean on Priors, Not Programming Language Semantics
- 2026LLM Reasoning Is Latent, Not the Chain of Thought
- 2026The Geometry of Thought: How Scale Restructures Reasoning In Large Language Models
- 2025Conflict-Aware Fusion: Mitigating Logic Inertia in Large Language Models via Structured Cognitive Priors
- 2024Exploring the Limits of Fine-grained LLM-based Physics Inference via Premise Removal Interventions
- 2024Do Large Language Models Understand Logic or Just Mimick Context?
- 2026When Do LLMs Reason? A Dynamical Systems View via Entropy Phase Transitions