NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Natural Language Outlines for Code: Literate Programming in the LLM Era

Kensen Shi, Deniz Altinbüken, Saswat Anand, Mihai Christodorescu, Katja Grünwedel, Alexa Koenings, Sai Naidu, Anurag Pathak, Marc Rasi, Fredde Ribeiro, Brandon Ruffin, Siddhant Sanyam, Maxim Tabachnyk, Sara Toth, Roy Tu, Tobias Welp, Pengcheng Yin, Manzil Zaheer, Satish Chandra, Charles Sutton

Introduction

Software development is predominantly an exercise in reading and comprehension. Empirical studies indicate that developers spend up to 70% of their time understanding existing codebases rather than writing new lines. While traditional documentation tools like docstrings and inline comments exist, they often fail to bridge the "abstraction gap" between low-level implementation and high-level intent. Docstrings typically define function contracts (inputs and outputs) rather than internal logic, and manual comments frequently become "stale" as code evolves, leading to misinformation.

Researchers at Google propose Natural Language (NL) Outlines as a solution. These outlines partition code into logical sections summarized by concise prose, effectively bringing the "literate programming" ideal—where code is as readable as a narrative—into the modern era through the power of Large Language Models (LLMs).

Overview of NL Outlines across code understanding, maintenance, and developer experience.

The NL Outline Framework

NL outlines are structured, AI-maintained summaries that provide a middle ground between raw code and high-level documentation. Unlike static comments, these outlines are designed for bidirectional synchronization, acting as a live interface to the source code.

Generation Techniques

The researchers explored two primary methods for generating these outlines using Gemini and DeepSeek models:

  • Interleaved Generation: The LLM is prompted to rewrite the entire code block with outline comments inserted at logical boundaries. While this yields the highest quality, it is computationally expensive and slow due to the high token count.
  • Line Number Infilling: To optimize performance, the model receives code with line numbers and outputs only a mapping (e.g., Line 5-10 | Initialize data structures). This approach achieved a 4x–5x speedup in generation time, making it suitable for real-time IDE integration.

Bidirectional Maintenance: The "Finish Changes" Workflow

A core innovation of this work is the "Finish Changes" prototype, which addresses the problem of stale documentation. This feature enables a live, bidirectional sync between the code and its outline.

Detailed workflow for bidirectional code and outline maintenance.

As shown in the maintenance workflow, if a developer modifies a specific block of code, the LLM automatically detects the change and updates the corresponding outline statement to reflect the new logic. Conversely, the system supports "intent-based programming": if a developer edits an outline statement—for instance, changing "Parse JSON input" to "Parse CSV input"—the LLM can automatically refactor the underlying code blocks to match the updated natural language intent.

Evaluation and Use Cases

The effectiveness of NL outlines was evaluated across three distinct domains, demonstrating broad utility for professional software engineering.

General Development and Comprehension

Testing on a curated set of Python functions from 21 real-world projects showed that 90% of AI-generated outlines were rated "acceptable or better" by professional engineers, with 60% receiving an "excellent" rating. The models proved adept at inferring high-level concepts; for example, correctly identifying a "Traveling Salesman Problem" solver even when the specific terminology was absent from the source code.

Security Analysis and Reverse Engineering

In a study involving 80 decompiled Android functions (40 malicious, 40 benign), professional reverse engineers used outlines to audit code. This is a particularly challenging task because decompiled code often lacks meaningful variable names and structure. The study found that 26 out of 30 participants rated the outlines as "very" or "extremely" helpful. Notably, the LLM achieved a 0% false positive rate in identifying suspicious behaviors in the test set.

Code Review and Virtual CL Splits

One of the most impactful applications is the "Virtual CL Split." Large Change Lists (CLs) are often difficult to review because changes are presented in file-system order rather than logical order. By using NL outlines, the system can group diffs by topic (e.g., "Update database schema" or "Refactor error handling") across multiple files. In a beta test with 7,000 users, this feature received overwhelming praise for its ability to decompose complex reviews into manageable, logical tasks.

Key Insights and Implementation

  • The "Star Comment" Convention: The authors propose using a specific prefix (e.g., #* or //*) to denote AI-managed comments. This signals to both the developer and the IDE that these lines are managed by an LLM and should be treated with "cautious trust."
  • Summarization as a UI Layer: Outlines serve as a functional UI layer within the IDE. They enable features like logical code folding (collapsing code blocks into their summaries) and "jump-to-logic" navigation, where clicking a summary statement moves the cursor to the relevant implementation.

Conclusion and Future Work

NL outlines represent a significant step toward making code more readable and maintainable by leveraging the reasoning capabilities of modern LLMs. While challenges remain—such as managing the risk of "drift" if sync is not perfectly real-time and expanding support to more diverse programming languages—the high quality of current results suggests a paradigm shift in developer experience. Future research will focus on longitudinal studies to observe how these outlines affect long-term codebase health and developer productivity.

Reference: Shi, K., et al. (2025). Natural Language Outlines for Code: Literate Programming in the LLM Era. FSE Companion ’25.

Summary updated

BibTeX
@inproceedings{shi2024natural,
  author = {Kensen Shi and Deniz Altinbü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},
  title = {{Natural Language Outlines for Code: Literate Programming in the LLM Era}},
  booktitle = {SIGSOFT FSE Companion},
  year = {2024},
  url = {https://openreview.net/forum?id=PpgHKA0hCa},
}
Figure