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

Seq2Edits: Sequence Transduction Using Span-level Edit Operations

Felix Stahlberg, Shankar KumarEMNLP 2020

Introduction

Standard sequence-to-sequence (seq2seq) models, such as those used in machine translation, are designed to generate an entirely new target sequence from an input. However, many natural language processing (NLP) tasks—including Grammatical Error Correction (GEC), text simplification, and text normalization—involve outputs that are nearly identical to the inputs. In these scenarios, using a full Transformer to "re-type" the entire sentence is computationally wasteful, as a large percentage of tokens are simply copied. Furthermore, these "black-box" models rarely provide explanations for specific changes.

Seq2Edits addresses these inefficiencies by framing sequence transduction as an edit-prediction problem rather than a generation problem. By predicting a series of span-level edit operations, the model achieves state-of-the-art results while running significantly faster and providing human-readable explanations for its actions.

Methodology: Span-Level Edit Operations

The core innovation of Seq2Edits is representing a transformation as a sequence of 3-tuple edit operations: $(t_n, p_n, r_n)$.

  • $t_n$ (Tag): A human-readable category for the edit (e.g., SPELL for spelling or SVA for subject-verb agreement).
  • $p_n$ (Span End): The end position in the source sentence for the current edit.
  • $r_n$ (Replacement): The token(s) to insert in place of the source span.
Example of the Seq2Edits representation, showing how a source sentence is transformed into a target through a sequence of tagged edit operations.

Model Architecture

The Seq2Edits architecture utilizes a modified Transformer where the decoder is split horizontally into two distinct parts to handle the multi-faceted prediction task.

  1. Decoder A: Responsible for predicting the tag ($t_n$) and the span end ($p_n$). The span end is predicted using a Pointer Network mechanism, allowing the model to "point" directly to positions in the input sequence.
  2. Decoder B: Takes the latent representations and predictions from Decoder A to predict the replacement tokens ($r_n$).
The Seq2Edits architecture featuring a split decoder for tag, span, and replacement prediction.

By predicting edits auto-regressively from left to right, the model focuses its computational budget only on the parts of the sentence that require modification. If a span is correct, the model predicts a SELF tag, which functions as a bulk-copy operation, bypassing the need for token-by-token generation.

Experimental Setup

The authors evaluated Seq2Edits across five distinct NLP tasks to demonstrate its versatility:

  • Text Normalization: English and Russian Wikipedia data.
  • Sentence Fusion: The DiscoFuse dataset.
  • Sentence Splitting & Rephrasing: The WikiSplit dataset.
  • Text Simplification: The WikiLarge corpus.
  • Grammatical Error Correction (GEC): Training on Lang-8, FCE, and W&I, with evaluations on CoNLL-2014, BEA-2019, and JFLEG.

Results and Discussion

Seq2Edits demonstrates significant improvements in both efficiency and performance:

  • Efficiency and Speed: The model achieved a 5.2x speedup over a standard Transformer baseline for native English GEC. Because inference time scales with the number of edits rather than the target sentence length, the model is exceptionally fast for high-proficiency text where few corrections are needed.
  • Performance: The model set new state-of-the-art (SOTA) marks for Text Normalization (English and Russian) and Sentence Splitting & Rephrasing. In GEC, it reached a GLEU score of 64.3 on the JFLEG test set, the highest reported at the time.
  • Explainability: Unlike traditional seq2seq models, Seq2Edits provides an automatic justification for every change via its predicted tags. This makes it a valuable pedagogical tool, capable of explaining grammatical errors (e.g., "subject-verb agreement") to users.

Conclusion

Seq2Edits offers a more efficient and interpretable approach to sequence transduction for tasks where the source and target are highly similar. While it may be less suited for tasks requiring radical rewrites (like translation between distant languages), its performance on editing-centric tasks is superior to standard generation models. Future work may involve exploring non-linear generation orders and automated induction of error-tag dictionaries for new domains.

Summary updated

BibTeX
@inproceedings{stahlberg2020seq,
  author = {Felix Stahlberg and Shankar Kumar},
  title = {{Seq2Edits: Sequence Transduction Using Span-level Edit Operations}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.418},
}
Figure