NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Transforming Sequence Tagging Into A Seq2Seq Task

Karthik Raman, Iftekhar Naim, Jiecao Chen, Kazuma Hashimoto, Kiran Yalasangi, Krishna Srinivasan

Abstract

Sequence tagging tasks, such as Named Entity Recognition (NER) and slot-filling, are increasingly being addressed using unified generative models like T5. However, the performance of these models is highly sensitive to the data format used for input and target sequences. Traditional formats often suffer from redundancy, "hallucinations" where the model alters the input text, and poor cross-lingual transfer. This paper evaluates 14 different formats and introduces a novel Sentinel-based format that replaces text-copying with unique placeholders. The proposed Sentinel+Tag format significantly improves accuracy, virtually eliminates hallucinations, and enhances multilingual zero-shot transfer by up to 47%.

Introduction

Traditionally, sequence tagging has been the domain of encoder-only models like BERT. As the field shifts toward Seq2Seq architectures, a critical question arises: how should the input sentence and its corresponding tags be represented as strings?

Most existing approaches utilize a TaggedSpans format, where the model is tasked with generating the original sentence with tags inserted (e.g., Add [ Kent James | artist ]...). This method introduces three primary issues:

  1. Redundancy: The model consumes computational resources "re-typing" the input text.
  2. Hallucination: Generative models may inadvertently modify, add, or delete words from the original text during the copying process.
  3. Cross-lingual Friction: Text-copying is inherently language-dependent, hindering zero-shot performance when a model trained in one language is applied to another.

Methods: The Sentinel+Tag Format

To address these challenges, the authors conducted an extensive study of over 1,000 experiments across 14 formats. The standout contribution is the Sentinel+Tag format.

In this approach, the input is modified by inserting unique "sentinel" tokens (e.g., <extra_id_0>, <extra_id_1>) before every word. The model's target output is then simplified to a sequence of these sentinels paired with their associated tags (e.g., <extra_id_0> O <extra_id_1> ARTIST). This "grounds" the tags to specific positions in the input without requiring the model to regenerate the actual words.

Comparison of various Seq2Seq data formats for sequence tagging.

The study also explored "Extractive" variants, which only output labeled spans, and "Simplified" variants that reduce the complexity of BIO notation.

Datasets

The evaluation spanned 7 diverse public benchmarks across 7 languages:

  • Monolingual (English): SNIPS (intent/slot-filling) and three MIT datasets (Movie Trivia, Movie, and Restaurant) for NER.
  • Multilingual: mATIS (travel queries in English, Hindi, Turkish), mTOP (complex semantic parsing in 6 languages), and mTOD (dialogue tasks in English, Spanish, Thai).

Results and Key Insights

The experimental results demonstrate that the choice of format is a primary driver of Seq2Seq performance.

Performance and Efficiency

The Sentinel+Tag format outperformed existing Seq2Seq formats on 6 out of 7 benchmarks. By removing the burden of repeating the input text, the model can dedicate more parameters to the core tagging task. Furthermore, because the target sequences are significantly shorter, this format enables an inference speedup of over 10x.

Performance comparison of mBERT and various Seq2Seq formats across benchmarks.

Eliminating Hallucinations

A major finding was the "Hallucination Trap." Standard formats like TaggedSpans were found to hallucinate in over 50% of examples in certain settings—a critical failure for production systems. The Sentinel format reduces this error rate to near zero (<0.15%), ensuring high data integrity.

Multilingual Zero-Shot Transfer

The most significant gain was observed in multilingual zero-shot settings. Because sentinel tokens are language-agnostic placeholders, they serve as a universal bridge. A model trained on English learns that "the token after <extra_id_1> is an ARTIST," a pattern that transfers far more effectively to languages like Hindi or Thai than specific English word patterns. The Sentinel format achieved a 47% relative increase in accuracy over the standard TaggedSpans approach in zero-shot scenarios.

Limitations and Future Work

While highly effective, the sentinel approach introduces some overhead:

  • Preprocessing: It requires specific steps to insert tokens into the input and map them back to the original text post-inference.
  • Tokenization Sensitivity: In languages without clear word boundaries (e.g., Thai), sentinel placement depends on tokenizer quality, though experiments suggest the method is generally robust.
  • Document Length: For very sparse extractions in long documents, purely extractive methods might offer better efficiency, albeit with potential accuracy trade-offs.

Future research may explore how these formats interact with different decoding strategies or more complex structured prediction tasks beyond simple sequence tagging.

Summary updated

BibTeX
@inproceedings{raman2022transforming,
  author = {Karthik Raman and Iftekhar Naim and Jiecao Chen and Kazuma Hashimoto and Kiran Yalasangi and Krishna Srinivasan},
  title = {{Transforming Sequence Tagging Into A Seq2Seq Task}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.813},
}
Figure