[Paper Review] Optimizing Bi-Encoder for Named Entity Recognition via Contrastive Learning
Binder introduces a bi-encoder NER framework that uses contrastive learning to align entity type descriptions with text spans, achieving state-of-the-art results on nested and flat NER across general and biomedical domains, in both supervised and distantly supervised settings.
We present a bi-encoder framework for named entity recognition (NER), which applies contrastive learning to map candidate text spans and entity types into the same vector representation space. Prior work predominantly approaches NER as sequence labeling or span classification. We instead frame NER as a representation learning problem that maximizes the similarity between the vector representations of an entity mention and its type. This makes it easy to handle nested and flat NER alike, and can better leverage noisy self-supervision signals. A major challenge to this bi-encoder formulation for NER lies in separating non-entity spans from entity mentions. Instead of explicitly labeling all non-entity spans as the same class $ exttt{Outside}$ ($ exttt{O}$) as in most prior methods, we introduce a novel dynamic thresholding loss. Experiments show that our method performs well in both supervised and distantly supervised settings, for nested and flat NER alike, establishing new state of the art across standard datasets in the general domain (e.g., ACE2004, ACE2005) and high-value verticals such as biomedicine (e.g., GENIA, NCBI, BC5CDR, JNLPBA). We release the code at github.com/microsoft/binder.
Motivation & Objective
- Motivate NER as a representation-learning problem by aligning entity type descriptions with text spans in a shared vector space.
- Develop a two-encoder (bi-encoder) architecture that decouples entity type encoding from text encoding for faster training/inference.
- Introduce a dynamic thresholding contrastive loss to distinguish entity spans from non-entity spans, including span and position-based objectives.
- Enable effective learning under both supervised and distantly supervised (noisy labels) settings, including nested and flat NER.
- Demonstrate state-of-the-art performance across standard general and biomedical NER datasets.
Proposed method
- Two isomorphic transformers (entity type encoder and text encoder) map types and spans into a shared space.
- Entity type embeddings are derived from type descriptions via a dedicated encoder and a linear projection.
- Text token embeddings come from a separate text encoder; span representations are built from end-to-end token embeddings with a learned span width embedding.
- Two contrastive learning objectives: (i) span-based infoNCE aligning spans with their correct entity type, (ii) position-based objectives aligning start and end tokens with entity-type anchors to capture partial correctness.
- Dynamic thresholding losses are learned jointly with the contrastive losses to separate entity spans from non-entity spans, using a learned threshold derived from the [CLS] token similarity as a signal.
- Inference supports joint position-span and span-only strategies, with span-only found more effective in practice.
Experimental results
Research questions
- RQ1Can a bi-encoder architecture with contrastive learning effectively model NER by aligning entity type descriptions with candidate spans?
- RQ2How can dynamic thresholding be learned to separate entity spans from non-entity spans in a contrastive NER setup?
- RQ3Does a span-centric, decoupled encoder design handle nested and flat NER efficiently and robustly under supervised and distantly supervised settings?
- RQ4What are the empirical gains of Binder over prior NER methods on general-domain and biomedical datasets under both supervision regimes?
- RQ5Is dynamic thresholding superior to global or dev-tuned thresholds for non-entity span discrimination?
Key findings
- Achieves state-of-the-art results on nested NER datasets ACE2004, ACE2005, and GENIA in supervised settings, with absolute F1 improvements of 2.4–2.9 percentage points over prior best methods on ACE datasets and 0.3 percentage points on GENIA.
- Outperforms prior methods on flat NER datasets in BLURB benchmarks (e.g., BC5-chem, BC5-disease, NCBI) with notable gains in F1, and strongest performance on BC5CDR in distantly supervised NER (1.5 percentage points F1 gain).
- Demonstrates robustness to noisy distant supervision and achieves competitive or superior performance without requiring dictionary-based noise suppression techniques.
- Shows significant efficiency advantages, offering faster training and inference compared to several competitive NER frameworks (e.g., MRC-NER, Biaffine-NER, BERT-CRF).
- Ablation studies confirm the importance of: separate entity type and text encoders, span- and position-based contrastive losses, and dynamic thresholding; annotation-guided entity type descriptions yield best performance among descriptions tested.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.