The Whole Truth and Nothing But the Truth: Faithful and Controllable Dialogue Response Generation with Dataflow Transduction and Constrained Decoding

Hao Fang, Anusha Balakrishnan, Harsh Jhamtani, John Bufe, Jean Crawford, Jayant Krishnamurthy, Adam Pauls, Jason Eisner, Jacob Andreas, Dan Klein

TL;DR

This paper introduces a hybrid architecture for dialogue systems that combines the reliability of rule-based generation with the fluency of neural language models. By using "dataflow transduction" to generate a grammar of all possible truthful responses and then using a language model to pick the most natural one, the authors virtually eliminate the "hallucination" problem common in modern AI assistants.

What Problem Does This Paper Address?

Task-oriented dialogue systems (like virtual assistants) face a difficult trilemma: they must be truthful (accurate to the underlying database), fluent (natural-sounding), and controllable (easy for developers to update).

Current approaches usually fall into two camps, both of which fail one of these criteria:

  1. Neural Language Models (LMs): These are incredibly fluent but prone to "hallucinations"—confidently stating incorrect dates, times, or names because those strings were probable in their training data.
  2. Rule-Based Systems: These are perfectly truthful and controllable but are rigid, sound robotic, and become a maintenance nightmare as the system grows.

The authors aim to bridge this gap, ensuring that an agent never tells a user "I've booked a meeting with Sarah" when it actually booked one with "Tara" due to a speech recognition error.

Figure 1: Examples of how unconstrained models can fail by being untruthful (b) or under-informative (c).

Methods

The authors propose a two-stage hybrid pipeline:

  1. Dataflow Transduction: The system represents the agent's actions as a dataflow graph (a program showing how a result was computed). A set of declarative rules (written by developers) "transduces" this graph into a Quasi-synchronous Context-Free Grammar (QCFG). This grammar defines the entire space of every possible truthful response for that specific computation.
  2. Constrained Decoding: Instead of letting a neural LM (in this case, CodeT5) generate text freely, the system uses the QCFG as a constraint. During the beam search process, the LM is only allowed to select tokens that are valid according to the grammar.

Technically, this is achieved by intersecting the LM's probability distribution with the QCFG using an incremental Earley parsing algorithm. The result is a response that is both highly probable (fluent) and guaranteed to be grammatical within the "truthful" space defined by the rules.

Figure 3: The full pipeline from user utterance to dataflow graph, transduction into a QCFG, and finally constrained decoding.

Datasets

  • SMCalFlow: A large-scale dataset of complex calendar queries.
  • SMCalFlow2Text: A new benchmark introduced by the authors, which includes the original data plus 187 transduction rules they authored to cover the dataset's responses.
  • MultiWOZ 2.1: A standard multi-domain dialogue dataset used to demonstrate that the approach generalizes beyond just calendar tasks.

Key Insights and Ideas

  • Separation of Concerns: The rules handle what can be said (content selection and truthfulness), while the LM handles how to say it (surface realization). This allows developers to focus on logic without worrying about every linguistic variation.
  • Data Efficiency: One of the most striking findings is that a model trained on only 3% of the data using this hybrid approach performs as well as a standard neural model trained on 100% of the data. A few hours of expert rule-writing can replace thousands of training examples.
  • Provenance Matters: Because the grammar is tied to the dataflow graph, the system can easily generate responses that explain how it arrived at an answer (its provenance), which builds user trust and makes errors easier to spot.

Key Results

The hybrid system, QCFG-Constrained Decoding, outperformed unconstrained models across the board:

  • Truthfulness: In human evaluations, the hybrid system achieved 91.6% truthfulness, nearly matching the "Gold" human-verified responses (92.3%) and significantly beating the unconstrained LM (82.2%).
  • Hallucination Elimination: Qualitative analysis showed that while the unconstrained LM produced "untruths" in 19% of cases, the constrained system produced zero.
  • Data Efficiency: As shown in the ablation study, the constrained model is far more robust in low-data regimes.
Table 1: Quantitative results showing the hybrid system's superiority in truthfulness and relevance.

Qualitative examples in Table 2 highlight the difference: when asked about a meeting, the unconstrained model might hallucinate a time like "5:00 to 5:30 PM," whereas the constrained model stays strictly to the database's "4:00 to 4:30 PM."

Table 2: Example predictions from QCFG-constrained decoding and with unconstrained decoding. In all the examples shown, outputs from unconstrained decoding are untruthful to the database due to content hallucination even though the model has access to the correct execution results as part of the prompt. We observe that in a few cases, the constrained model prefers truthful but pragmatically unhelpful omissions like such as “Looks like it” (in Example C) compared to a more specific response.

Limitations and Future Work

  • Manual Rule Authoring: While the authors argue that writing 187 rules only took a few hours, it still requires human expertise. Future work could involve automatically inducing these rules from data or domain specifications.
  • Pragmatic Omissions: The system sometimes chooses a response that is truthful but "pragmatically unhelpful" (e.g., saying "Looks like it" instead of giving full details). The authors suggest adding a brevity penalty or weighting the grammar to encourage more descriptive outputs.
  • Language Support: The current study focused on English. Applying this to morphologically rich or free-word-order languages might require extending the template notation.

Summary updated

BibTeX
@inproceedings{fang2023whole,
  author = {Hao Fang and Anusha Balakrishnan and Harsh Jhamtani and John Bufe and Jean Crawford and Jayant Krishnamurthy and Adam Pauls and Jason Eisner and Jacob Andreas and Dan Klein},
  title = {{The Whole Truth and Nothing But the Truth: Faithful and Controllable Dialogue Response Generation with Dataflow Transduction and Constrained Decoding}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  url = {https://openreview.net/forum?id=gXVQ8rrLQN},
}
Figure