Optimizing Code Runtime Performance through Context-Aware Retrieval-Augmented Generation
Manish Acharya, Yifan Zhang, Kevin Leach, Yu Huang

TL;DR
This paper presents AUTOPATCH, a novel in-context learning method that enhances LLMs' ability to generate optimized code, significantly improving execution efficiency through context-aware analysis and analogy-driven frameworks.
Contribution
AUTOPATCH introduces a new framework combining analogy-driven learning, historical code context, and CFG analysis to improve automated code optimization with LLMs.
Findings
Achieves 7.3% improvement in execution efficiency over GPT-4o.
Effectively integrates code examples and CFG analysis for context-aware learning.
Demonstrates potential for advancing automated program runtime optimization.
Abstract
Optimizing software performance through automated code refinement offers a promising avenue for enhancing execution speed and efficiency. Despite recent advancements in LLMs, a significant gap remains in their ability to perform in-depth program analysis. This study introduces AUTOPATCH, an in-context learning approach designed to bridge this gap by enabling LLMs to automatically generate optimized code. Inspired by how programmers learn and apply knowledge to optimize software, AUTOPATCH incorporates three key components: (1) an analogy-driven framework to align LLM optimization with human cognitive processes, (2) a unified approach that integrates historical code examples and CFG analysis for context-aware learning, and (3) an automated pipeline for generating optimized code through in-context prompting. Experimental results demonstrate that AUTOPATCH achieves a 7.3% improvement in…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware System Performance and Reliability · Distributed and Parallel Computing Systems · Scientific Computing and Data Management
MethodsSPEED: Separable Pyramidal Pooling EncodEr-Decoder for Real-Time Monocular Depth Estimation on Low-Resource Settings · ALIGN
