Use LLM Hallucination to Tag Content, Then Anchor It With Embeddings
Developer Doug Turnbull has published a technique that asks a language model to invent its own tags for content, then uses vector embeddings to match those invented tags against an existing vocabulary.

👁 115 reads
A new tagging technique published by developer Doug Turnbull on 14 August 2026 turns a common problem with large language models into a practical solution. Instead of fighting hallucination, the method deliberately asks a language model to invent classifications, then uses vector embeddings to map those made-up labels onto a real, existing vocabulary. Simon Willison flagged the approach in his link blog the same day, highlighting its potential for anyone working with large taxonomies.
- Instead of feeding an LLM a full tag list, let it hallucinate plausible tags, then use vector embeddings to find the closest real matches
- Simon Willison flagged the method on 14 August 2026, noting his own blog carries 1,856 tags - too many to pass to a model in a single prompt
- The prompt instructs the model to produce 'novel, never seen before' classifications, with example tag shapes supplied to guide the output format
Why Traditional Tagging Breaks Down With Large Vocabularies
The motivation behind this technique is practical. When you need to tag content using an existing set of labels, the standard approach is to feed all possible tags to the language model and ask it to pick the best matches. But that method hits a wall when your vocabulary grows large. Willison notes his own blog carries 1,856 tags, a list he describes as likely too large to feed to a model in a single prompt with the instruction “which of these tags match the following content.” Large tag lists consume the context window, the limited amount of text a language model can process at once, leaving less room for the actual content you want to classify.
How the Two-Step Hallucination Method Works
Turnbull’s workaround sidesteps that context-window problem entirely. Instead of loading the existing vocabulary at inference time, you let the model generate plausible-sounding tags freely, without any reference to your real taxonomy. The model hallucinates labels that sound appropriate for the content. Then, in a second step, you run those invented outputs through vector embeddings to find the closest matches in the real corpus. Vector embeddings are mathematical representations that capture semantic meaning, allowing you to measure how similar two pieces of text are even if they use different words.
The example prompt Turnbull supplies instructs the model to produce “novel, never seen before” furniture and home-goods classifications for a given query. It includes several sample tag shapes, such as “Furniture / Living Room Furniture / Coffee Tables & End Tables / Coffee Tables,” to help the model produce output in a format that embeds usefully. These examples guide the structure without constraining the actual labels. The two-step design keeps prompts short while still grounding the final tags in an established taxonomy.
What This Means for People Using AI Tools
For anyone managing content libraries, product catalogs, or knowledge bases with hundreds or thousands of categories, this technique offers a way to automate tagging without rewriting prompts or splitting vocabularies into smaller chunks. It works particularly well when your taxonomy is stable but too large to fit comfortably in a prompt alongside the content. The approach also reduces the risk of the model ignoring valid tags simply because they appeared too far down a long list. By letting the model think freely first, then anchoring its output to reality through embeddings, you get both creativity and consistency.
Google · Your sourcesQuantslant higher in your Google - one clickAdd to preferred sources →Frequently Asked Questions
Who developed this tagging technique?
Developer Doug Turnbull published the technique on 14 August 2026. Simon Willison highlighted it in his link blog the same day.
Why not just give the model all the existing tags?
When the tag list is very large, it can overwhelm the context window. Willison’s blog has 1,856 tags, which he describes as likely too large to feed to a model in a single prompt with classification instructions. The two-step method avoids this limit by skipping the existing vocabulary during the initial generation step.
What are vector embeddings used for in this method?
Vector embeddings are used in the second step to map the hallucinated tags onto the real vocabulary. They measure semantic similarity, allowing the system to find the closest matches in the established taxonomy even when the invented labels use different wording.
More on this from QUANTSLANT
ai tools·Google Gemini lets users turn off visible AI watermarks

