ReMCTS: Reflection-Enhanced Monte Carlo Tree Search for Code Generation
Abstract
Open-weight large language models (LLMs) can generate function-level programs from natural-language prompts, but plausible candidates still fail on hidden semantics and repeat mistakes across repair attempts. We present ReMCTS, an execution-grounded, memory-augmented, LLM-guided MCTS-style search framework. It organizes program candidates as tree states, retains branch-local debugging context, retrieves failure experience across branches, and distinguishes failed checks from unavailable evidence. On HumanEval and MBPP-Sanitized, visible-test ReMCTS improves over direct generation in 8 of 10 model-dataset pairs under held-out evaluation, whereas proxy-only search is less stable. Controlled tree-search, sampling, repair, and memory ablations characterize the source and limits of these gains. A 30-task HumanEval-X C++ pilot further demonstrates compatibility with compiler-backed execution, but does not constitute a broad multilingual evaluation.
Create a lesson
Metadata
- Comments
- 21 pages, 2 figures. To appear in the Proceedings of EMNLP 2026
Related papers
ToolSmith: An Automatic Tool-Generation Framework for Multimodal Search Agents
Shared title terminologycs.CLRui Sun, Junhua Huang, Luca Zancato et al.
IRTIQA: Evolving in English, Evaluated in Urdu -- Does Agent Self-Evolution Transfer from English to Urdu and Code-Switched Input?
Shared title terminologycs.CLAbdullah Hashmat, Danish Javed, Usman Naseem et al.
Tells of a Lying Machine: Analyzing LLM-Generated Strategic Dialogue in Chinese Werewolf
Shared title terminologycs.CLXian Cui, Gan Yang, Dongqi Han et al.
NORMCRAFT: Cultural Norm Generation for Context-Aware Language Model Alignment
Shared title terminologycs.CLTangyuan Zhang, Zhuang Li, Fatemeh Shiri et al.
Evaluating Large Language Models on conversational African American English: Feature classification and next-turn generation
Shared title terminologycs.CLRomeo De Timmerman, Thomas Demeester, Els Lefever
Worth the Wait? How Response Time and Streaming Shape Judgments of Generative AI Answers and Chatbot Engagement
Shared title terminologycs.CLZihan Chen, Di Zhu, Lei Nico Zheng