Catching LLM page overflow: a measure-and-repair loop for single-page LaTeX generation
Scholeristical · reddit · 2026-09-09
A developer building an LLM-powered tool that outputs LaTeX for single-page documents shares hard-won lessons: models don't reliably understand "fill exactly one page," producing outputs that are either too sparse or spill onto page two.
What was tried
- Counting content elements and total characters to set floor/ceiling thresholds, calibrated using another model's output as a stand-in
- In production, the model barely hit the character floor, with element density about half of what was assumed — heuristics don't transfer across models
Current approach: a measure-and-repair loop
- Generate, score against floor/ceiling thresholds, and if out of bounds, run a corrective pass to expand or compress, keeping the higher-scoring version
- Branch the initial prompt based on source data density, instructing the model to expand upfront when input is light
The author is still tuning thresholds against live traffic and asks whether there's a better proxy for "fullness" than raw character or element counts.
More from coding & agent
- A Curated Paper Collection on Harness Engineering from YC Paper Club — dair_ai · 2026-09-09
- This agent prints a personalized AI morning newspaper from your calendar and email while you sleep — bookwormengr · 2026-09-09
- DAIR.AI compiles 21-paper Harness Engineering collection tracing the loop from GPT-2 to self-rewriting agent harnesses — omarsar0 · 2026-09-09
- Meta's Personal AI Agent Muse Can Pay Bills, Book Dates in Early Hands-On — jeff_weinstein · 2026-09-09
- exe.dev deep dive: ssh to a persistent Linux VM in half a second, priced like a folder — davidcrawshaw · 2026-09-09
- Harvey post-trains RLM agents for M&A diligence, lifting benchmark pass rate from 23% to 62% — lateinteraction · 2026-09-09