A Low-Cost, Controllable and Interpretable Task-Oriented Chatbot: With Real-World After-Sale Services as Example

Xiangyu Xi, Chenxu Lv, Yuncheng Hua, Wei Ye, Chaobo Sun, Shuaipeng Liu, Fan Yang, Guanglu Wan

Abstract

Building task-oriented dialogue systems (TODS) for real-world applications often involves navigating a trade-off between development cost, system controllability, and performance. Traditional architectures rely on complex "intent and slot" ontologies and opaque neural policies that require extensive manual labeling and are difficult to debug. This paper introduces TaskFlow, a framework that simplifies TODS by representing conversations as a tree-based structure of Dialogue Actions. By utilizing unsupervised clustering for action discovery and a retrieval-based execution engine, TaskFlow reduces the human effort required for deployment by over 50% while ensuring high interpretability. We demonstrate the effectiveness of TaskFlow using real-world after-sale service logs from an electric bike rental platform.

Introduction

Task-oriented chatbots are essential for modern customer service, yet their development remains a significant bottleneck for many enterprises. Developers typically face three primary challenges:

  1. Complex Ontologies: Defining rigid intents and slots for messy, unpredictable human conversations is labor-intensive.
  2. The "Black Box" Policy: Neural-based dialogue policies are difficult to inspect or manually override, making it hard to fix specific logic errors.
  3. Data Scarcity: High-performing models usually require massive amounts of human-labeled data, which is expensive to acquire.

To address these issues, TaskFlow shifts the paradigm from complex NLU/DST modules to a streamlined, tree-based "Dialogue Action" framework. This approach prioritizes ease of engineering and transparency without sacrificing the ability to handle complex service scenarios.

The TaskFlow Framework

Offline Pipeline: Building the Bot

The construction of a TaskFlow bot begins with the unsupervised discovery of dialogue patterns from existing chat logs.

  • Dialogue Action Construction: Rather than manually defining intents, the framework uses ConSERT (a contrastive learning-based BERT model) to generate sentence embeddings for thousands of historical utterances. These embeddings are then grouped using K-means clustering. Each cluster represents a distinct "Dialogue Action" (e.g., "Reporting a broken lock" or "Asking for a refund").
  • Standardization via Retrieval: To map live user input to these discovered actions, TaskFlow employs a two-stage retrieval method: a fast BM25 search followed by a BERT-based reranker. This retrieval-based approach is more flexible than traditional classification; developers can add or remove actions by simply updating the retrieval index, avoiding the need for model retraining.
  • Tree Construction: The system analyzes the sequences of these actions using an N-gram model to identify common conversational flows. By applying beam search to sample high-quality sequences, the framework automatically generates a tree structure that represents the most frequent and successful "happy paths" in a service interaction.

Online Pipeline: Running the Bot

During live operation, the bot functions as an execution engine that follows the paths defined in the TaskFlow tree. For actions that require specific data (such as an order ID or duration), a Bi-LSTM + CRF model is used for parameter extraction. This ensures that the bot can perform necessary API calls (e.g., checking a bike's status) while maintaining the flow of the conversation.

Experimental Setup and Results

The framework was evaluated using 50,000 real-world conversation logs from Meituan’s electric bike rental service. After initial clustering and minor manual refinement, the researchers identified 82 user actions and 93 staff actions across three primary scenarios: Forget to Lock Bike, Mechanical Failure, and Out of Power.

Efficiency and Developer Burden

One of the most significant findings was the reduction in human labor. Building a traditional TODS architecture for these scenarios required approximately 21 person-days. In contrast, the TaskFlow system was deployed in just 9 person-days—a 57% reduction in developer effort. This efficiency stems from the automated discovery of actions and the intuitive nature of the tree-based logic.

Performance and Robustness

In human evaluations, TaskFlow demonstrated high effectiveness:

  • Completion Rate: The bot successfully resolved user issues 75% to 81% of the time across the tested scenarios.
  • Robustness: In the "Forget to Lock Bike" scenario, the system correctly identified and handled user requirements in 96.31% of cases. While some responses were noted as "incomplete" due to the extreme diversity of human speech, the core logic remained sound.

Discussion and Key Insights

TaskFlow’s success highlights several important shifts in chatbot design:

  • Interpretability: Because the bot follows an explicit tree, human operators can see exactly why a specific response was chosen. If a bot makes an error, the developer can simply edit the tree node rather than attempting to fine-tune a neural network.
  • Hot-Swappable Logic: The retrieval-based mapping allows the bot to be updated in real-time. New service policies can be implemented by adding new example utterances to the index.
  • Handling Imbalance: Traditional classifiers often struggle with rare user intents. Retrieval-based methods are naturally more robust to these imbalanced datasets.

Conclusion

TaskFlow provides a pragmatic solution for enterprises needing to deploy controllable and cost-effective chatbots. By replacing complex ontologies with a tree of dialogue actions, the framework bridges the gap between fully automated neural models and manually scripted bots. Future work will focus on expanding TaskFlow to handle multi-scenario transitions and employing more sophisticated sequence modeling to capture even more nuanced dialogue patterns.

Summary updated

BibTeX
@inproceedings{xi2022low,
  author = {Xiangyu Xi and Chenxu Lv and Yuncheng Hua and Wei Ye and Chaobo Sun and Shuaipeng Liu and Fan Yang and Guanglu Wan},
  title = {{A Low-Cost, Controllable and Interpretable Task-Oriented Chatbot: With Real-World After-Sale Services as Example}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2022},
}
Figure