DFA-RAG: Conversational Semantic Router for Large Language Model with Definite Finite Automaton

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Sun, Yiyou, Hu, Junjie, Cheng, Wei, Chen, Haifeng
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866913374883807232
author Sun, Yiyou
Hu, Junjie
Cheng, Wei
Chen, Haifeng
author_facet Sun, Yiyou
Hu, Junjie
Cheng, Wei
Chen, Haifeng
contents This paper introduces the retrieval-augmented large language model with Definite Finite Automaton (DFA-RAG), a novel framework designed to enhance the capabilities of conversational agents using large language models (LLMs). Traditional LLMs face challenges in generating regulated and compliant responses in special scenarios with predetermined response guidelines, like emotional support and customer service. Our framework addresses these challenges by embedding a Definite Finite Automaton (DFA), learned from training dialogues, within the LLM. This structured approach acts as a semantic router which enables the LLM to adhere to a deterministic response pathway. The routing is achieved by the retrieval-augmentation generation (RAG) strategy, which carefully selects dialogue examples aligned with the current conversational context. The advantages of DFA-RAG include an interpretable structure through human-readable DFA, context-aware retrieval for responses in conversations, and plug-and-play compatibility with existing LLMs. Extensive benchmarks validate DFA-RAG's effectiveness, indicating its potential as a valuable contribution to the conversational agent.
format Preprint
id arxiv_https___arxiv_org_abs_2402_04411
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle DFA-RAG: Conversational Semantic Router for Large Language Model with Definite Finite Automaton
Sun, Yiyou
Hu, Junjie
Cheng, Wei
Chen, Haifeng
Computation and Language
Machine Learning
This paper introduces the retrieval-augmented large language model with Definite Finite Automaton (DFA-RAG), a novel framework designed to enhance the capabilities of conversational agents using large language models (LLMs). Traditional LLMs face challenges in generating regulated and compliant responses in special scenarios with predetermined response guidelines, like emotional support and customer service. Our framework addresses these challenges by embedding a Definite Finite Automaton (DFA), learned from training dialogues, within the LLM. This structured approach acts as a semantic router which enables the LLM to adhere to a deterministic response pathway. The routing is achieved by the retrieval-augmentation generation (RAG) strategy, which carefully selects dialogue examples aligned with the current conversational context. The advantages of DFA-RAG include an interpretable structure through human-readable DFA, context-aware retrieval for responses in conversations, and plug-and-play compatibility with existing LLMs. Extensive benchmarks validate DFA-RAG's effectiveness, indicating its potential as a valuable contribution to the conversational agent.
title DFA-RAG: Conversational Semantic Router for Large Language Model with Definite Finite Automaton
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2402.04411