Inference

Inference is using a trained model: you send input in, the model applies what training encoded in its parameters, and you get an answer out, one token at a time.

Fundamentalsmodel inferencegeneration
§ 01DefinitionInference

No jargon, no math

In plain words, what is it?

After training, the parameters are frozen and the work changes name: inference. Your prompt is tokenized into numbers. The model runs them through its layers and out comes a probability for every possible next token. It picks one (how boldly is set by temperature), appends it, and runs again, now with a longer input. That loop is why answers appear word by word and why long answers cost more: every token is a fresh pass through billions of parameters, usually on a GPU. The KV cache remembers past calculations so tokens after the first are cheaper. It breaks at the context window: too many tokens and the model literally cannot see the beginning of your document.

§ 02How it worksPrompt in, tokens predicted one by one, answer out
  1. 01

    Tokenize. Your prompt becomes a list of numbered tokens.

  2. 02

    First pass. The model computes probabilities for the next token.

  3. 03

    Pick. One token is sampled, the boldness set by temperature.

  4. 04

    Append and repeat. The new token joins the input; the loop runs until a stop signal.

  5. 05

    Stream. Tokens return as they are generated, so the answer appears word by word.

§ 04

Want this running in your stack?

We design and ship AI systems with permissions, logs and human approval. It starts with a 30-minute scoping call.