Decoding Text Spans for Efficient and Accurate Named-Entity Recognition

Andrea Maracani, Savas Özkan, Junyi Zhu, Sinan Mutlu, Mete Ozay

TL;DR

The paper introduces SpanDec and SF-SpanDec, novel frameworks that dramatically accelerate span-based Named Entity Recognition (NER) for production deployments. By decoupling span processing into a lightweight final decoder and filtering out unlikely entity candidates early, the authors achieve up to a 2.7× throughput boost and an 8.2× reduction in computational cost (GFLOPs) while matching state-of-the-art accuracy.

What Problem Does This Paper Address?

Named Entity Recognition (NER) is foundational for industrial pipelines like clinical coding and document parsing. In production, models must be incredibly fast (low latency, high throughput) and cheap to run.

Standard token classification models (which label text word-by-word) are fast but struggle with ambiguous or nested entity boundaries. To fix this, state-of-the-art models use span-based classification, explicitly evaluating sequences of words. However, popular span-based methods like PL-Marker insert special "marker tokens" into the text and pass them through every single layer of a deep Transformer encoder. Because the number of candidate spans scales quadratically ($O(L^2)$ with text length), this creates a massive computational bottleneck, making span-based NER too expensive for high-volume serving or on-device apps.

Industrial view of NER paradigms and their trade-offs

Methods

The authors propose two complementary optimizations to eliminate this bottleneck:

  1. Decoupled Span Processing (SpanDec): Instead of dragging span markers through the entire encoder, SpanDec encodes the raw text tokens exactly once. Span-marker interactions are deferred entirely to a lightweight, single-layer span decoder at the very end of the network. To keep the overall parameter count identical to the baseline, the authors simply swap out the final encoder layer for this decoder layer.
  2. Early Span Filtering (SF-SpanDec): To further reduce work for the decoder, the authors introduce a lightweight binary classifier right after the encoder. This classifier quickly flags tokens that are highly unlikely to be part of any entity (the "O" or Outside class). Spans containing these tokens are aggressively pruned, reducing the candidate pool by roughly 85% before the decoder even touches them.
Diagram of Model Flows comparing standard approaches to SpanDec and SF-SpanDec

Datasets

The frameworks were evaluated across four diverse, widely recognized NER benchmarks:

  • CoNLL++: A corrected version of the classic general-domain CoNLL03 dataset.
  • CrossNER: A challenging cross-domain dataset spanning five distinct domains.
  • OntoNotes5: A large-scale, multi-genre English dataset.
  • BC5CDR: A biomedical dataset focusing on chemical and disease entities.
Overview of the evaluation datasets

Key Insights and Ideas

  • The Final Layer is Enough: The core "aha" moment is that span representations do not need deep, multi-layer contextualization alongside text tokens. Computing their interactions at the final stage via cross-attention is sufficient to capture complex boundary physics.
  • Pruning is Safe and Highly Effective: A simple token-level check can safely eliminate the vast majority of candidate spans without hurting the model's final F1 score. This turns a heavy quadratic problem into a much sparser, lighter workload.

Key Results

  • Better Trade-offs: As shown in the latency vs. F1 chart, SpanDec variants consistently deliver a superior Pareto frontier compared to standard token classification and PL-Marker.
  • Massive Speedups: Using a RoBERTa-Large backbone, SpanDec matches PL-Marker's accuracy while cutting GFLOPs from 222.7 down to 33.9 (a 6.5× reduction) and increasing throughput significantly.
  • Token-Classification Efficiency, Span-Based Accuracy: With the MiniLM backbone, the filtered variant (SF-SpanDec) achieves nearly the same computational footprint (1.92 GFLOPs) as naive token classification (1.90 GFLOPs) but retains a +1.1% absolute advantage in average F1 score.
F1 scores vs. Latency trade-off across different model sizes
Detailed performance and efficiency metrics across benchmarks

Limitations and Future Work

While SF-SpanDec successfully matches the theoretical computational cost (GFLOPs) of naive token classification, its actual runtime throughput sits at about 92-93% of token classification. The authors note that their current software implementation introduces minor overhead during the dynamic span-filtering step. They point to software engineering optimizations and hardware-specific implementations as promising directions for future work to fully realize these theoretical speedups in production. Additionally, hyperparameters were not exhaustively tuned, leaving room for potential accuracy gains.

Summary updated

BibTeX
@inproceedings{maracani2026decoding,
  author = {Andrea Maracani and Savas Özkan and Junyi Zhu and Sinan Mutlu and Mete Ozay},
  title = {{Decoding Text Spans for Efficient and Accurate Named-Entity Recognition}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-industry.71},
}
Figure