LLM Interactive Optimization of Open Source Python Libraries -- Case Studies and Generalization
Not on the map. Why?
Abstract (arXiv)
With the advent of large language models (LLMs) like GPT-3, a natural question is the extent to which these models can be utilized for source code optimization. This paper presents methodologically stringent case studies applied to well-known open source python libraries pillow and numpy. We find that contemporary LLM ChatGPT-4 (state September and October 2023) is surprisingly adept at optimizing energy and compute efficiency. However, this is only the case in interactive use, with a human expert in the loop. Aware of experimenter bias, we document our qualitative approach in detail, and provide transcript and source code. We start by providing a detailed description of our approach in conversing with the LLM to optimize the _getextrema function in the pillow library, and a quantitative evaluation of the performance improvement. To demonstrate qualitative replicability, we report further attempts on another locus in the pillow library, and one code locus in the numpy library, to demonstrate generalization within and beyond a library. In all attempts, the performance improvement is significant (factor up to 38). We have also not omitted reporting of failed attempts (there were none). We conclude that LLMs are a promising tool for code optimization in open source libraries, but that the human expert in the loop is essential for success. Nonetheless, we were surprised by how few iterations were required to achieve substantial performance improvements that were not obvious to the expert in the loop. We would like bring attention to the qualitative nature of this study, more robust quantitative studies would need to introduce a layer of selecting experts in a representative sample -- we invite the community to collaborate.
Key facts. Cited by 3 papers in the map (data through 13 Oct 2026). Builds on 10 of its 38 references that are in the map. First posted on arXiv 8 Dec 2023.
Builds on
10 of 38 references.
References · 10
- 2014ImageNet Large Scale Visual Recognition Challengecited by 8,476
- 2021Evaluating Large Language Models Trained on Codecited by 8,205
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,586
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 395
- 2023The Impact of AI on Developer Productivity: Evidence from GitHub Copilotcited by 269
- 2023Learning Performance-Improving Code Editscited by 105
- 2022Using Transfer Learning for Code-Related Taskscited by 18
- 2023Analysis of ChatGPT on Source Codecited by 12
- 2021Technical debt and agile software development practices and processes: An industry practitioner surveycited by 4
- 2023A Case for Sustainability and Environment Friendliness in Software Development and Architecture Decisions by Taking Energy-Efficient Design Decisionscited by 3
Built on by
Citing papers per year: 2024: 1; 2025: 2.
3 papers.