Topic 4 of 5 · 4 min read
Output limits and silent truncation
Goal: Recognise a reply or chat history that was cut by a token limit and fix it by splitting the task or raising the output limit.
Models have a separate cap on how long one reply can be, and apps may quietly drop old messages when a chat gets too long, so a cut-off answer or a forgotten instruction is often a limit, not a mistake in the model's thinking.
Check yourself · 1 of 3
A long reply ends in the middle of a sentence. What is the most likely cause?
Why it matters
Two things look like "the AI got worse" but are plain limits.
- A reply stops mid-sentence or a long document ends early. The model hit its maximum output length. Providers set a cap on tokens per reply, often much smaller than the input window. The model docs list both numbers, for example the OpenAI models page. Through an API, the response usually says why it stopped, with a field such as a stop reason. A value meaning "length" or "max tokens" tells you it was cut, not finished.
- The chat forgets the rules from the start. When history grows past the window, an app has to cut something. Many apps drop or shorten the oldest messages and do not tell you. Your first instruction may be the first thing to go.
How to spot and fix it
- Look at the end of the reply. Does it stop mid-word, skip the closing section, or promise "part 2" that never comes? That points to an output cap.
- Ask it to continue. "Continue from the last sentence" often works, but check the join for repeated or missing text.
- Split the task. Ask for chapters or sections one at a time, each with its own request.
- Raise the limit when you control the API call, and keep input small enough to leave room.
- Repeat key rules. If an old instruction seems forgotten, restate it, or start a fresh chat with a short summary.
Before and after
Before: "Write the full 12-section onboarding guide." The reply ends in section 8, mid-sentence. The user assumes the model gave up.
After: "Write sections 1 to 4 of the onboarding guide. Stop after section 4." Then ask for 5 to 8, then 9 to 12. Each part finishes cleanly, and the user keeps control of the format.
Another case: at turn 60 the assistant stops using the requested British spelling. The instruction sat at turn 1, and the app trimmed it. Restating the rule fixes it.
What goes wrong
- Mistaking a cut for a refusal or a failure. The model did not choose to stop.
- Not noticing a clean-looking cut. Sometimes a reply ends at a full stop, but half the content is missing. Compare with what you asked for.
- Assuming old turns are still there. Apps handle overflow differently and rarely announce it.
Examples
Reading a stop reason
An API response shows stop_reason: max_tokens. The text ended at "The third risk is". That is a truncated reply. Raise the output limit or ask for the risks in two smaller requests.
The forgotten rule
You told the assistant at the start: "Always answer in plain language for a nurse." Fifty turns later it uses heavy jargon. Restate the rule in the next message, or open a new chat, paste a short summary and add the rule at the top.
Key points
- Each model has a maximum reply length that is separate from, and usually smaller than, its input window.
- A reply that stops mid-sentence or skips its last sections was probably cut by the output limit.
- API responses usually include a stop reason, and a length-type reason means the reply was truncated.
- When a chat overflows the window, apps may silently drop or shorten the oldest messages.
- Fix cuts by splitting the task, raising the limit where you can, or restating key rules.
Common mistakes
- Treating a mid-sentence ending as the model giving up.
- Asking for one very long document in a single request.
- Assuming the whole chat is still being sent after dozens of turns.
- Not checking the stop reason when calling an API.
Check yourself · 2 of 3
A chat of 80 turns stops following a rule you gave in the first message. What is a likely cause?
Check yourself · 3 of 3
You asked for a 12-section guide and it stops during section 8. What is the best next step?
Practice items, not counted towards your mastery.
Start here
- Context windows (Claude docs) (opens in a new tab)DocsFree
How the window fills with input and output, what happens at the limit, and how tool results count.
- Lost in the Middle: How Language Models Use Long Contexts (opens in a new tab)PaperFree
The study showing models use facts at the start and end of a long input better than facts in the middle.
- Context Rot (Chroma research) (opens in a new tab)ArticleFree
Tests of many models showing accuracy falls as input grows, even on simple tasks.
More for this topic
- Models (OpenAI API docs) (opens in a new tab)DocsFree
Each model's current context window and maximum output tokens, listed side by side.