Variance — Large language model evaluation | variance-inc.com
Explain tokens, accumulated inputs, generated output, stopping limits and why advertised capacity is not a quality score.
A context window is the text a model can reference while generating a response, including the response itself. It is not the model's training corpus. That distinction matters because people often read a large window as a measure of knowledge, when it is a measure of how much text can be in view at once.
Prompts, messages, tool results, documents, tool definitions and generated output can all consume context. The exact inclusion varies by provider and model, so the only reliable way to know your budget is to read the provider's documentation for the model you are using.
A language model generates the next token from the prompt and prior generated output, stopping at a configured length or an end-of-sequence token. This is the mechanism behind most length surprises. The model does not know your intended length unless the prompt or the configuration says so.
Hugging Face documents max_new_tokens as a generation-length control. It limits how much new text is produced. It does not control the prompt length, and it does not guarantee that the answer is complete; it only caps the new tokens.
With a decoder-only model, a result may include the initial prompt unless your code separates it. If you count tokens on the raw result, you may be counting the prompt as output. Separate them before you measure length or grade content.
Greedy decoding and sampling are different modes. Hugging Face distinguishes them and advises checking the model's expected prompt or chat template. A model that expects a chat template may behave differently when given a raw string, and that difference can look like a quality problem.
On narrow screens, swipe or scroll the plate sideways.
Anthropic cautions that larger context does not automatically improve answers and recommends curating relevant context as conversations grow. Capacity is a limit, not a quality score. A long conversation with irrelevant history can perform worse than a short one with the right context.
For testing, decide the context sizes you expect in real use and test at those sizes. If your real inputs are short, a test with very long contexts measures a situation you do not have. If your real inputs are long, test with long inputs and note where truncation begins.
When an answer is cut off, check three things in order: the output limit, the total context budget, and whether the result includes the prompt. Each has a different fix, and guessing at the cause wastes runs.
Write down the configuration you used: model, prompt template, decoding mode, output limit and context size. Without that, a result cannot be reproduced, and an unreproducible result cannot guide a decision.
To build a test package, write the system instruction first, then the user messages, then any reference material, and finally leave a clearly marked place for the answer. Keep each part in its own field so you can count them separately. State the size of each part in your notes, and label the package as your own test setup. Do not present a made-up example as if it were a provider's real limit. The goal is a package you can rerun and compare, not a claim about what any vendor allows.
To tell a total-context overflow from an output-length cap, watch where the failure appears. If the request is rejected before any text is produced, suspect the total budget. If text starts and then stops mid-sentence, suspect the output limit. Confirm by lowering only the output limit or only the input size, one at a time. Then check the chosen provider's documentation for how it reports each case, because error messages and behavior differ between providers.
Further reading