Source-linked AI summary

Hybrid Code Networks: practical and efficient end-to-end dialog control with supervised and reinforcement learning

Jason D. Williams, Kavosh Asadi, Geoffrey Zweig

arXiv:1702.03274v2cs.AIcs.CL

TL;DR

Task-oriented dialog systems need both data-efficient end-to-end learning and explicit domain knowledge and constraints. The paper introduces Hybrid Code Networks, which combine an RNN with developer software and action templates. HCNs outperform prior learned or deployed systems across the reported domains while using less data and supporting supervised, reinforcement, or mixed training.

  • Problem

    End-to-end RNN dialog methods require large amounts of data and lack a general mechanism for injecting domain knowledge and constraints.

  • Method

    Hybrid Code Networks combine an RNN with domain-specific software, entity handling, and system action templates while retaining end-to-end learning.

  • Results

    HCNs exceed purely learned models on the bAbI benchmark, outperform commercially deployed rule-based systems in two troubleshooting domains, and support mixed reinforcement and supervised learning in a name-dialing simulation.

  • Takeaways & Limitations

    HCNs provide more developer control and require less training data than existing end-to-end approaches, at the expense of a small amount of developer effort.

  • Takeaways & Limitations

    The Task6 evaluation includes different dialog policies in training and testing, while the goal is to mimic the training policy.

Abstract

from arXiv · show

End-to-end learning of recurrent neural networks (RNNs) is an attractive solution for dialog systems; however, current techniques are data-intensive and require thousands of dialogs to learn simple behaviors. We introduce Hybrid Code Networks (HCNs), which combine an RNN with domain-specific knowledge encoded as software and system action templates. Compared to existing end-to-end approaches, HCNs considerably reduce the amount of training data required, while retaining the key benefit of inferring a latent representation of dialog state. In addition, HCNs can be optimized with supervised learning, reinforcement learning, or a mixture of both. HCNs attain state-of-the-art performance on the bAbI dialog dataset, and outperform two commercially deployed customer-facing dialog systems.

1 Introduction

Hybrid Code Networks address the tension between data-intensive end-to-end dialog learning and the need for explicit domain knowledge and constraints. They combine an RNN with developer-provided software and action templates while supporting supervised and reinforcement learning.

  • Motivation: Pipeline dialog systems require specialized labels for separate language understanding, state tracking, action selection, and language generation modules.Module dependencies also complicate defining dialog state and maintaining history.
  • Motivation: End-to-end RNNs infer latent dialog state without state labels but lack a general mechanism for injecting domain knowledge and constraints.Simple operations such as sorting database results or updating entity dictionaries may otherwise require thousands of dialogs to learn.
  • Contribution: HCNs combine an RNN with developer-expressed domain knowledge through software and system action templates.The approach retains end-to-end trainability while allowing supervised or reinforcement-learning updates.
  • Contribution: HCNs are organized around an operational loop whose programmatic code and trainable components jointly support dialog control.The figure distinguishes developer code from trainable components and shows concatenated vectors entering the RNN.

2 Model description

An HCN combines recurrent state accumulation with developer-controlled entity handling, domain logic, action templates, and an entity extractor. It builds a feature vector, predicts permitted actions, and executes the selected template or API action in a recurrent loop.

  • Components: HCNs contain an RNN, domain-specific software, domain-specific action templates, and an entity extraction module.Both the RNN and developer code maintain state, while templates can represent communicative actions or API calls.
  • Feature construction: User utterances become bag-of-words, embedding, and entity features before developer code grounds and maintains recognized entities.Entity tracking can map mentions such as “Jennifer Jones” to a named entity representation.
  • Action selection: Concatenated features enter an RNN whose hidden state feeds a softmax distribution over system action templates.The hidden state is retained for the next timestep.
  • Action selection: An element-wise action mask assigns zero probability to non-permitted actions before an action is selected.Reinforcement learning samples from the distribution for exploration; otherwise the highest-probability action is chosen.
  • Execution loop: Selected actions pass through entity-output code and branch into API calls or rendered text, with resulting features and actions returned to the next timestep.API outputs can provide additional dialog features.

3 Related work

Dialog-control research divides broadly between modular pipelines and recurrent end-to-end models. HCNs belong to the latter while retaining explicit action selection and developer-controlled handling of domain entities and actions.

  • Pipeline approaches: Pipeline approaches decompose dialog control into language understanding, state tracking, action selection, and language generation.Related work includes feed-forward neural policies trained with supervised learning followed by reinforcement learning.
  • End-to-end approaches: End-to-end RNN approaches map observable dialog history directly to output words and can add API-call actions for task-oriented domains.These systems use architectures including memory, gated-memory, query-reduction, and copy-augmented networks.
  • HCNs: HCNs use an RNN to accumulate dialog state and choose actions while combining learned control with domain-specific procedural mechanisms.Their action outputs are template-based rather than solely generated as token sequences.

4 Supervised learning evaluation I

On the bAbI restaurant tasks, HCNs combine simple domain-specific software, entity and action templates, database handling, and masking with recurrent learning. They attain perfect accuracy on Task5-OOV and outperform prior learned models on Task6, while learning effectively with substantially less data.

  • Setup: The bAbI evaluation covers restaurant-domain Task5-OOV and Task6, with Task5-OOV testing entity values absent from training.Turn accuracy requires an exact action-string match at each turn, while dialog accuracy requires every turn to be correct.
  • Implementation: The implementation uses string-matched entity extraction, software-based entity updates, 16 Task5 and 58 Task6 action templates, sorted database results, and if-then action masks.Task6 additionally uses mined no-result queries and database-state context features.
  • Setup: HCN variants differ by whether utterance embeddings and action masking are included.The experiments compare four combinations of these two components.
  • Results: Task5-OOV reaches perfect accuracy with HCNs, while on Task6 HCNs outperform past learned models even though rules alone perform poorly.Rules can reach perfect accuracy on synthetic Task5, whose data are generated using rules.
  • Caveat: The Task6 data contain systematic training–testing differences because DSTC2 intentionally used different dialog policies across splits.The experiments aim to mimic the training-set policy, limiting how the result should be interpreted.

5 Supervised learning evaluation II

HCNs were evaluated on real customer-support dialogs against a production rule-based system using a comparative measure of initial correct-action sequences. They exceeded the existing system after about 30 dialogs, and synthetic dialogs further improved performance.

  • Data and evaluation: The evaluation used real customer-support transcripts from the “reset password” and “cannot access account” domains.The dialogs came from a customer-facing system and were collected from real users.
  • Data and evaluation: Dialogs were labeled by retaining the most appropriate system actions and truncating each dialog after the first incorrect action.The resulting dataset contained complete and partial dialogs containing only correct system actions.
  • Model configuration: In the evaluated instance, the HCN relied purely on its recurrent neural network because entities and mask logic were unnecessary.No domain-specific software was written for this instance.
  • Comparison: ∆P compares which system produces longer continuous sequences of correct actions from the dialog start; HCNs exceeded the rule-based system after about 30 dialogs.Experiments were repeated five times with shuffled training-set order.
  • Synthetic supervision: Synthetic “sunny-day” dialogs sampled from the rule-based controller were added to labeled data, further improving HCN performance.The sampled sets contained 75 dialogs for “Forgot password” and 325 for “Can’t access account”.

6 Reinforcement learning illustration

The paper illustrates reinforcement-learning optimization of an HCN with policy gradients, while allowing supervised updates to preserve labeled behavior. In simulation, a handful of supervised dialogs dramatically accelerated learning, and supervised dialogs could be interleaved during reinforcement learning.

  • Optimization: Policy-gradient reinforcement learning updates the dialog policy using trajectory returns, with better dialogs increasing the likelihood of their selected actions.The baseline estimates average return to affect convergence variance without changing long-term bias.
  • Optimization: Supervised and reinforcement learning can update the same network, but reinforcement learning need not agree with the supervised training set.After reinforcement updates, supervised steps restore reproduction of the training set when needed.
  • Experimental setup: The simulated task rewarded successful completion with 1 and failure with 0, using discount 0.95 so shorter successful dialogs received higher returns.For successful dialogs, G = 0.95^T−1, where T is the number of system turns.
  • Results: Pre-training with 1, 2, 5, or 10 labeled dialogs dramatically improved reinforcement-learning speed compared with reinforcement learning alone.The comparison included a randomly initialized LSTM and supervised initialization from sampled training dialogs.
  • Results: Adding supervised dialogs before reinforcement-learning dialogs 0, 100, 200, through 900 demonstrated that supervised and reinforcement learning can be interleaved.This supports adding developer-corrected training examples while reinforcement learning is in progress.

7 Conclusion

The conclusion presents Hybrid Code Networks as an end-to-end dialog approach that combines learned control with developer-specified procedural knowledge and constraints. Across several domains, HCNs used less training data or achieved stronger performance than the compared systems, while supporting supervised and reinforcement learning.

  • HCNs separate procedural knowledge and constraints into software while learning dialog control.This design provides more developer control than existing end-to-end approaches, with a small amount of developer effort.
  • HCNs exceeded purely learned models on a public restaurant-domain benchmark and outperformed a commercially deployed rule-based system in two troubleshooting domains.The conclusion reports results across three dialog domains.
  • HCNs can be optimized with a mixture of reinforcement and supervised learning in a simulated name-dialing domain.
  • Future work includes integrating entity extraction into the neural network, richer utterance embeddings, text generation, speech-recognition input, and live deployment.The authors also identify applications beyond dialog where domain constraints matter for safety or limited data.

A.1 Model implementation details

The implementation uses a Keras/Theano recurrent model whose observation input excludes the previous action and action mask, alongside domain-specific HCN implementation details and example dialogs. The appendix also documents model dimensions and a system turn that supplied venue information without an API call.

  • The RNN was specified in Keras 0.3.3 with Theano 0.8.0.dev0 backend, using an observation input that excludes the previous action and action mask.
  • The model code defines an input for available actions, recurrent and dense layers, a softmax action output, action normalization, and categorical cross-entropy loss.The supplied code fragments expose these implementation components but do not provide a complete listing.
  • The appendix provides example dialogs for the five HCN systems and notes that entity tags were removed for readability.
  • Table 3 reports the dimensions of the five HCNs described in the paper.
  • In one bAbI Task6 system turn, venue information was provided without first making an API call.

A.4 Task5 and Task6 context features

The appendix identifies the context features used for the Task5 and Task6 experiments as binary features conveying entity and database state.

  • Task5 and Task6 use context features to convey entity state.
  • Task5 and Task6 use context features to convey database state.
  • The listed context features are binary.

A.5 Forgot password example dialog

The appendix illustrates customer-support and name-dialing interactions through example dialogs. These examples include shortened system actions and show multi-turn troubleshooting, clarification, alternative contact handling, and password recovery.

  • Some system actions in the examples are shortened for space.
  • The forgot-password example directs the user to a reset URL and asks whether the guidance was helpful.
  • The email sign-in example chains checks for caps lock, email spelling, server status, password reset, and security-code entry.
  • The name-dialing examples clarify ambiguous names and distinguish requested home contacts from available work numbers.
  • Table 4 describes binary context features used to convey entity and database state in Section 4.
Loading 1702.03274v2…