Language Models as Compilers: Simulating Pseudocode Execution Improves Algorithmic Reasoning in Language Models
Hyungjoo Chae, Yeonghyeon Kim, Seungone Kim, Kai Tzu-iunn Ong, Beong-woo Kwak, Moohyeon Kim, Sunghwan Kim, Taeyoon Kwon, Jiwan Chung, Youngjae Yu, Jinyoung Yeo
摘要
Algorithmic reasoning tasks that involve complex logical patterns, such as completing Dyck language, pose challenges for large language models (LLMs), despite their recent success. Prior work has used LLMs to generate programming language and applied external compilers for such tasks. Yet, when on the fly, it is hard to generate an executable code with the correct logic for the solution. Even so, code for one instance cannot be reused for others, although they might require the same logic to solve. We present THINK-AND-EXECUTE, a novel framework that improves LLMs' algorithmic reasoning: (1) In THINK, we discover task-level logic shared across all instances, and express such logic with pseudocode; (2) In EX-ECUTE, we tailor the task-level pseudocode to each instance and simulate the execution of it. THINK-AND-EXECUTE outperforms several strong baselines (including CoT and PoT) in diverse algorithmic reasoning tasks. We manifest the advantage of using task-level pseudocode over generating instance-specific solutions one by one. Also, we show that pseudocode can better improve LMs' reasoning than natural language guidance, even though they are trained with natural language instructions.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 13 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Incentivizing Reasoning for Advanced Instruction-Following of Large Language Models 引用了 Self-Consistency Improves Chain of Thought Reasoning in Language Models
- Incentivizing Reasoning for Advanced Instruction-Following of Large Language Models 引用了 Large Language Models are Zero-Shot Reasoners
- Incentivizing Reasoning for Advanced Instruction-Following of Large Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Learning to Reason via Program Generation, Emulation, and Search 引用了 Self-Consistency Improves Chain of Thought Reasoning in Language Models
- Learning to Reason via Program Generation, Emulation, and Search 引用了 PAL: Program-aided Language Models
- Learning to Reason via Program Generation, Emulation, and Search 引用了 Large Language Models are Zero-Shot Reasoners
- Learning to Reason via Program Generation, Emulation, and Search 引用了 Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them
- Learning to Reason via Program Generation, Emulation, and Search 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Self-Consistency Improves Chain of Thought Reasoning in Language Models 引用了 Large Language Models are Zero-Shot Reasoners
- Large Language Models are Zero-Shot Reasoners 引用了 Self-Consistency Improves Chain of Thought Reasoning in Language Models
- Self-Consistency Improves Chain of Thought Reasoning in Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models 引用了 Self-Consistency Improves Chain of Thought Reasoning in Language Models
- Unlocking the Power of Multi-Agent LLM for Reasoning: From Lazy Agents to Deliberation 引用了 Self-Consistency Improves Chain of Thought Reasoning in Language Models
- Unlocking the Power of Multi-Agent LLM for Reasoning: From Lazy Agents to Deliberation 引用了 Large Language Models are Zero-Shot Reasoners
- Unlocking the Power of Multi-Agent LLM for Reasoning: From Lazy Agents to Deliberation 引用了 When Thinking Fails: The Pitfalls of Reasoning for Instruction-Following in LLMs
- Unlocking the Power of Multi-Agent LLM for Reasoning: From Lazy Agents to Deliberation 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Linguistic Generalizability of Test-Time Scaling in Mathematical Reasoning 引用了 Self-Consistency Improves Chain of Thought Reasoning in Language Models
- Linguistic Generalizability of Test-Time Scaling in Mathematical Reasoning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- PAL: Program-aided Language Models 引用了 Self-Consistency Improves Chain of Thought Reasoning in Language Models
- PAL: Program-aided Language Models 引用了 Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them
- PAL: Program-aided Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Large Language Models are Zero-Shot Reasoners 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- When Thinking Fails: The Pitfalls of Reasoning for Instruction-Following in LLMs 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them 引用了 Self-Consistency Improves Chain of Thought Reasoning in Language Models
- Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them 引用了 Large Language Models are Zero-Shot Reasoners
- Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
引用它的顶会 Paper13
- When Thinking Fails: The Pitfalls of Reasoning for Instruction-Following in LLMsXiaomin Li, Zhou Yu, Zhiwei Zhang, Xupeng Chen 等NeurIPS 2025 · 63 次引用
- Linguistic Generalizability of Test-Time Scaling in Mathematical ReasoningGuijin Son, Jiwoo Hong, Hyunwoo Ko, James ThorneACL 2025 · 36 次引用
- Incentivizing Reasoning for Advanced Instruction-Following of Large Language ModelsYulei Qin, Gang Li, Zongyi Li, Zihan Xu 等NeurIPS 2025 · 17 次引用
- Learning to Reason via Program Generation, Emulation, and SearchNathaniel Weir, Muhammad Khalifa, Linlu Qiu, Orion Weller 等NeurIPS 2024 · 16 次引用
- Unlocking the Power of Multi-Agent LLM for Reasoning: From Lazy Agents to DeliberationZhiwei Zhang, Xiaomin Li, Yudi Lin, Hui Liu 等ICLR 2026 · 13 次引用
它引用的 Paper13
- 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 次引用
- PAL: Program-aided Language ModelsLuyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon 等ICML 2023 · 700 次引用
- Self-Consistency Improves Chain of Thought Reasoning in Language ModelsXuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V. Le 等ICLR 2023 · 681 次引用
- Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve ThemMirac Suzgun, Nathan Scales, Nathanael Schärli, Sebastian Gehrmann 等ACL Findings 2023 · 253 次引用
相关 Paper
- Reversal of Thought: Enhancing Large Language Models with Preference-Guided Reverse Reasoning Warm-upJiahao Yuan, Dehui Du, Hao Zhang, Zixiang Di 等ACL 2025 · 12 次引用
- Chain of Code: Reasoning with a Language Model-Augmented Code EmulatorChengshu Li, Jacky Liang, Andy Zeng, Xinyun Chen 等ICML 2024 · 155 次引用
- How Do Humans Write Code? Large Models Do It the Same Way TooLong Li, Xuzheng He, Haozhe Wang, Linlin Wang 等EMNLP 2024 · 1 次引用
- CoT-RAG: Integrating Chain of Thought and Retrieval-Augmented Generation to Enhance Reasoning in Large Language ModelsFeiyang Li, Peng Fang, Zhan Shi, Arijit Khan 等EMNLP Findings 2025 · 11 次引用
- Fine-Tuning Large Vision-Language Models as Decision-Making Agents via Reinforcement LearningSimon Zhai, Hao Bai, Zipeng Lin, Jiayi Pan 等NeurIPS 2024 · 214 次引用
