Two years ago, "AI code completion" meant predicting the rest of a line. Today, models write entire functions from a comment, and this month DeepMind announced a system that competes in programming contests.
On 2 February, DeepMind described AlphaCode, which it evaluated on recent contests on the Codeforces platform. Averaged across ten contests, AlphaCode ranked around the top 54% of participants, roughly median human performance, on problems that require understanding a novel description, designing an algorithm and implementing it correctly.
That is a remarkable step from autocomplete. How did we get here?
What changed technically
Transformers and scale. The same architecture and scaling trends behind GPT-3 apply to code. Larger models trained on more code generate longer, more coherent programs.
Training on code. OpenAI's Codex, the model behind GitHub Copilot, was trained on a very large corpus of public code. Its paper showed that a model fine-tuned on code vastly outperforms a general language model of the same size at writing programs.
Evaluation by execution. Researchers moved from judging generated code by how it looks to whether it passes tests. This made progress measurable and pointed to a powerful technique: generate many candidates and let tests choose.
Sampling and filtering. AlphaCode takes this to an extreme. For each problem it generates a very large number of candidate programs, filters out those that fail the example tests in the problem statement, clusters the survivors by behaviour on generated inputs, and submits a small number of diverse candidates.
flowchart TB
P[Problem statement] --> G[Generate a vast number<br/>of candidate programs]
G --> F{Pass example tests?}
F -->|no| X[Discard]
F -->|yes| C[Cluster by behaviour<br/>on generated inputs]
C --> S[Submit up to 10<br/>diverse candidates]Completion vs generation
| Completion | Generation | |
|---|---|---|
| Input | Code you are typing | A description of what you want |
| Output | The next token or line | A whole function or program |
| Developer role | Writing, with help | Specifying and verifying |
| Main risk | Small plausible mistakes | Large plausible mistakes |
With completion, the developer is still writing the program, and mistakes are small and local. With generation, the developer is increasingly describing the program and checking the result. Mistakes can be larger and harder to spot, because the developer did not reason through every line.
What this means for developers today
Describing problems precisely becomes a core skill. A vague comment produces a vague function. A docstring with inputs, outputs, edge cases and an example produces far better results.
def merge_intervals(intervals: list[tuple[int, int]]) -> list[tuple[int, int]]:
"""Merge overlapping or touching closed intervals.
- Input intervals may be unsorted; each is (start, end) with start <= end.
- Intervals that touch (e.g. (1, 3) and (3, 5)) should be merged.
- Return a new list sorted by start.
>>> merge_intervals([(5, 7), (1, 3), (2, 4), (8, 8)])
[(1, 4), (5, 7), (8, 8)]
"""Tests become the specification. If you can express what "correct" means as tests, you can generate, check and even choose between multiple candidates, the same idea AlphaCode uses at scale.
Review changes character. Reviewing generated code means checking that it solves the right problem, handles edge cases and fits the codebase, not just that it compiles.
Fundamentals still matter. Knowing algorithms and data structures is what lets you judge whether a generated solution is sensible, efficient and correct.
Limitations to remember
- Contest problems are self-contained and well specified. Real software involves large codebases, unclear requirements and many interacting parts.
- AlphaCode's approach depends on generating enormous numbers of samples, which is expensive, and on having tests to filter with.
- Generated code can be insecure, inefficient or subtly wrong in ways tests do not cover.
- Licensing and attribution questions about models trained on public code are unresolved.
The bottom line
The move from completion to generation is the most significant change in programming tools in years. It does not remove the need for engineering skill. It shifts that skill towards specifying problems clearly and verifying solutions rigorously. Teams that invest in good tests and clear specifications will get the most out of the new tools.
Our secure SDLC team is building test-first workflows that make AI code generation safe to use in production projects.