---
title: "Don't Classify, Hallucinate! Using Vector Embeddings to Match LLM-Generated Tags"
source: "Simon Willison 博客（Atom）"
source_tier: "t2"
url: "https://simonwillison.net/2026/Aug/14/dont-classify-hallucinate/"
permalink: "https://feed.astralor.com/items/itm_245d0828ba0a8acb9ed6b37b"
published: "2026-08-14T21:54:35.000Z"
score: 69
channel: "ai"
tags: ["LLM","Content Classification","Vector Embeddings","Tag Management"]
---

# Don't Classify, Hallucinate! Using Vector Embeddings to Match LLM-Generated Tags

## AI commentary

> The essence of this post is reverse thinking: instead of asking the model to classify, let it be creative and then use vector search to converge. This is especially useful for content platforms maintaining large tag taxonomies. I particularly appreciate the tip of including tag shape examples in the prompt, which greatly improves the mapping of hallucinated tags.

## At a glance

Simon Willison shares a clever technique for tagging blog posts: instead of asking an LLM to choose from an existing list of tags, let the model freely "hallucinate" possible tags, then use vector embeddings to match those hallucinated tags to the closest real tags in the existing corpus. This solves the problem of having too many tags to feed directly into an LLM, and includes an example prompt to help the model generate tags in a similar shape. It offers a new approach to content classification and tag management.

## Key points

- When there are too many tags to feed directly into an LLM, let the model "hallucinate" tags first.
- Use vector embeddings to match hallucinated tags to the closest existing tags in the corpus.
- Doug Turnbull's example prompt includes examples of the tag shape to help the model generate more useful tags.
- This approach applies to any scenario needing to map free text to a controlled vocabulary.

## Full text

Don't classify. Hallucinate! I still have quite a bit of older content on my blog that I never got round to tagging. My blog has 1,856 tags - likely too many to feed to an LLM in one go and say "which of these tags match the following content". Doug Turnbull has a neat solution. Tell the model to output tags without any details of the existing vocabulary, then use vector embeddings against the existing corpus to find the concrete tags that are closest to the ones the model imagined might fit! His example prompt suggests including an example of the shape of your tags to help the model make a more useful guess: Your task is to create novel, never seen before, furniture, home goods, or hardware classification that best fit a search query. Product classifications might look like: Furniture / Living Room Furniture / Coffee Tables & End Tables / Coffee Tables Décor & Pillows / Decorative Pillows & Blankets / Throw Pillows Furniture / Bedroom Furniture / Dressers & Chests Kitchen & Tabletop / Kitchen Organization / Food Storage & Canisters School Furniture and Supplies / School Furniture / School Chairs & Seating / Stackable Chairs Baby & Kids / Toddler & Kids Bedroom Furniture / Kids Beds Here's the query to generate classifications for: brown coffee table Tags: search, ai, generative-ai, llms, embeddings, doug-turnbull

---

Verify against the original before citing; curated by Astral Feed: https://feed.astralor.com/items/itm_245d0828ba0a8acb9ed6b37b
