一句话:提出自然语言大纲作为代码与 LLM 交互的新模态,可自动生成并实现代码与 NL 双向同步。
本文提出将自然语言大纲(NL outline)作为一种新的交互模态与界面,为开发者提供覆盖整个软件开发流程的 AI 辅助。一个函数的大纲由若干用简洁散文写成的语句组成,它们划分代码并以文学化编程的风格概括其主要思想。作者发现现代 LLM 能在实践中生成准确且高质量的大纲,并且大纲支持代码与自然语言之间的双向同步:开发者修改任一侧,LLM 会自动更新另一侧。文章讨论了多种用例,包括加速代码与 diff 的理解和导航、简化代码维护、增强代码搜索、引导代码生成等;随后提出并比较多种用于生成大纲的 LLM 提示技术,并邀请专业开发者评判大纲质量;最后通过代码审查和恶意软件检测两个案例研究展示应用。
We propose using natural language outlines as a novel modality and interaction surface for providing AI assistance to developers throughout the software development process. An NL outline for a code function comprises multiple statements written in concise prose, which partition the code and summarize its main ideas in the style of literate programming. Crucially, we find that modern LLMs can generate accurate and high-quality NL outlines in practice. Moreover, NL outlines enable a bidirectional sync between code and NL, where a developer can change either code or NL and have the LLM automatically update the other. We discuss many use cases for NL outlines: they can accelerate understanding and navigation of code and diffs, simplify code maintenance, augment code search, steer code generation, and more. We then propose and compare multiple LLM prompting techniques for generating outlines and ask professional developers to judge outline quality. Finally, we present two case studies applying NL outlines toward code review and malware detection.
@inproceedings{paperbot9033,
title = {Natural Language Outlines for Code: Literate Programming in the LLM Era},
author = {Kensen Shi and Deniz Altınbüken and Saswat Anand and Mihai Christodorescu and Katja Grünwedel and Alexa Koenings and Sai Naidu and Anurag Pathak and Marc Rasi and Fredde Ribeiro and Brandon Ruffin and Siddhant Sanyam and Maxim Tabachnyk and Sara Toth and Roy Tu and Tobias Welp and Pengcheng Yin and Manzil Zaheer and Satish Chandra and Charles Sutton},
booktitle = {FSE},
year = {2025},
doi = {10.1145/3696630.3728541}
}