Skip to content

sdg-bella/Code-Over-Words

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Code over Words

technical report technical report

This is the code repo for our work "Code over Words: Overcoming Semantic Inertia via Code-Grounded Reasoning."

Intro

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. 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.

Our work provide 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.

Some Demos

Install

You should firstly install baba-is-auto locally based on the instructions in baba-is-auto/README.md. We use vllm to help accelerate our inference. Our model is based on Qwen2.5-7B-Instruct.

Training and Inference

Training:

tbd.

Inference:
Download our SFT Lora from technical report. You should also download the original Qwen2.5-7b-Instruct model. By default, you should put these checkpoints in src/lcv/ft.

Then in your bash, run

cd src/lcv && bash inference.sh

Acknowledgement

Arvi "Hempuli" Teikari
baba-is-auto
TheoryCoder

If you find our work useful, please cite us at

@article{xu2026code,
  title={Code over Words: Overcoming Semantic Inertia via Code-Grounded Reasoning},
  author={Xu, Manjie and Isabella Yin and Tu, Xinyi and Zhang, Chi and Zhu, Yixin},
  journal={arXiv preprint arXiv:2601.18352},
  year={2026}
}  

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •