Proceedings

Can You Improve My Code? Optimizing Programs with Local Search

Download BibTeX Cite

Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence. Main Track. Pages 2940-2948.

https://doi.org/10.24963/ijcai.2023/328

Abstract

This paper introduces a local search method for improving an existing program with respect to a measurable objective. Program Optimization with Locally Improving Search (POLIS) exploits the structure of a program, defined by its lines. POLIS improves a single line of the program while keeping the remaining lines fixed, using existing brute-force synthesis algorithms, and continues iterating until it is unable to improve the program's performance. POLIS was evaluated with a 27-person user study, where participants wrote programs attempting to maximize the score of two single-agent games: Lunar Lander and Highway. POLIS was able to substantially improve the participants' programs with respect to the game scores. A proof-of-concept demonstration on existing Stack Overflow code measures applicability in real-world problems. These results suggest that POLIS could be used as a helpful programming assistant for programming problems with measurable objectives.

  1. [Albarghouthi et al., 2013] Aws Albarghouthi, Sumit Gul- wani, and Zachary Kincaid. Recursive program synthesis. In International Conference Computer Aided Verification, CAV, pages 934-950, 2013.
  2. [Aleixo and Lelis, 2023] David S. Aleixo and Levi H. S. Lelis. Show me the way! bilevel search for synthesiz- ing programmatic strategies. In Proceedings of the AAAI Conference on Artificial Intelligence. AAAI Press, 2023.
  3. [Amir and Amir, 2018] Dan Amir and Ofra Amir. High- lights: Summarizing agent behavior to people. In Pro- ceedings of the 17th International Conference on Au- tonomous Agents and MultiAgent Systems, AAMAS '18, page 1168-1176, Richland, SC, 2018. International Foun- dation for Autonomous Agents and Multiagent Systems.
  4. [Aniche et al., 2020] Maurício Finavaro Aniche, Erick Maziero, Rafael Serapilha Durelli, and Vinicius H. S. Durelli. The effectiveness of supervised machine learning algorithms in predicting software refactoring. CoRR, abs/2001.03338, 2020.
  5. [Balog et al., 2016] Matej Balog, Alexander L. Gaunt, Marc Brockschmidt, Sebastian Nowozin, and Daniel Tar- low. Deepcoder: Learning to write programs. CoRR, abs/1611.01989, 2016.
  6. [Barke et al., 2020] Shraddha Barke, Hila Peleg, and Nadia Polikarpova. Just-in-time learning for bottom-up enumer- ative synthesis. Proceedings of the ACM on Programming Languages, 4(OOPSLA):1-29, Nov 2020.
  7. [Bastani et al., 2018] Osbert Bastani, Yewen Pu, and Ar- mando Solar-Lezama. Verifiable reinforcement learning via policy extraction. In Proceedings of the International Conference on Neural Information Processing Systems, page 2499-2509.
  8. [Brockman et al., 2016] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
  9. [Devlin et al., 2017] Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy I/O. In Doina Precup and Yee Whye Teh, edi- tors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 990-998. PMLR, 2017.
  10. [Ellis et al., 2020] Kevin Ellis, Catherine Wong, Maxwell I. Nye, Mathias Sablé-Meyer, Luc Cary, Lucas Morales, Luke B. Hewitt, Armando Solar-Lezama, and Joshua B. Tenenbaum. Dreamcoder: Growing generalizable, in- terpretable knowledge with wake-sleep bayesian program learning. CoRR, abs/2006.08381, 2020.
  11. [Ferdowsifard et al., 2020] Kasra Ferdowsifard, Allen Or- dookhanians, Hila Peleg, Sorin Lerner, and Nadia Polikar- pova. Small-step live programming by example. In Pro- ceedings of the Annual ACM Symposium on User Interface Software and Technology, page 614-626, New York, NY, USA, 2020. Association for Computing Machinery.
  12. [Fowler, 2018] Martin Fowler. Refactoring: improving the design of existing code. Addison-Wesley Professional, 2018.
  13. [Fraňová, 1985] Marta Fraňová. A methodology for auto- matic programming based on the constructive matching strategy. In Bob F. Caviness, editor, EUROCAL '85, pages 568-569, Berlin, Heidelberg, 1985. Springer Berlin Hei- delberg. [Friedman, 2021] Nat Friedman. Introducing GitHub Copilot: your AI pair programmer. https://github.blog/ 2021-06-29-introducing-github-copilot-ai-pair-programmer/, 2021. [Online; accessed 11-August-2022]. Link
  14. [Goues et al., 2019] Claire Le Goues, Michael Pradel, and Abhik Roychoudhury. Automated program repair. Com- mun. ACM, 62(12):56-65, nov 2019.
  15. [Guo et al., 2022] Daya Guo, Alexey Svyatkovskiy, Jian Yin, Nan Duan, Marc Brockschmidt, and Miltiadis Alla- manis. Learning to complete code with sketches. In Inter- national Conference on Learning Representations, 2022.
  16. [Hoos and Stützle, 2004] Holger Hoos and Thomas Stützle. Stochastic Local Search: Foundations & Applications.
  17. [Kalyan et al., 2018] Ashwin Kalyan, Abhishek Mohta, Oleksandr Polozov, Dhruv Batra, Prateek Jain, and Sumit Gulwani. Neural-guided deductive search for real-time program synthesis from examples. In International Con- ference on Learning Representations, 2018.
  18. [Kodratoff et al., 1990] Y. Kodratoff, M. Franova, and D. Partridge. Logic programming and program synthesis. In Systems Integration '90. Proceedings of the First Inter- national Conference on Systems Integration, pages 346- 355, 1990.
  19. [Le Goues et al., 2011] Claire Le Goues, ThanhVu Nguyen, Stephanie Forrest, and Westley Weimer. Genprog: A generic method for automatic software repair. Ieee trans- actions on software engineering, 38(1):54-72, 2011.
  20. [Leurent, 2018] Edouard Leurent. An environment for au- tonomous driving decision-making. https://github.com/ eleurent/highway-env, 2018. Accessed: 2021-10-11. Link
  21. [Medeiros et al., 2022] Leandro C. Medeiros, David S. Aleixo, and Levi H. S. Lelis. What can we learn even from the weakest? Learning sketches for programmatic strate- gies. In Proceedings of the AAAI Conference on Artificial Intelligence. AAAI Press, 2022.
  22. [Miltner et al., 2019] Anders Miltner, Sumit Gulwani, Vu Le, Alan Leung, Arjun Radhakrishna, Gustavo Soares, Ashish Tiwari, and Abhishek Udupa. On the fly synthesis of edit suggestions. Proceedings of the ACM Programming Languages, 3(OOPSLA), 2019.
  23. [Mnih et al., 2015] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Belle- mare, Alex Graves, Martin Riedmiller, Andreas K Fidje- land, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540):529-533, 2015.
  24. [Nguyen et al., 2013] Hoang Duong Thien Nguyen, Dawei Qi, Abhik Roychoudhury, and Satish Chandra. Semfix: Program repair via semantic analysis. In 2013 35th In- ternational Conference on Software Engineering (ICSE), pages 772-781, 2013.
  25. [Ni et al., 2021] Wode Ni, Joshua Sunshine, Vu Le, Sumit Gulwani, and Titus Barik. Recode: A lightweight find- and-replace interaction in the ide for transforming code by example. In The 34th Annual ACM Symposium on User Interface Software and Technology, UIST '21, page 258-269, New York, NY, USA, 2021. Association for Computing Machinery.
  26. [Qiu and Zhu, 2022] Wenjie Qiu and He Zhu. Programmatic reinforcement learning without oracles. In International Conference on Learning Representations, 2022.
  27. [Raychev et al., 2014] Veselin Raychev, Martin Vechev, and Eran Yahav. Code completion with statistical language models. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, page 419-428, New York, NY, USA, 2014. Association for Computing Machinery.
  28. [Sharma et al., 2021] Tushar Sharma, Maria Kechagia, Ste- fanos Georgiou, Rohit Tiwari, and Federica Sarro. A sur- vey on machine learning techniques for source code anal- ysis. CoRR, abs/2110.09610, 2021.
  29. [Shin et al., 2019] Richard Shin, Neel Kant, Kavi Gupta, Christopher M. Bender, Brandon Trabucco, Rishabh Singh, and Dawn Xiaodong Song. Synthetic datasets for neural program synthesis. ArXiv, abs/1912.12345, 2019.
  30. [Smith, 1976] David Canfield Smith. Pygmalion: A cre- ative programming environment. Technical report, Stan- ford University, 1976.
  31. [Snoek et al., 2012] Jasper Snoek, Hugo Larochelle, and Ryan P. Adams. Practical bayesian optimization of ma- chine learning algorithms. In Proceedings of the Interna- tional Conference on Neural Information Processing Sys- tems, page 2951-2959, Red Hook, NY, USA, 2012.
  32. Curran Associates Inc. [Taylor et al., 2021]
  33. Matthew E. Taylor, Nicholas Nissen, Yuan Wang, and Neda Navidi. Improving reinforcement learning with human assistance: An argument for human subject studies with HIPPO gym. CoRR, abs/2102.02639, 2021.
  34. [Udupa et al., 2013] Abhishek Udupa, Arun Raghavan, Jy- otirmoy V. Deshmukh, Sela Mador-Haim, Milo M.K. Mar- tin, and Rajeev Alur. Transit: Specifying protocols with concolic snippets. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Imple- mentation, pages 287-296. ACM, 2013.
  35. [Verma et al., 2018a] Abhinav Verma, Vijayaraghavan Mu- rali, Rishabh Singh, Pushmeet Kohli, and Swarat Chaud- huri. Programmatically interpretable reinforcement learn- ing. CoRR, abs/1804.02477, 2018.
  36. [Verma et al., 2018b] Abhinav Verma, Vijayaraghavan Mu- rali, Rishabh Singh, Pushmeet Kohli, and Swarat Chaud- huri. Programmatically interpretable reinforcement learn- ing. CoRR, abs/1804.02477, 2018.
  37. [Verma et al., 2019] Abhinav Verma, Hoang M. Le, Yisong Yue, and Swarat Chaudhuri. Imitation-projected program- matic reinforcement learning. In Proceedings of the In- ternational Conference on Neural Information Processing Systems.
  38. [Waldinger and Lee, 1969] Richard J. Waldinger and Richard C. T. Lee. Prow: A step toward automatic program writing. In Proceedings of the 1st International Joint Conference on Artificial Intelligence, IJCAI'69, page 241-252, San Francisco, CA, USA, 1969. IJCAI

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards