A generative dialogue system based on a large language model

Through a generative dialogue system based on large language model, transfer learning and Transformer architecture are used to solve the problem of insufficient dialogue state tracking and reasoning capabilities in multiple rounds of dialogue, and the efficient and natural dialogue generation of dialogue systems in complex scenarios is achieved.

CN119782490BActive Publication Date: 2025-08-19INSPUR SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510279905.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-08-19
Estimated Expiration
2045-03-11

AI Technical Summary

Technical Problem

The existing generative dialogue system is difficult to accurately track dialogue status in multiple rounds of dialogue, lacks effective reasoning capabilities, and is limited in application in cross-domain and zero-sample scenarios.

Method used

A generative dialogue system based on large language models is adopted, including dialogue state tracking module, thinking chain reasoning module and dialogue generation module. Transfer learning and Transformer architecture are used, combining multi-layer self-attention mechanisms and feedforward networks to realize real-time tracking and logical reasoning of dialogue states.

Benefits of technology

Improves the coherence and accuracy of the dialogue system in complex multi-round dialogue, and can be flexibly applied in new domains and zero-sample scenarios to generate natural, smooth and context-sensitive dialogue replies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782490B_ABST
    Figure CN119782490B_ABST
Patent Text Reader

Abstract

The present invention discloses a generative dialogue system based on a large language model, which relates to the field of artificial intelligence technology. Addressing the limitations of existing generative dialogue systems in multi-round dialogues, the system employs a solution comprising: a dialogue interface module responsible for receiving user input and displaying output results; a dialogue state tracking module that uses key information encoding to generate prompts, combines context transformation, utilizes transfer learning to fine-tune the large language model, builds a sample library for real-time retrieval of examples, and accurately tracks multi-round dialogue states; a thought chain reasoning module that stores and manages intermediate state information, dynamically retrieves, calls tools to execute tasks, integrates results, and establishes reasoning logic to understand user intent; and a dialogue generation module based on a Transformer-based large language model that captures context, adjusts generation strategies, and implements personalized responses. The present invention is used to accurately identify user intent in multi-round dialogues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a generative dialogue system based on a large language model. Background Art

[0002] With advances in artificial intelligence (AI) technology, the demand for human-computer interaction systems is increasing across a variety of application scenarios, such as intelligent customer service, voice assistants, and virtual agents. Natural language processing (NLP) is a key technology for implementing these systems, enabling machines to understand and generate natural human language. However, traditional conversational systems typically rely on pre-designed rules and templates. These systems often employ architectures based on finite state machines or decision trees. While capable of providing basic conversational capabilities for specific tasks, they exhibit significant limitations in complex, open-domain, multi-turn conversations.

[0003] The limitations of traditional dialogue systems are mainly reflected in the following aspects:

[0004] 1. Limitations of fixed rules and templates: Early dialogue systems conducted conversations using a predefined "input-output" model. While this approach has certain application value in specific fields, the system lacks a deep understanding of the conversation content and is unable to cope with unstructured or complex and changing dialogue scenarios.

[0005] 2. Insufficient dialogue flexibility: Rule-based systems often struggle to adapt to the variability and diversity of users' natural language. Users may express the same intent in different ways, and traditional systems lack sufficient generalization capabilities, resulting in inaccurate capture and understanding of user intent.

[0006] 3. Poor context handling capabilities in multi-turn conversations: Traditional systems struggle to accurately maintain contextual information during multi-turn conversations. This often results in the system being unable to accurately track the state of the conversation during consecutive rounds, impacting the accuracy of the system's response.

[0007] With the rapid development of deep learning technology, data-driven dialogue systems have gradually emerged. In recent years, neural network models have demonstrated powerful learning capabilities in natural language processing tasks, automatically learning language patterns and semantic features from large amounts of data, thereby improving the performance of dialogue systems. Among them, generative dialogue systems have become a hot topic of research.

[0008] The advantage of generative dialogue systems is that they can dynamically generate natural language output based on input, rather than relying solely on predefined templates. These systems utilize deep learning models such as recurrent neural networks (RNNs), long short-term memory networks (LSTMs), and Transformer architectures, which demonstrate greater flexibility and adaptability in generating text. However, despite the advancements made by deep learning-based generative dialogue systems over traditional systems, several challenges remain:

[0009] a) Insufficient dialogue state tracking capabilities: Generative dialogue systems often have difficulty accurately tracking dialogue states in multi-round dialogues, especially in dialogues involving multiple domains or complex tasks. The system may not be able to correctly understand the changes in user intent.

[0010] b) Lack of effective reasoning capabilities: Although deep learning models can generate fluent natural language text, their reasoning capabilities are limited, making it difficult to make logical and coherent inferences in complex conversation scenarios. This limits the application of the system in high-level conversation understanding.

[0011] c) Difficulties in zero-shot learning and cross-domain transfer: Generative dialogue systems often perform poorly when faced with new domains or zero-shot tasks due to their lack of effective cross-domain transfer capabilities. This poses a challenge to their wide adaptability in practical application scenarios. Summary of the Invention

[0012] In response to the limitations of existing generative dialogue systems in multi-round dialogues, the present invention provides a generative dialogue system based on a large language model, aiming to improve the ability to recognize user intentions and the system's reasoning ability in multi-round dialogues.

[0013] The present invention provides a generative dialogue system based on a large language model, which solves the above-mentioned technical problems by adopting the following technical solutions:

[0014] A generative dialogue system based on a large language model, whose structure includes:

[0015] The dialogue interface module is responsible for receiving user input and displaying the corresponding output generated by the system to the user;

[0016] The dialogue state tracking module uses key conversation information to encode prompts, combines contextual transformation prompts, and uses transfer learning to fine-tune large language models to adapt to multi-domain dialogue state tracking tasks. It also builds a sample library containing dialogue examples from various domains to retrieve relevant examples in real time, achieving accurate and real-time tracking of dialogue states in multi-round conversations.

[0017] The Thought Chain Reasoning module is used to store and manage intermediate state information generated during the conversation process, and dynamically retrieve previously stored intermediate states based on the current conversation state to ensure the coherence of generated responses with previous conversation content. It is also used to call multiple tools to perform complex tasks, integrate the obtained results into the conversation, establish logical connections between multiple reasoning steps, analyze the key elements of user input, and gradually reason to understand the user's intentions.

[0018] The dialogue generation module uses a large language model with a Transformer architecture based on a multi-layer self-attention mechanism and a feedforward network. It is used to simultaneously focus on all parts of the input sequence when generating dialogue responses, effectively capture long-range contextual information, and dynamically adjust the generation strategy according to the context of the current dialogue. It extracts language features from large-scale unlabeled text data and fine-tunes the large language model with a Transformer architecture on data in specified domains. It is used to retain and selectively activate important contextual information in multiple rounds of dialogue, flexibly adjust the generation strategy according to different user requests and interaction methods, analyze the user's emotional state in real time and adjust the tone and content of the reply accordingly, and automatically adjust the reply style and content based on the user's historical dialogues and preferences to achieve personalized replies.

[0019] Optionally, the dialog state tracking module involved specifically includes:

[0020] A fine-tuning unit, which uses transfer learning to fine-tune the pre-trained large language model to achieve multi-domain and zero-shot learning;

[0021] The slot encoding unit uses natural language processing technology to annotate and encode key conversation information into a unified format. It then leverages the rich semantic understanding and knowledge of the fine-tuned large language model to generate targeted slot prompts. The fine-tuned large language model also uses the encoded information to identify key features and generate prompts that are more appropriate to the conversation context, thereby guiding the system to accurately focus on specific information.

[0022] The prefix prompt unit is used to enhance context understanding based on the fine-tuned large language model. It converts slot prompts into key prefix prompts and value prefix prompts. During the conversion process, the fine-tuned large language model uses its understanding of context to analyze the relevance of each prompt to the context and dynamically adjust the emphasis of the prompt. This enhances state tracking capabilities based on context, allowing the system to more sensitively capture key changes in the conversation.

[0023] The example retrieval unit is used to build a sample library containing dialogue examples from various fields. Through a real-time retrieval mechanism, it uses the fine-tuned large language model to accurately understand the semantics of the current dialogue and retrieve the most relevant dialogue examples from the sample library in real time.

[0024] Further optionally, during the process of generating a dialogue response, the example retrieval unit uses a real-time retrieval mechanism and similarity calculation to retrieve the example most relevant to the current dialogue from the sample library, thereby assisting in generating accurate dialogue status information.

[0025] Optionally, the thought chain reasoning modules involved specifically include:

[0026] The external memory encoding unit is used to store and manage the intermediate state information generated during the conversation. It also uses the information retrieval mechanism to dynamically retrieve the previously stored intermediate states based on the current conversation state to ensure the coherence of the generated responses with the previous conversation content.

[0027] The tool integration unit is used to integrate multiple tools to support the execution of complex tasks. It also uses a feedback mechanism to integrate the results obtained by calling tools into the conversation, enhancing the interactivity and practicality of the conversation.

[0028] A logical connection unit, used to establish logical connections between multiple reasoning steps through a thought chain reasoner when performing complex tasks;

[0029] The step-by-step reasoning unit is used to continuously correct and optimize the dialogue state maintained by the dialogue state tracking module through the thought chain reasoner when facing complex and long-sequence dialogues, accurately understand user intentions, and generate logically reasonable responses.

[0030] Preferably, the external memory encoding unit involved stores and manages intermediate state information generated during the conversation, including user input, generated replies, and important context information.

[0031] Optionally, when executing complex tasks, the logic connection unit establishes logical connections between multiple reasoning steps through a thought chain reasoner. This process includes: first, in-depth analysis of key elements of the user input, which are important information processed and identified by the dialogue state tracking module; then, generating a final response through a series of reasoning steps, ensuring that the response is consistent with the dialogue state tracking module's understanding and processing of the dialogue, making the entire dialogue reasoning process logically rigorous;

[0032] When faced with complex and long-sequence dialogues, the step-by-step reasoning unit uses a step-by-step reasoning method through the thought chain reasoner to continuously correct and optimize the dialogue state maintained by the dialogue state tracking module, accurately understand the user's intention, and generate logically reasonable responses. In this process, the thought chain reasoner sets the reasoning path to ensure that the reasoning results of each step are consistent with the previous content, helping the dialogue state tracking module to accurately understand the user's intention and generate logically reasonable responses.

[0033] Optionally, the dialogue generation module involved specifically includes:

[0034] The training fine-tuning unit is used to extract language features from large-scale unlabeled text data and use transfer learning technology to fine-tune the large language model based on the Transformer architecture on data in a specific domain;

[0035] The capture and adjustment unit utilizes a large language model based on the Transformer architecture to focus on different parts of the input sequence while generating dialogue responses, effectively capturing long-range contextual information and dynamically adjusting the generation strategy based on the context of the current dialogue.

[0036] The dialogue generation unit uses a large language model based on the Transformer architecture to retain and selectively activate important contextual information in multiple rounds of dialogue, and flexibly adjusts the generation strategy based on different user requests and interaction methods;

[0037] The personalized generation unit is used to analyze the user's emotional state in real time with the help of the emotion recognition module. When generating dialogue replies, the tone and content of the reply are adjusted according to the user's emotional changes. At the same time, the reply style and content are automatically adjusted according to the user's historical conversations and preferences, generating natural, fluent, contextual, interactive, relevant and logical replies.

[0038] Optionally, the large language models in both the dialogue state tracking module and the dialogue generation module adopt a Transformer architecture based on a multi-layer self-attention mechanism and a feedforward network. A temporal factor is introduced into the Transformer architecture to handle the sequential and temporal correlation of dialogues in the dialogue system.

[0039] The time factor introduced is located between the word embedding layer and the feedforward neural network, specifically including:

[0040] A time embedding layer, which encodes the temporal information of the conversation turns formed by the text. The time embedding is either a relative time embedding, which represents the relative time interval between conversation turns, or an absolute time embedding, which represents the absolute timestamp of the conversation turn.

[0041] A time-aware self-attention mechanism is used to consider the semantic relationship between words in the multi-head self-attention mechanism and combine it with the time embedding vector to calculate the attention weight. This allows the large language model to pay more attention to temporally related or close conversation content, thereby better capturing the coherence and contextual dependencies of the conversation.

[0042] A time decay mechanism is used to add a time decay factor to the weight calculation of the feedforward neural network or the self-attention mechanism, so that the influence of the previous dialogue round on the current generated answer gradually decreases;

[0043] Among them: the word embedding layer is used to convert the text of the input layer into a word embedding vector, and the feedforward neural network is used to further transform and process the hidden state after the self-attention mechanism is processed.

[0044] Preferably, the dialogue interface module supports multiple input methods, including text input, voice input, and image input, and can adapt to different device screen sizes and resolutions to provide a consistent and friendly user interaction experience.

[0045] The generative dialogue system based on a large language model of the present invention has the following beneficial effects compared with the prior art:

[0046] 1. This invention can accurately track state changes in complex conversations, handle complex multi-round conversations, and provide more coherent and intelligent conversation services in combination with tool operations, making the conversations generated by the system more natural and smooth, thereby improving the user experience;

[0047] 2. The present invention uses a dialogue state tracking module to enable the system to track and update the dialogue state in real time, thereby significantly improving the coherence and accuracy of the dialogue; through the thought chain reasoning module, a step-by-step reasoning method is adopted to gradually analyze user questions, and external memory is used to store intermediate results to ensure that the generated responses are logically coherent and meet the context requirements; the generative dialogue module is based on a pre-trained Transformer language model, which can make full use of large-scale language knowledge to generate natural, fluent and context-consistent dialogue responses, so as to be flexibly applied in new fields and zero-sample learning scenarios, ensuring that the generated dialogue content meets the needs of the specified field. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Attachment Figure 1 It is a module connection block diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the technical solution, the technical problems solved and the technical effects of the present invention more clear, the technical solution of the present invention is clearly and completely described below in conjunction with specific embodiments.

[0050] Example: Refer to the attached Figure 1 This embodiment proposes a generative dialogue system based on a large language model, the structure of which includes:

[0051] The dialogue interface module is responsible for receiving user input and displaying the corresponding output generated by the system to the user;

[0052] The dialogue state tracking module uses key conversation information to encode prompts, combines contextual transformation prompts, and uses transfer learning to fine-tune large language models to adapt to multi-domain dialogue state tracking tasks. It also builds a sample library containing dialogue examples from various domains to retrieve relevant examples in real time, achieving accurate and real-time tracking of dialogue states in multi-round conversations.

[0053] The Thought Chain Reasoning module is used to store and manage intermediate state information generated during the conversation process, and dynamically retrieve previously stored intermediate states based on the current conversation state to ensure the coherence of generated responses with previous conversation content. It is also used to call multiple tools to perform complex tasks, integrate the obtained results into the conversation, establish logical connections between multiple reasoning steps, analyze the key elements of user input, and gradually reason to understand the user's intentions.

[0054] The dialogue generation module uses a large language model with a Transformer architecture based on a multi-layer self-attention mechanism and a feedforward network. It is used to simultaneously focus on all parts of the input sequence when generating dialogue responses, effectively capture long-range contextual information, and dynamically adjust the generation strategy according to the context of the current dialogue. It extracts language features from large-scale unlabeled text data and fine-tunes the large language model with a Transformer architecture on data in specified domains. It is used to retain and selectively activate important contextual information in multiple rounds of dialogue, flexibly adjust the generation strategy according to different user requests and interaction methods, analyze the user's emotional state in real time and adjust the tone and content of the reply accordingly, and automatically adjust the reply style and content based on the user's historical dialogues and preferences to achieve personalized replies.

[0055] In this embodiment, the dialogue interface module supports multiple input methods, including text input, voice input, and image input, and can adapt to different device screen sizes and resolutions to provide a consistent and friendly user interaction experience.

[0056] In this embodiment, the dialog state tracking module specifically includes:

[0057] A fine-tuning unit, which uses transfer learning to fine-tune the pre-trained large language model to achieve multi-domain and zero-shot learning;

[0058] The slot encoding unit uses natural language processing technology to annotate and encode key conversation information into a unified format. It then leverages the rich semantic understanding and knowledge of the fine-tuned large language model to generate targeted slot prompts. The fine-tuned large language model also uses the encoded information to identify key features and generate prompts that are more appropriate to the conversation context, thereby guiding the system to accurately focus on specific information.

[0059] The prefix prompt unit is used to enhance context understanding based on the fine-tuned large language model. It converts slot prompts into key prefix prompts and value prefix prompts. During the conversion process, the fine-tuned large language model uses its understanding of context to analyze the relevance of each prompt to the context and dynamically adjust the emphasis of the prompt. This enhances state tracking capabilities based on context, allowing the system to more sensitively capture key changes in the conversation.

[0060] The example retrieval unit is used to build a sample library containing dialogue examples from various fields. Through a real-time retrieval mechanism, it uses the fine-tuned large language model to accurately understand the semantics of the current dialogue, and retrieves the most relevant dialogue examples from the sample library in real time to assist in generating accurate dialogue status information.

[0061] It should be noted that the fine-tuning unit in the dialog state tracking module uses transfer learning to fine-tune the pre-trained large language model to achieve multi-domain and zero-shot learning. This process is specifically achieved through the following methods:

[0062] i) Application of transfer learning technology. Transfer learning is a machine learning method that aims to apply knowledge learned from one or more source tasks to a target task. In this invention, the fine-tuning unit uses transfer learning technology to transfer the language knowledge and patterns learned by a pre-trained large language model on a large-scale general dataset to the domain-specific dialogue state tracking task. In this way, the model can quickly adapt and achieve good performance on limited domain-specific data.

[0063] ii) Implementation of multi-domain learning. In order to adapt to the multi-domain dialogue state tracking task, the fine-tuning unit adopts a variety of strategies: ① Domain adaptation: The fine-tuning unit enables the pre-trained large language model to adapt to the language style and dialogue mode of different domains by training on data from multiple domains. This includes pre-processing and labeling dialogue data from different domains to ensure that the model can accurately understand and generate dialogues that conform to the characteristics of the domain. ② Domain-specific fine-tuning: During the fine-tuning process, the pre-trained large language model will be specifically optimized for the characteristics of each domain. For example, in the tourism field, the pre-trained large language model will focus on learning tourism-related vocabulary, attraction information, and user preferences; in the medical field, the pre-trained large language model will focus on medical terminology, disease information, and patient needs. In this way, the pre-trained large language model can achieve efficient dialogue state tracking in different domains.

[0064] iii) Implementation of zero-shot learning. Zero-shot learning refers to the ability of a pre-trained large language model to track conversational states in a new domain by transferring and reasoning about knowledge from related domains, even without domain-specific training data. The fine-tuning unit implements zero-shot learning through the following methods: ① Knowledge transfer: Leveraging the knowledge learned by the pre-trained large language model on a large-scale general dataset, the fine-tuning unit can transfer this knowledge to the new domain. For example, the pre-trained large language model can infer conversational logic and user intent in the new domain by understanding common conversational patterns and language structure. ② Enhanced reasoning capabilities: The fine-tuning unit enhances the reasoning capabilities of the pre-trained large language model, enabling it to generate reasonable conversational responses through logical reasoning and knowledge association in the absence of domain-specific data. For example, the pre-trained large language model can infer the user's potential needs and generate corresponding responses by analyzing the keywords and context of the user's input.

[0065] It should also be noted that the fine-tuning unit employs multiple fine-tuning algorithms to improve the adaptability and performance of the pre-trained large language model. These include: ① LoRA (Low-Rank Adaptation), an efficient fine-tuning method that simulates full-parameter fine-tuning by adding low-rank matrices to the pre-trained large language model. This method significantly reduces the computational resources and time required for fine-tuning while maintaining comparable performance to full-model fine-tuning. LoRA is suitable for situations with insufficient labeled data, but may not be as effective as SFT when the labeled dataset is large. ② Adapter Tuning: Adapter tuning implements fine-tuning by adding small neural network modules (adapters) to each layer of the model. The adapters are independent of the main model structure; only the adapter parameters are updated during fine-tuning, while the other pre-trained parameters of the model remain unchanged. This method improves the model's flexibility and adaptability. ③ Prefix Tuning: Prefix tuning implements fine-tuning by adding a trainable prefix to the input sequence of the pre-trained large language model. The prefix can be a fixed-length vector sequence, which the pre-trained large language model learns during training to adapt to specific tasks. These techniques are all prior art and will not be described in detail here.

[0066] In this embodiment, the thought chain reasoning module involved specifically includes:

[0067] The external memory encoding unit is used to store and manage the intermediate state information generated during the conversation. It uses the information retrieval mechanism to dynamically retrieve previously stored intermediate states based on the current conversation state to ensure the coherence of the generated responses with the previous conversation content. The intermediate state information includes user input, generated responses, and important contextual information.

[0068] The tool integration unit is used to integrate multiple tools (such as database queries and API calls) to support the execution of complex tasks. It also uses a feedback mechanism to integrate the results obtained by calling tools into the conversation, enhancing the interactivity and practicality of the conversation.

[0069] The logical connection unit is used to establish logical connections between multiple reasoning steps when performing complex tasks through the thought chain reasoner. This process includes: first, in-depth analysis of the key elements of the user input. These key elements are important information processed and identified by the dialogue state tracking module. Then, a series of reasoning steps are used to generate the final response, ensuring that the response is consistent with the dialogue state tracking module's understanding and processing of the conversation, making the entire dialogue reasoning process logically rigorous;

[0070] The step-by-step reasoning unit is used to continuously correct and optimize the dialogue state maintained by the dialogue state tracking module through the step-by-step reasoning method of the thought chain reasoner when facing complex and long-sequence dialogues, accurately understand the user's intention, and generate logically reasonable responses. In this process, the thought chain reasoner sets the reasoning path to ensure that the reasoning results of each step are consistent with the previous content, helping the dialogue state tracking module to accurately understand the user's intention and generate logically reasonable responses.

[0071] In this embodiment, the dialogue generation module involved specifically includes:

[0072] The training fine-tuning unit is used to extract language features from large-scale unlabeled text data and use transfer learning technology to fine-tune the large language model based on the Transformer architecture on data in a specific domain;

[0073] The capture and adjustment unit utilizes a large language model based on the Transformer architecture to focus on different parts of the input sequence while generating dialogue responses, effectively capturing long-range contextual information and dynamically adjusting the generation strategy based on the context of the current dialogue.

[0074] The dialogue generation unit uses a large language model based on the Transformer architecture to retain and selectively activate important contextual information in multiple rounds of dialogue, and flexibly adjusts the generation strategy based on different user requests and interaction methods;

[0075] The personalized generation unit is used to analyze the user's emotional state in real time with the help of the emotion recognition module. When generating dialogue replies, the tone and content of the reply are adjusted according to the user's emotional changes. At the same time, the reply style and content are automatically adjusted according to the user's historical conversations and preferences, generating natural, fluent, contextual, interactive, relevant and logical replies.

[0076] It should be added that the execution operations of the training fine-tuning unit of the dialogue generation module involved are similar to those of the fine-tuning unit in the dialogue state tracking module. Both are for fine-tuning the pre-trained large language model to make it meet current needs. The process of fine-tuning the large language model by the training fine-tuning unit is similar to the process of fine-tuning the large language model by the aforementioned fine-tuning unit, and will not be repeated here.

[0077] It should also be added that the large language model involved in the dialogue state tracking module or the dialogue generation module is a model based on the Transformer architecture, specifically ChatGLM (a language model developed by Zhipu AI, which has the characteristics of efficient parallel computing capabilities and good scalability, and can handle large-scale text data and complex language tasks. It can be used in the dialogue system to accurately track the dialogue state and generate high-quality dialogue responses).

[0078] Specifically, in this embodiment, the large language models involved in the dialogue state tracking module or the dialogue generation module all adopt the Transformer architecture based on a multi-layer self-attention mechanism and a feedforward network. A time factor is introduced into the Transformer architecture to handle the sequential and temporal correlation of dialogues in the dialogue system.

[0079] The introduced time factor is located between the word embedding layer (used to convert the text of the input layer into word embedding vectors) and the feedforward neural network (used to further transform and process the hidden state after the self-attention mechanism). Specifically, it includes:

[0080] The time factors introduced specifically include:

[0081] 1. The time embedding layer is used to encode the time information of the dialogue turns formed by the text. This time embedding layer can be used after the word embedding layer to incorporate time information into the word embedding vector. Time embedding can take two forms:

[0082] Relative time embedding: This embedding represents the relative time interval between dialogue turns. For example, for two dialogue turns i and j, we calculate the relative time difference t between them ij , and then through a learnable embedding matrix E rel This time difference is mapped into a fixed-dimensional vector space. In this way, the word embedding vector of each dialogue turn will carry relative time information.

[0083] Absolute time embedding: This embedding method represents the absolute timestamp of the dialogue turn. The timestamp of each dialogue turn is t i Through a learnable embedding matrix E absMapped into a fixed-dimensional vector space. These time embedding vectors will be fused with the word embedding vectors, for example by addition or concatenation, to provide temporal information to the subsequent self-attention mechanism.

[0084] 2. The time-aware self-attention mechanism is used to consider the semantic relationship between words in the multi-head self-attention mechanism, and to calculate the attention weights in combination with the time embedding vector, so that the large language model pays more attention to the conversation content that is temporally related or close, so as to better capture the coherence and contextual dependencies of the conversation. Specifically, the time-aware self-attention mechanism is introduced. When calculating the self-attention weight, in addition to the traditional word embedding vectors Q (query vector), K (key vector) and V (value vector), the influence of the time embedding vector is also considered. The time embedding vector can be concatenated or added to the Q and K vectors to form new query and key vectors containing time information. For example, the new query vector Q′ can be Q and the time embedding vector E t In this way, the big prediction model considers both semantic and temporal factors when calculating the attention score.

[0085] 3. Time decay mechanism, which is used to add a time decay factor to the weight calculation of the feedforward neural network part or the self-attention mechanism, so that the influence of the previous dialogue round on the current generated answer gradually weakens.

[0086] In the feedforward neural network part, the hidden state of each position can be multiplied by a time decay factor α t , this factor is a value between 0 and 1 and decreases gradually over time. For example, we can define α t = exp(−λt), where λ is a learnable parameter that controls the rate of time decay. In this way, the influence of earlier dialogue rounds on the currently generated answer will gradually weaken, but a certain amount of historical information will still be retained.

[0087] Of course, in the weight calculation of the self-attention mechanism, the attention score can also be multiplied by a decay coefficient based on the time difference before the softmax function. In this way, the attention weights between earlier rounds will decay faster, thus simulating the gradual weakening of attention to past information in human conversations.

[0088] Based on the large language model described above, its operating process is as follows: ① Input: The user enters the conversation text, and each conversation turn is identified and timestamp-labeled. ②2. Word Embedding Layer: The input conversation text is converted into a word embedding vector, with each word mapped to a high-dimensional vector space. ③ Time Embedding Layer: Encodes the temporal information of each conversation turn, which can be either relative time embedding or absolute time embedding: i) Relative time embedding: Calculates the relative time difference between each conversation turn and maps it to a fixed-dimensional vector. ii) Absolute time embedding: Directly maps the absolute timestamp of each conversation turn to a fixed-dimensional vector. The time embedding vector is fused with the word embedding vector (addition or concatenation). ④ Time-aware Self-Attention Mechanism: In the multi-head self-attention mechanism, the time embedding vector is combined to calculate the attention weight. The new query vector Q′ and key vector K′ are obtained by adding or concatenating the time embedding vector with the traditional word embedding vector. The attention score between Q′ and K′ is calculated, taking into account semantic and temporal factors. ⑤ Time Decay Mechanism: In the weight calculation of the feedforward neural network part or the self-attention mechanism, a time decay factor α is added. t , time decay factor α t This is typically defined as exp(−λt), where λ controls the rate of time decay. The influence of earlier dialogue turns on the currently generated response gradually decreases, while still retaining a certain amount of historical information. ⑥ Feedforward Neural Network: Processes the hidden state, applying nonlinear transformations and time decay factors. ⑦ Decoder: Generates a response based on the aforementioned output and time information. ⑧ Output: This can reference information from the dialogue state tracking module to ensure the accuracy and coherence of the response.

[0089] Through the above process, the big prediction model can more effectively handle the time correlation and sequence in the dialogue system, improving the performance and user experience of the dialogue system.

[0090] The specific working process of the system described in this embodiment is as follows:

[0091] 1. User input phase: Users input content through the dialogue interface module. The input method can be text, voice, or image. The dialogue interface module receives user input and passes it to subsequent modules for processing.

[0092] Suppose the user inputs: "I want to travel to City A this weekend. Please recommend some interesting attractions for me. It would be best if you could also know the ticket prices."

[0093] 2. Dialogue status tracking stage:

[0094] (2.1) Fine-tuning unit: Using transfer learning technology, based on the knowledge accumulated in the tourism field and related fields, the pre-trained large language model is fine-tuned to adapt to the multi-domain dialogue state tracking task.

[0095] Assume that the large language model described in this stage has previously learned a large amount of tourism-related text data. Through fine-tuning, it can better handle the current dialogue state tracking task related to recommending tourist attractions in City A.

[0096] (2.2) Slot Encoding Unit: This unit labels key conversation information entered by the user and encodes it into a unified format. It then generates targeted slot prompts using the rich semantic understanding and knowledge base of the fine-tuned large language model. The fine-tuned large language model also uses the encoded information to identify key features and generate prompts that are more appropriate to the conversation context, thereby guiding the system to focus precisely on the specified information.

[0097] Based on the above assumptions, key information such as "weekend" (time), "city A" (location), "travel" (user request), "interesting attractions" (request content), and "ticket price" (request content) is encoded into a unified format according to predefined slot types, and slot prompts are generated, such as "time - weekend", "location - city A", "user request - recommended tourist attractions and ticket prices", etc., to guide the system's attention to this information.

[0098] (2.3) Prefix Prompt Unit: Based on the enhanced understanding of context by the fine-tuned large language model, slot prompts are converted into key prefix prompts and value prefix prompts. During the conversion process, the fine-tuned large language model uses its understanding of context to analyze the degree of relevance of each prompt to the context and dynamically adjust the emphasis of the prompt, thereby enhancing state tracking capabilities in combination with context, enabling the system to more sensitively capture key changes in the conversation.

[0099] Based on the above assumptions, we transform "user request - tourist attraction and ticket price recommendation" into a key prefix prompt such as "travel request: attractions and ticket prices", as well as corresponding more detailed value prefix prompts, to enhance the large language model's ability to capture key changes in user needs.

[0100] (2.4) Example Retrieval Unit: In a constructed sample library containing conversation examples from various domains, a real-time retrieval mechanism is used to utilize the fine-tuned large language model to accurately understand the semantics of the current conversation, perform similarity calculations (such as cosine similarity), and retrieve the examples most relevant to the current conversation.

[0101] Suppose the sample library contains a conversation example similar to "I plan to travel to City B. What places are worth visiting and how much are the tickets?" Because the location and request type are similar, this example is retrieved to assist in generating accurate conversation status information, determining that the current conversation is related to recommending tourist attractions and involves attention to location, time, and ticket prices.

[0102] 3. Thinking chain reasoning stage:

[0103] (3.1) External memory encoding unit: This unit stores and manages the information processed by the dialogue state tracking module and the intermediate state information generated by previous dialogues (user input, generated responses, and important contextual information). It also dynamically retrieves previously stored intermediate states based on the current dialogue state.

[0104] Based on the aforementioned assumptions, it was found that the user had previously expressed interest in historical and cultural attractions. This information was retrieved and used for subsequent reasoning.

[0105] (3.2) Tool Integration Unit: If the user input involves complex tasks (such as the need to query database information, etc.), the integrated tool module (such as database query, API call, etc.) is called to perform the relevant tasks, and the obtained results are integrated into the conversation through the feedback mechanism.

[0106] Based on the above assumptions, it is specifically identified that the user demand involves the complex task of querying tourist attractions and ticket prices in City A. The database query tool module is called to connect to the relevant tourism information database. The database query tool module obtains the interesting attractions in City A and their ticket price information from the database and feeds the results back to the system.

[0107] (3.3) Logical connection unit: This unit conducts in-depth analysis of the key elements of user input (information processed by the dialogue state tracking module), establishes logical connections between multiple reasoning steps through the thought chain reasoner, and generates preliminary response logic through a series of reasoning steps.

[0108] Based on the aforementioned assumptions, this step specifically determines to filter out popular attractions that are open on weekends from the tourist attraction database, and then further links it to the acquisition of ticket price information.

[0109] (3.4) Step-by-step reasoning unit: When faced with complex and long-sequence dialogues, the thought chain reasoner uses a step-by-step reasoning method to continuously correct and optimize the dialogue state maintained by the dialogue state tracking module, accurately understand user intentions, and generate more logical response reasoning results.

[0110] Based on the above assumptions, this step specifically involves first selecting those attractions in City A that are open on weekends, then sorting them according to their popularity, and then combining them with ticket price information to generate a preliminary attraction recommendation logic, such as recommending them from high to low popularity, while also marking the ticket prices.

[0111] 4. Dialogue generation stage:

[0112] (4.1) Training and fine-tuning unit: Extract language features from large-scale unlabeled text data and use transfer learning technology to fine-tune the large language model based on the Transformer architecture on data in a specific domain, providing a better language foundation for dialogue generation.

[0113] Based on the above assumptions, we extract expressions and common vocabulary related to tourist attraction recommendations, and fine-tune the large language model based on the Transformer architecture on tourism data, so that it can better generate responses that are suitable for tourist attraction recommendation scenarios.

[0114] (4.2) Capture Adjustment Unit: Utilizes a large language model based on the Transformer architecture to simultaneously focus on all parts of the input sequence, effectively capture long-range contextual information, and dynamically adjust the generation strategy according to the context of the current conversation.

[0115] Based on the above assumptions, we capture long-range contextual information such as the user's interest in City A, weekends, tourist attractions, and ticket prices. We dynamically adjust the generation strategy based on the current conversation context, determine the response in the form of a list of recommended attractions, and sort them by popularity.

[0116] (4.3) Dialogue Generation Unit: Retains and selectively activates important contextual information in multiple rounds of dialogue, flexibly adjusts the generation strategy based on different user requests and interaction methods, and combines the reasoning results of the thought chain reasoning module to generate preliminary dialogue response content.

[0117] Assuming a previous conversation about travel, the system retains contextual information related to travel preferences and selectively activates information related to recommended tourist attractions in City A. Based on the user's request, the system flexibly adjusts the generation strategy to generate preliminary responses, such as "Recommended weekend attractions in City A: Attraction a, ticket price X yuan; Attraction b, ticket price Y yuan..."

[0118] (4.4) Personalization Generation Unit: The emotional recognition module analyzes the user's emotional state in real time, adjusts the tone and content of the reply based on the user's emotional changes, and automatically adjusts the reply style and content based on the user's historical conversations and preferences, generating a natural, fluent, contextually relevant, interactive, relevant, and logical final reply.

[0119] Assuming the user is previously interested in historical and cultural attractions, highlighting attractions like Attraction A in your reply will result in a natural, fluent, contextual, interactive, relevant, and logical response: "Wow, a weekend trip to City A is awesome! I highly recommend Attraction A, which has a rich historical and cultural heritage and costs X yuan. And Attraction B, which is magnificent and costs Y yuan. Both attractions are very popular on weekends and definitely worth a visit!"

[0120] 5. Results display stage:

[0121] The final response generated is displayed to the user through the dialogue interface module. The user can see the output generated by the system and complete a dialogue interaction.

[0122] Based on the above assumptions, the user can finally see the system-recommended weekend tourist attractions and ticket price information for City A, completing this dialogue interaction.

[0123] In summary, the generative dialogue system based on a large language model of the present invention can improve the ability to recognize user intentions and the system's reasoning ability in multi-round dialogues, and address the limitations of existing generative dialogue systems in multi-round dialogues.

[0124] The above specific examples are used to illustrate the principles and implementation methods of the present invention in detail. These examples are only used to help understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made by those skilled in the art without departing from the principles of the present invention should fall within the scope of patent protection of the present invention.

Claims

1. A generative dialogue system based on a large language model, characterized by: Its structure includes: The dialogue interface module is responsible for receiving user input and displaying the corresponding output generated by the system to the user; The dialogue state tracking module uses key conversation information to encode prompts, combines contextual transformation prompts, and uses transfer learning to fine-tune large language models to adapt to multi-domain dialogue state tracking tasks. It also builds a sample library containing dialogue examples from various domains to retrieve relevant examples in real time, achieving accurate and real-time tracking of dialogue states in multi-round conversations. The Thought Chain Reasoning module is used to store and manage intermediate state information generated during the conversation process, and dynamically retrieve previously stored intermediate states based on the current conversation state to ensure the coherence of generated responses with previous conversation content. It is also used to call multiple tools to perform complex tasks, integrate the obtained results into the conversation, establish logical connections between multiple reasoning steps, analyze the key elements of user input, and gradually reason to understand the user's intentions. The dialogue generation module uses a large language model with a Transformer architecture based on a multi-layer self-attention mechanism and a feedforward network. It is designed to simultaneously focus on all parts of the input sequence when generating dialogue responses, effectively capturing long-range contextual information and dynamically adjusting the generation strategy based on the context of the current dialogue. It extracts language features from large-scale unlabeled text data and fine-tunes the large language model with the Transformer architecture on data from a specific domain. It is designed to retain and selectively activate important contextual information in multiple rounds of dialogue, flexibly adjust the generation strategy based on different user requests and interaction methods, analyze the user's emotional state in real time and adjust the tone and content of the response accordingly, and automatically adjust the response style and content based on the user's historical dialogue and preferences to achieve personalized responses. The large language models in the dialogue state tracking module and the dialogue generation module both adopt a Transformer architecture based on a multi-layer self-attention mechanism and a feedforward network. A time factor is introduced into the Transformer architecture to handle the sequentiality and temporal correlation of dialogues in the dialogue system. The introduced time factor is located between the word embedding layer and the feedforward neural network, specifically including a time embedding layer, a time-aware self-attention mechanism, and a time decay mechanism. The word embedding layer is used to convert the text of the input layer into a word embedding vector, and the feedforward neural network is used to perform further feature conversion and processing on the hidden state processed by the self-attention mechanism.

2. A generative dialogue system based on a large language model according to claim 1, characterized in that: The dialogue state tracking module specifically includes: A fine-tuning unit, which uses transfer learning to fine-tune the pre-trained large language model to achieve multi-domain and zero-shot learning; The slot encoding unit uses natural language processing technology to annotate and encode key conversation information into a unified format. It then leverages the rich semantic understanding and knowledge of the fine-tuned large language model to generate targeted slot prompts. The fine-tuned large language model also uses the encoded information to identify key features and generate prompts that are more appropriate to the conversation context, thereby guiding the system to accurately focus on specific information. The prefix prompt unit is used to enhance context understanding based on the fine-tuned large language model. It converts slot prompts into key prefix prompts and value prefix prompts. During the conversion process, the fine-tuned large language model uses its understanding of context to analyze the relevance of each prompt to the context and dynamically adjust the emphasis of the prompt. This enhances state tracking capabilities based on context, allowing the system to more sensitively capture key changes in the conversation. The example retrieval unit is used to build a sample library containing dialogue examples from various fields. Through a real-time retrieval mechanism, it uses the fine-tuned large language model to accurately understand the semantics of the current dialogue and retrieve the most relevant dialogue examples from the sample library in real time.

3. A generative dialogue system based on a large language model according to claim 2, characterized in that: During the process of generating a dialogue response, the example retrieval unit uses a real-time retrieval mechanism and similarity calculation to retrieve the examples most relevant to the current dialogue from the sample library, thereby assisting in generating accurate dialogue status information.

4. A generative dialogue system based on a large language model according to claim 2, characterized in that: The thought chain reasoning module specifically includes: The external memory encoding unit is used to store and manage the intermediate state information generated during the conversation. It also uses the information retrieval mechanism to dynamically retrieve the previously stored intermediate states based on the current conversation state to ensure the coherence of the generated responses with the previous conversation content. The tool integration unit is used to integrate multiple tools to support the execution of complex tasks. It also uses a feedback mechanism to integrate the results obtained by calling tools into the conversation, enhancing the interactivity and practicality of the conversation. A logical connection unit, used to establish logical connections between multiple reasoning steps through a thought chain reasoner when performing complex tasks; The step-by-step reasoning unit is used to continuously correct and optimize the dialogue state maintained by the dialogue state tracking module through the thought chain reasoner when facing complex and long-sequence dialogues, accurately understand user intentions, and generate logically reasonable responses.

5. A generative dialogue system based on a large language model according to claim 4, characterized in that: The external memory encoding unit stores and manages intermediate state information generated during the conversation, including user input, generated replies, and important context information.

6. A generative dialogue system based on a large language model according to claim 4, characterized in that: When performing complex tasks, the logic connection unit uses a thought chain reasoner to establish logical connections between multiple reasoning steps. This process includes: first, in-depth analysis of the key elements of the user input, which are important information processed and identified by the dialogue state tracking module. Then, through a series of reasoning steps, the final response is generated, ensuring that the response is consistent with the dialogue state tracking module's understanding and processing of the conversation, making the entire dialogue reasoning process logically rigorous; When faced with complex and long-sequence dialogues, the step-by-step reasoning unit uses a step-by-step reasoning method through the thought chain reasoner to continuously correct and optimize the dialogue state maintained by the dialogue state tracking module, accurately understand the user's intention, and generate logically reasonable responses. In this process, the thought chain reasoner sets the reasoning path to ensure that the reasoning results of each step are consistent with the previous content, helping the dialogue state tracking module to accurately understand the user's intention and generate logically reasonable responses.

7. A generative dialogue system based on a large language model according to claim 4, characterized in that: The dialogue generation module specifically includes: The training fine-tuning unit is used to extract language features from large-scale unlabeled text data and use transfer learning technology to fine-tune the large language model based on the Transformer architecture on data in a specific domain; The capture and adjustment unit utilizes a large language model based on the Transformer architecture to focus on different parts of the input sequence while generating dialogue responses, effectively capturing long-range contextual information and dynamically adjusting the generation strategy based on the context of the current dialogue. The dialogue generation unit uses a large language model based on the Transformer architecture to retain and selectively activate important contextual information in multiple rounds of dialogue, and flexibly adjusts the generation strategy based on different user requests and interaction methods; The personalized generation unit is used to analyze the user's emotional state in real time with the help of the emotion recognition module. When generating dialogue replies, the tone and content of the reply are adjusted according to the user's emotional changes. At the same time, the reply style and content are automatically adjusted according to the user's historical conversations and preferences, generating natural, fluent, contextual, interactive, relevant and logical replies.

8. A generative dialogue system based on a large language model according to claim 7, characterized in that: The introduced time factor is located between the word embedding layer and the feedforward neural network, specifically including the time embedding layer, the time-aware self-attention mechanism, and the time decay mechanism, where: A time embedding layer, which encodes the temporal information of the conversation turns formed by the text. The time embedding is either a relative time embedding, which represents the relative time interval between conversation turns, or an absolute time embedding, which represents the absolute timestamp of the conversation turn. A time-aware self-attention mechanism is used to consider the semantic relationship between words in the multi-head self-attention mechanism and combine it with the time embedding vector to calculate the attention weight. This allows the large language model to pay more attention to temporally related or close conversation content, thereby better capturing the coherence and contextual dependencies of the conversation. The time decay mechanism is used to add a time decay factor to the weight calculation of the feedforward neural network part or the self-attention mechanism, so that the influence of the previous dialogue round on the current generated answer gradually weakens.

9. A generative dialogue system based on a large language model according to claim 1, characterized in that: The dialogue interface module supports multiple input methods, including text input, voice input, and image input, and can adapt to different device screen sizes and resolutions to provide a consistent and friendly user interaction experience.

Citation Information

Patent Citations

  • Equipment residual life prediction model construction method based on deep learning

    CN113051839A

  • Artificial intelligence voice call method based on large language model

    CN118486307A