mlsanityData to 14 Oct 2026

SpecAgent: A Speculative Retrieval and Forecasting Agent for Code Completion

arXiv 2510.17925 ↗First posted 20 Oct 2025cs.SE cs.AIcited by 3

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Large Language Models (LLMs) excel at code-related tasks but often struggle in realistic software repositories, where project-specific APIs and cross-file dependencies are crucial. Retrieval-augmented methods mitigate this by injecting repository context at inference time. The low inference-time latency budget affects either retrieval quality or the added latency adversely impacts user experience. We address this limitation with SpecAgent, an agent that improves both latency and code-generation quality by proactively exploring repository files during indexing and constructing speculative context that anticipates future edits in each file. This indexing-time asynchrony allows thorough context computation, masking latency, and the speculative nature of the context improves code-generation quality. Additionally, we identify the problem of future context leakage in existing benchmarks, which can inflate reported performance. To address this, we construct a synthetic, leakage-free benchmark that enables a more realistic evaluation of our agent against baselines. Experiments show that SpecAgent consistently achieves absolute gains of 9-11% (48-58% relative) compared to the best-performing baselines, while significantly reducing inference latency.

Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 23 of its 51 references that are in the map. First posted on arXiv 20 Oct 2025.

Builds on

23 of 51 references.

References · 23

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  2. 2021Program Synthesis with Large Language Modelscited by 3,637
  3. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  4. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  5. 2023Teaching Large Language Models to Self-Debugcited by 988
  6. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  7. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 546
  8. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  9. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  10. 2022The Stack: 3 TB of permissively licensed source codecited by 359
  11. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 353
  12. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 183
11 more
  1. 2024RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graphcited by 91
  2. 2025The SWE-Bench Illusion: When State-of-the-Art LLMs Remember Instead of Reasoncited by 49
  3. 2024Language Models for Code Completion: A Practical Evaluationcited by 39
  4. 2024REPOFUSE: Repository-Level Code Completion with Fused Dual Contextcited by 32
  5. 2024HumanEvo: An Evolution-aware Benchmark for More Realistic Evaluation of Repository-level Code Generationcited by 28
  6. 2024Benchmarks and Metrics for Evaluations of Code Generation: A Critical Reviewcited by 20
  7. 2024Hierarchical Context Pruning: Optimizing Real-World Code Completion with Repository-Level Pretrained Code LLMscited by 13
  8. 2022Accelerating Code Search with Deep Hashing and Code Classificationcited by 10
  9. 2024Leveraging Large Language Models for Code Translation and Software Development in Scientific Computingcited by 9
  10. 2025SPENCER: Self-Adaptive Model Distillation for Efficient Code Retrievalcited by 5
  11. 2024SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep Hashingcited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 3.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026FastContext: Training Efficient Repository Explorer for Coding Agents
  2. 2025NL2Repo-Bench: Towards Long-Horizon Repository Generation Evaluation of Coding Agents
  3. 2026AgSpec: Pushing the Limits of Retrieval-Based Speculative Decoding in Coding Agent Pipelines
  4. 2026Agent Retrieval Bench: Evaluating Repository Context Retrieval for Coding Agents
  5. 2026SpecHop: Continuous Speculation for Accelerating Multi-Hop Retrieval Agents
  6. 2026An Empirical Study of Speculative Decoding on Software Engineering Tasks ↗
  7. 2026Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation
  8. 2025FastCoder: Accelerating Repository-level Code Generation via Efficient Retrieval and Verification