Papers
Topics
Authors
Recent
Search
2000 character limit reached

LLM Interactive Optimization of Open Source Python Libraries -- Case Studies and Generalization

Published 8 Dec 2023 in cs.SE, cs.AI, cs.HC, and cs.PF | (2312.14949v2)

Abstract: With the advent of 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.

Authors (1)
Definition Search Book Streamline Icon: https://streamlinehq.com
References (39)
  1. “ChatGPT 4” Accessed: 2023-09-16 URL: https://chat.openai.com
  2. Uchechukwu Awada, Keqiu Li and Yanming Shen “Energy Consumption in Cloud Computing Data Centers” In International Journal of Cloud Computing and Services Science (IJ-CLOSER) 3, 2014 DOI: 10.11591/closer.v3i3.6346
  3. “Data Centres and Data Transmission Networks” Accessed: 2023-11-24 URL: https://www.iea.org/energy-system/buildings/data-centres-and-data-transmission-networks
  4. “Technical debt and agile software development practices and processes: An industry practitioner survey” In CoRR abs/2104.14761, 2021 arXiv: https://arxiv.org/abs/2104.14761
  5. “Identification and Measurement of Technical Debt Requirements in Software Development: a Systematic Literature Review” In CoRR abs/2105.14232, 2021 arXiv: https://arxiv.org/abs/2105.14232
  6. “Technical Debt, Agile, and Sustainability” Accessed: 2023-11-24 URL: https://learn.greensoftware.foundation/
  7. “A Case for Sustainability and Environment Friendliness in Software Development and Architecture Decisions by Taking Energy-Efficient Design Decisions”, 2023 arXiv:2311.01680 [cs.SE]
  8. “Large Language Models for Software Engineering: A Systematic Literature Review”, 2023 arXiv:2308.10620 [cs.SE]
  9. “Using Transfer Learning for Code-Related Tasks” In IEEE Transactions on Software Engineering 49.4, 2023, pp. 1580–1598 DOI: 10.1109/TSE.2022.3183297
  10. Zimin Chen, Sen Fang and Martin Monperrus “Supersonic: Learning to Generate Source Code Optimizations in C/C++”, 2023 arXiv:2309.14846 [cs.SE]
  11. “Learning Performance-Improving Code Edits”, 2023 arXiv:2302.07867 [cs.SE]
  12. “Sparks of Artificial General Intelligence: Early experiments with GPT-4”, 2023 arXiv:2303.12712 [cs.CL]
  13. “Analysis of ChatGPT on Source Code”, 2023 arXiv:2306.00597 [cs.SE]
  14. “Evaluating Large Language Models Trained on Code” In CoRR abs/2107.03374, 2021 arXiv: https://arxiv.org/abs/2107.03374
  15. “Learning Performance-Improving Code Edits” In arXiv preprint arXiv:2302.07867, 2023
  16. Jonathan H Choi and Daniel Schwarcz “Ai assistance in legal analysis: An empirical study” In Available at SSRN 4539836, 2023
  17. Peter Lee, Sebastien Bubeck and Joseph Petro “Benefits, limits, and risks of GPT-4 as an AI chatbot for medicine” In New England Journal of Medicine 388.13 Mass Medical Soc, 2023, pp. 1233–1239
  18. “Navigating the jagged technological frontier: Field experimental evidence of the effects of AI on knowledge worker productivity and quality” In Harvard Business School Technology & Operations Mgt. Unit Working Paper, 2023
  19. “Experimental evidence on the productivity effects of generative artificial intelligence” In Available at SSRN 4375283, 2023
  20. “The impact of ai on developer productivity: Evidence from github copilot” In arXiv preprint arXiv:2302.06590, 2023
  21. “pipexec - Build a network of processes and connecting pipes” Accessed: 2023-11-29 URL: https://github.com/flonatel/pipexec
  22. “rmToo - Open Source Requirements Management Tool” Accessed: 2023-11-29 URL: https://github.com/florath/rmtoo
  23. “Pillow: ImageStat Module” Accessed: 2023-09-19 URL: https://pillow.readthedocs.io/en/stable/reference/ImageStat.html
  24. Deutsche Telekom “Deutsche Telekom Promtathon” Accessed: 2023-09-16 URL: https://www.linkedin.com/feed/update/urn:li:activity:7108471295427719168/
  25. “Synapse CoR” Accessed: 2023-11-29 URL: https://github.com/ProfSynapse/Synapse_CoR
  26. “ImageNet Large Scale Visual Recognition Challenge” In International Journal of Computer Vision (IJCV) 115.3, 2015, pp. 211–252 DOI: 10.1007/s11263-015-0816-y
  27. “Python timeit library: repeat” Accessed: 2023-09-17, see timeit.Timer.repeat URL: https://docs.python.org/3/library/timeit.html
  28. “Python timeit library” Accessed: 2023-09-17 URL: https://docs.python.org/3/library/timeit.html
  29. “Optimize ImageStat.Stat._getextrema function” Accessed: 2023-12-05 URL: https://github.com/python-pillow/Pillow/pull/7593/
  30. “Optimize ImageStat.Stat._getcount function” Accessed: 2023-12-05 URL: https://github.com/python-pillow/Pillow/pull/7599/
  31. “Performance improvement of polyutils.as_series” Accessed: 2023-12-05 URL: https://github.com/numpy/numpy/pull/25299
  32. “Source Code for the paper ”LLM Interactive Optimization of Open Source Python Libraries - Case Studies and Generalization”” Accessed: 2023-11-27 URL: https://github.com/florath/LLMInteractiveOptOfPythonLibs
  33. “Pillow/src/PIL/ImageStats.py” Line 52, Accessed: 2023-09-16 URL: https://github.com/python-pillow/Pillow/blob/main/src/PIL/ImageStat.py
  34. “Numpy” Accessed: 2023-09-17 URL: https://numpy.org/
  35. “Fixedint” Accessed: 2023-09-17 URL: https://github.com/nneonneo/fixedint
  36. “Python Generators” Accessed: 2023-09-17 URL: https://wiki.python.org/moin/Generators
  37. “Numpy source code” Line 67, Accessed: 2023-09-20 URL: https://github.com/numpy/numpy/blob/main/numpy/polynomial/polyutils.py
  38. “Google Bard” Accessed: 2023-09-16 URL: https://bard.google.com
  39. “Stylish Article” Accessed: 2023-11-01 URL: https://www.latextemplates.com/template/stylish-article
Citations (1)

Summary

No one has generated a summary of this paper yet.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Continue Learning

We haven't generated follow-up questions for this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 1 like about this paper.