π€ AI Summary
Existing AI-generated code often struggles to simultaneously achieve functional correctness and runtime performance. To address this challenge, this work proposes Copper, a novel framework that, for the first time, integrates formal correctness guarantees with performance optimization objectives within an AI-assisted programming pipeline. Copper establishes a closed-loop optimization mechanism by synergistically combining AI-driven code synthesis, formal verification, automated performance profiling, and performance-aware specifications. Experimental results demonstrate that, across diverse algorithms and real-world programming tasks, Copper consistently produces code that not only rigorously satisfies functional correctness but also significantly outperforms state-of-the-art AI baselines in both execution time and memory efficiency.
π Abstract
Generative AI has made remarkable progress in producing functionally correct code, yet ensuring both correctness and performance remains an open challenge. We present Copper, a framework that combines formal verification with performance-aware specification to generate code that is provably correct and efficiently executable. Our approach integrates AI-driven code synthesis with formal verification tools, and automated performance profiling loops. Evaluated on a diverse set of algorithmic and real-world programming tasks, Copper produces solutions that satisfy strict correctness guarantees while delivering significant improvements in runtime and memory efficiency compared to baseline AI-generated code. This work demonstrates that it is feasible to bridge the gap between trustworthiness and performance in AI-assisted programming, offering a practical pathway toward reliable, high-performance code generation.