In the world of Natural Language Processing (NLP), "structured prediction" is the heavy lifting. It’s the process of turning messy, human sentences into organized data—identifying people and places, mapping how they relate to each other, or tracking the state of a complex conversation. Traditionally, this required a "Swiss Army Knife" of specialized models: one architecture for named entity recognition (NER), another for relation extraction, and yet another for coreference resolution.
A 2021 ICLR paper titled "Structured Prediction as Translation between Augmented Natural Languages" proposes a radical simplification: What if we treated every structured prediction task as a simple translation problem?
TL;DR
The authors introduce TANL (Translation between Augmented Natural Languages), a framework that frames diverse structured prediction tasks as text-to-text translation using a single, standard T5 model. By outputting sentences "augmented" with brackets and labels (e.g., [ Tolkien | person ]), the model leverages its pre-trained knowledge of language and label semantics to achieve state-of-the-art results across multiple benchmarks, particularly in low-resource settings.
What Problem Does This Paper Address?
Most existing approaches to structured prediction rely on task-specific discriminative classifiers. If you want to find "People" and "Locations," you build a model with a specific output layer that predicts class numbers (e.g., Class 1 = Person, Class 2 = Location).
This approach has two major flaws:
- Ignoring Label Semantics: To a traditional classifier, the label "Person" is just an arbitrary number. It doesn't "know" that a person is likely to be the author of a book.
- Architectural Rigidity: Because the output layers are hard-coded for specific tasks, it’s difficult to train one model to do everything at once or to transfer knowledge from one task to another without changing the model's "plumbing."
Methods
The authors' solution is elegantly simple: TANL. They use a standard T5 (Text-to-Text Transfer Transformer) model and define an "augmented natural language" for the output.
- The Augmented Format: Instead of predicting a graph directly, the model is trained to output the original sentence with structural information embedded in it. For example:
- Input: "Tolkien wrote The Hobbit."
- Output:
[ Tolkien | person | author of = The Hobbit ] wrote [ The Hobbit | book ].
- Output:
- Unified Architecture: Because the input and output are always just strings of text, the exact same model architecture and hyperparameters can be used for NER, relation extraction, coreference resolution, and more.
- Multi-Task Learning: You can prefix the input with a task name (e.g.,
srl: ...) and train a single model to handle every task simultaneously. - Robust Decoding: Since generative models can occasionally "hallucinate" or make typos, the authors use a Needleman-Wunsch alignment algorithm (a technique from bioinformatics) to match the model's output back to the original input tokens, ensuring the extracted data is grounded in the source text.
Datasets
The authors evaluated TANL on a massive suite of benchmarks:
- Joint Entity & Relation Extraction: CoNLL04, ADE, NYT, ACE2005.
- Named Entity Recognition (NER): CoNLL03, OntoNotes, GENIA, ACE2005.
- Relation Classification: FewRel, TACRED.
- Semantic Role Labeling (SRL): CoNLL-2005, CoNLL-2012.
- Coreference Resolution: CoNLL-2012.
- Event Extraction: ACE2005.
- Dialogue State Tracking (DST): MultiWOZ 2.1.
Key Insights and Ideas
- Labels are Words, Too: By using natural words like "person" or "location" in the output string, the model can tap into the latent knowledge it gained during pre-training. It "understands" the categories it is predicting, which is a massive advantage over models that treat labels as abstract integers.
- Context is King: Repeating the input sentence in the output (rather than just listing extracted entities) provides the model with better context and a "natural" flow, which the authors found significantly improves performance.
- The Power of Generative Models: This paper challenges the assumption that generative models are too "unconstrained" for structured tasks. With the right formatting and alignment, they can be more robust than specialized discriminators.
Key Results
TANL didn't just work; it dominated.
- New State-of-the-Art (SOTA): It achieved SOTA results on joint entity and relation extraction (CoNLL04, ADE, NYT, ACE2005), relation classification (FewRel, TACRED), and SRL.
- Few-Shot Champion: In low-resource regimes (using only ~1% of training data), TANL outperformed the previous best model (SpERT) by a wide margin. This is largely thanks to its ability to leverage label semantics.
- One Model to Rule Them All: A single "multi-task" model trained on all datasets performed nearly as well as—and sometimes better than—models trained on individual tasks.
Limitations and Future Work
- Inference Speed: Because T5 is an auto-regressive model (it generates text one token at a time), it is significantly slower than discriminative models that can process a whole sentence in one pass.
- Long-Range Dependencies: For tasks like coreference resolution in long documents, the model is limited by the transformer's maximum sequence length. The authors had to chunk long documents, which can lead to missed connections between distant mentions.
- Hallucination Risk: While the alignment algorithm mitigates this, the model can still technically generate invalid formats or incorrect words, a problem traditional classifiers don't have.
In summary, TANL proves that in NLP, sometimes the best way to handle complexity is to turn it into a conversation. By teaching models to "speak" structure, we can build more flexible, knowledgeable, and unified AI systems.
Summary updated