Industry Commentary →

The Classification Architecture Problem Hidden in Your AI Stack

Simon Willison points to a technique that inverts how most teams use LLMs for classification — free generation plus embedding grounding outperforms constrained vocabulary selection, and it changes how you should build tagging and knowledge pipelines.

Simon Willison published a post on August 14 pointing to a technique from search engineer Doug Turnbull: Don’t classify, hallucinate. The premise is straightforward — rather than feeding an LLM a vocabulary of existing tags and asking it to classify, have the model generate novel tag descriptions freely, then use vector embeddings to find the closest real tags. Constrained classification underperforms; free generation plus post-hoc grounding outperforms.

Most enterprise teams are doing the constrained version. They have a taxonomy, they hand it to the model, and they wonder why classification quality is mediocre. The framing here suggests the problem is not the model — it is the architecture.

flowchart TD
Doc[Document to classify]
Doc --> C[Constrained path:<br/>give LLM vocabulary list]
Doc --> F[Free-generation path:<br/>no vocabulary constraint]
C --> C2[LLM selects<br/>closest label]
C2 --> C3[Misclassification<br/>when vocab has gaps]
F --> F2[LLM generates<br/>semantic description freely]
F2 --> F3[Vector embedding<br/>finds closest real tag]
F3 --> F4[Accurate classification<br/>even across vocabulary gaps]
class C3 bad
class F3 accent
class F4 good
classDef good fill:#163a26,stroke:#44cc77,color:#d7ffe6;
classDef bad fill:#3a1620,stroke:#ff5555,color:#ffd9d9;
classDef warn fill:#3a2e16,stroke:#ffaa33,color:#ffe9c7;
classDef accent fill:#15233b,stroke:#4488ff,color:#dce9ff;

The rundown: what Willison is pointing to

Turnbull’s core argument, as Willison frames it: when you constrain an LLM to classify into a fixed vocabulary, you are asking it to do something that sounds precise but actually degrades output quality. The model has to fit what it would naturally say into whatever bucket is least wrong. If the vocabulary does not have the right bucket, you get the closest approximation — which may be misleading.

The alternative: let the model generate freely. It produces richer, more accurate semantic descriptions when unconstrained. You then run those descriptions through a vector embedding model and find the closest match in your actual taxonomy. The “hallucination” — the model generating something not in your vocabulary — becomes useful signal rather than error, because it accurately describes what the content is about.

This reframes “hallucination” as a feature in the right architectural context. The LLM is not confabulating. It is generating an accurate description of something your vocabulary does not have a label for yet.

For the working software engineer

If you are building or maintaining a classification pipeline, this is an architectural change, not a prompt tweak. The implementation: strip the vocabulary constraint from your classification prompt, add an embedding step, and route generated descriptions through a similarity search against your tag index.

The practical tradeoffs to evaluate:

Latency. You are adding an embedding step. In most enterprise pipelines where classification happens offline or in batch, this is a non-issue. For real-time classification at the user-facing layer, it adds a small amount of latency worth measuring.

Cost. An additional embedding call is cheap relative to the classification call. Net cost impact is usually negligible.

Vocabulary maintenance. The constrained approach requires curating the vocabulary you hand to the LLM. The free-generation approach shifts that curation upstream — the vocabulary lives in your embedding index rather than in your prompt. In practice this is easier to maintain, because you add tags to the index without touching prompt instructions or rerunning evaluation sets.

Quality at the edges. Where this technique materially outperforms constrained classification is at the margins — unusual content, emerging topics, documents that cut across multiple categories. If your content set is well-bounded and your taxonomy is stable, the quality difference will be small. If your content is heterogeneous or your taxonomy is evolving, the difference is significant.

For business owners and operators

If you are investing in enterprise knowledge management, content classification, or RAG systems, the architectural choice your team makes at the classification layer will determine how well those systems hold up as content grows and diversifies.

Constrained classification systems tend to work when the vocabulary was built. They degrade over time as content drifts from what was anticipated when the taxonomy was designed. Documents end up classified into the “other” bucket or mis-tagged into the nearest available category, and search and retrieval quality quietly erodes. The maintenance loop becomes: update the vocabulary, retune the prompt, retest. Repeat quarterly.

Free generation plus embedding grounding avoids some of this. The model does not become less accurate as vocabulary gaps grow, because it is not constrained by those gaps. Adding a new tag means adding it to the embedding index — no prompt changes, no retest cycle.

The business case is really about maintenance cost and downstream quality. Classification errors are invisible until they surface in search results, a misrouted workflow, or a compliance audit where a document was incorrectly labeled. The free-generation approach is architecturally more resilient to the content drift that happens in any real enterprise over time.

My take

I spent time at H&R Block re-architecting the SOA for TaxCut 2007 — their flagship consumer tax software. The existing system had a rules engine that classified tax scenarios into a predefined set of categories, each mapped to a form and a calculation path. The rules were extensive, carefully maintained, and expensive to update whenever the tax code added an edge case.

What Turnbull’s approach reminds me of is the pattern that makes constrained classification attractive in the first place: it feels safe. The vocabulary is controlled. The outputs are bounded. You know what the model can and cannot say. That feels like governance.

The problem is that safety through constraint is brittle. Tax law adds a new edge case. Content expands into a new domain. The model starts picking the “other” bucket at a higher rate, and the constrained vocabulary becomes a liability rather than a control.

The version of this that holds up over time: constrain the actions the system takes — what it routes, triggers, or writes — not the language it uses to describe what it is looking at. Let the model generate freely at the classification step, then ground the output. The controls live downstream, not in the vocabulary list.

Put constraints where mistakes are costly, not where mistakes are informative. That is a consistent principle across AI system design, and this technique makes it concrete.

Frequently Asked Questions

What is the free-generation-plus-embedding approach to LLM classification?

Instead of giving an LLM a predefined tag vocabulary and asking it to pick, you ask the model to describe the document or content freely — generating whatever language best characterizes it. You then run those generated descriptions through a vector embedding model and find the closest matches in your actual tag vocabulary. The LLM produces richer semantic output when unconstrained. The embedding step grounds that output to your real taxonomy. Simon Willison highlighted this approach, originally framed by search engineer Doug Turnbull, as outperforming constrained classification in accuracy.

Why does constrained vocabulary classification underperform with LLMs?

LLMs generate text probabilistically, and forcing a selection from a fixed list changes the task from 'describe what this is' to 'pick the least-wrong label.' When the vocabulary has gaps, near-misses, or outdated terms, the model picks the closest option rather than a useful one. Free generation avoids that ceiling. The embedding step that follows can find the right match across a large vocabulary because it operates in semantic space rather than discrete selection.

What does this mean for enterprise RAG and knowledge management systems?

If your enterprise RAG system or knowledge-management platform uses constrained classification anywhere in the pipeline — document tagging, content routing, topic assignment — this technique is worth evaluating. The tradeoff is an added embedding step, which adds latency and cost. The benefit is classification quality that does not degrade as your vocabulary grows or as content drifts from what was anticipated when the taxonomy was designed. For organizations with large or heterogeneous document sets, the quality gain typically outweighs the added step.

When does constrained classification still make sense?

When the vocabulary is small, stable, and the categories are mutually exclusive with no ambiguity. Binary classification and tightly bounded taxonomies — 'is this a contract or not,' 'which of three compliance categories does this fall under' — often perform well with constrained approaches because the model has enough signal to pick accurately. The technique Willison describes adds the most value when vocabulary size is large, when categories overlap semantically, or when the content set is heterogeneous enough that a predefined list will always lag behind what actually shows up.

Shawn Livermore — Fractional CTO & Chief AI Officer
About the Author

Shawn Livermore

Fractional CTO and Chief AI Officer with nearly 3 decades of enterprise architecture experience. Clients include Kelley Blue Book, LERETA ($18B property tax processor), First American Financial, Carvana, WellPoint/Anthem, and PacifiCare. 92 client reviews, 5-star average.

View full background →

Need a fractional CTO or CAIO?

Technology leadership without the full-time headcount. Engagements start with a conversation.

Man writing a flowchart diagram on a whiteboard with a blue marker.