Introduction
Sequence labeling (SL) is a fundamental task in Natural Language Processing, encompassing critical applications such as Named Entity Recognition (NER), Part-of-Speech (POS) tagging, and Chinese Word Segmentation (CWS). While modern deep learning models have achieved high performance, they often struggle with the "long-tail" problem: accurately labeling rare words or entities that appear infrequently in the training data. Traditional models rely on internal parameters to memorize patterns, which proves insufficient for these sparse cases.
To address this, researchers have explored retrieval-augmented methods that allow models to consult external datastores at inference time—effectively turning the task into an "open-book exam." However, simple retrieval often introduces noise, as semantically similar words may have different syntactic roles. This paper introduces GNN-SL, a framework that uses Graph Neural Networks (GNNs) to filter and aggregate information from retrieved examples, significantly improving prediction accuracy for challenging cases.
The GNN-SL Framework
The core innovation of GNN-SL lies in its ability to reason over retrieved examples using a heterogeneous graph. The architecture augments a standard sequence labeling backbone (such as BERT or RoBERTa) through a five-stage pipeline:
- Representation Extraction: The input sentence is processed by a vanilla SL model to generate contextualized vector representations for each word.
- $k$NN Search: For each word, the system queries a datastore containing the entire training set to find the $k$ most similar previously seen examples based on vector distance.
- Graph Construction: A heterogeneous graph is built featuring three node types: Input nodes (the current sentence), Neighbor nodes (retrieved words and their context), and Label nodes (the ground-truth tags of the neighbors).
- Message Passing: A Heterogeneous Graph Transformer facilitates information flow between nodes. This allows the model to determine which neighbors are truly relevant by comparing their original training context with the current input context.
- Prediction: The GNN-refined representations are passed to a final softmax layer for classification.
Key Results and Evaluation
The researchers evaluated GNN-SL across a diverse set of benchmarks for NER, CWS, and POS tagging. The model demonstrated consistent improvements over both vanilla baselines and standard $k$NN-augmented models.
Chinese Word Segmentation (CWS)
GNN-SL achieved new State-of-the-Art (SOTA) results across all four major CWS benchmarks: PKU, CITYU, MSR, and AS. As shown in the performance tables below, the addition of the GNN reasoning layer consistently provides a significant boost over the base BERT and ChineseBERT models.
Named Entity Recognition and POS Tagging
In NER tasks, GNN-SL provided substantial F1 score improvements, including a +2.14 boost on English OntoNotes 5.0 and a +3.17 increase on Chinese OntoNotes 4.0 compared to a vanilla BERT-Large baseline. These gains were particularly pronounced for rare entities, validating the model's ability to leverage external evidence effectively.
Key Insights
- Labels as Evidence: Ablation studies revealed that including labels as explicit nodes in the graph is vital. This allows the GNN to directly weigh the evidence for specific tags based on the reliability of the retrieved neighbors.
- Contextual Filtering: Unlike standard $k$NN methods that use simple distance-based weighting, the GNN acts as a sophisticated filter. By analyzing the context of retrieved neighbors, it learns to ignore "noisy" examples that are semantically similar but syntactically irrelevant.
- Robustness to Noise: The graph-based reasoning makes the model significantly more robust to the quality of the retrieval datastore compared to previous non-graph retrieval methods.
Conclusion and Future Work
GNN-SL represents a significant step forward in retrieval-augmented sequence labeling. By combining the memorization capabilities of large language models with the explicit reasoning of GNNs over retrieved examples, it effectively tackles the long-tail challenges of SL. Future research will focus on improving the efficiency of the retrieval process and developing more sophisticated distance metrics to ensure the most relevant neighbors are selected for the graph construction phase.
Summary updated