Learning to Reason via Program Generation, Emulation, and Search
Nathaniel Weir, Muhammad Khalifa, Linlu Qiu, Orion Weller, Peter Clark
摘要
Program synthesis with language models (LMs) has unlocked a large set of reasoning abilities; code-tuned LMs have proven adept at generating programs that solve a wide variety of algorithmic symbolic manipulation tasks (e.g. word concatenation). However, not all reasoning tasks are easily expressible as code, e.g. tasks involving commonsense reasoning, moral decision-making, and sarcasm understanding. Our goal is to extend an LM's program synthesis skills to such tasks and evaluate the results via pseudo-programs, namely Python programs where some leaf function calls are left undefined. To that end, we propose, Code Generation and Emulated EXecution (CoGEX). CoGEX works by (1) training LMs to generate pseudo-programs, (2) teaching them to emulate their generated program's execution, including those leaf functions, allowing the LM's knowledge to fill in the execution gaps; and (3) using them to search over many programs to find an optimal one. To adapt the CoGEX model to a new task, we introduce a method for performing program search to find a single program whose pseudo-execution yields optimal performance when applied to all the instances of a given dataset. We show that our approach yields large improvements compared to standard in-context learning approaches on a battery of tasks, both algorithmic and soft reasoning. This result thus demonstrates that code synthesis can be applied to a much broader class of problems than previously considered. Our released dataset, fine-tuned models, and implementation can be found at https://github.com/nweir127/CoGEX.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- STaR: Bootstrapping Reasoning With Reasoning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Language Models as Compilers: Simulating Pseudocode Execution Improves Algorithmic Reasoning in Language Models 引用了 Large Language Models are Zero-Shot Reasoners
- Language Models as Compilers: Simulating Pseudocode Execution Improves Algorithmic Reasoning in Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Large Language Models are Zero-Shot Reasoners 引用了 STaR: Bootstrapping Reasoning With Reasoning
- Large Language Models are Zero-Shot Reasoners 引用了 AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts
- Large Language Models are Zero-Shot Reasoners 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- TUMIX: Multi-Agent Test-Time Scaling with Tool-Use Mixture 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Large Language Models as Optimizers 引用了 Large Language Models are Zero-Shot Reasoners
- Large Language Models as Optimizers 引用了 AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts
- Large Language Models as Optimizers 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- ARM: Adaptive Reasoning Model 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- R1-Code-Interpreter: LLMs Reason with Code via Supervised and Multi-stage Reinforcement Learning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
引用它的顶会 Paper7
- ARM: Adaptive Reasoning ModelSiye Wu, Jian Xie, Yikai Zhang, Aili Chen 等NeurIPS 2025 · 31 次引用
- TUMIX: Multi-Agent Test-Time Scaling with Tool-Use MixtureYongchao Chen, Jiefeng Chen, Rui Meng, Ji Yin 等ICLR 2026 · 13 次引用
- R1-Code-Interpreter: LLMs Reason with Code via Supervised and Multi-stage Reinforcement LearningYongchao Chen, Yueying Liu, Junwei Zhou, Yilun Hao 等ICLR 2026 · 6 次引用
- Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMsDayu Yang, Tianyang Liu, Daoan Zhang, Antoine Simoulin 等EMNLP 2025 · 1 次引用
- Language Models as Compilers: Simulating Pseudocode Execution Improves Algorithmic Reasoning in Language ModelsHyungjoo Chae, Yeonghyeon Kim, Seungone Kim, Kai Tzu-iunn Ong 等EMNLP 2024
它引用的 Paper22
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo 等NeurIPS 2022 · 8,168 次引用
- AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated PromptsTaylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace 等EMNLP 2020 · 1,162 次引用
- STaR: Bootstrapping Reasoning With ReasoningEric Zelikman, Yuhuai Wu, Jesse Mu, Noah D. GoodmanNeurIPS 2022 · 1,126 次引用
- Large Language Models as OptimizersChengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu 等ICLR 2024 · 817 次引用
相关 Paper
- Chain of Code: Reasoning with a Language Model-Augmented Code EmulatorChengshu Li, Jacky Liang, Andy Zeng, Xinyun Chen 等ICML 2024 · 155 次引用
- Language Models of Code are Few-Shot Commonsense LearnersAman Madaan, Shuyan Zhou, Uri Alon, Yiming Yang 等EMNLP 2022 · 103 次引用
- PAL: Program-aided Language ModelsLuyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon 等ICML 2023 · 700 次引用
- HYSYNTH: Context-Free LLM Approximation for Guiding Program SynthesisShraddha Barke, Emmanuel Anaya Gonzalez, Saketh Ram Kasibatla, Taylor Berg-Kirkpatrick 等NeurIPS 2024 · 34 次引用
- NExT: Teaching Large Language Models to Reason about Code ExecutionAnsong Ni, Miltiadis Allamanis, Arman Cohan, Yinlin Deng 等ICML 2024 · 73 次引用
