Abstract
Generating fluent natural language responses from structured semantic representations is a critical step in task-oriented conversational systems. While neural approaches like sequence-to-sequence (Seq2Seq) models have become standard, they often struggle with underspecified semantic representations, leading to poor sentence planning and limited control. This paper proposes using tree-structured semantic representations for better discourse-level structuring. We introduce a constrained decoding approach for Seq2Seq models that leverages these representations to improve semantic correctness and demonstrate significant gains in data efficiency and accuracy on both a new weather dataset and the E2E dataset.
The Challenge of Flat Representations
In task-oriented dialogue systems, the goal is to transform structured data into natural language. Traditionally, neural models rely on "flat" Meaning Representations (MRs)—essentially unordered lists of key-value pairs. This approach suffers from two primary issues: a lack of control over discourse structure (e.g., how to relate contrasting facts) and a tendency toward semantic errors like hallucinations or omissions.
As shown in Figure 1, flat MRs do not specify the relationship between attributes. By moving to compositional, tree-structured representations, we provide the model with a "blueprint" for the response, explicitly defining discourse relations like CONTRAST or INFORM to guide the generation process.
Methodology: Tree-Structured Planning and Constrained Decoding
The proposed framework bridges the gap between flexible neural models and the structural rigor of rule-based systems through two main components:
Linearized Trees
Input trees are "linearized" into sequences of tokens that standard Seq2Seq models can process. For example, a structure might look like CONTRAST [ INFORM [name, rating], INFORM [family_friendly] ]. This provides the model with much stronger supervision on alignment, as it learns exactly which words correspond to which part of the hierarchy.
Constrained Decoding
The core innovation is a constrained decoding algorithm used during beam search. The algorithm maintains a state of the input tree, tracking which nodes have been "covered" by the generated text.
- Inclusion Constraints: If the model attempts to generate a token not present in the active branch of the tree, that path is pruned.
- Completion Constraints: The model is prevented from finishing a segment until all required attributes in that branch have been mentioned.
- Ellipsis Handling: The system is sophisticated enough to allow for natural language phenomena like ellipsis, where redundant information (e.g., a city name mentioned previously) can be omitted without violating constraints.
Key Results: Accuracy and Efficiency
The constrained decoding model (S2S-CONSTR) significantly outperformed unconstrained baselines. On the E2E dataset, it achieved a Tree Accuracy of 99.25%, compared to much lower scores for standard models.
A standout finding is the model's data efficiency. As illustrated in Figure 6, the constrained model reaches over 90% accuracy with as few as 2,000 training examples, whereas standard models require tens of thousands of examples to reach similar reliability. Human evaluations further confirmed that tree-based models produce more correct and grammatical responses, with more varied and expressive text than "flat" models.
Conclusion and Limitations
By replacing flat MRs with tree-structured representations and enforcing semantic "safety rails" through constrained decoding, neural language generators become far more reliable and controllable. While this approach increases the complexity of the content planning stage and can occasionally lead to "stuttering" (where the model gets stuck trying to find a valid path), it virtually eliminates hallucinations and allows for high-quality generation even in low-data regimes. Future work will explore "softening" constraints to prevent degenerate outputs and improving automatic tree annotation processes.
Summary updated