Token Limit Artifacts in Conditional Generation
Issue: Truncated Prompts/Conditions Lead to Artifacts When Input Exceeds Token Limit
Frequency: Common
Symptoms
- Long, detailed prompts truncated at token limit
- Artifacts appear in regions corresponding to truncated text
- Quality degrades when prompt is long
- Inconsistent behavior based on prompt length
Root Cause Vision models often use text encoding (CLIP, BERT) to condition generation. Truncation at token limit causes information loss. Model must hallucinate missing condition; leads to artifacts in regions that were supposed to be controlled by truncated text.
Example
Scenario: Product image generation with detailed specifications
Prompt: "Red leather wallet, compact size, professional appearance, stitching detail, vintage look, durable, waterproof..."
Model token limit: 77 tokens
Truncated to: "Red leather wallet, compact size, professional appearance, stitching detail, vintage"
Generated image: Stitching detail and vintage look missing; looks cheap/plastic
Impact: Product doesn't match specification
Key Statistics
- Token usage: Short prompts (20 tokens): 95% quality
- Medium prompts (50 tokens): 88% quality
- Long prompts (>77 tokens, truncated): 70% quality
Mitigation Strategies
- Increase Token Limit: If feasible, extend context window for prompts
- Prompt Prioritization: Keep critical keywords early (not truncated)
- Multiple Passes: Use multiple generations with different parts of prompt
- Compress Prompt: Summarize detailed spec into fewer tokens
Metrics
- Quality vs. prompt length
- Artifact detection at truncation point
Alerts
- Prompt length >token limit → Warn or summarize