An Enhanced Span-based Decomposition Method for Few-Shot Sequence Labeling

Peiyi Wang, Runxin Xu, Tianyu Liu, Qingyu Zhou, Yunbo Cao, Baobao Chang, Zhifang Sui

Introduction

Sequence labeling tasks, such as Named Entity Recognition (NER) and Slot Filling (SF), are foundational to natural language processing but typically require extensive human-annotated data. Few-Shot Sequence Labeling (FSSL) addresses this challenge by training models to generalize to new domains with only a handful of examples (e.g., 1-5 examples per class).

Overview of the few-shot sequence labeling task where a model identifies entities in a query sentence based on limited support examples.

Traditional FSSL methods often suffer from two major flaws:

  1. Token-level Fragmentation: Assigning labels to individual tokens ignores the holistic nature of entities (e.g., "Albert Einstein"). If a model labels "Albert" but misses "Einstein," the entity's integrity is lost.
  2. The CRF Bottleneck: Conditional Random Fields (CRFs) struggle to learn transition rules for new domains from sparse data, leading to poor performance in few-shot settings.

The ESD Framework

To overcome these issues, this paper introduces Enhanced Span-based Decomposition (ESD). ESD reimagines sequence labeling as a span-level matching problem rather than token-level classification. By treating entities as holistic units, the model preserves entity boundaries and avoids the limitations of traditional decoding.

The complete architecture of the Enhanced Span-based Decomposition (ESD) framework, detailing the flow from span initialization to final refining.

Methodology

The ESD framework decomposes the labeling process into several specialized modules:

  • Span Initialization: The model uses a sentence encoder (BERT) to represent every possible text span (up to a fixed length, typically 8) by concatenating the embeddings of its start and end tokens.
  • Span Enhancing Module: This module utilizes Intra-Span Attention (ISA) to incorporate sentence context and Cross-Span Attention (CSA) to allow query spans to interact with support set examples before classification.
  • Span Prototypical Module: In few-shot learning, queries are compared to class "prototypes." ESD uniquely handles the "O" (Outside) class by partitioning it into three sub-types based on proximity to entities, preventing this diverse class from becoming a noisy average.
  • Span Matching and Refining: The model calculates similarity between query spans and class prototypes. To resolve overlaps (e.g., deciding between "Albert" and "Albert Einstein"), a Beam Soft-NMS algorithm—borrowed from computer vision—is used during inference to find the most likely set of non-conflicting or nested spans.

Experimental Results

ESD was evaluated on major benchmarks including FewNERD and SNIPS, setting new state-of-the-art records:

  • FewNERD: On the "INTER" 1~2 shot task, ESD achieved an F1 score of 59.29, a massive jump over the previous ProtoBERT baseline of 38.83.
  • SNIPS: ESD outperformed the previous best model by 4.58 F1 points in the 5-shot setting.
  • Robustness and Efficiency: ESD remained stable in "Nested" entity scenarios where other models failed. Additionally, it is nearly 3x faster during inference than some token-level competitors because it avoids iterative decoding steps.

Conclusion

By shifting from token-level classification to span-based decomposition, ESD provides a robust and efficient framework for few-shot sequence labeling. Its ability to handle complex linguistic structures like nested entities while maintaining high performance makes it a significant advancement for low-resource NLP tasks.

Summary updated

BibTeX
@inproceedings{wang2022enhanced,
  author = {Peiyi Wang and Runxin Xu and Tianyu Liu and Qingyu Zhou and Yunbo Cao and Baobao Chang and Zhifang Sui},
  title = {{An Enhanced Span-based Decomposition Method for Few-Shot Sequence Labeling}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.369},
}
Figure