# Concepts

> What AI models are and how they behave.

Page: https://schubergphilis.github.io/ai-training/concepts/
License: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/

How language models work, what they're good at, and where they break.

## How language models work

- [How a language model works](https://schubergphilis.github.io/ai-training/concepts/how-models-work/): What a language model actually does when it answers, why that explains its strengths, and why it explains its failures too.
- [What the model can see](https://schubergphilis.github.io/ai-training/concepts/context-window/): Measure a page of text in tokens and work out how many pages a context window holds, so a long chat that contradicts itself has an explanation.

## Prompting

- [Instruction, context and format](https://schubergphilis.github.io/ai-training/concepts/prompt-anatomy/): Turn a one-line request into a prompt with a clear instruction, marked context, a named audience and a stated output format, and see what each part changes.
- [Show one example](https://schubergphilis.github.io/ai-training/concepts/one-example/): Replace a paragraph of formatting rules with one worked input and output pair, see the model copy the pattern, and learn when to show an example instead of describing and how many to give.
- [Output the next step can use](https://schubergphilis.github.io/ai-training/concepts/structured-output/): Ask a chat assistant for action items as named fields with allowed values, check the result with the program that has to read it, and fix the prompt until it passes.
- [The prompt before the conversation](https://schubergphilis.github.io/ai-training/concepts/system-prompt/): The system prompt sets the role, the tone and the standing rules before the first message, and it is where behavior that should hold every time gets fixed.
- [Change the prompt before you retry](https://schubergphilis.github.io/ai-training/concepts/iterating-on-a-prompt/): A summary skips the decisions of a meeting. Name the gap, change one line of the prompt, compare with the last round, and move the fix you made twice into a saved template.

## Capabilities and limits

- [Where a model makes things up](https://schubergphilis.github.io/ai-training/concepts/thin-path/): Why one model gives a reliable summary and an invented citation in the same afternoon, which tasks earn a spot-check and which earn a check of every specific, and how naming the two properties behind a wrong answer picks the fix.
- [Same prompt, different answer](https://schubergphilis.github.io/ai-training/concepts/same-prompt-twice/): Run a toy model on the page ten times at two temperatures, count how often the answers agree, and see why one good run proves nothing and what check a workflow built on a model needs.
- [Getting a straight answer](https://schubergphilis.github.io/ai-training/concepts/straight-answer/): Why a model praises your plan and folds under pushback, how a leading question produces a leading answer, and three ways to ask so that the answer tells you something.
- [Wrong about the world, or wrong about the text](https://schubergphilis.github.io/ai-training/concepts/wrong-about-the-world/): Two kinds of wrong answer, one wrong about the world and one wrong about the text you gave the model, and the check that finds each kind.
- [What every token costs](https://schubergphilis.github.io/ai-training/concepts/what-tokens-cost/): Price a short prompt and a long one on a small model and a large one, see why the answer and the model size set the bill and the wait, and find the rule a long instruction file buried.

## What an agent is

- [Watch a tiny agent work](https://schubergphilis.github.io/ai-training/concepts/agent-loop/): Read the transcript of a toy agent that lists a folder and reads a note, name each phase as observe, think or act, see how a tool is described to the model, and learn the ways the loop ends.
- [One prompt, many requests](https://schubergphilis.github.io/ai-training/concepts/one-prompt-many-requests/): Follow one prompt to an agent through every model request it causes, see what the harness sends each time and what comes back from the environment, and learn why the model needs the whole history on every request.
- [Assistant or agent?](https://schubergphilis.github.io/ai-training/concepts/assistant-or-agent/): Separate the model from the software around it, apply one test that tells an assistant from an agent whatever the interface looks like, name the parts of the harness, and list an agent's tools before judging its reach.
- [Who decides the next step](https://schubergphilis.github.io/ai-training/concepts/autonomy-scale/): Place a product or workflow on the autonomy scale by asking who decides the next step, see one coding agent land on three points in three permission settings, and name the step that moves a workflow up or down.

## Tokens, cost and effort

- [Reading the token counts](https://schubergphilis.github.io/ai-training/concepts/reading-token-counts/): Read the input and output token counts of every request in a short chat and in one prompt to an agent, see why a one-line question late in a conversation costs more than the same question at the start, and learn when to start a new conversation.
- [Caching and effort](https://schubergphilis.github.io/ai-training/concepts/caching-and-effort/): See what an effort level changes in everything the model writes, choose a level for a kind of work, and read a long chat priced with and without a prompt cache to find what the cache saves and what makes it stop working.

## Grounding and memory

- [Answers from documents the model never saw](https://schubergphilis.github.io/ai-training/concepts/retrieval/): Read the output of a small keyword search over four policy texts, see it find the leave policy in the document's own words and miss it in a colleague's words, and learn what grounding promises and what it leaves for you to check.
- [Where memory comes from](https://schubergphilis.github.io/ai-training/concepts/memory/): Take the phrase "it remembered" apart into what was stored and what was read back, see how a long session drifts as its window fills, and pick summarize, start fresh or retrieve as the way out.
