Skip to main content
SAICA-KG

Papers

ARCS: Agentic Retrieval-Augmented Code Synthesis with Iterative Refinement

Manish Bhattarai, Miguel Cordova, Javier E. Santos, Dan O'Malley · 2025 · arXiv

Source →arXiv:2504.20434DOI: 10.48550/arXiv.2504.204347 citations
agentic-ai

TL;DR

ARS provides a practical, reproducible approach to reliable code synthesis using existing LLM checkpoints using existing LLM checkpoints as a state-action process with provable guarantees on termination, monotonic improvement, and bounded cost.

Abstract

We present Agentic Retrieval-Augmented Code Synthesis (ARCS), a system that improves LLM-based code generation without fine-tuning. ARCS operates through a budgeted synthesize-execute-repair loop over a frozen model: it retrieves relevant code context before generation, proposes candidates, executes them against tests, and repairs based on execution feedback. This retrieval-before-generation design reduces hallucination and accelerates convergence. We formalize ARCS as a state-action process with provable guarantees on termination, monotonic improvement, and bounded cost. A tiered controller (Small/Medium/Large) trades latency for accuracy predictably. On HumanEval, ARCS achieves up to 87.2% pass@1 with Llama-3.1-405B, surpassing CodeAgent (82.3%) while using simpler control than tree-search methods. On TransCoder, it achieves>= 90% accuracy on most translation pairs. On a LANL scientific corpus, it improves CodeBLEU by +0.115 over baseline RAG. ARCS provides a practical, reproducible approach to reliable code synthesis using existing LLM checkpoints.

Editorial notes

Introduces ARCS (Agentic Retrieval-Augmented Code Synthesis), a budgeted synthesize-execute-repair loop over a frozen LLM with formal guarantees on termination, monotonic improvement, and bounded cost. Evaluated on HumanEval, TransCoder, and a LANL scientific corpus; reports 87.2% pass@1 on HumanEval with Llama-3.1-405B vs. CodeAgent at 82.3%. The retrieval-before-generation design is a concrete example of a pre_generation guardrail that targets fabrication. Relates to SAICA-KG failure modes: fabrication, logic_error. Useful as a case study for the ControlParadigm axis: a tiered controller (Small/Medium/Large) is a worked example of cost-aware supervision.

View raw YAML on GitHub →