Lune

EMNLP2024顶会

Code Prompting Elicits Conditional Reasoning Abilities in Text+Code LLMs

Haritz Puerto, Martin Tutek, Somak Aditya, Xiaodan Zhu, Iryna Gurevych

摘要

Reasoning is a fundamental component of language understanding. Recent prompting techniques, such as chain of thought, have consistently improved LLMs' performance on various reasoning tasks. Nevertheless, there is still little understanding of what triggers reasoning abilities in LLMs in the inference stage. In this paper, we investigate the effect of the input representation on the reasoning abilities of LLMs. We hypothesize that representing natural language tasks as code can enhance specific reasoning abilities such as entity tracking or logical reasoning. To study this, we propose code prompting, a methodology we operationalize as a chain of prompts that transforms a natural language problem into code and directly prompts the LLM using the generated code without resorting to external code execution. We find that code prompting exhibits a high-performance boost for multiple LLMs (up to 22.52 percentage points on GPT 3.5, 7.75 on Mixtral, and 16.78 on Mistral) across multiple conditional reasoning datasets. We then conduct comprehensive experiments to understand how the code representation triggers reasoning abilities and which capabilities are elicited in the underlying models. Our analysis on GPT 3.5 reveals that the code formatting of the input problem is essential for performance improvement. Furthermore, the code representation improves sample efficiency of in-context learning and facilitates state tracking of entities. 1

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Read it in Two Steps: Translating Extremely Low-Resource Languages with Code-Augmented Grammar Books 引用了 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 引用了 PAL: Program-aided Language Models
  • Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs 引用了 Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them
  • 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
  • Synatra: Turning Indirect Knowledge into Direct Demonstrations for Digital Agents at Scale 引用了 PAL: Program-aided Language Models
  • Synatra: Turning Indirect Knowledge into Direct Demonstrations for Digital Agents at Scale 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large 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
  • Large Language Models are Zero-Shot Reasoners 引用了 Training language models to follow instructions with human feedback
  • Fine-Tuning on Diverse Reasoning Chains Drives Within-Inference CoT Refinement in LLMs 引用了 Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them
  • Fine-Tuning on Diverse Reasoning Chains Drives Within-Inference CoT Refinement in LLMs 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large 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
  • Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them 引用了 Training language models to follow instructions with human feedback
  • Chain-of-Thought Prompting Elicits Reasoning in Large Language Models 引用了 Training language models to follow instructions with human feedback
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper5

  1. Synatra: Turning Indirect Knowledge into Direct Demonstrations for Digital Agents at ScaleTianyue Ou, Frank F. Xu, Aman Madaan, Jiarui Liu 等NeurIPS 2024 · 45 次引用
  2. Fine-Tuning on Diverse Reasoning Chains Drives Within-Inference CoT Refinement in LLMsHaritz Puerto, Tilek Chubakov, Xiaodan Zhu, Harish Tayyar Madabushi 等ACL 2025 · 13 次引用
  3. Read it in Two Steps: Translating Extremely Low-Resource Languages with Code-Augmented Grammar BooksChen Zhang, Jiuheng Lin, Xiao Liu, Zekai Zhang 等ACL 2025 · 5 次引用
  4. From Tools to Teammates: Evaluating LLMs in Multi-Session Coding InteractionsNathanaël Carraz Rakotonirina, Mohammed Hamdy, Jon Ander Campos, Lucas Weber 等ACL 2025 · 5 次引用
  5. 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 次引用

它引用的 Paper16

  1. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  3. Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo 等NeurIPS 2022 · 8,168 次引用
  4. PAL: Program-aided Language ModelsLuyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon 等ICML 2023 · 700 次引用
  5. 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

  1. Chain of Code: Reasoning with a Language Model-Augmented Code EmulatorChengshu Li, Jacky Liang, Andy Zeng, Xinyun Chen 等ICML 2024 · 155 次引用
  2. CodePlan: Unlocking Reasoning Potential in Large Language Models by Scaling Code-form PlanningJiaxin Wen, Jian Guan, Hongning Wang, Wei Wu 等ICLR 2025
  3. The Magic of IF: Investigating Causal Reasoning Abilities in Large Language Models of CodeXiao Liu, Da Yin, Chen Zhang, Yansong Feng 等ACL Findings 2023 · 9 次引用
  4. NL-Debugging: Exploiting Natural Language as an Intermediate Representation for Code DebuggingWeiming Zhang, Qingyao Li, Xinyi Dai, Jizheng Chen 等EMNLP 2025 · 1 次引用
  5. Do Code Semantics Help? A Comprehensive Study on Execution Trace-Based Information for Code Large Language ModelsJian Wang, Xiaofei Xie, Qiang Hu, Shangqing Liu 等EMNLP Findings 2025
黄昏的海面,两侧是细线勾勒的悬崖