Dual Inference for Improving Language Understanding and Generation

Shang-Yu Su, Yung-Sung Chuang, Yun-Nung Chen

Introduction

In conversational AI, Natural Language Understanding (NLU) and Natural Language Generation (NLG) are fundamentally linked. NLU maps natural language to semantic labels (e.g., "book a flight" $\rightarrow$ intent: flight), while NLG performs the inverse mapping. While joint training (dual learning) has been shown to improve performance, the rise of massive pre-trained models like BERT and GPT makes retraining from scratch computationally prohibitive.

This paper introduces a "plug-and-play" Dual Inference Framework that exploits the structural duality of NLU and NLG during the inference stage. By using a "backward" model to validate a "forward" model's predictions—essentially checking if a generated output can reconstruct its original input—the researchers achieve consistent performance gains across multiple benchmarks without requiring model retraining.

The Dual Inference Framework

The core logic of the proposed framework is Bayesian: a high-quality output in one direction should be easily reversible in the other. For instance, if an NLG model generates a sentence from a semantic frame, a "good" sentence is one that an NLU model can accurately translate back into that same frame.

Instead of relying solely on the standard conditional probability $P(y|x)$, the framework introduces a weighted objective function that incorporates:

  1. Forward Probability: The direct prediction from the primary model.
  2. Backward Probability: The likelihood of reconstructing the input from the output.
  3. Marginal Distributions: Estimates of the general likelihood of the input $P(x)$ and output $P(y)$.

In practice, the system uses beam search to generate a set of candidate hypotheses and then applies this dual objective to re-rank them, selecting the candidate that best satisfies the bidirectional consistency.

Estimating Semantic Marginals

A significant challenge in applying Bayes' Theorem to semantic frames is estimating the marginal probability $P(x)$. Unlike natural language, semantic frames (intents and slots) do not have a strict sequential order. To address this, the authors developed a non-autoregressive approach using a Masked Transformer.

The Masked Transformer architecture used to estimate the density of semantic frames by predicting masked slots.

As shown in Figure 1, this model estimates the "density" of a semantic frame by masking and predicting various slots within the frame, similar to the training objective of BERT. This allows for effective marginal estimation without imposing an arbitrary sequence on the semantic data.

Experimental Results

The researchers evaluated the framework on three major benchmarks: ATIS (flight reservations), SNIPS (voice assistant domains), and E2E NLG (restaurant descriptions).

Performance comparison across ATIS, SNIPS, and E2E NLG datasets, showing consistent gains with Dual Inference (DualInf).

As detailed in Figure 3, the dual inference technique consistently outperformed baseline models:

  • NLU Performance: On the ATIS dataset, the framework improved intent prediction accuracy from 84.10% to 85.57% and enhanced F1 scores for slot filling.
  • NLG Performance: On the E2E NLG dataset, the method boosted the BLEU score from 24.98 to 25.35, with corresponding improvements in ROUGE metrics.
  • Robustness: The gains were observed regardless of the underlying training method (iterative baseline, dual supervised learning, or joint baseline), demonstrating the framework's flexibility as a post-hoc enhancement.

Discussion and Future Work

The primary advantage of Dual Inference is its versatility; it acts as a "sanity check" that can be applied to nearly any existing architecture. However, this comes with a trade-off in inference latency, as generating and re-ranking multiple candidates increases computational cost.

Furthermore, the framework's success depends on the quality of the marginal distribution estimates. While the Masked Transformer performs well for semantic frames, future work involves scaling this approach to state-of-the-art Large Language Models (LLMs) and optimizing the re-ranking process for real-time applications.

Summary updated

BibTeX
@inproceedings{su2020dual,
  author = {Shang-Yu Su and Yung-Sung Chuang and Yun-Nung Chen},
  title = {{Dual Inference for Improving Language Understanding and Generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.findings-emnlp.443},
}
Figure