ARCS: Agentic Retrieval-Augmented Code Synthesis with Iterative Refinement

📅 2025-04-29
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Code generation for high-performance computing (HPC) faces a fundamental trade-off among numerical accuracy, robustness, and computational efficiency. To address this, we propose an agent-driven retrieval-augmented code synthesis framework that introduces two key innovations: (1) a novel proxy-based Retrieval-Augmented Generation (RAG) mechanism, and (2) a state-action search tree formalism that models code generation as a dynamic, iterative process jointly optimizing for functional correctness and editing efficiency. Our approach employs chain-of-thought reasoning to guide retrieval and leverages real-time program execution feedback in a closed-loop refinement cycle across multiple iterations. Evaluated on GeeksforGeeks and HumanEval benchmarks, our method significantly outperforms conventional prompting techniques, achieving substantial improvements in both code generation and translation quality. The framework enables high-accuracy, scalable, and automated software development tailored to HPC domains.

Technology Category

Application Category

📝 Abstract
In supercomputing, efficient and optimized code generation is essential to leverage high-performance systems effectively. We propose Agentic Retrieval-Augmented Code Synthesis (ARCS), an advanced framework for accurate, robust, and efficient code generation, completion, and translation. ARCS integrates Retrieval-Augmented Generation (RAG) with Chain-of-Thought (CoT) reasoning to systematically break down and iteratively refine complex programming tasks. An agent-based RAG mechanism retrieves relevant code snippets, while real-time execution feedback drives the synthesis of candidate solutions. This process is formalized as a state-action search tree optimization, balancing code correctness with editing efficiency. Evaluations on the Geeks4Geeks and HumanEval benchmarks demonstrate that ARCS significantly outperforms traditional prompting methods in translation and generation quality. By enabling scalable and precise code synthesis, ARCS offers transformative potential for automating and optimizing code development in supercomputing applications, enhancing computational resource utilization.
Problem

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

Efficient optimized code generation for supercomputing systems
Accurate robust code synthesis completion and translation
Automating code development to enhance computational resource utilization
Innovation

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

Integrates RAG with CoT reasoning
Uses agent-based RAG for code retrieval
Optimizes via state-action search tree
🔎 Similar Papers
No similar papers found.
Manish Bhattarai
Manish Bhattarai
Scientist at Los Alamos National Laboratory,
Adversarial MLGenerative AINatural Language ProcessingDeep LearningComputer Vision
M
Miguel Cordova
Los Alamos National Laboratory, Los Alamos, New Mexico, USA
J
Javier Santos
Los Alamos National Laboratory, Los Alamos, New Mexico, USA
D
Dan O'Malley
Los Alamos National Laboratory, Los Alamos, New Mexico, USA