The LLM Went Where the Switch Cases Were
2026-08-07
A brokerage I work with makes a lot of marketing collateral — listing postcards, seasonal mailers, seller’s guides. Beautiful stuff, built by a real designer. And every single time an agent wanted one personalized — their headshot, their listing, their name on it — it went through a human. Not because the transformation was hard. Because there was no tractable way to describe it to a computer.
I want to talk about why that “no tractable way” quietly dissolved this year, because I think it’s the most underrated thing LLMs are doing, and it has almost nothing to do with chatbots.
The pipeline was never the problem
Personalizing a designed PDF is a textbook pipe-and-filter job. Open the master, blank out the example’s content, drop in this transaction’s content at the right coordinates, save. I’d written that filter by hand half a dozen times — one per template. Same three steps every time. Deterministic, fast, testable.
The logic never varied. What varied — endlessly — was the input to the logic: where does the photo go on this piece, what text is dynamic, what does the agent actually need to type. Every new design was a new set of answers, and the only place to put those answers was code. if pumpkin_postcard: … elif seller_guide: … elif …. A switch statement with no bottom, because the set of “pieces a brokerage might want” has no bottom.
That’s the classic wall. The transformation is simple; producing the transformation’s configuration for an arbitrary input is a combinatorial explosion. So you hand-write the top few cases and a human does the infinite tail forever.
The LLM is a parser front-end
Here’s the reframe that made it click. The step that was killing us — turn an arbitrary designed document into a structured description of what’s dynamic — is a parsing problem. Take something from an unbounded space (any layout a designer might dream up) and lower it into one bounded representation (a small schema: these regions, these fields).
That’s exactly what a compiler front-end does. Messy source in, clean intermediate representation out, and everything downstream is deterministic. We’ve just never had a parser that could accept reality as its grammar. Now we do.
So the shape of the system flipped. Staff upload the finished PDF. A model looks at it — measures the geometry, reads the layout — and proposes the schema: “the headline lives here, the photo fills this box, here are the three fields an agent should fill in.” A human glances at a preview and approves. From then on agents self-serve, and a plain deterministic renderer does the swapping. No new code per template. Ever.
The logic didn’t change. The renderer is the same filter I’d have written by hand. What changed is that the ambiguous seam in the middle — the part that used to require a person translating a design into a spec — got a machine that can do the translation.
The discipline: emit the connector, not the product
This is the part I’d underline for anyone building with LLMs right now.
The model does not generate the marketing piece. It generates the schema — the config that tells a deterministic renderer how to generate the piece. That distinction is the whole ballgame.
Config is inspectable. You can diff it, cache it, show it to a human, store it, and run it a million times with identical output. The non-determinism is quarantined at one boundary — the moment of interpretation — and it never touches the final pixels. A person reviews the schema once; every generation after that is boring and correct.
The tempting version is to let the model render the PDF directly. It demos identically. It’s also a dice roll on every single generation, with nothing to review and no reason to trust it twice. Put the LLM at the boundary of your system, lowering the world into your types. Don’t put it in the core, doing deterministic work you could have done deterministically.
Two honest edges
It doesn’t collapse every switch case. It collapses the interpretation ones — “what does this layout mean” — not the logic ones. A piece with five conditional front designs, or a document whose personalization branches across pages, still needs a filter a human writes. The LLM ate the perception explosion, not the computation. Know which one you’re facing.
And the reason this matters commercially isn’t that the switch cases were hard. It’s that they were never worth writing. Nobody staffs a developer to build a parser for a one-off seasonal postcard — the case is too niche to justify the code, so it stays manual forever. The model changes the unit cost of the long tail from a dev-week each to a prompt. That’s what finally lets the 80% of automation that was always theoretically possible actually happen.
The takeaway
We didn’t get smarter logic. We got a way to feed the logic we already had. The pipe-and-filter pattern is decades old; the deterministic renderer is dull on purpose; the human still signs off. The one new part is a universal adapter sitting at the messy front edge, doing the translation that used to be an infinite pile of if-statements.
Old idea. Newly possible. That’s most of what’s happening right now, if you look past the chat window.