{"type":"ScholarlyArticle","title":"Can You Improve My Code? Optimizing Programs with Local Search","authors":[{"name":"Fatemeh Abdollahi","slug":"fatemeh-abdollahi","given":"Fatemeh","family":"Abdollahi","affiliation":"Department of Computing Science , University of Alberta , Canada; Alberta Machine Intelligence Institute (Amii)"},{"name":"Saqib Ameen","slug":"saqib-ameen","given":"Saqib","family":"Ameen","affiliation":"Department of Computing Science , University of Alberta , Canada; Alberta Machine Intelligence Institute (Amii)"},{"name":"Matthew E. Taylor","slug":"matthew-e-taylor","given":"Matthew E.","family":"Taylor","affiliation":"Department of Computing Science , University of Alberta , Canada; Alberta Machine Intelligence Institute (Amii)"},{"name":"Levi H. S. Lelis","slug":"levi-h-s-lelis","given":"Levi H. S.","family":"Lelis","affiliation":"Department of Computing Science , University of Alberta , Canada; Alberta Machine Intelligence Institute (Amii)"}],"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.","doi":"10.24963/ijcai.2023/328","url":"https://ijcai.org/proceedings/2023/328","pdf":"https://ijcai.org/proceedings/2023/0328.pdf","markdown":"https://ijcai.org/proceedings/2023/328.md","bibtex":"https://ijcai.org/proceedings/2023/bibtex/328","volume":{"slug":"2023","title":"Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence","short_title":"IJCAI 2023","url":"https://ijcai.org/proceedings/2023/","year":2023,"location":"Macao, SAR","dates":"19-25 August 2023","editors":"Edith Elkind","isbn":"978-1-956792-03-4","publisher":"International Joint Conferences on Artificial Intelligence Organization","doi_prefix":"10.24963/ijcai.2023"},"section":"Humans and AI","track":"Main Track","number":328,"pages":{"first":2940,"last":2948},"keywords":["Humans and AI: HAI: Applications","Humans and AI: HAI: Human-AI collaboration"],"videos":[],"references":[{"position":1,"raw":"[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.","title":"Aws Albarghouthi, Sumit Gulwani, and Zachary Kincaid. Recursive program synthesis","authors":"Albarghouthi","year":"2013","venue":"International Conference Computer Aided Verification, CAV","doi":null,"url":null,"internal_url":null},{"position":2,"raw":"[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.","title":"Show me the way! bilevel search for synthesizing programmatic strategies","authors":"David S Aleixo, H S Levi, Lelis","year":"2023","venue":"Proceedings of the AAAI Conference on Artificial Intelligence","doi":null,"url":null,"internal_url":null},{"position":3,"raw":"[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.","title":"Highlights: Summarizing agent behavior to people","authors":"Amir Amir, Dan Amir, Ofra Amir","year":"2018","venue":"Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS '18","doi":null,"url":null,"internal_url":null},{"position":4,"raw":"[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.","title":"The effectiveness of supervised machine learning algorithms in predicting software refactoring","authors":"Maurício Finavaro Aniche, Erick Maziero, Rafael Serapilha Durelli, H S Vinicius, Durelli","year":"2020","venue":null,"doi":null,"url":null,"internal_url":null},{"position":5,"raw":"[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.","title":"Deepcoder: Learning to write programs","authors":"Matej Balog, Alexander L Gaunt, Marc Brockschmidt, Sebastian Nowozin, Daniel Tarlow","year":"2016","venue":null,"doi":null,"url":null,"internal_url":null},{"position":6,"raw":"[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.","title":"Just-in-time learning for bottom-up enumerative synthesis","authors":"Shraddha Barke, Hila Peleg, Nadia Polikarpova","year":"2020","venue":"Proceedings of the ACM on Programming Languages","doi":null,"url":null,"internal_url":null},{"position":7,"raw":"[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.","title":"Osbert Bastani, Yewen Pu, and Armando Solar-Lezama. Verifiable reinforcement learning via policy extraction","authors":"Bastani","year":"2018","venue":"Proceedings of the International Conference on Neural Information Processing Systems","doi":null,"url":null,"internal_url":null},{"position":8,"raw":"[Brockman et al., 2016] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.","title":"Openai gym","authors":"Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, Wojciech Zaremba","year":"2016","venue":null,"doi":null,"url":null,"internal_url":null},{"position":9,"raw":"[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.","title":"Robustfill: Neural program learning under noisy I/O","authors":"Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-Rahman Mohamed, Pushmeet Kohli","year":"2017","venue":"Proceedings of the 34th International Conference on Machine Learning","doi":null,"url":null,"internal_url":null},{"position":10,"raw":"[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.","title":"Dreamcoder: Growing generalizable, interpretable knowledge with wake-sleep bayesian program learning","authors":"Kevin Ellis, Catherine Wong, Maxwell I Nye, Mathias Sablé-Meyer, Luc Cary, Lucas Morales, Luke B Hewitt, Armando Solar-Lezama, Joshua B Tenenbaum","year":"2020","venue":null,"doi":null,"url":null,"internal_url":null},{"position":11,"raw":"[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.","title":"Kasra Ferdowsifard, Allen Ordookhanians","authors":"Ferdowsifard","year":"2020","venue":"Proceedings of the Annual ACM Symposium on User Interface Software and Technology","doi":null,"url":null,"internal_url":null},{"position":12,"raw":"[Fowler, 2018] Martin Fowler. Refactoring: improving the design of existing code. Addison-Wesley Professional, 2018.","title":"Refactoring: improving the design of existing code","authors":"Martin Fowler","year":"2018","venue":null,"doi":null,"url":null,"internal_url":null},{"position":13,"raw":"[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].","title":"A methodology for automatic programming based on the constructive matching strategy","authors":"Marta Fraňová","year":"1985","venue":"Nat Friedman. Introducing GitHub Copilot: your AI pair programmer","doi":null,"url":"https://github.blog/2021-06-29-introducing-github-copilot-ai-pair-programmer/,2021","internal_url":null},{"position":14,"raw":"[Goues et al., 2019] Claire Le Goues, Michael Pradel, and Abhik Roychoudhury. Automated program repair. Com- mun. ACM, 62(12):56-65, nov 2019.","title":"Automated program repair","authors":"Claire Le Goues, Michael Pradel, Abhik Roychoudhury","year":"2019","venue":"Commun. ACM","doi":null,"url":null,"internal_url":null},{"position":15,"raw":"[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.","title":"Learning to complete code with sketches","authors":"Alexey Daya Guo, Jian Svyatkovskiy, Nan Yin, Marc Duan, Miltiadis Brockschmidt, Allamanis","year":"2022","venue":"International Conference on Learning Representations","doi":null,"url":null,"internal_url":null},{"position":16,"raw":"[Hoos and Stützle, 2004] Holger Hoos and Thomas Stützle. Stochastic Local Search: Foundations & Applications.","title":"Stochastic Local Search: Foundations & Applications","authors":"Stützle Hoos, Holger Hoos, Thomas Stützle","year":"2004","venue":null,"doi":null,"url":null,"internal_url":null},{"position":17,"raw":"[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.","title":"Neural-guided deductive search for real-time program synthesis from examples","authors":"Ashwin Kalyan, Abhishek Mohta, Oleksandr Polozov, Dhruv Batra, Prateek Jain, Sumit Gulwani","year":"2018","venue":"International Conference on Learning Representations","doi":null,"url":null,"internal_url":null},{"position":18,"raw":"[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.","title":"Logic programming and program synthesis","authors":"Y Kodratoff, M Franova, D Partridge","year":"1990","venue":"Proceedings of the First International Conference on Systems Integration","doi":null,"url":null,"internal_url":null},{"position":19,"raw":"[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.","title":"Genprog: A generic method for automatic software repair","authors":"Claire Le Goues, Thanhvu Nguyen, Stephanie Forrest, Westley Weimer","year":"2011","venue":"Ieee transactions on software engineering","doi":null,"url":null,"internal_url":null},{"position":20,"raw":"[Leurent, 2018] Edouard Leurent. An environment for au- tonomous driving decision-making. https://github.com/ eleurent/highway-env, 2018. Accessed: 2021-10-11.","title":"Edouard Leurent. An environment for autonomous driving decision-making","authors":"Leurent","year":"2018","venue":null,"doi":null,"url":"https://github.com/eleurent/highway-env,2018","internal_url":null},{"position":21,"raw":"[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.","title":"What can we learn even from the weakest? Learning sketches for programmatic strategies","authors":"Leandro C Medeiros, David S Aleixo, Levi H S Lelis","year":"2022","venue":"Proceedings of the AAAI Conference on Artificial Intelligence","doi":null,"url":null,"internal_url":null},{"position":22,"raw":"[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.","title":"On the fly synthesis of edit suggestions","authors":"Anders Miltner, Sumit Gulwani, Vu Le, Alan Leung, Arjun Radhakrishna, Gustavo Soares, Ashish Tiwari, Abhishek Udupa","year":"2019","venue":"Proceedings of the ACM Programming Languages","doi":null,"url":null,"internal_url":null},{"position":23,"raw":"[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.","title":"Human-level control through deep reinforcement learning","authors":"Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski","year":"2015","venue":"nature","doi":null,"url":null,"internal_url":null},{"position":24,"raw":"[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.","title":"Semfix: Program repair via semantic analysis","authors":"Hoang Duong, Thien Nguyen, Dawei Qi, Abhik Roychoudhury, Satish Chandra","year":"2013","venue":"35th International Conference on Software Engineering (ICSE)","doi":null,"url":null,"internal_url":null},{"position":25,"raw":"[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.","title":"Recode: A lightweight findand-replace interaction in the ide for transforming code by example","authors":"Wode Ni, Joshua Sunshine, Sumit Vu Le, Titus Gulwani, Barik","year":"2021","venue":"The 34th Annual ACM Symposium on User Interface Software and Technology, UIST '21","doi":null,"url":null,"internal_url":null},{"position":26,"raw":"[Qiu and Zhu, 2022] Wenjie Qiu and He Zhu. Programmatic reinforcement learning without oracles. In International Conference on Learning Representations, 2022.","title":"Programmatic reinforcement learning without oracles","authors":"Wenjie Qiu, He Zhu","year":"2022","venue":"International Conference on Learning Representations","doi":null,"url":null,"internal_url":null},{"position":27,"raw":"[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.","title":"Code completion with statistical language models","authors":"Veselin Raychev, Martin Vechev, Eran Yahav","year":"2014","venue":"Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation","doi":null,"url":null,"internal_url":null},{"position":28,"raw":"[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.","title":"A survey on machine learning techniques for source code analysis","authors":"Tushar Sharma, Maria Kechagia, Stefanos Georgiou, Rohit Tiwari, Federica Sarro","year":"2021","venue":null,"doi":null,"url":null,"internal_url":null},{"position":29,"raw":"[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.","title":"Synthetic datasets for neural program synthesis","authors":"Richard Shin, Neel Kant, Kavi Gupta, Christopher M Bender, Brandon Trabucco, Rishabh Singh, Dawn Xiaodong Song","year":"2019","venue":null,"doi":null,"url":null,"internal_url":null},{"position":30,"raw":"[Smith, 1976] David Canfield Smith. Pygmalion: A cre- ative programming environment. Technical report, Stan- ford University, 1976.","title":"Pygmalion: A creative programming environment","authors":"David Canfield, Smith","year":"1976","venue":null,"doi":null,"url":null,"internal_url":null},{"position":31,"raw":"[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.","title":"Practical bayesian optimization of machine learning algorithms","authors":"Snoek","year":"2012","venue":"Proceedings of the International Conference on Neural Information Processing Systems","doi":null,"url":null,"internal_url":null},{"position":32,"raw":"Curran Associates Inc. [Taylor et al., 2021]","title":null,"authors":"Curran Associates, Inc [ Taylor","year":"2021","venue":null,"doi":null,"url":null,"internal_url":null},{"position":33,"raw":"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.","title":"Improving reinforcement learning with human assistance: An argument for human subject studies with HIPPO gym","authors":"Matthew E Taylor, Nicholas Nissen, Yuan Wang, Neda Navidi","year":"2021","venue":null,"doi":null,"url":null,"internal_url":null},{"position":34,"raw":"[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.","title":"Transit: Specifying protocols with concolic snippets","authors":"Abhishek Udupa, Arun Raghavan, Jyotirmoy V Deshmukh, Sela Mador-Haim, Milo M K Martin, Rajeev Alur","year":"2013","venue":"Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation","doi":null,"url":null,"internal_url":null},{"position":35,"raw":"[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.","title":"Programmatically interpretable reinforcement learning","authors":"Verma","year":"2018","venue":null,"doi":null,"url":null,"internal_url":null},{"position":36,"raw":"[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.","title":"Programmatically interpretable reinforcement learning","authors":"Verma","year":"2018","venue":null,"doi":null,"url":null,"internal_url":null},{"position":37,"raw":"[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.","title":"Imitation-projected programmatic reinforcement learning","authors":"Abhinav Verma, M Hoang, Yisong Le, Swarat Yue, Chaudhuri","year":null,"venue":"Proceedings of the International Conference on Neural Information Processing Systems","doi":null,"url":null,"internal_url":null},{"position":38,"raw":"[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.","title":"Prow: A step toward automatic program writing","authors":"Richard J Waldinger, C T Richard, Lee","year":"1969","venue":"Proceedings of the 1st International Joint Conference on Artificial Intelligence, IJCAI'69","doi":null,"url":null,"internal_url":"/proceedings/1969/23"}],"license_note":"Copyright International Joint Conferences on Artificial Intelligence."}