CLAIFeb 11, 2025

CodeI/O: Condensing Reasoning Patterns via Code Input-Output Prediction

arXiv:2502.07316v447 citationsh-index: 10Has CodeICML
Originality Incremental advance
AI Analysis

This work addresses the problem of fragmented training data for reasoning tasks in AI, offering a novel approach that could benefit researchers and practitioners in natural language processing and AI reasoning, though it appears incremental as it builds on existing Chain-of-Thought methods.

The paper tackles the challenge of improving reasoning in Large Language Models across diverse tasks by proposing CodeI/O, a method that transforms code into input-output prediction formats to expose models to universal reasoning primitives, resulting in consistent performance gains on symbolic, scientific, logic, math, and commonsense reasoning tasks, with further enhancements through verification and revision in CodeI/O++.

Reasoning is a fundamental capability of Large Language Models. While prior research predominantly focuses on enhancing narrow skills like math or code generation, improving performance on many other reasoning tasks remains challenging due to sparse and fragmented training data. To address this issue, we propose CodeI/O, a novel approach that systematically condenses diverse reasoning patterns inherently embedded in contextually-grounded codes, through transforming the original code into a code input-output prediction format. By training models to predict inputs/outputs given code and test cases entirely in natural language as Chain-of-Thought (CoT) rationales, we expose them to universal reasoning primitives -- like logic flow planning, state-space searching, decision tree traversal, and modular decomposition -- while decoupling structured reasoning from code-specific syntax and preserving procedural rigor. Experimental results demonstrate CodeI/O leads to consistent improvements across symbolic, scientific, logic, math & numerical, and commonsense reasoning tasks. By matching the existing ground-truth outputs or re-executing the code with predicted inputs, we can verify each prediction and further enhance the CoTs through multi-turn revision, resulting in CodeI/O++ and achieving higher performance. Our data and models are available at https://github.com/hkust-nlp/CodeIO.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes