先幻觉生成,再映射标签
Simon Willison··作者 Simon Willison
关键信息
关键做法是把“生成”和“归一化”分开:先让模型提出新的标签,再通过向量 embeddings 的最近邻匹配把它们对齐到最接近的真实标签。文章还指出,给模型一些标签结构示例,可以提升它生成的分类结果质量。
资讯摘要
2026年8月14日,Simon Willison 发布了一篇题为《Don't classify. Hallucinate!》的链接文章,介绍一种适用于大规模内容库的标签处理方法。他提到自己的博客有 1,856 个标签,数量太多,几乎不可能一次性全部塞进 LLM 的提示词里,然后让模型从中精确挑选匹配项。这个思路来自 Doug Turnbull:不要直接让模型在现有词表里分类,而是先让模型为内容“编造”出看起来合理的标签。
随后,再把这些模型生成的标签与现有标签库做向量 embeddings 比较,通过最近邻方式找出最接近的真实标签。文章还给出了一个产品分类的提示词示例,先展示家具、家居和硬件类目的层级结构,再让模型对“brown coffee table”这样的查询生成分类。Willison 将这个方法描述为一个实用的工作流技巧,而不是重大的研究突破,但它确实为标签体系过大、无法直接枚举的场景提供了一种更可扩展的做法。
资讯正文
别分类。尽情“幻觉”吧!
我博客上还有相当多较早的内容,一直没来得及加标签。我的博客有 1,856 个标签——可能太多了,不适合一次性喂给一个 LLM,然后问它“以下这些标签中,哪些与下面的内容匹配”。
Doug Turnbull 想出了一个巧妙的办法。让模型在不知道现有词汇表的情况下直接输出标签,然后再用向量嵌入在现有语料库中找出与模型“想象出来、可能合适”的那些标签最接近的具体标签!
他给出的示例提示词建议加入标签形状的示例,帮助模型做出更有用的猜测:
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
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
来源与参考
收录于 2026-08-15