← Latest papers
💬 NLP

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

The paper proposes "Just Pass Twice" (JPT), a method that enables causal large language models to perform efficient, state-of-the-art zero-shot Named Entity Recognition by concatenating input text to allow full bidirectional context without architectural changes, thereby overcoming the limitations of autoregressive generation while achieving over 20x faster inference.

Original authors: Ahmed Ewais, Ahmed Hashish, Amr Ali

Published 2026-08-27
📖 4 min read☕ Coffee break read

Original authors: Ahmed Ewais, Ahmed Hashish, Amr Ali

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Language is a web of context, where the meaning of a single word often depends entirely on the words that come after it. Consider the word "Paris." If you encounter it at the start of a sentence, your brain does not yet know if it refers to the French capital or the musician who released a new album. To resolve this ambiguity, you must read the entire sentence. For decades, computers struggled with this same problem. Traditional tools for finding names of people, places, and organizations in text were built to look backward, analyzing words one by one as they appeared. They could not see the future, so they often guessed wrong when the crucial clue appeared later in the sentence. Meanwhile, the newest, most powerful computer language models could understand vast amounts of human knowledge, but they were built to write text, not to label it. They, too, were forced to look only backward, making them slow and prone to errors when asked to identify specific words in a block of text.

A team of researchers at WitnessAI has found a way to give these powerful models the ability to see the whole picture without changing their underlying design. They call their method "Just Pass Twice." The solution is deceptively simple: instead of feeding a sentence to the computer model just once, they feed it twice, back-to-back. The first time, the model reads the sentence normally. The second time, it reads the exact same sentence again. Because the model is designed to remember everything it has seen so far, the second reading allows every single word to "look back" at the entire first reading. This means that when the model analyzes the word "Paris" during the second pass, it can already see the words "new album" that appeared later in the first pass. This trick effectively gives the model a view of the entire sentence at once, allowing it to make precise decisions about what each word means, all while running at a speed that is more than twenty times faster than the previous best methods.

The researchers tested this approach on a wide variety of tasks where computers must identify specific types of information, such as names of people, organizations, and locations, across different fields like music, politics, and science. They found that by combining this "double reading" technique with clear, written definitions of what each type of entity is, the model became incredibly accurate. In tests, it outperformed the best existing methods by a significant margin, improving its accuracy by nearly eight points on average. This is a substantial leap in performance for a task that has been studied for decades. The model did not just guess better; it understood the context more deeply. For instance, it could distinguish between a "person" and a "politician" or a "country" and an "organization" by relying on the specific definitions provided, rather than just memorizing a list of names.

What makes this discovery particularly striking is how it bypasses the usual trade-offs in artificial intelligence. Typically, making a model more accurate requires making it slower or more complex. Generative models, which create text word by word, are slow because they must wait for each word to be written before moving to the next. Discriminative models, which simply label words, are fast but often lack the deep understanding of the newest, largest models. The "Just Pass Twice" method bridges this gap. It allows a large, knowledge-rich model to perform the fast, precise job of labeling text. The researchers achieved this without altering the model's architecture or requiring it to be retrained from scratch. They simply changed the input, duplicating the text so the model could process it in a single, parallel burst of calculation rather than a slow, sequential one.

The implications of this work extend beyond just finding names in text. It demonstrates that the limitations of modern language models are not always due to a lack of intelligence, but sometimes due to the way they are asked to work. By finding a way to let these models see the full context of a sentence, the researchers have unlocked a new level of efficiency and accuracy. Their method is not a magic trick or a complex algorithmic overhaul; it is a straightforward adjustment that leverages the model's existing capabilities in a new way. The result is a system that is both faster and smarter, capable of handling the nuances of human language with a level of precision that was previously out of reach for this class of tools. This approach suggests that the path forward for artificial intelligence may not always require building bigger or more complex machines, but rather finding simpler, more elegant ways to use the ones we already have.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →