Code Generation
A model producing working source code from a description of what you want.
Think of it like
Describing a shelf to a carpenter and getting back the cut, drilled, ready-to-assemble pieces.
Example
“Write a function that validates an email address” — the model returns a complete, runnable function with the regex and edge cases.
How it actually works
Code generation works because code is text with rigid structure and abundant training examples, and it comes with a rare gift: you can often run the output to check it. That testability is why coding became AI’s strongest applied domain. The catch is confident-but-wrong code — subtle bugs, made-up library functions — so generated code still needs review and tests, not blind trust.
For product teams
The capability that made AI immediately, measurably useful to a huge profession.
For engineers
Generating syntactically valid, functional source code from natural-language or partial-code prompts.
Related
- Hallucination — Its risk: plausible code calling functions that don’t exist.
- Copilot — The assistant form most people first met it as.
- Code Interpreter — Running the output to verify it.
Read anything AI without the jargon
Look up any term in plain English, or save terms as you read with the free Chrome extension.
Open DecoderAdd to Chrome