只需两次通过:利用LLM进行零样本命名实体识别的高效标记分类
Just Pass Twice: Efficient Token Classification with LLMs for Zero-Shot NER
AI总结:
本文提出JPT方法,通过两次输入拼接实现双向上下文的标记分类,提升零样本NER性能,比现有方法快20倍,F1得分提升7.9%。
摘要:
大型语言模型编码了大量世界知识,对零样本命名实体识别(NER)有价值。然而,其因果注意力机制(仅允许token关注前文上下文)阻碍了需要未来上下文进行歧义消解的标记分类。现有方法通过生成式使用LLM,提示其列出实体或生成结构化输出,但存在解码慢、生成虚假实体和格式错误等问题。我们提出Just Pass Twice(JPT),一种简单有效的技术,使因果LLM能够利用完整双向上下文进行判别性标记分类。我们的关键见解是将输入拼接自身,使第二轮中每个token能关注完整句子,无需架构修改。我们结合这些表示与定义引导的实体嵌入,实现灵活的零样本泛化。我们的方法在零样本NER基准上取得最佳成果,平均在CrossNER和MIT基准上比先前最佳方法提升7.9% F1,速度比同类生成方法快20倍以上。
英文摘要:
Large language models encode extensive world knowledge valuable for zero-shot named entity recognition. However, their causal attention mechanism, where tokens attend only to preceding context, prevents effective token classification when disambiguation requires future context. Existing approaches use LLMs generatively, prompting them to list entities or produce structured outputs, but suffer from slow autoregressive decoding, hallucinated entities, and formatting errors. We propose Just Pass Twice (JPT), a simple yet effective method that enables causal LLMs to perform discriminative token classification with full bidirectional context. Our key insight is that concatenating the input to itself lets each token in the second pass attend to the complete sentence, requiring no architectural modifications. We combine these representations with definition-guided entity embeddings for flexible zero-shot generalization. Our approach achieves state-of-the-art results on zero-shot NER benchmarks, surpassing the previous best method by +7.9 F1 on average across CrossNER and MIT benchmarks, being over 20x faster than comparable generative methods. Interactive demo and access to the model are available at https://witness-ai-jpt-ner.hf.space/
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。