ARCS: Agentic Retrieval-Augmented Code Synthesis with Iterative Refinement

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.
View on arXiv@article{bhattarai2025_2504.20434, title={ ARCS: Agentic Retrieval-Augmented Code Synthesis with Iterative Refinement }, author={ Manish Bhattarai and Miguel Cordova and Javier Santos and Dan O'Malley }, journal={arXiv preprint arXiv:2504.20434}, year={ 2025 } }