Generation Probabilities Are Not Enough: Uncertainty Highlighting in AI Code Completions
Open Access
- 29 October 2024
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Computer-Human Interaction
Abstract
Large-scale generative models have enabled the development of AI-powered code completion tools to assist programmers in writing code. Like all AI-powered tools, these code completion tools are not always accurate and can introduce bugs or even security vulnerabilities into code if not properly detected and corrected by a human programmer. One technique that has been proposed and implemented to help programmers locate potential errors is to highlight uncertain tokens. However, little is known about the effectiveness of this technique. Through a mixed-methods study with 30 programmers, we compare three conditions: providing the AI system's code completion alone, highlighting tokens with the lowest likelihood of being generated by the underlying generative model, and highlighting tokens with the highest predicted likelihood of being edited by a programmer. We find that highlighting tokens with the highest predicted likelihood of being edited leads to faster task completion and more targeted edits, and is subjectively preferred by study participants. In contrast, highlighting tokens according to their probability of being generated does not provide any benefit over the baseline with no highlighting. We further explore the design space of how to convey uncertainty in AI-powered code completion tools and find that programmers prefer highlights that are granular, informative, interpretable, and not overwhelming. This work contributes to building an understanding of what uncertainty means for generative models and how to convey it effectively.Keywords
All Related Versions
This publication has 14 references indexed in Scilit:
- Large Language Models and Simple, Stupid Bugs2023
- Survey of Hallucination in Natural Language GenerationACM Computing Surveys, 2023
- Explanations Can Reduce Overreliance on AI Systems During Decision-MakingarXiv, 2023
- Reducing Conversational Agents’ Overconfidence Through Linguistic CalibrationTransactions of the Association for Computational Linguistics, 2022
- Algorithmic Risk Assessments Can Alter Human Decision-Making Processes in High-Stakes Government ContextsProceedings of the ACM on Human-Computer Interaction, 2021
- How Can We Know When Language Models Know? On the Calibration of Language Models for Question AnsweringTransactions of the Association for Computational Linguistics, 2021
- Show or suppress? Managing input uncertainty in machine learning model explanationsArtificial Intelligence, 2021
- The SPACE of Developer ProductivityQueue, 2021
- Do Explanations Help Users Detect Errors in Open-Domain QA? An Evaluation of Spoken vs. Visual Explanations2021
- Effects of spell checkers on English as a second language students’ incidental spelling learning: a cognitive load perspectiveReading and Writing, 2017