Concepts

Code generation

Quick explainer2 min readBeginner

Code generation is AI writing computer code from a description in plain language, such as a comment or a request.

In plain words

Language models trained on public code learn how programs are written; OpenAI's Codex, for example, learned from code on GitHub. Given a comment, a function name or a request, they suggest code. The HumanEval benchmark tests this by checking whether generated functions pass unit tests. Tools such as GitHub Copilot put this inside the editor; coding agents such as Claude Code can work across many files at once.

A quick example

A developer types a comment: 'return the three most common words in this text'. The assistant suggests a complete function. The developer runs the tests, spots one edge case the code misses, and fixes it before committing.

Where you'll meet it

  • Code editors, through tools like GitHub Copilot.
  • Coding agents that edit files and run commands for you.

Related

Sources

  1. PaperEvaluating Large Language Models Trained on Code, Chen et al. (arXiv) · read 29 Sept 2026
  2. DocsResearch: quantifying GitHub Copilot's impact on developer productivity and happiness, GitHub Blog · read 29 Sept 2026
  3. DocsClaude Code overview, Anthropic (Claude Code Docs) · read 29 Sept 2026

Checked by WhatIsAI against the sources above · 29 Sept 2026. Spotted an error? Report it.