多行AI辅助代码创作
Multi-line AI-assisted Code Authoring
February 6, 2024
作者: Omer Dunay, Daniel Cheng, Adam Tait, Parth Thakkar, Peter C Rigby, Andy Chiu, Imad Ahmad, Arun Ganesan, Chandra Maddila, Vijayaraghavan Murali, Ali Tayyebi, Nachiappan Nagappan
cs.AI
摘要
CodeCompose是一款由大型语言模型(LLMs)驱动的AI辅助代码编写工具,为Meta的数以万计的开发人员提供内联建议。本文介绍了我们如何将该产品从显示单行建议扩展到多行建议。这一演进过程需要我们克服几个独特挑战,以改善这些建议对开发人员的可用性。
首先,我们讨论了多行建议可能产生的“刺耳”效果,因为LLM的建议不断在开发人员现有代码周围移动,否则会导致生产率和满意度降低。
其次,生成多行建议需要更长的时间;因此,我们介绍了几项创新投资,以减少用户感知的延迟。这些模型托管优化使多行建议的延迟加快了2.5倍。
最后,我们对数以万计的工程师进行实验,以了解多行建议如何影响用户体验,并将其与单行建议进行对比。我们的实验显示:(i)多行建议占被接受的总字符数的42%(尽管仅占显示建议的16%);(ii)多行建议将用户节省的按键次数的百分比从9%增加到17%。多行CodeCompose已经推广到Meta的所有工程师,并有不到1%的工程师选择退出多行建议。
English
CodeCompose is an AI-assisted code authoring tool powered by large language
models (LLMs) that provides inline suggestions to 10's of thousands of
developers at Meta. In this paper, we present how we scaled the product from
displaying single-line suggestions to multi-line suggestions. This evolution
required us to overcome several unique challenges in improving the usability of
these suggestions for developers.
First, we discuss how multi-line suggestions can have a 'jarring' effect, as
the LLM's suggestions constantly move around the developer's existing code,
which would otherwise result in decreased productivity and satisfaction.
Second, multi-line suggestions take significantly longer to generate; hence
we present several innovative investments we made to reduce the perceived
latency for users. These model-hosting optimizations sped up multi-line
suggestion latency by 2.5x.
Finally, we conduct experiments on 10's of thousands of engineers to
understand how multi-line suggestions impact the user experience and contrast
this with single-line suggestions. Our experiments reveal that (i) multi-line
suggestions account for 42% of total characters accepted (despite only
accounting for 16% for displayed suggestions) (ii) multi-line suggestions
almost doubled the percentage of keystrokes saved for users from 9% to 17%.
Multi-line CodeCompose has been rolled out to all engineers at Meta, and less
than 1% of engineers have opted out of multi-line suggestions.