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.
GPT-4.1 Sets the Standard in Automated Experiment Design Using Novel Python Libraries
Copelabs, Lusófona University(Copelabs与卢斯奥法纳大学);Center of Technology and Systems (UNINOVA-CTS) and Associated Lab of Intelligent Systems (LASI)(技术与系统中心(UNINOVA-CTS)及智能系统关联实验室);CICANT, Lusófona University(CICANT与卢斯奥法纳大学)
Cross-Ecosystem Vulnerability Analysis for Python Applications
University of Athens(雅典大学);National Infrastructures for Research and Technology(国家研究与技术基础设施);Athens University of Economics and Business(雅典经济与商业大学);ETH Zurich(苏黎世联邦理工学院);Technical University of Crete(克里特理工大学)
Harnessing LLMs for Document-Guided Fuzzing of Python Libraries
The University of Queensland(昆士兰大学);Texas A&M University–Kingsville(德克萨斯农工大学金斯维尔分校);Central Queensland University(中昆士兰大学);University of Illinois Chicago(伊利诺伊大学芝加哥分校)
PCART: Automated Repair of Python API Parameter Compatibility Issues
Key Laboratory for Safety-critical Software Development and Verification, Nanjing University of Aeronautics and Astronautics(南京航空航天大学安全关键软件开发与验证重点实验室);State Key Lab. for Novel Software Technology, Nanjing University(南京大学软件新技术国家重点实验室);Department of Computer Science and Engineering, Southern University of Science and Technology(南方科技大学计算机科学与工程系);School of Automation Science and Electrical Engineering, Beihang University(北京航空航天大学自动化科学与电气工程学院)
PCART 是首个自动修复 Python API 参数兼容性问题的工具,通过自动化提取、仪器化、映射、评估、修复和验证,有效检测并修复多种参数变化问题。
Evolution of Deprecated APIs and Their Replacements in Python Libraries
College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics(南京航空航天大学计算机科学与技术学院);Key Laboratory for Safety-critical Software Development and Verification, Nanjing University of Aeronautics and Astronautics(南京航空航天大学安全关键软件开发与验证重点实验室);State Key Laboratory for Novel Software Technology, Nanjing University(南京大学软件新技术国家重点实验室)
Intertwining Ecosystems: A Large Scale Empirical Study of Libraries that Cross Software Ecosystems
各种技术栈和第三方库使用的增加导致开发人员不可避免地切换技术。为了帮助这些开发人员,维护人员已经开始将他们的库发布到多种技术,即,一个跨生态系统的图书馆我们的目标是探索这些跨生态系统库在生态系统之间交织的程度。我们对来自五个不同软件生态系统的110万个库进行了大规模的实证研究,即,PyPI for Python,CRAN for R,Maven for Java,RubyGems for Ruby,NPM for JavaScript,以确定4,146个GitHub项目,这些项目将库发布到这五个生态系统。分析他们的贡献,我们首先发现这些跨生态系统库的绝大多数贡献者(中位数为37.5%)来自单一生态系统,同时也从目标生态系统之外获得了很大一部分贡献(中位数为24.06%)。我们还发现,跨生态系统库是使用多种程序设计语言编写的。具体而言,三个(即,PyPI,CRAN,RubyGems)的大部分源代码都是使用非特定于该生态系统的语言编写的。随着生态系统变得相互交织,这为研究开辟了新的途径,例如跨生态系统库是否可以解决寻找替代库的问题,或者这些库如何适应每个生态系统。