---
title: "别分类，去幻觉！——用向量嵌入匹配LLM生成的标签"
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","内容分类","向量嵌入","标签管理"]
---

# 别分类，去幻觉！——用向量嵌入匹配LLM生成的标签

## AI 点评

> 这篇博客的精髓在于“逆向思维”：与其让模型做分类，不如让它发挥创造力，再用向量检索来收敛。对于维护大型标签体系的内容平台，这个方法尤其实用。我特别欣赏提示词中给出标签形态示例的做法，这大大提高了幻觉标签的可映射性。

## 速览

Simon Willison分享了一个为博客打标签的巧妙方法：与其让LLM从现有标签列表中挑选，不如让模型自由“幻觉”出可能的标签，再用向量嵌入将幻觉标签与现有标签库中最接近的真实标签匹配。该方法解决了标签数量过多无法直接输入LLM的问题，并通过示例提示词帮助模型生成更符合格式的标签。这为内容分类和标签管理提供了新思路。

## 关键点

- 当标签数量过多时，直接让LLM从现有标签中选择不可行，可以让模型先“幻觉”出标签。
- 利用向量嵌入将幻觉标签与现有标签库中的最接近标签进行匹配。
- Doug Turnbull提出的示例提示词包含现有标签的形状示例，帮助模型生成更有用的标签。
- 这种方法适用于任何需要将自由文本映射到可控词汇表的场景。

## 全文

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

---

引用前请核对原文;本文由星际流动整理:https://feed.astralor.com/items/itm_245d0828ba0a8acb9ed6b37b
