paper-with-me

Papers

Language Models as Compilers: Simulating Pseudocode Execution Improves Algorithmic Reasoning in Language Models

2024-04-03 · Hyungjoo Chae, Yeonghyeon Kim, Seungone Kim, Kai Tzu-iunn Ong, Beong-woo Kwak, Moohyeon Kim, SeongHwan Kim, Taeyoon Kwon, Jiwan Chung, Youngjae Yu, Jinyoung Yeo

Algorithmic reasoning refers to the ability to understand the complex patterns behind the problem and decompose them into a sequence of reasoning steps towards the solution. Such nature of algorithmic reasoning makes it a challenge for large language models (LLMs), even though they have demonstrated promising performance in other reasoning tasks. Within this context, some recent studies use programming languages (e.g., Python) to express the necessary logic for solving a given instance/question (e.g., Program-of-Thought) as inspired by their strict and precise syntaxes. However, it is non-trivial to write an executable code that expresses the correct logic on the fly within a single inference call. Also, the code generated specifically for an instance cannot be reused for others, even if they are from the same task and might require identical logic to solve. This paper presents Think-and-Execute, a novel framework that decomposes the reasoning process of language models into two steps. (1) In Think, we discover a task-level logic that is shared across all instances for solving a given task and then express the logic with pseudocode; (2) In Execute, we further tailor the generated pseudocode to each instance and simulate the execution of the code. With extensive experiments on seven algorithmic reasoning tasks, we demonstrate the effectiveness of Think-and-Execute. Our approach better improves LMs' reasoning compared to several strong baselines performing instance-specific reasoning (e.g., CoT and PoT), suggesting the helpfulness of discovering task-level logic. Also, we show that compared to natural language, pseudocode can better guide the reasoning of LMs, even though they are trained to follow natural language instructions.

📄 PDF Abstract BibTeX arXiv:2404.02575

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

DuET: Dual Execution for Test Output Prediction with Generated Code and Pseudocode

2026-04-13 · Hojae Han, Jaejin Kim, Seung-won Hwang, Yu Jin Kim 외 arxiv

This work addresses test output prediction, a key challenge in test case generation. To improve the reliability of predicted outputs by LLMs, prior approaches generate code first to ground predictions. One grounding stra…

Semantic Scaffolds for Pseudocode-to-Code Generation

2020-05-12 · ACL 2020 6 · Ruiqi Zhong, Mitchell Stern, Dan Klein

We propose a method for program generation based on semantic scaffolds, lightweight structures representing the high-level semantic and syntactic composition of a program. By first searching over plausible scaffolds then…

Code Generation

MLIR: A Compiler Infrastructure for the End of Moore's Law

2020-02-25 · Chris Lattner, Mehdi Amini, Uday Bondhugula, Albert Cohen 외

This work presents MLIR, a novel approach to building reusable and extensible compiler infrastructure. MLIR aims to address software fragmentation, improve compilation for heterogeneous hardware, significantly reduce the…

LazyTensor: combining eager execution with domain-specific compilers

2021-02-26 · Alex Suhan, Davide Libenzi, Ailing Zhang, Parker Schuh 외

Domain-specific optimizing compilers have demonstrated significant performance and portability benefits, but require programs to be represented in their specialized IRs. Existing frontends to these compilers suffer from …

Code Simulation Challenges for Large Language Models

2024-01-17 · Emanuele La Malfa, Christoph Weinhuber, Orazio Torre, Fangru Lin 외

Many reasoning, planning, and problem-solving tasks share an intrinsic algorithmic nature: correctly simulating each step is a sufficient condition to solve them correctly. This work studies to what extent Large Language…