What are maximum output tokens? Output limits and truncation checks
Distinguish output caps, context windows, and actual response length through a long-summary example, including parameter settings, finish reasons, and completeness checks.
Understand the concept
Maximum output tokens cap a generation budget rather than requiring a response of that length. They relate to, but differ from, context capacity and model output limits. Some interfaces include reasoning in the relevant budget. A response can reach its cap unfinished, so a successful request does not establish completeness.
Token caps do not map to a fixed character count
Token counts depend on the tokenizer, so equally long Chinese text and code can use different counts. For a thousand-character summary, specify the desired length and allow sufficient budget. A cap of one thousand tokens does not mean one thousand Chinese characters.
Google exposes output settings such as maxOutputTokens; other services use different names. Check the interface version instead of copying fields across providers. Unsupported or oversized values may fail or be adjusted under service rules.
Check finish reasons before treating output as complete
If a multi-chapter summary ends mid-sentence, inspect the budget instead of publishing the fragment. Structured output needs closed syntax and required fields. A completed network stream and a completed task are separate conditions.
Other stop conditions can end output early even below the cap, so verify required coverage too. This is a troubleshooting method without a model call. Start with short material and a complete format, then increase content to locate omissions.
Choose between a larger budget and task decomposition
Increasing the cap may be impossible near total context capacity. Remove irrelevant input or summarize sections with provenance before combining them. Check cross-section conflicts so the final summary does not merge incompatible conditions into a nonexistent conclusion.
Longer output can be repetitive; value depends on the task. Record model version, usage, required coverage, and stop status to distinguish budget shortages from capability issues. No fixed setting is prescribed because limits and target texts differ.
Checked sources
These sources support the concepts and methods described here. Examples and test scope are labeled separately; check the version of the tools you use.