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

arXiv cs.CL / 4/8/2026

💬 OpinionIdeas & Deep AnalysisModels & Research

Key Points

  • The paper explains that causal LLMs struggle with zero-shot token classification for NER when disambiguation needs future context due to left-to-right (causal) attention.
  • It proposes “Just Pass Twice (JPT),” which concatenates the input sentence with itself so tokens in the second pass can effectively attend to the full bidirectional context without any model architecture changes.
  • JPT combines these bidirectionally informed representations with definition-guided entity embeddings to improve flexible zero-shot generalization across entity types.
  • On zero-shot NER benchmarks (CrossNER and MIT), the method reports state-of-the-art performance with an average +7.9 F1 improvement over the previous best approach.
  • The approach is also claimed to be over 20x faster than comparable generative decoding-based NER methods, while reducing issues like slow autoregressive generation, hallucinated entities, and formatting errors.

Abstract

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.