GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generation
Xitao Li, Haijun Wang, Gege Yuan, Qiyuan Wu, Jiali Wei, Ming Fan, Xiaofei Xie
Key points
From the paper's conclusion- GraphAHA organizes the test-time code generation in a typed directed acyclic graph.
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. 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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- HarnessPro: Recursive Harness Self-Improvement with Pareto Optimization for Performance-Cost Trade-offsarXiv · 2026
- HERO: Harnessing Evidence for Test-time Refinement and Prompt Optimization in Program GenerationarXiv · 2026
- HarnessMM: Recursive Self-Improvement for Harness Token EfficiencyarXiv · 2026
- GraphAlignCoder: Aligning Program and Proof Graphs for Code GenerationarXiv · 2026
- TEX: Test-Time Scaling Testing Agents via Execution-based Cross-ValidationarXiv · 2026
- Reasoning-Trace Overflow in Code Generation: An Empirical Study of Explicit Reasoning ModelsarXiv · 2026