用大模型内部表示实现零样本实体检索,无需预设类型
NER Retriever: Zero-Shot Named Entity Retrieval with Type-Aware Embeddings
- 利用大模型中间层值向量构建类型感知的实体嵌入
- 在三个基准上超越词法与密集文本检索基线
- 适合需要灵活、无模式实体搜索的应用场景
我们提出 NER Retriever,一种用于即兴命名实体检索的零样本检索框架,该任务属于命名实体识别的变体,其中目标类型事先未知,用户通过自定义类型描述来检索提及该类型实体的文档。不同于依赖固定模式或微调模型的方法,本方法基于大语言模型(LLM)的内部表示,将实体提及和用户提供的开放式类型描述映射到共享语义空间。我们发现,特别是中间层Transformer块中的值向量,比常用的顶层嵌入更能有效编码细粒度类型信息。为优化这些表示,我们训练了一个轻量级对比投影网络,对齐类型相关的实体并分离无关类型。最终生成的实体嵌入紧凑、类型感知,非常适合最近邻搜索。在三个基准上的评估显示,NER Retriever 显著优于词法和密集句子级检索基线。研究结果为LLM内表示的选择提供了实证支持,并展示了可扩展、无模式实体检索的实际解决方案。代码库已公开于 https://github.com/ShacharOr100/ner_retriever。
原文摘要 · Abstract (English)
We present NER Retriever, a zero-shot retrieval framework for ad-hoc Named Entity Retrieval, a variant of Named Entity Recognition (NER), where the types of interest are not provided in advance, and a user-defined type description is used to retrieve documents mentioning entities of that type. Instead of relying on fixed schemas or fine-tuned models, our method builds on internal representations of large language models (LLMs) to embed both entity mentions and user-provided open-ended type descriptions into a shared semantic space. We show that internal representations, specifically the value vectors from mid-layer transformer blocks, encode fine-grained type information more effectively than commonly used top-layer embeddings. To refine these representations, we train a lightweight contrastive projection network that aligns type-compatible entities while separating unrelated types. The resulting entity embeddings are compact, type-aware, and well-suited for nearest-neighbor search. Evaluated on three benchmarks, NER Retriever significantly outperforms both lexical and dense sentence-level retrieval baselines. Our findings provide empirical support for representation selection within LLMs and demonstrate a practical solution for scalable, schema-free entity retrieval. The NER Retriever Codebase is publicly available at https://github.com/ShacharOr100/ner_retriever
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。