Replay enhancement method and system based on large language model

Through the reply enhancement method based on the large language model, user problems are disassembled, pre-replies are generated and search optimization is carried out, which solves the problem that the existing question-and-answer system cannot effectively deal with complex problems, and achieves more efficient search and reply quality.

CN119597871APending Publication Date: 2025-03-11AISINO CORPORATION

Patent Information

Application Number
CN202411529393.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When the existing question-and-answer system handles query that users have multiple sub-questions, the search results cannot cover all sub-questions, and the user's problems and the knowledge fragment expression of the knowledge base are very different, which makes the search difficult.

Method used

The reply enhancement method based on the large language model is adopted. By receiving user questions, it disassembles them into multiple sub-problems, generates pre-replies, and performs disassembly processing. The knowledge base enhancement search is performed as a search condition, and finally the response to user questions is generated.

Benefits of technology

It effectively improves the effectiveness of problem retrieval, ensures the ability to respond to complex problems, improves the quality of responses, and optimizes the search hit rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597871A_ABST
    Figure CN119597871A_ABST
Patent Text Reader

Abstract

The invention discloses a reply enhancement method and system based on a large language model, and belongs to the technical field of data processing. The method comprises the following steps: receiving a user question, and disassembling the user question by using a large language model to generate a plurality of sub-questions corresponding to the user question; generating pre-replies corresponding to a plurality of sub-questions by using a question and answer interface of the large language model for the plurality of sub-questions; splitting the pre-replies corresponding to the plurality of sub-questions to obtain split text segments, and performing enhanced retrieval in a knowledge base by taking the split text segments corresponding to the plurality of sub-questions as retrieval conditions to obtain a retrieval text; through the large language model, replies corresponding to the sub-questions are generated according to the retrieval text, and replies of the user question are generated according to the replies corresponding to the sub-questions on the basis of a preset reply generation strategy and the replies corresponding to the sub-questions. According to the method, the effectiveness of question retrieval is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and more specifically, to a reply enhancement method and system based on a large language model. Background Art

[0002] The question-answering system is a comprehensive application system in natural language processing. It has a wide range of application scenarios and has been widely used in various industries. The question-answering system usually contains multiple sub-parts, including knowledge base construction, user question processing, semantic matching, answer generation and other steps.

[0003] Large Language Model (LLM) is an autoregressive language generation model based on the Transformer Decoder structure. Such models usually have billions of parameters and perform well in many natural language processing tasks, including text generation, machine translation, text classification, question answering, and other tasks.

[0004] For question answering in specific fields such as finance, law, and taxation, retrieval enhancement technology is usually used to improve the model's response ability, but there are still some problems, as follows:

[0005] 1) A user's question contains multiple sub-questions, and the search results cannot cover all sub-questions;

[0006] 2) There are large differences between the expressions of user questions and knowledge fragments in the knowledge base, making retrieval difficult. Summary of the invention

[0007] In view of the above problems, the present invention proposes a reply enhancement method based on a large language model, comprising:

[0008] Receive a user question, and use the large language model to decompose the user question to generate multiple sub-questions corresponding to the user question;

[0009] Using the question-answering interface of the large language model, generating pre-responses corresponding to the multiple sub-questions for the multiple sub-questions;

[0010] Splitting the pre-answers corresponding to the multiple sub-questions to obtain text segments of the split answers, and using the text segments of the split answers corresponding to the multiple sub-questions as search conditions to perform enhanced search in the knowledge base to obtain search texts;

[0011] Replies corresponding to a plurality of sub-questions are generated according to the search text by using the large language model, and replies to the user's question are generated according to the replies corresponding to the plurality of sub-questions based on a preset reply generation strategy.

[0012] Optionally, the user question is decomposed using the large language model to generate multiple sub-questions corresponding to the user question, including:

[0013] Define a task prompt template, and fill the user question into the defined task prompt template to generate a question prompt template;

[0014] Inputting the question prompt template into the large language model, using the large language model to decompose the user question according to the question prompt template, and generating a plurality of sub-questions corresponding to the user question;

[0015] The user questions include: user questions and user conversation records;

[0016] The task prompt template includes: a text for guiding the large language model to complete the specified task.

[0017] Optionally, the reply enhancement method also includes:

[0018] Generate a question list based on multiple sub-questions corresponding to the user's question.

[0019] Optionally, using the question-answering interface of the large language model, for multiple sub-questions, generating pre-replies corresponding to multiple sub-questions, including:

[0020] The question list is sent to the question-answering interface of the large language model, and through the question-answering interface, a pre-response is made to a plurality of sub-questions in the question list according to the question list.

[0021] Optionally, splitting the pre-answers corresponding to the multiple sub-questions into segments includes:

[0022] Split the large text of the pre-response into smaller text snippets.

[0023] Optionally, based on a preset reply generation strategy, generating a reply to the user question according to the replies corresponding to the multiple sub-questions includes:

[0024] Based on a preset response generation strategy, selecting response fragments from the responses corresponding to the multiple sub-questions;

[0025] splicing the reply fragments into a reply prompt, wherein the reply prompt includes: a final reply text;

[0026] The reply prompt is sent to a large language model, and the large language model is used to obtain an answer fragment according to the reply prompt. After replacing the final reply text in the reply prompt with the answer fragment, a reply to the user's question is output.

[0027] Optionally, the preset response generation strategy is an iterative strategy, and the output response to the user question is the output result of the last round of iteration.

[0028] On the other hand, the present invention also proposes a reply enhancement system based on a large language model, comprising:

[0029] A decomposition unit, configured to receive a user question and decompose the user question using the large language model to generate a plurality of sub-questions corresponding to the user question;

[0030] A pre-response unit, configured to generate pre-responses corresponding to the multiple sub-questions using the question-answering interface of the large language model;

[0031] A stripping unit, configured to strip the pre-answers corresponding to the plurality of sub-questions to obtain stripped text segments, and to perform enhanced search in the knowledge base using the stripped text segments corresponding to the plurality of sub-questions as search conditions to obtain search text;

[0032] A reply unit is used to generate replies corresponding to multiple sub-questions according to the search text through the large language model, and generate replies to user questions based on the replies corresponding to the multiple sub-questions based on a preset reply generation strategy.

[0033] Optionally, the decomposition unit decomposes the user question using the large language model to generate multiple sub-questions corresponding to the user question, including:

[0034] Define a task prompt template, and fill the user question into the defined task prompt template to generate a question prompt template;

[0035] Inputting the question prompt template into the large language model, using the large language model to decompose the user question according to the question prompt template, and generating a plurality of sub-questions corresponding to the user question;

[0036] The user questions include: user questions and user conversation records;

[0037] The task prompt template includes: a text for guiding the large language model to complete the specified task.

[0038] Optionally, the disassembly unit is also used to:

[0039] Generate a question list based on multiple sub-questions corresponding to the user's question.

[0040] Optionally, the pre-response unit uses the question-answering interface of the large language model to generate pre-responses corresponding to the multiple sub-questions, including:

[0041] The question list is sent to the question-answering interface of the large language model, and through the question-answering interface, a pre-response is made to a plurality of sub-questions in the question list according to the question list.

[0042] Optionally, the stripping unit strips the pre-answers corresponding to the multiple sub-questions, including:

[0043] Split the large text of the pre-response into smaller text snippets.

[0044] Optionally, the reply unit generates a reply to the user question based on a preset reply generation strategy and according to replies corresponding to the multiple sub-questions, including:

[0045] Based on a preset response generation strategy, selecting response fragments from the responses corresponding to the multiple sub-questions;

[0046] splicing the reply fragments into a reply prompt, wherein the reply prompt includes: a final reply text;

[0047] The reply prompt is sent to a large language model, and the large language model is used to obtain an answer fragment according to the reply prompt. After replacing the final reply text in the reply prompt with the answer fragment, a reply to the user's question is output.

[0048] Optionally, the preset response generation strategy is an iterative strategy, and the output response to the user question is the output result of the last round of iteration.

[0049] In yet another aspect, the present invention further provides a computing device, comprising: one or more processors;

[0050] a processor for executing one or more programs;

[0051] When the one or more programs are executed by the one or more processors, the above-described method is implemented.

[0052] In yet another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the method described above is implemented.

[0053] Compared with the prior art, the present invention has the following beneficial effects:

[0054] The present invention provides a reply enhancement method based on a large language model, comprising: receiving a user question, using the large language model to decompose the user question to generate multiple sub-questions corresponding to the user question; using the question-answering interface of the large language model to generate multiple pre-replies corresponding to the multiple sub-questions for the multiple sub-questions; decomposing the pre-replies corresponding to the multiple sub-questions to obtain decompressed text fragments, using the decompressed text fragments corresponding to the multiple sub-questions as retrieval conditions, performing enhanced retrieval in a knowledge base to obtain retrieval text; generating replies corresponding to multiple sub-questions according to the retrieval text through the large language model, and generating replies to the user question according to the replies corresponding to the multiple sub-questions based on a preset reply generation strategy. The present invention effectively improves the effectiveness of question retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 is a flow chart of the method of the present invention;

[0056] Figure 2 is a flow chart of an embodiment of the method of the present invention;

[0057] Figure 3 It is a structural diagram of the system of the present invention. DETAILED DESCRIPTION

[0058] Now, exemplary embodiments of the present invention are described with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely and to fully convey the scope of the present invention to those skilled in the art. The terms used in the exemplary embodiments shown in the accompanying drawings are not intended to limit the present invention. In the accompanying drawings, the same units / elements are marked with the same reference numerals.

[0059] Unless otherwise specified, the terms (including technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is understood that the terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.

[0060] Embodiment 1:

[0061] The present invention also proposes a reply enhancement method based on a large language model, such as Figure 1 As shown, including:

[0062] Step 1: receiving a user question, and using the large language model to decompose the user question to generate multiple sub-questions corresponding to the user question;

[0063] Step 2: using the question-answering interface of the large language model, for multiple sub-questions, generate pre-responses corresponding to the multiple sub-questions;

[0064] Step 3: Split the pre-answers corresponding to the multiple sub-questions into strips to obtain stripped text segments, and use the stripped text segments corresponding to the multiple sub-questions as search conditions to perform enhanced search in the knowledge base to obtain search texts;

[0065] Step 4: Generate replies corresponding to multiple sub-questions according to the search text using the large language model, and generate replies to the user's question based on the replies corresponding to the multiple sub-questions based on a preset reply generation strategy.

[0066] The user question is decomposed using the large language model to generate multiple sub-questions corresponding to the user question, including:

[0067] Define a task prompt template, and fill the user question into the defined task prompt template to generate a question prompt template;

[0068] Inputting the question prompt template into the large language model, using the large language model to decompose the user question according to the question prompt template, and generating a plurality of sub-questions corresponding to the user question;

[0069] The user questions include: user questions and user conversation records;

[0070] The task prompt template includes: a text for guiding the large language model to complete the specified task.

[0071] The reply enhancement method further includes:

[0072] Generate a question list based on multiple sub-questions corresponding to the user's question.

[0073] The question-answering interface of the large language model is used to generate pre-replies corresponding to multiple sub-questions, including:

[0074] The question list is sent to the question-answering interface of the large language model, and through the question-answering interface, a pre-response is made to a plurality of sub-questions in the question list according to the question list.

[0075] The pre-answers corresponding to the multiple sub-questions are split into strips, including:

[0076] Split the large text of the pre-response into smaller text snippets.

[0077] Wherein, based on a preset reply generation strategy, generating a reply to the user's question according to the replies corresponding to the multiple sub-questions includes:

[0078] Based on a preset response generation strategy, selecting response fragments from the responses corresponding to the multiple sub-questions;

[0079] splicing the reply fragments into a reply prompt, wherein the reply prompt includes: a final reply text;

[0080] The reply prompt is sent to a large language model, and the large language model is used to obtain an answer fragment according to the reply prompt. After replacing the final reply text in the reply prompt with the answer fragment, a reply to the user's question is output.

[0081] Among them, the preset response generation strategy is an iterative strategy, and the output response to the user question is the output result of the last round of iteration.

[0082] The present invention is further described below with reference to specific cases:

[0083] The specific case process mainly includes four stages: question segmentation, pre-response content generation, retrieval enhancement and model response generation. The specific process is as follows Figure 2 As shown, including:

[0084] Question segmentation, including:

[0085] Use the large language model to decompose questions. Given a user input question, the large language model generates a series of sub-questions. The steps are as follows:

[0086] Define the task prompt template. Prompt is a piece of text used to guide the big language model to complete a specified task. The question sentence extension prompt template can be adjusted according to the specific big model version used.

[0087] The question extension prompt template is as follows:

[0088] Instructions: You are a user consultation assistant. You will receive a user question and conversation history. Please determine whether the user question contains multiple sub-questions. If it contains sub-questions, please output the sub-question list in JSON format; otherwise, return a JSON list containing only the original question.

[0089] Question: $question$

[0090] Conversation history: $Conversation history$

[0091] In the above template, $question$ and $conversation history$ are placeholders for text replacement.

[0092] Get the user's question and conversation history, and fill them into the prompt template.

[0093] Send the filled template to the big model to get the rewritten question list in the format of ["Sub-question 1", "Sub-question 2"..., "Sub-question n"]

[0094] The pre-reply content is generated as follows:

[0095] The list of questions obtained in the question splitting stage is sent to the large model question-answering interface in sequence to obtain the large model response content of the first stage, and a new question list is constructed: [("sub-question 1", "pre-response content 1"), ("sub-question 2", "pre-response content 2"), ..., ("sub-question n", "pre-response content n")]. The pre-response content is highly related to the sub-questions and introduces additional information. Compared with the original question, the pre-response content expands the semantic information, making up for the lack of reasoning ability of the retrieval system, thereby improving the retrieval recall rate. For example, for the user's question "My family bought carrots from the countryside, washed and packaged them before selling them, what is the tax rate?" If the text search is performed directly, it is difficult for the searcher to associate "washed and packaged before selling" with "vegetable circulation links", and instead it will retrieve the relevant content of "carrot tax rate", resulting in retrieval errors. On the other hand, the model's pre-response was: "If your family bought carrots from the countryside, washed them, and simply packaged them before selling them, this may be considered as primary processing. The income tax rate in the vegetable circulation link may vary according to local laws and regulations. Please consult the local tax bureau." Although the model's response did not correctly respond to the user's content, it supplemented key information such as "primary processing" and "vegetable circulation link", thereby achieving correct retrieval by the search module.

[0096] Retrieval enhancements are as follows:

[0097] The search enhancement phase is generally divided into two parts: offline processing and online search. The offline processing part splits large text into smaller text segments. Compared with large text segments, small text segments can:

[0098] 1) Reduce the noise in the vector encoding process, thereby enhancing the retrieval accuracy;

[0099] 2) Reduce the cost of model inference and improve the information density in prompts of the same length.

[0100] Commonly used text segmentation methods include fixed-length segmentation, sentence-based segmentation, recursive segmentation, and specific text segmentation. The above segmentation methods have the problem of losing semantic information. For example, for the following text fragments:

[0101] “Article 2 The following cross-border taxable activities are exempt from value-added tax:

[0102] (1) Construction services for engineering projects located abroad.

[0103] The construction services provided by the general contractor and subcontractors for construction projects located abroad are all considered construction services for construction projects located abroad.

[0104] (2) Engineering supervision services for engineering projects located abroad.

[0105] (3) Engineering survey and exploration services for projects and mineral resources outside the country.

[0106] (IV) Conference and exhibition services where the venue is overseas.

[0107] The organization and arrangement services provided for clients to participate in conferences and exhibitions held overseas are considered conference and exhibition services with the conference and exhibition venues located overseas.

[0108] (V) Warehousing services with storage locations outside the country.

[0109] (VI) Tangible movable property leasing services where the subject matter is used overseas.

[0110] The existing stripping method will cause the key information "the following cross-border taxable activities are exempt from value-added tax" to be lost in the remaining paragraphs except the first paragraph, and the paragraphs are meaningless. The present invention adopts a heuristic stripping rule to splice the key information of the paragraphs after stripping, and the key information of the paragraphs includes the title and the parent list.

[0111] After adopting the present invention, the stripping result is:

[0112] First text:

[0113] “Article 2 The following cross-border taxable activities are exempt from value-added tax:

[0114] (1) Construction services for engineering projects located abroad.

[0115] The construction services provided by the general contractor and subcontractors for construction projects located abroad are all considered construction services for construction projects located abroad.

[0116] (2) Engineering supervision services for engineering projects located abroad.

[0117] (3) Engineering survey and exploration services for projects and mineral resources outside China.

[0118] Article 2 Text:

[0119] “Article 2 The following cross-border taxable activities are exempt from value-added tax:

[0120] (IV) Conference and exhibition services where the venue is overseas.

[0121] The organization and arrangement services provided for clients to participate in conferences and exhibitions held overseas are considered conference and exhibition services with the conference and exhibition venues located overseas.

[0122] (V) Warehousing services with storage locations outside the country.

[0123] (VI) Tangible movable property leasing services where the subject matter is used overseas.

[0124] In the online search part, the present invention uses sub-questions and model pre-responses as search conditions to participate in knowledge base search and recall. The present invention improves the search effect by expanding the search conditions. The specific search tool can use mature software such as ElasticSearch and Milvus, which will not be described in detail in the present invention.

[0125] The reply is generated as follows:

[0126] As mentioned above, the present invention first splits the user's question and responds to each split question separately. Since the split questions still have a certain relevance, the model's response content inevitably has problems such as repeated answers and incoherence. To address this problem, this patent designs a response generation strategy that combines multiple response fragments into a single response that is logically consistent, concise and clear. The present invention designs two response generation strategies: iterative generation and one-time generation.

[0127] The iterative generation strategy feeds multiple reply fragments into the large model in sequence for content extraction. The operation steps are as follows:

[0128] Step 1: Initialize the final reply text and select the reply segments one by one

[0129] Step 2: For each reply segment selected in step 1, concatenate prompts. The prompt template is as follows:

[0130] Instructions: You are a reply summary assistant. You will receive user questions, reply text snippets, and final reply text. Your task is to combine user questions and the content of the reply text to enrich the final reply. You need to decide whether to use the reply snippet based on the user's question. If you use it, rewrite the final reply text. The rewritten text needs to be coherent and logical. If you do not use it, return the final text as it is.

[0131] User questions: $User questions$

[0132] Reply to sub-section: $Reply to sub-section$

[0133] Final response text: $Final response text$

[0134] Among them, $user question$, $reply segment$, and $final reply text$ are text placeholders used for text replacement.

[0135] Step 3: Feed the above prompt into the large language model to obtain the answer fragment, and replace the final reply text with the answer fragment.

[0136] Step 4: Repeat steps 2-3 above

[0137] Step 5: Return the output of the last round as the final answer

[0138] The one-time generation strategy constructs prompts from multiple reply fragments and feeds them into the large language model at once to obtain the total reply text. The prompt template is constructed as follows:

[0139] Instructions: You are a reply summary assistant. You will receive user questions and multiple reply text fragments. Your task is to combine the user questions and the contents of multiple reply texts to generate a rich final reply. You need to decide the final reply content based on the user's questions. The text needs to be fluent and logical.

[0140] User questions: $User questions$

[0141] Reply to sub-section: $Reply to sub-section$;

[0142] The advantages of the present invention are:

[0143] The ability of the question-answering system based on a large language model to respond to complex questions has been enhanced, and the quality of responses has been improved;

[0144] Using model pre-responses for retrieval improves the retrieval hit rate of the retrieval system without introducing additional systems or expert knowledge;

[0145] The text splitting granularity is optimized to avoid loss of semantic information in the splitting results, thereby improving the retrieval hit rate.

[0146] Embodiment 2:

[0147] On the other hand, the present invention also proposes a reply enhancement system 200 based on a large language model, such as Figure 3 As shown, including:

[0148] A decomposition unit 201 is used to receive a user question and decompose the user question using the large language model to generate a plurality of sub-questions corresponding to the user question;

[0149] A pre-response unit 202, configured to generate pre-responses corresponding to the multiple sub-questions using the question-answering interface of the large language model for the multiple sub-questions;

[0150] A stripping unit 203 is used to strip the pre-answers corresponding to the multiple sub-questions to obtain stripped text segments, and use the stripped text segments corresponding to the multiple sub-questions as search conditions to perform enhanced search in the knowledge base to obtain search text;

[0151] The reply unit 204 is used to generate replies corresponding to multiple sub-questions according to the search text using the large language model, and generate a reply to the user's question based on the replies corresponding to the multiple sub-questions based on a preset reply generation strategy.

[0152] The decomposition unit 201 decomposes the user question using the large language model to generate multiple sub-questions corresponding to the user question, including:

[0153] Define a task prompt template, and fill the user question into the defined task prompt template to generate a question prompt template;

[0154] Inputting the question prompt template into the large language model, using the large language model to decompose the user question according to the question prompt template, and generating a plurality of sub-questions corresponding to the user question;

[0155] The user questions include: user questions and user conversation records;

[0156] The task prompt template includes: a text for guiding the large language model to complete the specified task.

[0157] The disassembling unit 201 is also used for:

[0158] Generate a question list based on multiple sub-questions corresponding to the user's question.

[0159] The pre-response unit 202 uses the question-answering interface of the large language model to generate pre-responses corresponding to the multiple sub-questions, including:

[0160] The question list is sent to the question-answering interface of the large language model, and through the question-answering interface, a pre-response is made to a plurality of sub-questions in the question list according to the question list.

[0161] The stripping unit 203 strips the pre-answers corresponding to the multiple sub-questions, including:

[0162] Split the large text of the pre-response into smaller text snippets.

[0163] The reply unit 204 generates a reply to the user's question based on a preset reply generation strategy and according to replies corresponding to the multiple sub-questions, including:

[0164] Based on a preset response generation strategy, selecting response fragments from the responses corresponding to the multiple sub-questions;

[0165] splicing the reply fragments into a reply prompt, wherein the reply prompt includes: a final reply text;

[0166] The reply prompt is sent to a large language model, and the large language model is used to obtain an answer fragment according to the reply prompt. After replacing the final reply text in the reply prompt with the answer fragment, a reply to the user's question is output.

[0167] Among them, the preset response generation strategy is an iterative strategy, and the output response to the user question is the output result of the last round of iteration.

[0168] The present invention effectively improves the effectiveness of question retrieval.

[0169] Embodiment 3:

[0170] Based on the same inventive concept, the present invention also provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of the method in the above embodiment.

[0171] Embodiment 4:

[0172] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both a built-in storage medium in a computer device and an extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of the method in the above embodiment.

[0173] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0174] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0177] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0178] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A reply enhancement method based on a large language model, characterized in that: include: Receive a user question, and use the large language model to decompose the user question to generate multiple sub-questions corresponding to the user question; Using the question-answering interface of the large language model, generating pre-responses corresponding to the multiple sub-questions for the multiple sub-questions; Splitting the pre-answers corresponding to the multiple sub-questions to obtain text segments of the split answers, and using the text segments of the split answers corresponding to the multiple sub-questions as search conditions to perform enhanced search in the knowledge base to obtain search texts; Replies corresponding to a plurality of sub-questions are generated according to the search text by using the large language model, and replies to the user's question are generated according to the replies corresponding to the plurality of sub-questions based on a preset reply generation strategy.

2. The recovery enhancement method according to claim 1, characterized in that: The using the large language model to decompose the user question to generate a plurality of sub-questions corresponding to the user question includes: Define a task prompt template, and fill the user question into the defined task prompt template to generate a question prompt template; Inputting the question prompt template into the large language model, using the large language model to decompose the user question according to the question prompt template, and generating a plurality of sub-questions corresponding to the user question; The user questions include: user questions and user conversation records; The task prompt template includes: a text for guiding the large language model to complete the specified task.

3. The recovery enhancement method according to claim 2, characterized in that: The response enhancement method further comprises: Generate a question list based on multiple sub-questions corresponding to the user's question.

4. The recovery enhancement method according to claim 1, characterized in that: The question-answering interface using the large language model generates, for a plurality of sub-questions, pre-replies corresponding to the plurality of sub-questions, including: The question list is sent to the question-answering interface of the large language model, and through the question-answering interface, a pre-response is made to a plurality of sub-questions in the question list according to the question list.

5. The recovery enhancement method according to claim 1, characterized in that: The step of splitting the pre-answers corresponding to the multiple sub-questions into strips includes: Split the large text of the pre-response into smaller text snippets.

6. The recovery enhancement method according to claim 1, characterized in that: The generating a reply to the user's question based on the preset reply generation strategy and according to the replies corresponding to the multiple sub-questions includes: Based on a preset response generation strategy, selecting response segments from the responses corresponding to the multiple sub-questions; splicing the reply fragments into a reply prompt, wherein the reply prompt includes: a final reply text; The reply prompt is sent to a large language model, and the large language model is used to obtain an answer fragment according to the reply prompt. After replacing the final reply text in the reply prompt with the answer fragment, a reply to the user's question is output.

7. The recovery enhancement method according to claim 6, characterized in that: The preset reply generation strategy is an iterative strategy, and the reply to the user question outputted is the output result of the last round of iteration.

8. A reply enhancement system based on a large language model, characterized in that: include: A decomposition unit, configured to receive a user question and decompose the user question using the large language model to generate a plurality of sub-questions corresponding to the user question; A pre-response unit, configured to generate pre-responses corresponding to the multiple sub-questions using the question-answering interface of the large language model; A stripping unit, configured to strip the pre-answers corresponding to the plurality of sub-questions to obtain stripped text segments, and to perform enhanced search in the knowledge base using the stripped text segments corresponding to the plurality of sub-questions as search conditions to obtain search text; A reply unit is used to generate replies corresponding to multiple sub-questions according to the search text through the large language model, and generate replies to user questions based on the replies corresponding to the multiple sub-questions based on a preset reply generation strategy.

9. A computer device, characterized in that: include: one or more processors; a processor for executing one or more programs; When the one or more programs are executed by the one or more processors, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Knowledge enhancement-based large model question and answer method, apparatus and device, and medium

    CN117669717A

  • Method and device for generating reply based on retrieval enhancement large model

    CN118626605A

  • Method for improving answer accuracy for generative ai-based multiple questions

    KR102711560B1

Cited By

  • Programs, information processing devices, methods, and systems

    JP7880107B1