liveBook · Manning

Autocomplete

As explained in Introduction to Generative AI, Second Edition

A text-input feature that predicts and suggests a continuation while a user is composing text.

Autocomplete predicts a continuation as someone writes. In programming, it offers code suggestions inside developer tools, often using a language model fine-tuned for code. A programmer can specify a language and describe a desired function in a comment or docstring; the system proposes an implementation, usually as a quick first attempt rather than a guaranteed solution. section 6.6

Code autocomplete works especially well when:

  • The code has clear structure and repeating patterns, such as repeatedly called functions. section 6.6
  • The programmer wants to iterate quickly from a reasonable first draft, while checking results for failures, especially in complex functions. section 6.6
  • The user wants pair-programming assistance rather than a system acting autonomously. section 6.6

A function described in a docstring

A programmer writes a natural-language description of what a function should do. An autocomplete tool then attempts to implement that function, turning the description into code that can be reviewed and revised. section 6.6

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains the coding workflow and rationale at a high level, but stops short of implementation details and autonomous operation.
Examples
Uses GitHub Copilot, Codex, natural-language function descriptions, comments, and docstrings as concrete examples.
What you can do after
Apply it via GitHub Copilot to generate a first code implementation and then iterate while checking for failures.
How it connects
Connects autocomplete with large language models, code generation, pair programming, and developer tools.

Also explained in

Compare how 2 books explain autocomplete →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.