Skip to content
All topics

Domain

AI and LLM fundamentals

How language models turn text into tokens, process context and generate output, and why their behaviour is probabilistic.

0 of 12 articles published. Topics are listed in reading order: each comes after the topics it builds on.

How language models work

What happens inside a model between receiving text and returning it.

  1. What a large language model isComing soon

    A model that predicts the next token from the tokens before it, and what that does and does not imply about understanding.

    Fundamentals · Beginner

  2. Tokens and tokenizationComing soon

    How text is split into tokens, why token counts differ between models and languages, and why it matters for cost and limits.

    Fundamentals · Beginner

  3. Transformers and attentionComing soon

    How self-attention lets each token draw on every earlier token, and why its cost grows with context length.

    Fundamentals · Advanced

  4. Prefill and decode phasesComing soon

    Why reading the prompt and generating the answer have different performance profiles, and how that shapes latency.

    Fundamentals · Advanced

  5. The KV cacheComing soon

    How storing attention keys and values avoids recomputation during decoding, and what it costs in memory.

    Advanced engineering · Advanced

Generation and sampling

How a model chooses each output token and why outputs vary between calls.

  1. Sampling: temperature, top-p and top-kComing soon

    How sampling parameters reshape the next-token distribution, and how to choose them for a task.

    Fundamentals · Intermediate

  2. Why model output is nondeterministicComing soon

    Sources of variation beyond sampling, why temperature 0 is not a guarantee, and how to design around it.

    Fundamentals · Intermediate

  3. Stop sequences, max tokens and finish reasonsComing soon

    How generation ends, how to detect truncated output, and how to handle each finish reason.

    Fundamentals · Intermediate

Context and knowledge

What a model knows, what it can see in one call, and where its answers come from.

  1. Context windows and their limitsComing soon

    What counts toward the context window, what happens when it is exceeded, and why long context is not free.

    Fundamentals · Beginner

  2. Training data and knowledge cutoffsComing soon

    Why a model's knowledge stops at a date, and how applications supply newer or private information.

    Fundamentals · Beginner

  3. Hallucination: causes and mitigationsComing soon

    Why models produce fluent but false statements, and which engineering measures reduce the risk.

    Fundamentals · Intermediate

  4. Grounding answers in supplied sourcesComing soon

    Making a model answer from provided documents, and checking that it did.

    Fundamentals · Intermediate