← Back to Paper Radar

GrepSeek: Training Search Agents for Direct Corpus Interaction

Alireza Salemi, Chang Zeng, Atharva Nijasure, J.H. Chung, Razieh Rahimi, F. Diaz, Hamed Zamani
arXiv.org | 2026

Reading guide · Based on sections of the original paper

The authors show that a compact open-weight model can be trained, through verified cold-start SFT followed by GRPO, to search a raw text corpus with Unix shell commands instead of a ranked retriever index. They pair this with two execution optimizations that make such search fast at Wikipedia scale while returning the same output as a plain sequential run.

Why read this

This paper is for retrieval and agent practitioners weighing grep-style corpus interaction against BM25 or dense retrievers, especially for multi-hop QA.

What the authors found

  • With a Qwen3.5-9B backbone, the authors report a macro average of 0.5226 across eight QA benchmarks. The strongest baseline, Search-R1 with Qwen3-Emb-4B retrieval, scores 0.4945. Metrics are F1 on seven FlashRAG sets and GPT-4.1-judged accuracy on BrowseComp-Plus, and the models were trained only on NQ and HotpotQA. The authors report significant gains on NQ, HotpotQA, 2Wiki and BrowseComp-Plus. PopQA is a significant loss, and GrepSeek does not lead on TriviaQA or Bamboogle. With a Qwen3-4B backbone, the macro average is 0.4280 versus 0.3946. 3.2 Main Findings
  • Both training stages matter in the authors' ablations. Macro F1 drops to 0.3803 without GRPO and to 0.3235 without SFT. BrowseComp-Plus is the exception: there, the RL-only variant beats the full model. Appendix D Additional Results
  • These are measured latencies on the 14GB, 21M-passage corpus. PACE cuts average retrieval latency from 5.39 s to 0.07 s per query (77×), after about 21 minutes of preprocessing to build a 2.8GB auxiliary structure. Sharding needs no extra preprocessing and reaches 0.71 s with 32 shards (7.6×). 1 Introduction

Main limitation

Lexical search brings no relevance ranking and is sensitive to surface form. Matches come back in file order, and spelling or diacritic variants can cause misses. This is consistent with the PopQA drop. The authors also note that longer sequences reduce training throughput. 3.3 Analysis

Where to start

Appendix D Additional Results · It has the EM results, the per-dataset SFT/GRPO ablations including the BrowseComp-Plus exception, and the full 4B-backbone table.

Abstract

Large Language Model (LLM) search agents have shown strong promise for knowledge-intensive language tasks through multiple rounds of reasoning and information retrieval. Most existing systems access information using a retriever that takes a keyword or natural language query and returns a ranked list of documents using an index of pre-computed document representations. In this work, we explore a complementary perspective in which the search agent treats the corpus itself as the search environment and finds evidence by issuing executable shell commands. We introduce GrepSeek, an optimized direct corpus interaction (DCI) search agent that trains a compact search agent to find, filter, and compose evidence from large text corpora. To address the instability of learning behavior directly with reinforcement learning on large corpora, we propose a two-stage training pipeline. First, we construct a cold-start dataset using an answer-aware Tutor and answer-blind Planner to generate verified, causally grounded search trajectories. Second, we refine the initialized policy with Group Relative Policy Optimization (GRPO), allowing the agent to improve its task-oriented search behavior through direct interaction with the corpus. To make DCI practical at scale, we further use a semantics-preserving sharded-parallel execution engine that accelerates shell-based retrieval by up to $7.6\times$ while preserving byte-exact equivalence with sequential execution of the shell command. Experiments across seven open-domain question answering benchmarks show that GrepSeek achieves the strongest overall token-level $F_1$ and Exact Match. Our analysis also highlights the limitations of purely lexical interaction on queries with substantial surface-form variation, suggesting DCI as a practical and competitive method for search agents that can complement existing retrieval paradigms in the real world.

Generated automatically from paper sections on 2026-11-28.