ReMCTS: Reflection-Enhanced Monte Carlo Tree Search for Code Generation

Huifei Wang, Xinying Huang, Yiheng Sun, Yifan Yuan
9/28/2026
cs.CL

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2026remcts,
  title  = {ReMCTS: Reflection-Enhanced Monte Carlo Tree Search for Code Generation},
  author = {Huifei Wang and Xinying Huang and Yiheng Sun and Yifan Yuan},
  year   = {2026},
  eprint = {2609.34717},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.34717v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.34717.svg)](https://codeofpaper.com/paper/2609.34717)

Discussion