CodeI/O: コード入出力予測を通じた推論パターンの簡略化
CodeI/O: Condensing Reasoning Patterns via Code Input-Output Prediction
February 11, 2025
著者: Junlong Li, Daya Guo, Dejian Yang, Runxin Xu, Yu Wu, Junxian He
cs.AI
要旨
推論は大規模言語モデルの基本的な能力です。従来の研究は主に数学やコード生成などの狭いスキルの向上に焦点を当ててきましたが、他の多くの推論タスクのパフォーマンス向上は、訓練データがまばらで断片化しているために依然として困難です。この問題に対処するために、私たちはCodeI/Oを提案します。これは、文脈に根ざしたコードに固有に埋め込まれた多様な推論パターンを体系的に凝縮する革新的なアプローチです。これは、元のコードをコード入出力予測形式に変換することで実現されます。モデルを訓練して、自然言語で完全にコードとテストケースから入出力を予測させることで、Chain-of-Thought(CoT)の合理性として普遍的な推論プリミティブ -- 例えば、論理フローの計画、状態空間探索、決定木の走査、モジュール分解 -- にさらすことができます。これにより、構造化された推論をコード固有の構文から切り離し、手続きの厳密さを保持しつつ、実験結果は、CodeI/Oが象徴的、科学的、論理的、数学的、数値的、常識的な推論タスク全体で一貫した改善をもたらすことを示しています。既存の正解出力に一致させるか、予測された入力でコードを再実行することで、各予測を検証し、マルチターンの修正を通じてCoTをさらに向上させ、CodeI/O++を実現し、より高いパフォーマンスを達成します。当社のデータとモデルは、https://github.com/hkust-nlp/CodeIO で入手可能です。
English
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.Summary
AI-Generated Summary