Is Code Better Than Language for Algorithmic Reasoning

22d ago · Global · primary source: export.arxiv.org

Deterministic code execution outperforms natural-language reasoning by 31.6 percentage points on algorithmic tasks, but changing only the intermediate representation — without actual execution — yields no meaningful gain, according to a new study on arXiv. The paper, submitted June 14, disentangles two factors often conflated when comparing tool-augmented language models: the intermediate representation (code vs. natural language) and the execution mechanism [1]. On a 40-task verifiable algorithmic benchmark, deterministic code execution delivered a +31.6pp improvement over natural-language reasoning [1]. However, an intermediate intervention — where the model expressed reasoning as executable code but the language model simulated that code in context — was not meaningfully different from natural-language reasoning, showing a difference of just +0.15pp [1]. These results suggest that changing the intermediate representation alone does not explain the tool-use advantage, providing evidence that performance gains require reliable external execution [1]. The authors formalize this intuition with a statistical decision-theoretic model that characterizes when execution dominates end-to-end risk in the disentangled trace-generation/execution regime [1]. A reconstruction intervention, which used a proxy language model to infer natural-language reasoning traces from code representations, recovered performance comparable to the original natural-language reasoning pipeline, further validating the theory [1]. Large language models, the neural networks underlying modern chatbots, are typically based on transformer architectures and are pre-trained to predict the next word before being fine-tuned to follow instructions [2]. A reasoning model is a type of LLM specifically trained to solve complex tasks requiring multiple steps of logical reasoning, demonstrating superior performance on logic, mathematics, and programming tasks compared to standard LLMs [5]. The new study's findings arrive as the practice of "vibe coding" — where developers describe a task to an LLM and accept AI-generated code without thorough review — gains traction. The term was coined in February 2025 by computer scientist Andrej Karpathy and was named the Collins English Dictionary Word of the Year for 2025 [3]. Critics of the practice point to a lack of accountability, maintainability, and an increased risk of security vulnerabilities [3]. All experiments associated with the paper are hosted on Hugging Face, a platform that has collaborated with arXiv since 2022 to embed interactive machine-learning demos directly alongside papers [7][8]. The integration allows users to find open-source demos on a paper's arXiv abstract page and try them in a browser without writing code [9].

research-paperbenchmarktool-release

Background sources we checked (10)
  • en.wikipedia.org ↗ A large language model (LLM) is a neural network trained on a vast amount of text for natural language processing tasks, especially language generation. LLMs can typically generate, summarize, translate, and analyze text in many contexts, and are a foundational technology behind …
  • en.wikipedia.org ↗ Vibe coding is a software development practice assisted by artificial intelligence (AI) where the software developer describes a project or task in a prompt to a large language model (LLM) which generates source code automatically. Vibe coding may involve accepting AI-generated c…
  • en.wikipedia.org ↗ Gemini is a family of multimodal large language models (LLMs) developed by Google DeepMind, and the successor to LaMDA and PaLM 2. Comprising Gemini Pro, Gemini Deep Think, Gemini Flash, and Gemini Flash Lite, it was announced on December 6, 2023. It powers the chatbot of the sam…
  • en.wikipedia.org ↗ A reasoning model, also known as a reasoning language model (RLM) or large reasoning model (LRM), is a type of large language model (LLM) that has been specifically trained to solve complex tasks requiring multiple steps of logical reasoning. These models demonstrate superior per…
  • en.wikipedia.org ↗ Hangzhou DeepSeek Artificial Intelligence Basic Technology Research Co., Ltd., doing business as DeepSeek, is a Chinese artificial intelligence (AI) company that develops large language models (LLMs). Based in Hangzhou, Zhejiang, DeepSeek is owned and funded by High-Flyer, a Chin…
  • huggingface.co ↗ Hugging Face Machine Learning Demos on arXiv Back to Articles ... # Hugging Face Machine Learning Demos on arXiv Published November 17, 2022 Update on GitHub Upvote 1 - - - - - Abubakar Abid abidlabs Follow …
  • info.arxiv.org ↗ ## Hugging Face Spaces ... Hugging Face code repositories, About Hugging Face ... Collaborators: Abubakar Abid, Omar Sanseviero, Ahsen Khaliq, and the Hugging Face team ... Hugging Face Spaces includes links to demos created by the community or the authors themselves. By going to…
  • huggingface.co ↗ Demos on Hugging Face Spaces allow a wide audience to try out state-of-the-art machine learning research without writing any code. Hugging Face and ArXiv have collaborated to embed these demos directly along side papers on ArXiv! ... Thanks to this integration, users can now find…
  • en.wikipedia.org ↗ A large language model (LLM) is a type of machine learning model designed for natural language processing tasks such as language generation. LLMs are language models with many parameters, and are trained with self-supervised learning on a vast amount of text.…
  • en.wikipedia.org ↗ Douwe Kiela is a Dutch-American research scientist and entrepreneur working in the field of artificial intelligence with a focus on machine learning and natural language processing. He is a research scientist director at Google DeepMind. He previously co-founded and served as CEO…

Sources

Spot something wrong? Report an issue