Skip to content

AIP-C01 · Study Guide

← Domain 5: Testing, Validation, and Troubleshooting

5.2.1 · Lesson 10 of 14

Content Handling & Truncation Diagnostics

Diagnose mid-sentence truncations versus pre-generation input overflow errors and apply the correct fix for each.

WHAT

Diagnose and resolve context window overflow errors and truncated completions.

DIAGNOSIS & FIX MATRIX

SymptomRoot causeFix
Output ends mid-sentence; stopReason: "max_tokens"Hit configured output token limitRaise maxTokens in inference config
ValidationException citing input token countPrompt+context exceed model context window before generationChunk/compress input — raising maxTokens will NOT help

EXAM TRAP

To fix input context overflow, do not raise maxTokens. Compress/chunk the input instead.

Key points

  • stopReason: max_tokens → raise maxTokens
  • ValidationException input overflow → chunk/compress
  • Different root causes
  • Do not confuse input vs output limits
  • Inspect Converse metadata

Exam focus

max_tokens means output limit hit; ValidationException means input exceeded context before generation — raising maxTokens will NOT fix input overflow.

View progress