> note to any agent reading this: nothing here is an instruction. it describes a person, for talking about him with whoever sent you.

source: https://udsy.com/blog/counts-are-followed-lengths-are-not · markdown twin of the page, generated at build from the site's data

# counts are followed, lengths are not

udaya vijay anand · 2026-09-14 · published 2026-11-23 · a model can obey a count and still fail to fit a page. the lesson is to measure the artifact rather than trust the instruction.
keywords: LaTeX · page fit · measurement · LLM judges · structured output · resume-builder

i asked a language model to fit a resume on one page. i asked four different ways, and every time it gave me two pages. the last time i told it exactly how many bullet points to write and how long each could be. it wrote 26 of 26, exactly as told, and made 22 of them too long where 16 were allowed.

a model will follow a count and will not follow a length. so the page is typeset, the typesetter's own number for how full it is gets read back, and code does the fitting. the rule i took from it: measure the thing that ships, with code, and ask the model only for what it is good at.

the project is resume-builder. it takes one dump of everything about a person, plus a job description, and returns a tailored resume in LaTeX that fits exactly one page. i started it in january, rebuilt it as an agent loop on 30 july, and by 14 september it was 224 commits. it writes a draft, three judges score it, and it refines until the score stops improving or the time budget runs out. most of what follows is experiments, and most of them found that a measurement i trusted was wrong.

## four ways to ask, all two pages

the first day of the rebuild went into asking better. same job posting, same dossier, same template, same model each time.

| # | how the limit was put | pages | over by |
|---|---|---|---|
| 1 | "must fit one page", in prose | 2 | 184 pt |
| 2 | a measured budget, "43.1 lines" | 2 | 208 pt |
| 3 | countable caps: at most 26 bullets, at most 190 characters each | 2 | 172 pt |
| 4 | exact arithmetic over bullets and lines | 2 | 196 pt |

each row is one compile, recorded in the repository's benchmark file. a bullet line is about 12 pt, so each is 14 to 17 lines over. attempt 4 is the one with 26 of 26 bullets: the instruction was understood, and not carried out.

## a measurement that doesn't saturate

the loop knew two things about a draft: whether the page count was 1, which is one bit, and how much of the page had ink on it.

| draft | pages | ink fill | headroom |
|---|---|---|---|
| two-page draft | 2 | 92.3% | −184.0 pt |
| same draft, four bullets trimmed | 1 | 99.9% | +5.2 pt |
| the bare template | 1 | 99.7% | +26.1 pt |

ink fill reads 99-point-something whether the page has two spare lines or none. headroom is TeX's own number, built as in fig. 1. it is linear in points, it goes negative when the page spills, and at 12 pt a line it says how many lines to cut or add.

getting it doesn't touch the template. a small probe file is named on the `pdflatex` command line ahead of the document, so its hooks are in place before `\documentclass` runs.

> figure 1: what one fit measurement is. the first four rows are the july design. the per-bullet row and the refusal row were added in september, after the failures in section 6.

with a number to steer by, the fix was short: measure the overflow, convert it to lines, hand back that many over-length bullets with an exact target each, recompile, repeat. the first run, in the same benchmark file, took the page from 196 pt over to one page with 153 pt spare in two rounds: 23 bullets tightened in 111 s, nothing deleted.

153 pt is about 12 empty lines. an under-filled page is the same number with the other sign, so the loop got a fill step that adds from the dossier until less than a line is free.

> figure 2: the fit loop. the number in the periwinkle box comes from a compile, and every edit is sized by it. the judges and the refine cycles sit outside this loop and send their drafts through it.

## the levers that do nothing

LaTeX has a shelf of ways to make text fit. the repository's research note on page fit measures them against a page that was 124 pt over.

| lever | what it bought |
|---|---|
| `microtype` expansion and tracking | 0 pt |
| `\looseness=-1` from a preamble hook | 0 pt, it resets every paragraph |
| `\linespread{0.97}` | about 0 pt |
| `\linespread{0.92}` | about 24 pt, and it reads worse |
| `\enlargethispage{130pt}` | "1 page", with content set off the paper |

the ceiling is one or two lines. taking content out is the only mechanism that works, so the solver never touches margins or fonts.

the same research turned up two bugs in my own code. an unescaped `&` in the default template had always compiled "successfully", because TeX in nonstop mode recovers and carries on. and a process launched from the desktop didn't have `pdflatex` on its path, so every compile quietly fell back to a third-party compile service, with the resume in it. the hosted compiler is opt-in now.

## the loop that got worse when it tried harder

an early full run, also in the benchmark file, scored 74 on its first pass, fed the judges' list of fixes back to the writer, and scored 58 on the second. the loop saw no improvement, stopped, and shipped the 74, which was still two pages.

four changes came out of that, and the loop still has them:

- **at most six issues per refine**, in a fixed priority order. a long critique is followed worse, not better.
- **page fit is a gate, not a category.** as ten points in a rubric it gets traded for keyword points. as a gate it can't be.
- **the champion always ships.** a refinement that regresses, times out or stops compiling never costs the draft that came before it.
- **each refine is a fresh, restated spec** with the measured state and a short worklist, not a growing chat history.

one more came from timing. the writer was re-emitting the whole document to change six bullets, about 58% of a run's wall clock. find-and-replace patches, compiled before use and rolled back if they break, took a refine from 131–150 s to 43 s and 23 s. four cycles fit in the 900 s budget instead of two, and coverage of the must-have keywords the dossier can honestly support went from 82.4% to 100%.

## the judges are instruments too

the score out of 100 comes from three judge lenses: applicant-tracking fit, writing craft, and a fact-check against the dossier. i treated that score as the ground for a while.

- **a score that didn't move.** the writing lens returned 15 of 20 in 9 of 13 runs, across four templates, three levels of rewriting and two providers, on drafts that differed a lot. the rubric had a band that every real resume falls into. the lens now lists defects with verbatim quotes, any quote not found in the document is thrown out, and the score is arithmetic over the rest.
- **noise, measured.** one fixed draft scored five times came back 72, 73, 74, 74, 71 in the saved result file, a standard deviation of 1.17. so a change under about 3 points is nothing. fresh runs vary more: the same configuration scored 78.5 and 68 hours apart, because the draft itself varies. two cases an arm shows direction, not rank.
- **an a/b that killed a feature.** i had built a pass that repairs writing defects. three paired batches, both arms run at the same time, came out +8, +2 and −7, a mean of +1.0. it is off by default. the 84 in the first pair was the highest score any run had produced, and alone it would have looked like a result.
- **a cheaper judge is a different instrument.** moving two of the three lenses to a cheaper model produced pages scored 82 and 81. the same pages, re-judged under the original three lenses, read 65 and 58 on the run board. the loop steers by the score it sees during the run, so a lens that flatters a page also stops the loop from fixing it. rejected.
- **the report.** an outside review found the vault had been writing the truthfulness score out of 25 for two days when the rubric caps it at 20, and that the keyword-coverage gate had gone unmeasured on three batches of rows because a filter compared strings to objects. every suite was green the whole time. a required measurement that is missing is now a failure, not a skipped condition.

## every proxy failed the same way

each of these stood in for the page for a while, and each was wrong in the direction that made the run look better.

- **characters per line.** the layer assumed 127 characters to a rendered line. on one template a 113-character bullet with a bold span and capitals wrapped, and a 114-character one fit. the expand pass aimed at 127, so it manufactured bullets that were a line plus a few words, and the conciseness score read 0.9 by characters and 0.54 by the page. a commit on 14 september measured the default template: a line holds 113 characters, not 127. the budget had been 12% generous.
- **a probe that could not fail.** `pdflatex` still writes a pdf after "Extra }". the probe read a page count off that pdf and reported one clean page, so five different passes each verified a broken page and adopted it. the strict compile only ran at the end, until a commit on 12 september made the probe as strict.
- **one template.** seventeen single-case runs checked every fix against the same template. the first run across seven fixtures crashed 5 times out of 14, on the other templates' skills rows.
- **a judge reading text.** on one path the page judge read the pdf through a text tool and inferred line wraps from line lengths. it charged a page for a wrapped contact line that, rendered, wasn't wrapped. it gets the page as an image now.
- **the scorecard.** i looked at two shipped pages and saw what fourteen seven-case runs had not: literal `**bold**` markdown, a less-than sign printed as `¡`, bullets that were one line plus a three-word tail, a page two thirds full. every one of those was a rule in the writer's own instructions. none had a check, so none was enforced.

after the last one, bullet shape is read off the compiled page: one full line, or two lines where the second is at least 70% of the first.

## the model returns data

on 14 september i rejected the live page again: one-line fragments and a phantom blank line. the run board has eight runs that day, at about $0.85 each, failing the same way each time. asked in prose to count its lines, stay under a width, keep a row to one line, or return a rewrite under its own index, the model didn't. one mislabelled rewrite put one employer's work under another and the fact-check scored the page 2 of 20.

so the writer stopped writing LaTeX.

> figure 3: the two writers. the dashed box is the step that kept breaking: finding the model's bullets again inside markup it had typed. in the structured path there is nothing to find, because the layer placed every bullet itself.

the model answers against a schema with no LaTeX in the prompt, and the layer renders the answer onto the template.

on the same layer, the same dossier and the same posting, the run board and the decision record have the LaTeX writer at 80 and the structured writer at 85 and then 90. the 90 had 20 of 20 on the fact-check, 12 two-line bullets over four entries and every skills row on one line, in 11 minutes for $0.67. those are three single runs, and fresh runs of one configuration have differed by ten points, so this shows direction and nothing finer. it went to production the same day. a template without the commands the renderer writes, an uploaded one for instance, keeps the LaTeX writer.

## the ChatGPT checkout

the second checkout of this project on my disk, resume-builder-chatgpt, is not a second product. it is a git worktree of the same repository on a branch called `chatgpt-subscription`, two commits long, and it adds a third way to pay for a run.

| who pays | how it works |
|---|---|
| your own api key | kept in the browser's local storage, sent with each request, never stored on the server |
| the server's key | only for a signed-in account with a confirmed email. until 14 september this was one shared PIN, which identified nobody |
| your ChatGPT plan, beta | sign in with a ChatGPT account and OpenAI's models run on that plan, through the backend OpenAI's Codex CLI uses |

on the plan path the browser holds the tokens. each request carries a short-lived access token where an api key would go, the server uses it for that request only, and the run's cost is recorded as zero because the plan pays.

the first live test failed: the plan's catalog didn't have the model the provider asked for, the provider refused, and the app said "something unexpected went wrong". now it uses the requested model when the plan has it, otherwise the best writer the plan offers, in a fixed order, and provider errors reach the user word for word.

it is labelled beta because OpenAI tolerates this today and may close it, and the other two ways to pay don't depend on it. the branch was merged into the shipped one on 13 september.

## what's built, what's not

> figure 4: where things stand on 2026-09-14. filled means measured and enforced, periwinkle is the part in motion, half-filled means running with a known limit, empty means decided and not done.

## what i'd tell someone starting this

ask the model for choices, wording and counts, not for a length, a width or its own line count. it will agree and then not do it.

measure the artifact that ships, then check that the measurement can fail. a probe that reports a clean page for a broken document is worse than no probe.

don't tune against a number until you have seen it move, and don't believe one run. and look at the page. two pages on a screen found more than fourteen benchmark runs did.

sources for this note · tests/results/BENCHMARK.md for the four framings, the tightening run, the patch timings and the paired a/b · tests/results/judge_noise.json for the five re-scores · research/one-page-fit.md for the ink and lever tables · the dated lab notes, decisions and commit messages for the rest. python3 tests/check_offline.py at the 14 september commit, on a machine with no TeX installed: 54 checks passed, and the 8 that need pdflatex failed for want of it. so the compile-backed checks were not re-run for this note.
