Control-DAG: Constrained Decoding for Non-Autoregressive Directed Acyclic T5 using Weighted Finite State Automata

Jinghong Chen, Weizhe Lin, Jingbiao Mei, Bill Byrne

TL;DR

Researchers have developed Control-DAG, a new decoding algorithm that brings the speed of non-autoregressive (NAR) models to complex text generation tasks without sacrificing accuracy. By treating model outputs as Weighted Finite State Automata (WFSA), they can enforce strict rules on vocabulary, entity names, and sentence length, achieving zero "hallucinated" words and perfect entity reproduction while remaining significantly faster than traditional models.

What Problem Does This Paper Address?

Most modern AI text generators are auto-regressive (AR): they predict one word at a time, using each word to help predict the next. While accurate, this is slow. Non-autoregressive (NAR) models try to generate the whole sentence at once, offering massive speedups.

However, NAR models have a "reliability" problem. In tasks like Task-Oriented Dialogue (e.g., booking a flight) or Data-to-Text (e.g., describing a table of stats), they frequently fail in two ways:

  1. Out-of-Vocabulary (OOV) errors: They invent "neologisms" or gibberish words.
  2. Lexical failures: They forget to include crucial information, like a specific phone number or restaurant name provided in the input.

For a production-ready system, the error rate for these must be zero. This paper introduces a way to force NAR models to follow these strict rules.

Methods

The authors introduce DA-T5 (a Directed Acyclic version of the popular T5 model) and a decoding framework called Control-DAG. The process works in five main steps:

  1. DAG Generation: The model produces a Directed Acyclic Graph (DAG) representing all possible word sequences and their probabilities.
  2. WFSA Conversion: This DAG is converted into a Weighted Finite State Automaton (WFSA).
  3. Constraint Intersection: The authors build separate "Constraint FSAs" for Hard Lexical Constraints (HLC), ensuring specific phrases appear, and Vocabulary Constraints (VC), ensuring only valid words are used. By mathematically intersecting the model's WFSA with these constraint FSAs, they filter out every possible sentence that violates the rules.
  4. Length Control: They use a specialized DFS-Viterbi algorithm to ensure the output isn't too short or truncated.
  5. Pruning: To keep things fast, they prune the graph to keep only the most likely transitions and tokens.
The Control-DAG decoding pipeline, showing the transformation from input to constrained output.

Datasets

The model was evaluated on two major benchmarks:

  • Schema Guided Dialogue (SGD): A large-scale dataset for task-oriented dialogue (e.g., "Find me a bus from LA to SF").
  • Data Record To Text (DART): A dataset for open-domain structured data-to-text generation (turning table triplets into natural sentences).

Key Insights and Ideas

  • The Power of Intersection: The most elegant idea here is using formal language theory (FSA intersection) to solve a deep learning problem. Instead of "hoping" the model learns to be accurate, they use automata to guarantee it.
  • Sparsity is a Feature: The authors found that their DA-T5 model naturally learns to produce "sparse" graphs—meaning it's very confident about a few paths. This allows for aggressive pruning, which makes the complex math of WFSA intersection fast enough for real-time use.
  • Bridging the Gap: Previously, NAR models were mostly used for translation. This paper proves they can handle "grounded" generation tasks where specific data points must be preserved perfectly.

Key Results

  • Zero Error Rate: On the SGD dataset, Control-DAG achieved a 0.0% Slot Error Rate (SER) and 0.0% Neologism Rate (NEO). It effectively eliminated the primary weaknesses of NAR models.
  • Quality Gains: It didn't just fix errors; it improved overall text quality. On SGD, it boosted the BLEU score from 18.3 (greedy decoding) to 22.9.
  • Speed: While the constraints add some overhead, Control-DAG remained 1.7x faster than the standard auto-regressive "Constrained Beam Search" used in industry today.
  • Efficiency: It achieved these results using a "small" model architecture (T5-small), showing that clever decoding can make smaller models punch above their weight.
Performance comparison on the SGD dataset, highlighting the zero error rate and speedup of Control-DAG.

Limitations and Future Work

  • Implementation Overhead: The current implementation is in Python. The authors note that moving the DAG-to-WFSA conversion to C++ would likely yield even greater speedups.
  • Pruning Sensitivity: If the pruning is too aggressive, the "perfect" sentence might be accidentally deleted before the constraints are applied. Finding the optimal balance between speed and "coverage" remains a challenge.
  • Scaling: The study focused on the T5-small architecture; testing how this approach scales to much larger models (like Llama or GPT-scale NAR variants) is a logical next step.

Summary updated

BibTeX
@inproceedings{chen2024control,
  author = {Jinghong Chen and Weizhe Lin and Jingbiao Mei and Bill Byrne},
  title = {{Control-DAG: Constrained Decoding for Non-Autoregressive Directed Acyclic T5 using Weighted Finite State Automata}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-short.42},
}
Figure