CodeGrep: An RL-Trained Retrieval Agent for LLM Coding Agents
- URL: http://arxiv.org/abs/2608.05886v1
- Date: Thu, 06 Aug 2026 11:07:42 GMT
- Title: CodeGrep: An RL-Trained Retrieval Agent for LLM Coding Agents
- Abstract summary: We introduce CodeGrep, a 14B retrieval agent trained end-to-end with GRPO to issue parallel, glob, and read tool calls and return candidate files to a frozen downstream coding agent.<n>On all 500 SWE-Bench Verified instances, CodeGrep preserves resolve rate while substantially improving efficiency: 27.0% versus 25.8% for the no-retrieval baseline, with 15% fewer rounds and 19% fewer tokens on resolved instances.
- Score: 8.150687615894268
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Modern LLM coding agents such as Claude Code and OpenHands share a common inefficiency: they spend much of their token budget finding the file to patch, rather than patching it. On SWE-Bench Verified, a 30B OpenHands agent averages 23 rounds and 631K tokens per resolved issue, with many calls spent on grep, glob, and view_file during repository exploration. We introduce CodeGrep, a 14B retrieval agent trained end-to-end with GRPO to issue multi-turn parallel grep, glob, and read tool calls and return candidate files to a frozen downstream coding agent. On all 500 SWE-Bench Verified instances, CodeGrep preserves resolve rate while substantially improving efficiency: 27.0% versus 25.8% for the no-retrieval baseline, with 15% fewer rounds and 19% fewer tokens on resolved instances. Across retrievers, downstream utility follows a precision threshold: BM25 with precision 0.375 degrades the agent, Jina with precision 0.445 is neutral, and CodeGrep with precision 0.677 crosses the threshold at which retrieval begins to reduce rollout cost. To enable this study, we mine supervision from 67K open-source agent trajectories using CATM and build a Git-worktree environment for multi-turn agent RL. In our setting, applying the efficiency signal at the advantage layer rather than the reward layer reduces KL drift and translates cleanly into downstream efficiency. We will release the model, training pipeline, RL environment, and evaluation harnesses.
Related papers
- RobustSGPO: Search-Space Control for Agent Harness Evolution [56.722805974785125]
We introduce RobustSGPO, which specifies the requested edit, constructs and checks the patch, and continues search from either the incumbent or retained snapshots.<n>We evaluate permission scheduling, cumulative controls, and task-family transfer in the AgentX brainstorming workflow using 120 tasks, 95 runs, and 7,350 candidate attempts.
arXiv Detail & Related papers (2026-09-09T03:00:03Z) - Codebook Agent: Amortized Topology Design for LLM Multi-Agent Systems [67.04448659688579]
We develop a query-independent 16-entry codebook that ranks the top decoded candidates in a single batched forward pass.<n>With no iterative search and no message passing at test time, Codebook Agent is the most accurate method on all six benchmarks.
arXiv Detail & Related papers (2026-09-02T08:10:22Z) - LEGO-RL: Harness-Native Reinforcement Learning for Coding Agents [56.902747731541695]
We present LEGO-RL, a framework that bridges native coding-agent harnesses with scalable policy-gradient optimization.<n>We evaluate LEGO-RL by training the sparse MoE model Qwen3.5-35B-A3B with GSPO across three native coding-agent harnesses.
arXiv Detail & Related papers (2026-08-18T05:34:35Z) - RHO: Your Coding Agent is Secretly a Roboticist [24.9798218503493]
Code-as-Policies (CaP) has shown that large language models (LLMs) can write code to solve robotics tasks by composing perception, planning, and control primitives.<n>Recent CaP systems rely on multi-turn code-generation loops at test time, which is often infeasible for real-time robot control.<n>We introduce Robotics Harness Optimization (RHO), a novel paradigm in which tool-enabled coding agents, at training time, propose and search for interpretable, neurosymbolic multi-file policy repositories.
arXiv Detail & Related papers (2026-06-15T09:30:12Z) - Auditing Reward Hackability in Code RL Training Environments [0.0]
We measure the rate at which code RL environments accept incorrect solutions as correct.<n>On a 49-task sample of SWE-bench Verified, 28.5% of tasks have test suites weak enough that a Docker-verified incorrect patch passes them.
arXiv Detail & Related papers (2026-06-14T23:31:42Z) - Orchard: An Open-Source Agentic Modeling Framework [124.68499958175111]
We present Orchard, an open-source framework for scalable agentic modeling.<n>At its core is Orchard Env, a lightweight environment service providing reusable primitives for sandbox lifecycle management.<n>On top of Orchard Env, we build three agentic modeling recipes.
arXiv Detail & Related papers (2026-05-14T16:35:12Z) - Correctness-Aware Repository Filtering Under Maximum Effective Context Window Constraints [0.0]
Context window efficiency is a practical constraint in large language model (LLM)-based developer tools.<n>We present a correctness-aware context hygiene framework that intercepts repository scans before tokenization.<n>Our framework, by contrast, requires no indexing and operates at 0.01 ms per file decision.
arXiv Detail & Related papers (2026-05-14T04:37:39Z) - Delta-Based Neural Architecture Search: LLM Fine-Tuning via Code Diffs [48.83701310501069]
Large language models (LLMs) show strong potential for neural architecture generation.<n>Existing approaches produce complete model implementations from scratch.<n>We propose Delta-Code Generation, where fine-tuned LLMs generate compact unified diffs.
arXiv Detail & Related papers (2026-05-06T13:32:05Z) - Resource-Efficient Iterative LLM-Based NAS with Feedback Memory [49.44875022114861]
Neural Architecture Search (NAS) automates network design, but conventional methods demand substantial computational resources.<n>We propose a closed-loop pipeline leveraging large language models (LLMs) to iteratively generate, evaluate, and refine convolutional neural network architectures.
arXiv Detail & Related papers (2026-03-12T16:00:22Z) - CVeDRL: An Efficient Code Verifier via Difficulty-aware Reinforcement Learning [57.24524263804788]
Code verifiers play a critical role in post-verification for LLM-based code generation.<n>Existing supervised fine-tuning methods suffer from data scarcity, high failure rates, and poor inference efficiency.<n>We show that naive RL with only functionality rewards fails to generate effective unit tests for difficult branches and samples.
arXiv Detail & Related papers (2026-01-30T10:33:29Z) - ARCS: Agentic Retrieval-Augmented Code Synthesis with Iterative Refinement [1.980982378865332]
ARCS operates through a budgeted synthesize-execute-repair loop over a frozen model.<n>It retrieves relevant code context before generation, proposes candidates, executes them against tests, and repairs based on execution feedback.<n>On a LANL scientific corpus, it improves CodeBLEU by +0.115 over baseline RAG.
arXiv Detail & Related papers (2025-04-29T05:15:52Z) - Injecting Domain Adaptation with Learning-to-hash for Effective and
Efficient Zero-shot Dense Retrieval [49.98615945702959]
We evaluate LTH and vector compression techniques for improving the downstream zero-shot retrieval accuracy of the TAS-B dense retriever.
Our results demonstrate that, unlike prior work, LTH strategies when applied naively can underperform the zero-shot TAS-B dense retriever on average by up to 14% nDCG@10.
arXiv Detail & Related papers (2022-05-23T17:53:44Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.