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

📅 2026-09-11
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
为解决代码生成中预算分配与状态依赖问题,提出GraphAHA方法,通过图结构搜索和异构动作选择优化测试时代码生成。
📝 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.
Problem

Research questions and friction points this paper is trying to address.

code generation
inference budget
search-based methods
tree-structured search
adaptive allocation
Innovation

Methods, ideas, or system contributions that make the work stand out.

Graph-Based Adaptive Search
Heterogeneous Actions
Typed Directed Acyclic Graph
Hierarchical Thompson Sampling
Test-Time Code Generation
🔎 Similar Papers