Skip to content
aiqbench takeAI Products

aiqbench analysis

FasterPy leverages Large Language Models enhanced with RAG and LoRA to automate Python code optimization, addressing the scalability limits of traditional rule-based methods. By training on performance-improving code pairs, this framework offers a low-cost alternative for fixing execution efficiency bugs without manual rule maintenance. The approach represents a significant step toward practical, AI-driven software engineering tools that integrate directly into developer workflows.
Source coveringarXiv
What this isA model's reading of the article and related coverage, written for aiqbench. Not the publisher's words.

FasterPy: An LLM-based Code Execution Efficiency Optimization Framework

arXiv2 min read

arXiv:2512.22827v3 Announce Type: replace-cross Abstract: Code often suffers from performance bugs. These bugs necessitate the research and practice of code optimization. Traditional rule-based methods rely on manually designing and maintaining rules for specific performance bugs (e.g., redundant loops, repeated computations), making them laborintensive and limited in applicability. In recent years, machine learning and deep learning-based methods have emerged as promising alternatives by learning optimization heuristics from annotated code corpora and performance measurements. However, these approaches usually depend on specific program representations and meticulously crafted training datasets, making them costly to develop and difficult to scale. With the booming of Large Language Models (LLMs), their remarkable capabilities in code generation have opened new avenues for automated code optimization. In this work, we proposed FasterPy, a low-cost and efficient framework that adapts LLMs to optimize the execution efficiency of Python code. FasterPy combines Retrieval-Augmented Generation (RAG), supported by a knowledge base constructed from existing performance-improving code pairs and corresponding performance measurements, with Low-Rank Adaptation (LoRA) to enhance code optimization performance. Our experimental results on the Performance-Improving Code Edits (PIE) benchmark demonstrate the effectiveness of our method across multiple metrics. The FasterPy tool and the experimental results are available at https://github.com/WuYue22/fasterpy.

Abstract:Code often suffers from performance bugs. These bugs necessitate the research and practice of code optimization. Traditional rule-based methods rely on manually designing and maintaining rules for specific performance bugs (e.g., redundant loops, repeated computations), making them laborintensive and limited in applicability. In recent years, machine learning and deep learning-based methods have emerged as promising alternatives by learning optimization heuristics from annotated code corpora and performance measurements. However, these approaches usually depend on specific program representations and meticulously crafted training datasets, making them costly to develop and difficult to scale. With the booming of Large Language Models (LLMs), their remarkable capabilities in code generation have opened new avenues for automated code optimization. In this work, we proposed FasterPy, a low-cost and efficient framework that adapts LLMs to optimize the execution efficiency of Python code. FasterPy combines Retrieval-Augmented Generation (RAG), supported by a knowledge base constructed from existing performance-improving code pairs and corresponding performance measurements, with Low-Rank Adaptation (LoRA) to enhance code optimization performance. Our experimental results on the Performance-Improving Code Edits (PIE) benchmark demonstrate the effectiveness of our method across multiple metrics. The FasterPy tool and the experimental results are available at this https URL.

Software Engineering (cs.SE); Artificial Intelligence (cs.AI)

arXiv:2512.22827 [cs.SE]

(or arXiv:2512.22827v3 [cs.SE] for this version)

https://doi.org/10.48550/arXiv.2512.22827 Focus to learn more arXiv-issued DOI via DataCite

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Full text under the publisher's open licence · 290 words

Related coverage