GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generation

Xitao Li, Haijun Wang, Gege Yuan, Qiyuan Wu, Jiali Wei +2 more
9/11/2026
cs.SEcs.AI

No confident code implementation found for this paper.

Abstract

Test-time scaling improves code generation by spending additional inference budget (e.g., calls or tokens) on direct sampling, feedback-conditioned repair, and reasoning-guided implementation. Search-based methods can allocate this budget adaptively, but two challenges remain.

Show full abstract

First, tree-structured search treats each generation history as a separate state even when trajectories converge to the same program, duplicating evaluation and preventing statistics from being shared. Second, sampling, repair, and reasoning have complementary and state-dependent payoffs, making online allocation among them difficult under a finite budget. To address these challenges, we propose an adaptive graph search method with heterogeneous actions (GraphAHA). GraphAHA organizes the test-time code generation in a typed directed acyclic graph. Equivalent programs are merged into a single code node, allowing their downstream search statistics to be reused across all discovery paths. Hierarchical Thompson sampling then selects whether to generate a new state or follow an existing successor and, for generation, chooses among the type-valid sampling, reasoning, implementation, and repair operations. Evaluated on LiveCodeBench and CodeContests with Qwen2.5-Coder and DeepSeek-Coder, GraphAHA achieves the best score in 18 of 20 cases. For Pass@1 measured using visible tests, it outperforms the strongest baseline for both models on both benchmarks by 4.1 percentage points on average, demonstrating more effective use of a fixed inference budget.

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{li2026graphaha,
  title  = {GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generation},
  author = {Xitao Li and Haijun Wang and Gege Yuan and Qiyuan Wu and Jiali Wei and Ming Fan and Xiaofei Xie},
  year   = {2026},
  eprint = {2609.12757},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.12757v1}
}

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.12757.svg)](https://codeofpaper.com/paper/2609.12757)

Discussion