Practical Guide to Making LLMs Generate Stable Single-Page Docs
Scholeristical · reddit · 2026-07-16
The author is building a document generation tool that uses LLMs to output LaTeX strictly constrained to a single page. Since models don't naturally grasp the concept of "exactly one page," they typically make two errors:
- Too little content, leaving the page mostly empty
- Too much content, spilling over to a second page
Attempted Solutions
- Initially set upper and lower bounds using the number of content elements and total character count
- Calibrated thresholds using outputs from another model
- Post-launch, they found that production models had a very different structural density than expected, making these thresholds insufficiently universal
Current Approach
- Adopted a measure-and-repair loop: generate first, then score based on the bounds
- If it fails, the model performs a correction pass, and the higher-scoring version is selected
- Additionally, the initial prompt is adjusted based on the source data density: if the input is light, the model is prompted to expand further in advance
The author continues to tweak thresholds, looking for a better proxy metric for "page fill" than character or element counts.
More from coding & agent
- An MCP server signs every AI agent tool call into a verifiable Merkle chain — Funky_Chicken_22 · 2026-07-22
- Claude Code skill uses 10 Markdown rules to make outputs ADHD-friendly — alex_verem · 2026-07-22
- A Firecracker-based platform says it can host 6,000 AI agents on one 256 GB server — maritime_sh · 2026-07-22
- A better path to agent autonomy is running waves, finding friction, and iterating — JnBrymn · 2026-07-22
- AI agent designers map the visual and tonal cues behind companionship products — Unlikely-Platform-47 · 2026-07-22
- Coding agents are heading toward an AI-writes, AI-reviews, human-approves workflow — aftahi_ai · 2026-07-22