HyLECA

Hybrid Long-term Engaging Controlled Conversational Agents Development Framework

Summary

Hybrid Long-term Engaging Controlled Conversational Agents (HyLECA) is an open-source framework designed for the development of long-term engaging controlled conversational agents. HyLECA’s dialogue manager employs a hybrid architecture, combining rule-based methods for controlled dialogue flows with retrieval-based and generation-based approaches to enhance the utterance variability and flexibility. The motivation behind HyLECA lies in enhancing user engagement and enjoyment in task-oriented chatbots by leveraging the natural language generation capabilities of open-domain large language models within the confines of predetermined dialogue flows.

The software is publicly distributed on HyLECA GitHub repository.

System Architecture

The HyLECA system is fundamentally designed to follow predetermined dialogue flows by implementing a rule-based dialogue management approach. It incorporates all standard components and features typically found in chatbot frameworks, such as a dialogue manager, natural language understanding (NLU) module, response generation, action handling, and slot filling. Additionally, HyLECA records user data and conversation history, enabling the creation of chatbots with long-term interaction capabilities. At its core, the HyLECA dialogue manager serves as the central hub, loading relevant dialogue flows and user data for use as inputs throughout the system. Consequently, the entire system considers specific user information (e.g. name, age) and past conversations during its processing (shown as “User DB” in the figure below).

Schematics of the dialogue management system. The user communicates with the User Interface. Arrows between the system modules indicate the following order of execution: Dialogue Manager, Dialogue Flows, Natural Language Understanding, User Database, Retrieval Model, Natural Language Generation Models, and Response Ranker. Finally, the Response Ranker returns to the User Interface which communicates back to the User.
Figure 1: An overview of the system architecture, showing the data flow in the system (Basar et al., 2023).

Response Generation

The response generation consists of two main components: a retrieval module and a generation module. At each turn, candidate pre-scripted human-authored chatbot utterances are chosen according to the corresponding dialogue state and filtered based on the fulfillment of their predefined conditions. These candidate utterances are then processed by the built-in retrieval model for ranking, which is determined by their similarity to the conversation context. Simultaneously, each generative language model within the generation module produces response candidates. The generated and retrieved candidates are given to the response ranker within the response selection module, which returns the highest ranking candidate as the selected utterance.

Figure 2: An overview of the response selection pipeline within HyLECA’s hybrid architecture (Basar et al., 2022).

Processing a Dialogue State

Initially, when a new dialogue state is triggered, the dialogue manager selects an initiator chatbot utterance from a predefined set, as visualized in the figure below. The dialogue manager is designed to maintain the user in the current dialogue state until at least one of the state’s ending conditions is satisfied. During this time, the dialogue manager may need to repeat the dialogue state. Until then, the state conditions and response utterances can be configured to request the user to rephrase their utterance in the event that the NLU component fails to detect the required information. Additionally, the complexity of the state conditions can be adjusted to generate various scenarios. For example, a condition could be set to obtain a certain number of valid responses to a question. In such a scenario, the dialogue manager can continue to provide chatbot responses to the user input and request further elaboration or alternative ideas.

Upon meeting the termination conditions of the dialogue state, the dialogue manager initiates a counter to keep track of the number of exchanges between the generative language models (mentioned as NLG in the figure below) and the user. The dialogue state is then terminated, and the next state is triggered once the maximum exchange limit is reached. Currently, the dialogue manager is provided with a constant maximum exchange limit. In HyLECA, there is a sequential connection between the dialogue states, allowing for explicit definition of the subsequent state to be initiated after the current state concludes. The state triggers can also incorporate conditions based on the information identified by the NLU module during the conversation, enabling the call of different states.

Flowchart displaying user's interaction with the dialogue manager within a single dialogue state. The first arrow, represents triggering a new dialogue state, is pointing to a box of initiator chatbot utterances with the examples "What would be good about not smoking?" and  "What are the benefits of quitting smoking?". Second arrow, represents a selected pre-scripted utterance, is pointing to the user. Third arrow, represents the user's input, is pointing towards a box of response chatbot utterances with the examples "Yes, smoking is bad for your health." and "It concerns you that smoking may impact your appearance.". Fourth arrow, represents a chatbot response which could be selected from pre-scripted or generated utterances, is pointing back to the user. Third and fourth arrows together indicates iterative action between the chatbot and the user within the corresponding dialogue state. Finally, a fifth arrow, represents triggering another dialogue state, is pointing outwards.
Figure 3: A visualization of the chatbot utterance handling within a dialogue state (Basar et al., 2023). NLG stands for natural language generation, which includes generative language models such as GPT. Pre-scripted utterances are written by chatbot designers as responses to expected user inputs.

Publications

For more information, read the relevant publications below.

Basar, E., Sun, X., Hendrickx, I., de Wit, J., Bosse, T., de Bruijn, G., Bosch, J., & Krahmer, E. (2025). How Well Can Large Language Models Reflect? A Human Evaluation of LLM-generated Reflections for Motivational Interviewing Dialogues. Manuscript under revision.

Basar, E., Hendrickx, I., Krahmer, E., de Bruijn, G., & Bosse, T. (2024).  To What Extent Are Large Language Models Capable of Generating Substantial Reflections for Motivational Interviewing Counseling Chatbots? A Human Evaluation. In Proceedings of the Workshop on Human-Centered Large Language Modeling. Association for Computational Linguistics.

Basar, E., Balaji, D., He, L., Hendrickx, I., Krahmer, E., de Bruijn, G., & Bosse, T. (2023). HyLECA: A Framework for Developing Hybrid Long-term Engaging Controlled Conversational Agents. In Proceedings of the 5th Conference on Conversational User Interfaces (CUI’23). ACM.

Basar, E., Hendrickx, I., Krahmer, E., de Bruijn, G., & Bosse, T. (2022). Hints of Independence in a Pre-scripted World: On Controlled Usage of Open-domain Language Models for Chatbots in Highly Sensitive Domains.  In Proceedings of the 14th International Conference on Agents and Artificial Intelligence – Volume 1, pages 401-407.    

Presentations

  • Controlled Usage of Large Language Models in Chatbots for Health. At RadboudUMC Research Strategy Day 2024, 26 June 2024, Nijmegen, The Netherlands. Read more.
  • Generating Motivational interviewing Reflections for Counseling Chatbots with Large Language Models: A Human Evaluation. At NLG in Lowlands, 12 June 2024, Bielefeld, Germany. Read more.
  • Hybrid Long-term Engaging Controlled Conversational Agents. At Smooth Operators Festival, 31 May 2024, Tilburg, The Netherlands. Read more.
  • Findings from the Employing Large Language Models in Hybrid Task-oriented Chatbots for Health. At the 33nd Computational Linguistics in The Netherlands Conference, 22 September 2023, Antwerp, Belgium. Read more.
  • Look Who’s Talking: A multidisciplinary project for developing engaging long-term conversational chatbots for health promotion. At the 32nd Computational Linguistics in The Netherlands Conference, 17 June 2022, Tilburg, the Netherlands. Read more.
  • Hints of independence in a pre-scripted chatbot world: On controlled usage of open-domain language models for chatbots in highly sensitive domains. At NLG in Lowlands, 7 June 2022, Tilburg, The Netherlands. Read more.