AI News AI资讯 7d ago Updated 7d ago 更新于 7天前 43

Don't classify. Hallucinate! 别分类,去幻觉!

Doug Turnbull proposes a "hallucinate first, match later" approach for content tagging when facing large existing tag vocabularies (e.g., 1,856+ tags) Instead of asking the LLM to classify content from a fixed tag list, the model is prompted to generate novel, never-before-seen tag classifications Vector embeddings are then used to find the closest existing tags in the corpus that match the model's hallucinated output The technique uses example prompts showing the desired tag hierarchy shape to 当标签/分类体系规模过大(如1856个标签)时,无法将所有选项一次性输入LLM进行分类 提出"Don't classify. Hallucinate!"策略:让模型自由生成标签,再通过向量嵌入匹配到现有体系 使用向量相似度检索将模型"幻觉"出的标签映射到真实标签库,解决分类空间爆炸问题 通过示例提示词引导模型输出符合格式的标签,提升生成质量

60
Hot 热度
68
Quality 质量
58
Impact 影响力

Analysis 深度分析

TL;DR

  • Doug Turnbull proposes a "hallucinate first, match later" approach for content tagging when facing large existing tag vocabularies (e.g., 1,856+ tags)
  • Instead of asking the LLM to classify content from a fixed tag list, the model is prompted to generate novel, never-before-seen tag classifications
  • Vector embeddings are then used to find the closest existing tags in the corpus that match the model's hallucinated output
  • The technique uses example prompts showing the desired tag hierarchy shape to guide the model toward useful guesses
  • This bypasses token limits and classification overload while still anchoring results to a real, existing taxonomy

Why It Matters

This approach offers a practical workaround for a common problem in AI-powered content organization: when your tag or category vocabulary is too large to fit in context, traditional classification fails. It demonstrates how leveraging LLM creativity combined with embedding-based retrieval can produce better results than forcing the model to choose from an exhaustive list.

Technical Details

  • The core technique involves two stages: (1) LLM generation of novel tag classifications without reference to the existing vocabulary, and (2) vector embedding similarity search against the existing tag corpus to find the closest real matches
  • The prompt includes few-shot examples showing the expected hierarchical format (e.g., "Furniture / Living Room Furniture / Coffee Tables & End Tables / Coffee Tables") to constrain the model's output shape
  • The method is particularly suited for large-scale tagging problems where the full taxonomy exceeds practical context window limits
  • Embedding-based nearest-neighbor matching serves as the bridge between the model's creative output and the grounded, existing classification system

Industry Insight

  • This technique can be generalized beyond blog tagging to any domain requiring classification against large, evolving taxonomies (product catalogs, document management, media libraries)
  • The "hallucinate then retrieve" pattern may reduce classification errors compared to forcing models to choose from overwhelming option lists, as the model can express nuanced understanding before being anchored to discrete categories
  • Practitioners should consider this approach when facing tag vocabularies exceeding a few hundred entries, where traditional prompt-based classification becomes impractical

TL;DR

  • 当标签/分类体系规模过大(如1856个标签)时,无法将所有选项一次性输入LLM进行分类
  • 提出"Don't classify. Hallucinate!"策略:让模型自由生成标签,再通过向量嵌入匹配到现有体系
  • 使用向量相似度检索将模型"幻觉"出的标签映射到真实标签库,解决分类空间爆炸问题
  • 通过示例提示词引导模型输出符合格式的标签,提升生成质量

为什么值得看

该方案巧妙利用LLM的生成能力绕过传统分类的token限制,为大规模标签体系管理提供了新思路。对需要处理海量分类数据的AI应用开发者具有直接参考价值。

技术解析

  • 核心问题:传统LLM分类需要将所有候选标签输入prompt,当标签数量过大时超出上下文窗口限制
  • 解决方案:采用"生成-检索"两阶段架构,先让模型自由生成标签描述,再用向量嵌入在现有标签库中检索最相似项
  • 提示词设计:要求模型创建"novel, never seen before"的分类,并提供格式示例(如层级路径格式:Furniture / Living Room / Coffee Tables)
  • 向量匹配:将模型输出的标签文本转换为向量,与现有标签库的嵌入进行相似度计算,找到最近邻标签

行业启示

  • 大规模分类任务可考虑"生成+检索"范式,突破LLM上下文窗口限制
  • 向量嵌入技术可有效桥接自由生成与结构化标签体系,适用于内容管理、电商分类等场景
  • 提示词设计需明确输出格式示例,引导模型生成更贴合实际需求的标签结构

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

LLM 大模型 Embedding Model 嵌入模型 Research 科学研究