Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Just Pass Twice: Efficient Token Classification with LLMs for Zero-Shot NER

About

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.

Ahmed Ewais, Ahmed Hashish, Amr Ali• 2026

Related benchmarks

TaskDatasetResultRank
Named Entity RecognitionOntoNotes
F1-score43.1
102
Named Entity RecognitionCoNLL 03--
102
Named Entity RecognitionBC5CDR
F1 Score70.4
70
Named Entity RecognitionMIT Movie
Entity F173.4
57
Named Entity RecognitionMIT Restaurant--
50
Named Entity RecognitiontweetNER7
Entity F149.7
49
Named Entity RecognitionCrossNER
AI Score71.9
42
Named Entity RecognitionACE05
F1 Score44.6
41
Named Entity RecognitionWikiAnn
F1 Score64.7
40
Named Entity RecognitionGENIA
F1 Score50.8
40
Showing 10 of 22 rows

Other info

Follow for update