A large language model (LLM) is a neural network trained on a huge amount of text and code to predict the next token (a word or piece of a word). Everything a coding assistant does — completing a line, writing a function, explaining a stack trace — comes from that one skill applied over and over.
Four things that matter more than the maths
- The context window. The model only "knows" what is in its training data plus what you send it in the prompt: the open file, related files, docs, the ticket. Most quality problems in AI coding are context problems: the model never saw the internal library it should have used.
- Probabilities, not facts. The model produces the most plausible continuation. Plausible code usually compiles; it is not always correct, secure or consistent with your architecture. Tests and review stay essential.
- Tokens cost money and time. You pay per token sent and received, and longer prompts are slower. Agents that read whole repositories and retry many times can use orders of magnitude more tokens than autocomplete.
- Models change. Vendors release new versions every few months. A new model can be better on average and worse on your use case — which is why later levels cover evaluations.
Assistant, chat, agent
- Inline assistant: suggests the next lines while you type.
- Chat: answers questions and writes larger pieces on request, inside the IDE or a browser.
- Agent: an LLM in a loop with tools — it can read files, run tests, edit code and open a pull request with little human input in between.
What "AI writes X% of our code" means
When a company says a share of its code is AI-generated, ask three things: how is it counted (accepted suggestions, lines in merged changes, or delegated tasks), who reviews it, and did delivery outcomes change. The percentage is an input; lead time, quality and cost are the outcomes.