Session processing method, system and equipment based on large language model
By analyzing conversation text and task type, and dynamically switching large language models to adapt to the conversation context, the problem of incoherent context and fragmented user experience in existing conversation processing systems is solved, achieving coherence and diverse adaptability in conversation processing.
Patent Information
- Application Number
- CN202510802285.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-11-18
AI Technical Summary
Existing session processing systems typically only select a single large language model when processing the same session, resulting in inconsistent contexts between different session contents, fragmented user experience, and difficulty in meeting the diverse session processing needs in complex scenarios.
By acquiring the current dialogue text of the conversation, analyzing the task type and model switching intention, it is determined whether the current active large language model is applicable. If it is not applicable, the target large language model is determined, and the conversation context of the active large language model is converted into the context applicable to the target large language model. The large language model is then dynamically switched to process the current dialogue text.
It enables dynamic switching of large language models within the same conversation and automatic adaptation of conversation context, improving the accuracy of responses, ensuring the coherence of conversation context, enhancing user experience, and making it suitable for diverse application scenarios.
Smart Images

Figure CN120973889A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a conversation processing technology based on a large language model. BACKGROUND
[0002] With the rapid development of artificial intelligence technology, various large language models (LLM) have emerged. Different large language models (such as OpenAI's GPT series, Baidu's Ernie Bot, Patsnap's Starfire, Alibaba's Tongyiqw, Tencent's Hunyuan, Huawei's Pangu, Deepseek, etc.) usually adopt a single model architecture and have different strengths and limitations in their respective fields. For example, some large language models excel in creative generation, while others are more accurate in rigorous reasoning or professional knowledge.
[0003] The conversation processing system in the prior art can usually only select a single large language model as a conversation engine when processing the same conversation. When a user needs to obtain a more satisfactory conversation result, multiple conversations need to be established according to different problem characteristics or user needs, which may result in incoherent context, fragmented user experience, and difficulty in meeting the diversified conversation processing needs in complex scenarios. SUMMARY
[0004] The purpose of the present application is to provide a large language model-based conversation processing method, system and device to at least partially solve the technical problems of the prior art in processing the same conversation including different problem characteristics or user needs, which may result in incoherent context, fragmented user experience, and difficulty in meeting the diversified conversation processing needs in complex scenarios.
[0005] According to one aspect of the present application, a large language model-based conversation processing method is provided, wherein the method comprises:
[0006] obtaining and analyzing the current dialogue text of the conversation, determining the task type of the current dialogue text, and whether it includes a model switching intent;
[0007] According to whether the current dialogue text includes a model switching intent, the task type, the size of the conversation context after the current active large language model processes the previous dialogue text, and the response quality evaluation result, it is determined whether the current active large language model is suitable, and if not, a target large language model is determined;
[0008] Converting the conversation context after the current active large language model processes the previous dialogue text into a conversation context suitable for the target large language model;
[0009] The target large language model is taken as a current active large language model, and the current dialogue text is processed in combination with a conversation context applicable to the target large language model, to obtain an answer corresponding to the current dialogue text.
[0010] Optionally, the determination of whether the current active large language model is applicable according to whether the current dialogue text includes a model switching intention, the task type, a conversation context size after the current active large language model processes a previous dialogue text, and a response quality evaluation result comprises:
[0011] If the current dialogue text includes the model switching intention, a large language model matched with the model switching intention is determined from a preset large language model list as the target large language model.
[0012] If the current dialogue text does not include the model switching intention, and a comparison result of the conversation context size after the current active large language model processes the previous dialogue text with a context window supported by the current active large language model does not satisfy a preset context window limit threshold, it is determined that the current active large language model is not applicable, a comprehensive matching degree of each large language model in the preset large language model list is determined according to the task type, the conversation context size after the current active large language model processes the previous dialogue text, and the response quality evaluation result, and a large language model with a highest comprehensive matching degree is taken as the target large language model.
[0013] Optionally, the conversation context after the current active large language model processes the previous dialogue text comprises:
[0014] a general representation and specific information corresponding to the current active large language model, wherein
[0015] the general representation comprises sequential text content of the conversation context after the current active large language model processes the previous dialogue text, and a role identifier.
[0016] the specific information comprises an instruction format, a control parameter, a system prompt word format, a role setting rule, an internal state memory, an enhanced instruction of a specific task, and a special function mark.
[0017] Optionally, the conversion of the conversation context after the current active large language model processes the previous dialogue text into the conversation context applicable to the target large language model comprises:
[0018] conversion of specific information corresponding to the current active large language model into specific information corresponding to the target large language model.
[0019] The general representation and specific information corresponding to the target large language model are used as a conversation context applicable to the target large language model.
[0020] Optionally, before the target large language model is used as the currently active large language model, the method further comprises:
[0021] If the response quality evaluation result does not meet the preset response quality threshold, a quality problem type is determined, a requirement for the capability of the large language model is determined according to the quality problem type, and capability compensation is performed on the target large language model according to the requirement and the capability of the target large language model.
[0022] The target large language model is used as the currently active large language model.
[0023] The target large language model after capability compensation is used as the currently active large language model.
[0024] Optionally, the capability of the large language model comprises:
[0025] A capability profile of the large language model;
[0026] A feature supported by the large language model;
[0027] A context window supported by the large language model;
[0028] A technical response speed and a Token efficiency of the large language model.
[0029] Optionally, the capability profile of the large language model comprises:
[0030] Creative capability, reasoning capability, code capability, multilingual capability, and knowledge coverage capability.
[0031] Optionally, the feature supported by the large language model comprises:
[0032] Thinking chain, network search, code execution, image understanding, tool invocation, function invocation, plug-in, streaming output, and multi-modal input.
[0033] Optionally, the capability compensation performed on the target large language model according to the requirement and the capability of the target large language model comprises:
[0034] The requirement and the score of the capability of the target large language model are compared item by item, and a capability item with a score difference meeting a preset threshold is determined as a to-be-compensated capability item of the target large language model.
[0035] A preset instruction corresponding to the to-be-compensated capability item is executed to perform capability compensation on the to-be-compensated capability item of the target large language model.
[0036] Optionally, wherein the requirement for determining the capability of the large language model according to the quality problem type comprises:
[0037] mapping according to the quality problem type, wherein,
[0038] if the quality problem type includes an irrelevant type, mapping the irrelevant problem to the relevance understanding capability requirement;
[0039] if the quality problem type includes a fact error type, mapping the fact error problem to the knowledge coverage capability and the accuracy capability requirement;
[0040] if the quality problem type includes an incomplete answer type, mapping the incomplete answer problem to the comprehensiveness and detail grasp capability requirement;
[0041] if the quality problem type includes a context inconsistency type, mapping the context inconsistency problem to the context understanding and memory capability requirement;
[0042] if the quality problem type includes an illusion type, mapping the illusion problem to the fact checking capability requirement;
[0043] if the quality problem type includes a self-contradictory type, mapping the self-contradictory problem to the logical reasoning capability requirement;
[0044] determining the requirement for the capability of the large language model based on preset weights corresponding to each quality problem type.
[0045] Optionally, wherein the obtaining of the response quality evaluation result of the current active large language model after processing the previous dialogue text comprises:
[0046] obtaining a response quality score of the current active large language model after processing the previous dialogue text;
[0047] comparing the response quality score with a preset response quality score threshold, and determining the response quality evaluation result of the current active large language model after processing the previous dialogue text according to the comparison result.
[0048] Optionally, wherein the obtaining of the response quality score of the current active large language model after processing the previous dialogue text comprises:
[0049] respectively obtaining response quality scores of multiple dimensions of the current active large language model after processing the previous dialogue text, wherein the multiple dimensions at least include relevance, accuracy, completeness, consistency and user satisfaction;
[0050] The response quality score of each dimension is compared with the preset response quality score threshold of the corresponding dimension to obtain a comparison result of each dimension.
[0051] Based on the comparison result of each dimension and the preset weight of the corresponding dimension, a response quality evaluation result of the current active large language model after processing the previous dialogue text is determined.
[0052] Optionally, wherein the obtaining of the response quality score of the relevance dimension of the current active large language model after processing the previous dialogue text comprises:
[0053] Extracting keywords and topics in the current dialogue text, and extracting keywords and topics in the conversation context after the current active large language model processing the previous dialogue text;
[0054] Respectively calculating the matching rate of the keywords in the current dialogue text and the keywords in the conversation context after the current active large language model processing the previous dialogue text, and the matching rate of the topics in the current dialogue text and the topics in the conversation context after the current active large language model processing the previous dialogue text;
[0055] Calculating the semantic similarity between the current dialogue text and the conversation context after the current active large language model processing the previous dialogue text;
[0056] Based on the preset weight, the matching rate of the keywords, the matching rate of the topics and the semantic similarity are weighted calculated to obtain the response quality score of the relevance dimension of the current active large language model after processing the previous dialogue text.
[0057] Optionally, wherein the obtaining of the response quality score of the accuracy dimension of the current active large language model after processing the previous dialogue text comprises:
[0058] Extracting factual statements from the conversation context after the current active large language model processing the previous dialogue text, and verifying each factual statement to obtain a verification result;
[0059] Based on the verification result, calculating a factual accuracy rate;
[0060] Calculating the logical matching rate of the conversation context after the current active large language model processing the previous dialogue text;
[0061] Based on the preset weight, the factual accuracy rate and the logical matching rate are weighted calculated to obtain the response quality score of the accuracy dimension of the current active large language model after processing the previous dialogue text.
[0062] Optionally, wherein the obtaining of the response quality score of the completeness dimension of the current active large language model after processing the previous dialogue text comprises:
[0063] determine a key point in the current dialogue text and a key point in a session context after the current active large language model processes the previous dialogue text, respectively, and determine a key point coverage rate;
[0064] check whether there is an obvious truncation or incomplete mark in the session context after the current active large language model processes the previous dialogue text, to obtain a check result;
[0065] determine a response quality score of an integrity dimension of the current active large language model after processing the previous dialogue text based on the key point coverage rate and the check result.
[0066] Optionally, wherein the obtaining the response quality score of the consistency dimension of the current active large language model after processing the previous dialogue text comprises:
[0067] extracting a key point and a factual statement in the session context after the current active large language model processes the previous dialogue text;
[0068] processing the current dialogue text by using the current active large language model in combination with the session context after the current active large language model processes the previous dialogue text, to obtain an answer corresponding to the current dialogue text, and extracting a key point and a factual statement in the answer;
[0069] checking whether there is a contradiction between the key point and the factual statement in the answer and the key point and the factual statement in the session context after the current active large language model processes the previous dialogue text, to obtain a contradiction check result;
[0070] checking a reference accuracy of information in the current dialogue text in the answer, to obtain a reference accuracy check result;
[0071] checking a style consistency of the answer with the session context after the current active large language model processes the previous dialogue text, to obtain a style consistency check result;
[0072] determining a response quality score of a consistency dimension of the current active large language model after processing the previous dialogue text based on the contradiction check result, the reference accuracy check result, and the style consistency check result.
[0073] Optionally, wherein the obtaining the response quality score of the user satisfaction dimension of the current active large language model after processing the previous dialogue text comprises:
[0074] obtaining explicit feedback information of a user;
[0075] Based on a preset user behavior index, analyze user behavior, and use the analysis result as implicit feedback information of the user, wherein the user behavior index at least includes: repeated query times, whether there is a correction behavior, and a satisfaction mark;
[0076] Input the conversation context after the current active large language model processes the previous dialogue text into a preset machine learning model to obtain a predicted user satisfaction degree;
[0077] Based on the explicit feedback information, the implicit feedback information, and the predicted user satisfaction degree, determine the response quality score of the user satisfaction degree dimension after the current active large language model processes the previous dialogue text.
[0078] Optionally, the method further comprises:
[0079] Return the answer to the client to show to the user.
[0080] According to another aspect of the present application, a large language model-based conversation processing method is provided, wherein the method comprises:
[0081] Obtain and analyze the current dialogue text input by the user through the client, determine the task order of the current dialogue text and the task type of each task, and take the first task as the current task according to the task order;
[0082] Determine the dialogue text corresponding to the current task in the current dialogue text, and determine whether the current active large language model is applicable according to whether the dialogue text of the current task includes a model switching intent, the task type of the current task, the size of the conversation context after the current active large language model processes the previous dialogue text, and the response quality evaluation result, if not, determine the target large language model;
[0083] Convert the conversation context after the current active large language model processes the previous dialogue text into a conversation context suitable for the target large language model, if the response quality evaluation result does not meet a preset response quality threshold, determine the quality problem type, and according to the requirement of the ability of the large language model and the ability of the target large language model, perform ability compensation on the target large language model;
[0084] Based on the target large language model after ability compensation, process the dialogue text of the current task in combination with the conversation context suitable for the target large language model to obtain an answer corresponding to the dialogue text of the current task;
[0085] The ability-compensated target large language model is taken as a current active large language model, and the answer is updated to a conversation context applicable to the target large language model, to obtain an updated conversation context after the current active large language model processes the previous dialogue text, and obtain a response quality evaluation result of the updated conversation context after the current active large language model processes the previous dialogue text.
[0086] Sequentially traverse each task, and iterate according to the above steps until the last task, to obtain an answer corresponding to the dialogue text of the last task.
[0087] According to another aspect of the present application, a large language model-based conversation processing system is provided, wherein the system comprises:
[0088] A client and a server, wherein,
[0089] The client is configured to provide a unified interaction interface to realize user interaction, conversation management, and local caching.
[0090] The server comprises:
[0091] A registration and management module configured to manage the life cycle of each large language model in a preset large language model list, including registration, initialization, state monitoring and destruction, and capability maintenance of the large language model.
[0092] A unified conversation context management module configured to create a conversation and maintain a conversation context, wherein the conversation context comprises a general representation and specific information corresponding to each large language model in the preset large language model list.
[0093] A switching decision module configured to obtain and analyze a current dialogue text of a conversation, determine a task type of the current dialogue text and whether the current dialogue text includes a model switching intention, and determine whether a current active large language model is applicable according to whether the current dialogue text includes the model switching intention, the task type, a size of a conversation context after the current active large language model processes a previous dialogue text, and a response quality evaluation result, and if not, determine a target large language model as the current active large language model and trigger switching.
[0094] A context conversion adaptation module configured to, when the switching decision module triggers switching, convert a conversation context after a current active large language model processes a previous dialogue text, which is maintained in the unified conversation context management module, into a conversation context applicable to the target large language model.
[0095] The text processing module is configured to, according to the trigger switching instruction of the switching decision module, take the target large language model as a current active large language model, process the current dialogue text of the conversation based on the current active large language model and the corresponding conversation context, and obtain an answer corresponding to the current dialogue text.
[0096] The capability compensation module is configured to evaluate the response quality of the current active large language model after processing the previous dialogue text, determine a quality problem type if the evaluation result does not satisfy a preset response quality threshold, determine a requirement for the capability of the large language model according to the quality problem type, and compensate the capability of the target large language model according to the requirement and the capability of the target large language model.
[0097] Compared with the prior art, the present application provides a conversation processing method, system and device based on a large language model, which comprises the following steps: obtaining and analyzing a current dialogue text of a conversation, determining a task type of the current dialogue text and whether the current dialogue text includes a model switching intention; determining whether a current active large language model is applicable according to whether the current dialogue text includes a model switching intention, the task type, the size of the conversation context after the current active large language model processes a previous dialogue text, and a response quality evaluation result, determining a target large language model if the current active large language model is not applicable; converting the conversation context after the current active large language model processes the previous dialogue text into a conversation context suitable for the target large language model; taking the target large language model as a current active large language model, processing the current dialogue text in combination with the conversation context suitable for the target large language model, and obtaining an answer corresponding to the current dialogue text. The present application can select a suitable large language model as a target large language model according to the task type of the current text and the user intention contained in the same conversation, convert the conversation context into a conversation context suitable for the target large language model, process the current text, and obtain a corresponding answer. The large language model can be dynamically switched according to the dialogue content in the dialogue process of the same conversation, and the conversation context can be automatically adapted, which can improve the accuracy of the answer and ensure the coherence of the conversation context, is suitable for diversified application scenarios, and ensures that the user experience is not fragmented. BRIEF DESCRIPTION OF DRAWINGS
[0098] Other features, objects, and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments made with reference to the accompanying drawings:
[0099] Figure 1 FIG. 1 shows a schematic diagram of a conversation processing method based on a large language model according to an aspect of the present application;
[0100] Figure 2Fig. 1 shows a schematic diagram of a method for processing a conversation based on a large language model according to an optional embodiment of one aspect of the present application;
[0101] Figure 3 Fig. 2 shows a schematic diagram of a method for processing a conversation based on a large language model according to another aspect of the present application;
[0102] Figure 4 Fig. 3 shows a schematic diagram of a system for processing a conversation based on a large language model according to another aspect of the present application;
[0103] The same or similar reference signs in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0104] The present application will be further described by examples with reference to the accompanying drawings.
[0105] In a typical configuration of the embodiments of the present application, the execution subject of the method, the trusted parties of the system and / or the modules of the apparatus can each include one or more processors (CPUs), input / output interfaces, network interfaces and memories.
[0106] The memory can include non-persistent memory in computer-readable media, random access memories (RAMs) and / or non-volatile memories such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of the computer-readable media.
[0107] The computer-readable media include non-persistent and persistent, removable and non-removable media implemented by any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Examples of the computer storage media include, but are not limited to, phase-change memories (PRAMs), static random access memories (SRAMs), dynamic random access memories (DRAMs), other types of random access memories (RAMs), read-only memories (ROMs), electrically erasable programmable read-only memories (EEPROMs), flash memories or other memory technologies, compact discs read-only memories (CD-ROMs), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible to computing devices. According to the definition herein, the computer-readable media do not include transitory media such as modulated data signals and carriers.
[0108] In order to further clarify the technical means adopted by the present application and the effects achieved, the technical solutions of the present application are described in detail below with reference to the accompanying drawings and preferred embodiments.
[0109] Figure 1 Fig. 1 shows a schematic diagram of a method for processing a conversation based on a large language model according to an aspect of the present application, wherein the method of one embodiment comprises:
[0110] S101 obtaining and analyzing the current dialogue text of a conversation, determining the task type of the current dialogue text, and whether it includes a model switching intention;
[0111] S102 determining whether the currently active large language model is suitable according to whether the current dialogue text includes a model switching intention, the task type, the size of the conversation context after the currently active large language model processes the previous dialogue text, and the response quality evaluation result, and if not, determining a target large language model;
[0112] S103 converting the conversation context after the currently active large language model processes the previous dialogue text into a conversation context suitable for the target large language model;
[0113] S105 taking the target large language model as the currently active large language model, processing the current dialogue text in combination with the conversation context suitable for the target large language model, and obtaining the answer corresponding to the current dialogue text.
[0114] In human-computer interaction, a conversation usually includes multiple dialogues, and the machine processes user input according to the deployed conversation processing method. The conversation processing method claimed in the present application is implemented and / or executed by a client 200 and a server 100. The client 200 and the server 100 can be a computer device and / or a cloud with necessary software and hardware environment. The computer device includes but is not limited to a personal computer, a notebook computer, an industrial computer, an embedded computer, a server, a network host, a single network server or a network server cluster; the cloud is composed of a large number of computers or network servers based on cloud computing, wherein cloud computing is a kind of distributed computing, which is composed of a virtual supercomputer formed by a group of loosely coupled computer clusters.
[0115] Here, the computer device and / or cloud are only examples, and other existing or future devices and / or resource platforms suitable for the present application should also be included in the protection scope of the present application, which are hereby incorporated by reference.
[0116] In this embodiment, in step S101, when processing a conversation, the server 100 can obtain and analyze the current dialogue text of the conversation, determine the task type of the current dialogue text, and whether it includes a model switching intention.
[0117] In the human-computer interaction session, the user can input the current content to be asked or consulted through the client 200, which can be input in the form of text, voice, image, and / or video, etc. The server 100 can obtain the text of the current input content of the user as the current dialogue text, and analyze it to determine the task type corresponding to the current dialogue text (usually the task type corresponding to the user input content is single), and whether it includes a model switching intention, i.e., specifying a large language model for processing the current input content in the user's current input content.
[0118] Continuing in this embodiment, in step S102, the server 100 can determine whether the current dialogue text includes a model switching intention, the task type corresponding to the current dialogue text, and the response quality evaluation result of the current active large language model processing the last dialogue text in the same session according to the information determined in S101.
[0119] The server 100 can determine whether the current active large language model is suitable for processing the current dialogue text according to the information determined in S101 (whether the current dialogue text includes a model switching intention and the task type corresponding to the current dialogue text), the session context size after the current active large language model processing the last dialogue text in the same session, and the response quality evaluation result after the current active large language model processing the last dialogue text in the same session. If the determination result is not suitable, a new large language model is determined as the target large language model to process the current dialogue text.
[0120] Optionally, the step S102 includes:
[0121] If the current dialogue text includes a model switching intention, a large language model matching the model switching intention is determined from the preset large language model list as the target large language model.
[0122] If the current dialogue text does not include a model switching intention, and the comparison result of the session context size after the current active large language model processing the last dialogue text and the context window supported by the current active large language model does not satisfy the preset context window limit threshold, it is determined that the current active large language model is not suitable, and the comprehensive matching degree of each large language model in the preset large language model list is determined according to the task type, the session context size after the current active large language model processing the last dialogue text, and the response quality evaluation result, and the large language model with the highest comprehensive matching degree is selected as the target large language model.
[0123] The server 100 pre-stores a large language model list, which includes the unique identifiers of a plurality of large language models suitable for different task types and / or different application scenarios deployed in the server 100, wherein the unique identifier can be one or a combination of the number, name, identification code, or other identifier of the large language model.
[0124] In the method, the server 100 first determines whether the current dialogue text includes a model switching intention of the user, such as a specified large language model for processing the current dialogue text. If the current dialogue text includes the model switching intention of the user, a large language model matching the model switching intention of the user is determined from the pre-stored large language models as a target large language model. If the current dialogue text does not include the model switching intention of the user, the size of the session context after the current active large language model (the large language model before switching, the non-target large language model) processes the previous dialogue text is compared with the context window supported by the current active large language model. If the comparison result does not satisfy the preset context window limit threshold, that is, the size of the session context after the current active large language model processes the previous dialogue text exceeds the preset context window limit threshold of the current active large language model, it is determined that the current active large language model is not applicable. Then, the server 100 determines the comprehensive matching degree of each large language model in the preset large language model list according to the task type corresponding to the current dialogue text determined in step S103, the size of the session context after the current active large language model processes the previous dialogue text, and the response quality evaluation result after the current active large language model processes the previous dialogue text of the same session, and then determines the large language model with the highest comprehensive matching degree in the preset large language model list as the target large language model for processing the current dialogue text.
[0125] In the embodiment, after the target large language model is determined in step S102, in step S103, the server 100 can convert the session context after the current active large language model processes the previous dialogue text into the session context suitable for the target large language model.
[0126] In order to convert the session context into a format that can be fully understood by the target large language model, to ensure the coherence and consistency of the session context in the same session, in step S103, the server 100 can convert the session context after the current active large language model processes the previous dialogue text into the session context suitable for the target large language model.
[0127] Optionally, in step S103, the session context after the current active large language model processes the previous dialogue text includes:
[0128] a general representation and specific information corresponding to the current active large language model, wherein,
[0129] the general representation includes: sequential text content of the session context after the current active large language model processes the previous dialogue text, role identification;
[0130] the specific information includes: instruction format, control parameter, system prompt word format, role setting rule, internal state memory, enhancement instruction of specific task, and special function mark.
[0131] The session context after the current active large language model processes the previous dialogue text includes sequential text content constituted by all dialogue texts before the current dialogue text and corresponding answers, a role identifier, and specific information corresponding to the large language model processing each dialogue text. The sequential text content constituted by all dialogue texts before the current dialogue text and corresponding answers, and the role identifier can be used as a general representation, which is maintained in a standardized unified format and can be recognized or correctly processed by different large language models. The general representation can enable different large language models to recognize or correctly understand the historical dialogue context of the session. The specific information corresponding to the large language model can include the instruction format (for example, the thinking chain of Deepseek) of the large language model corresponding to the processing of each dialogue text in the session context after the current active large language model processes the previous dialogue text, control parameters (for example, temperature, top_p, etc.), system prompt word format, role setting rules (different models can have different role naming rules), internal state memory (some large language models can need to maintain internal state), enhancement instructions for specific tasks (for example, compensation information for the insufficient capabilities of specific large language models), special function markers (for example, whether to support code highlighting, table generation, etc.), and the like. The specific information is only applicable to the corresponding large language model, and other large language models can not be able to recognize or correctly process it.
[0132] Therefore, the server 100 needs to maintain a standardized session context. The session context after the current active large language model processes the previous dialogue text will maintain the general representation in a standardized unified format, and the specific information will be maintained as the specific information corresponding to the current active large language model processing the previous dialogue text.
[0133] Optionally, the step S103 comprises:
[0134] Converting the specific information corresponding to the current active large language model into specific information corresponding to the target large language model;
[0135] The general representation and the specific information corresponding to the target large language model are used as the session context applicable to the target large language model.
[0136] In the above embodiment, the server 100 can convert the specific information corresponding to the current active large language model in the session context after the current active large language model processes the previous dialogue text into specific information corresponding to the target large language model, and then use the standardized unified format general representation and the specific information corresponding to the target large language model as the session context suitable for the target large language model. The conversion process can include: sequentially extracting the historical content of the user input in the session and the role identifier from the general representation; converting and reconstructing the specific information, i.e., reconstructing the dialogue format according to the specific requirements of the target large language model, such as role identifier conversion, message structure reconstruction, system prompt word adjustment, addition or removal of special instructions, etc. For example, if the current active large language model is Baidu Wenxin Yiyang and the target large language model is Deepseek, the role identifier will be converted from "user / assistant" to "Human / Assistant", and professional analysis guidance system prompt words will be added, as well as the Deepseek specific thinking ability (enable_thinking) parameter will be enabled.
[0137] In the above embodiment, the server 100 can convert the specific information corresponding to the current active large language model in the session context after the current active large language model processes the previous dialogue text into specific information corresponding to the target large language model, and then use the standardized unified format general representation and the specific information corresponding to the target large language model as the session context suitable for the target large language model. The conversion process can include: sequentially extracting the historical content of the user input in the session and the role identifier from the general representation; converting and reconstructing the specific information, i.e., reconstructing the dialogue format according to the specific requirements of the target large language model, such as role identifier conversion, message structure reconstruction, system prompt word adjustment, addition or removal of special instructions, etc. For example, if the current active large language model is Baidu Wenxin Yiyang and the target large language model is Deepseek, the role identifier will be converted from "user / assistant" to "Human / Assistant", and professional analysis guidance system prompt words will be added, as well as the Deepseek specific thinking ability (enable_thinking) parameter will be enabled.
[0138] The above embodiment and / or optional embodiment of the large language model-based conversation processing method can select the target large language model with the highest comprehensive matching degree to process different dialogue contents in the same conversation, obtain answers corresponding to the dialogue contents, and dynamically switch large language models according to the dialogue contents in the conversation process of the same conversation, and automatically adapt the session context. The accuracy of the answers can be improved, the session context can be ensured to be coherent, the method is suitable for various application scenarios, and the user experience is not fragmented.
[0139] Optionally, as shown in the above embodiment, before step S105, the method further includes: Figure 2
[0140] S104 If the response quality evaluation result does not meet the preset response quality threshold, determining a quality problem type, and according to the quality problem type, determining the requirements for the capabilities of the large language model, and according to the requirements and the capabilities of the target large language model, compensating the capabilities of the target large language model;
[0141] In the above embodiment, step S105 includes:
[0142] The target large language model after the capability compensation is taken as the current active large language model, and the current dialogue text is processed in combination with the applicable conversation context of the target large language model to obtain an answer corresponding to the current dialogue text.
[0143] In step S104, the server 100 can determine the quality problem type according to the response quality evaluation result and the preset response quality threshold, determine the capability requirement that the large language model for processing the current dialogue text needs to have according to the determined quality problem type, determine the capability and / or compensation amount that the target large language model needs to compensate according to the capability corresponding to the target large language model determined in step S102, and then compensate the capability of the target large language model. In step S105, the server 100 can take the target large language model after the capability compensation obtained in step S104 as the current active large language model, process the current dialogue text of the conversation in combination with the conversation context applicable to the target large language model obtained in step S103, and obtain an answer corresponding to the current dialogue text.
[0144] Optionally, in step S104, the capability of the large language model includes:
[0145] a capability profile of the large language model;
[0146] a feature supported by the large language model;
[0147] a context window supported by the large language model;
[0148] a technical response speed and a Token efficiency of the large language model.
[0149] In step S104, the capability of the large language model can include a capability profile of the large language model, a feature supported by the large language model, a context window supported by the large language model, and a technical response speed (a calculation time required for processing a unit Token in a standard environment) and a technical Token efficiency (a token quantity consumed for completing an equal task) of the large language model.
[0150] Optionally, the capability profile of the large language model includes:
[0151] creative capability, reasoning capability, code capability, multilingual capability, and knowledge coverage capability.
[0152] The capability profile of the large language model can include, but is not limited to, creative ability, reasoning ability, code ability, multilingual ability, knowledge coverage ability, etc. The capability size of different capability dimensions of the capability profile of the large language model can be identified using a numerical score (e.g., 4.5). When deploying several large language models in the server 100, the capability profile of each large language model is usually registered and initialized, and managed and maintained. The baseline values of the capability profile are usually set by manual input during registration, and can be manually adjusted at any time. The capability profile can also be configured in an automatic maintenance mode, that is, it can be automatically updated based on the actual use data of the large language model. The flexible maintenance mechanism of the capability profile of the large language model can ensure that the large language models deployed in the server 100 can always maintain the latest and most accurate capability profile information, so that the best large language model can be selected as the target large language model when determining the target large language model for processing the current dialogue text.
[0153] Optionally, the features supported by the large language model include:
[0154] thinking chain, network search, code execution, image understanding, tool invocation, function invocation, plug-in, streaming output, multi-modal input.
[0155] The features supported by the large language model are usually represented by a Boolean value (e.g., 0 / 1 to identify support / non-support). The features supported by the large language model can include: thinking chain, network search, code execution, image understanding, tool invocation, function invocation, plug-in, streaming output, multi-modal input, etc. Different large language models can support different features.
[0156] Optionally, wherein the capability compensation of the target large language model according to the requirements and the capabilities of the target large language model comprises:
[0157] comparing the requirements and the scores of the capabilities of the target large language model item by item, and determining the capability item whose score difference meets a preset threshold as the to-be-compensated capability item of the target large language model;
[0158] executing a preset instruction corresponding to the to-be-compensated capability item to compensate the to-be-compensated capability item of the target large language model.
[0159] The server 100 can compare the requirement score of the ability of the determined large language model and the score of the ability of the target large language model determined through step S102 according to the dimensions of the capability profile, supported features, supported context window, technical response speed and Token efficiency, respectively, compare each difference obtained with a preset threshold, and then determine the ability item that meets the preset threshold as the to-be-compensated ability item of the target large language model. The preset threshold of different dimensions of ability is different, the capability profile dimension can be preset with a numerical threshold (for example, 0.3), the feature dimension can be preset with a Boolean threshold (for example, 0 or 1), the supported context window dimension can be preset with a numerical threshold (for example, 16KB) or a percentage threshold (for example, 90% of the maximum context window), the technical response speed dimension can be preset with a numerical threshold (for example, 1ms / Token), and the Token efficiency can be preset with a numerical threshold (for example, 10 Token / Unit task).
[0160] The server 100 can execute a preset instruction corresponding to the determined to-be-compensated ability item to compensate the to-be-compensated ability item of the target large language model. Different to-be-compensated ability items of different dimensions correspond to different preset instructions. For example, for the to-be-supplemented ability item of the capability profile dimension, such as creative ability and reasoning ability, a prompt word enhancement compensation instruction can be executed to compensate the corresponding capability profile by corresponding enhanced prompt words; for the feature dimension, the large model itself may not support it, and external tools or special instructions can be used to realize ability compensation; for the supported context window dimension, the context can be compressed to make the context size meet the supported context window of the target large language model and meet the preset threshold; the technical response speed and Token efficiency dimensions can be generally regarded as inherent attributes of the large language model, and if necessary, the large language model itself can be optimized for compensation. Different target large language models and ability dimensions can have corresponding compensation strategies. For example, if the code of the present application is written in Kotlin programming language, the ability dimension and the corresponding compensation strategy can be associated through the `registerStrategy` method when the large language model is deployed; a method for executing compensation can be pre-written (for example, the `ThinkingCapabilityCompensator` method in Kotlin can be used to compensate for insufficient thinking ability), and the method is executed when the compensation condition (the difference meets the preset threshold) is met; a compensation strategy including specific prompt words, instructions and parameters can be pre-set for the corresponding dimension.
[0161] The session processing method of the optional embodiment can balance flexibility and controllability, allows for the capability differences of large language models, provides corresponding capability compensation, and can dynamically determine whether capability compensation needs to be performed according to the difference between the target large language model and the capability requirement. Furthermore, for specific capability compensation items, an adaptive learning mechanism can be added, and the capability evaluation strategy can be automatically optimized according to the response quality evaluation effect of the session.
[0162] Optionally, the determining the requirement of the capability of the large language model according to the quality problem type comprises:
[0163] mapping according to the quality problem type, wherein,
[0164] if the quality problem type comprises an irrelevant type, mapping the irrelevant problem to the relevance understanding capability requirement;
[0165] if the quality problem type comprises a fact error type, mapping the fact error problem to the knowledge coverage capability and the accuracy capability requirement;
[0166] if the quality problem type comprises an incomplete answer type, mapping the incomplete answer problem to the comprehensiveness and detail grasping capability requirement;
[0167] if the quality problem type comprises a context inconsistency type, mapping the context inconsistency problem to the context understanding and memory capability requirement;
[0168] if the quality problem type comprises an illusion type, mapping the illusion problem to the fact checking capability requirement;
[0169] if the quality problem type comprises a self-contradiction type, mapping the self-contradiction problem to the logical reasoning capability requirement;
[0170] determining the requirement of the capability of the large language model based on preset weights corresponding to each quality problem type.
[0171] The server 100 can determine the quality problem type according to the response quality evaluation result and the preset response quality threshold through step S104. The quality problem type can include one or more of the following types: irrelevant type, factual error type, incomplete answer type, context inconsistency type, illusion type, and self-contradiction type. The server 100 can map the problems in the response quality evaluation result according to the determined quality problem type. If the determined quality problem type includes the irrelevant type, the irrelevant problems in the response quality evaluation result are mapped to the relevance understanding ability requirement. If the determined quality problem type includes the factual error type, the factual error problems in the response quality evaluation result are mapped to the knowledge coverage ability and accuracy ability requirement. If the determined quality problem type includes the incomplete answer type, the incomplete answer problems in the response quality evaluation result are mapped to the comprehensiveness and detail grasping ability requirement. If the determined quality problem type includes the context inconsistency type, the context inconsistency problems in the response quality evaluation result are mapped to the context understanding and memory ability requirement. If the determined quality problem type includes the illusion type, the illusion problems in the response quality evaluation result are mapped to the fact checking ability requirement. If the determined quality problem type includes the self-contradiction type, the self-contradiction problems in the response quality evaluation result are mapped to the logical reasoning ability requirement. Then, the server 100 can comprehensively calculate the mapped ability requirements according to the preset weights corresponding to each quality problem type, and take the calculation result as the requirement for the ability of the large language model.
[0172] Optionally, the obtaining of the response quality evaluation result of the current active large language model after processing the previous dialogue text includes:
[0173] The response quality score of the current active large language model after processing the previous dialogue text is obtained.
[0174] The response quality score is compared with a preset response quality score threshold, and the response quality evaluation result of the current active large language model after processing the previous dialogue text is determined according to the comparison result.
[0175] In this optional embodiment, the obtaining of the response quality evaluation result of the current active large language model after processing the previous dialogue text in the same session before the current dialogue text can include: first, obtaining the response quality score of the current active large language model after processing the previous dialogue text in the same session before the current dialogue text, then comparing the response quality score with a preset response quality score threshold, and according to the comparison result, the response quality evaluation result of the current active large language model after processing the previous dialogue text in the same session before the current dialogue text can be determined.
[0176] Optionally, the obtaining the response quality score of the current active large language model after processing the previous dialogue text comprises:
[0177] respectively obtaining a plurality of dimensions of response quality scores of the current active large language model after processing the previous dialogue text, wherein the plurality of dimensions at least include relevance, accuracy, completeness, consistency and user satisfaction;
[0178] comparing the response quality score of each dimension with the preset response quality score threshold of the corresponding dimension to obtain a comparison result of each dimension;
[0179] determining the response quality evaluation result of the current active large language model after processing the previous dialogue text based on the comparison result of each dimension and the preset weight of the corresponding dimension.
[0180] In this optional embodiment, the server 100 can first respectively obtain the response quality scores of the conversation context of the current active large language model after processing the previous dialogue text in multiple dimensions such as relevance, accuracy, completeness, consistency and user satisfaction, then compare the response quality score of each dimension with the preset response quality score threshold of the corresponding dimension to obtain a comparison result of each dimension, and then determine the response quality evaluation result of the current active large language model after processing the previous dialogue text according to the comparison result of each dimension and the preset weight of the corresponding dimension (the sum of the preset weights of all dimensions is 1). An exemplary method is to perform arithmetic multiplication operation on the comparison result of each dimension and the corresponding preset weight, and then perform arithmetic addition operation on the arithmetic multiplication operation results of all dimensions. The arithmetic addition operation result is determined as the response quality evaluation result of the current active large language model after processing the previous dialogue text.
[0181] Optionally, the obtaining the response quality score of the relevance dimension of the current active large language model after processing the previous dialogue text comprises:
[0182] extracting keywords and topics in the current dialogue text, and extracting keywords and topics in the conversation context of the current active large language model after processing the previous dialogue text;
[0183] respectively calculating the matching rate of the keywords in the current dialogue text with the keywords in the conversation context of the current active large language model after processing the previous dialogue text, and the matching rate of the topics in the current dialogue text with the topics in the conversation context of the current active large language model after processing the previous dialogue text;
[0184] calculating the semantic similarity between the current dialogue text and the conversation context of the current active large language model after processing the previous dialogue text;
[0185] The matching rate of the keyword, the matching rate of the theme, and the semantic similarity are calculated based on preset weights to obtain a response quality score of the relevance dimension after the current active large language model processes the previous dialogue text.
[0186] The relevance dimension can involve keywords, themes, and semantics. In this optional embodiment, the server 100 can first extract keywords and themes in the current dialogue text, and extract keywords and themes in the conversation context after the current active large language model processes the previous dialogue text, then calculate the matching rate of the keywords in the current dialogue text and the keywords in the conversation context after the current active large language model processes the previous dialogue text, and the matching rate of the themes in the current dialogue text and the themes in the conversation context after the current active large language model processes the previous dialogue text, and also calculate the semantic similarity between the current dialogue text and the conversation context after the current active large language model processes the previous dialogue text, and then calculate the matching rate of the keywords, the matching rate of the themes, and the semantic similarity based on preset weights (the sum of all preset weights is 1) corresponding to the keywords, the themes, and the semantics respectively. An exemplary, the calculated matching rate of the keywords and the corresponding preset weight are subjected to arithmetic multiplication operation, the calculated matching rate of the themes and the corresponding preset weight are subjected to arithmetic multiplication operation, and the calculated semantic similarity and the corresponding preset weight are subjected to arithmetic multiplication operation, and then the results of the arithmetic multiplication operations are subjected to arithmetic addition operation, and the result of the arithmetic addition operation is determined as the response quality score of the relevance dimension after the current active large language model processes the previous dialogue text.
[0187] Optionally, wherein obtaining the response quality score of the accuracy dimension after the current active large language model processes the previous dialogue text comprises:
[0188] Extracting factual statements from the conversation context after the current active large language model processes the previous dialogue text, and verifying each factual statement to obtain a verification result;
[0189] Calculating a factual accuracy rate based on the verification result;
[0190] Calculating a logical matching rate of the conversation context after the current active large language model processes the previous dialogue text;
[0191] Calculating a factual accuracy rate based on the verification result;
[0192] The accuracy dimension can involve facts and logic. In this optional embodiment, the server 100 can first extract factual statements from the session context after the current active large language model processes the previous dialogue text, verify each factual statement to obtain a verification result, then calculate the factual accuracy rate according to the obtained verification result, calculate the logical matching rate of the session context after the current active large language model processes the previous dialogue text, and then calculate the response quality score of the accuracy dimension of the session context after the current active large language model processes the previous dialogue text according to the respective preset weights of facts and logic (the sum of all preset weights is 1). An example can be to perform arithmetic multiplication on the calculated factual accuracy rate and the corresponding preset weight, perform arithmetic multiplication on the calculated logical matching rate and the corresponding preset weight, and then perform arithmetic addition on the results of each arithmetic multiplication to determine the arithmetic addition result as the response quality score of the accuracy dimension of the session context after the current active large language model processes the previous dialogue text.
[0193] Optionally, the obtaining of the response quality score of the integrity dimension of the session context after the current active large language model processes the previous dialogue text comprises:
[0194] determining the key points in the current dialogue text and the key points in the session context after the current active large language model processes the previous dialogue text, respectively, and determining the key point coverage rate;
[0195] checking whether there is an obvious truncation or incomplete mark in the session context after the current active large language model processes the previous dialogue text to obtain a checking result;
[0196] determining the response quality score of the integrity dimension of the session context after the current active large language model processes the previous dialogue text based on the key point coverage rate and the checking result.
[0197] The integrity dimension can involve key points, truncation or incomplete markers, etc. In this optional embodiment, the server 100 can first determine the key points in the current dialogue text and the key points in the session context after the current active large language model processes the previous dialogue text, respectively, wherein the key points can include question points and / or request points, and calculate the key point coverage (for example, key point coverage = number of key points in the current dialogue text / number of key points in the session context after the current active large language model processes the previous dialogue text), then check whether there are obvious truncation or incomplete markers in the session context after the current active large language model processes the previous dialogue text, obtain the check result (for example, number of obvious truncation or incomplete markers), and then determine the response quality score of the integrity dimension after the current active large language model processes the previous dialogue text according to the obtained key point coverage and check result, in combination with the preset response quality score rule of the integrity dimension. In one example, the response quality score rule of the integrity dimension can be preset to set a comparison table of key point coverage, number of obvious truncation or incomplete markers and response quality score of the integrity dimension, and after determining the key point coverage and detection result, the preset comparison table can be queried to determine the response quality score of the integrity dimension after the current active large language model processes the previous dialogue text.
[0198] Optionally, wherein obtaining the response quality score of the consistency dimension after the current active large language model processes the previous dialogue text comprises:
[0199] extracting key points and factual statements in the session context after the current active large language model processes the previous dialogue text;
[0200] processing the current dialogue text by using the current active large language model in combination with the session context after the current active large language model processes the previous dialogue text to obtain an answer corresponding to the current dialogue text, and extracting key points and factual statements in the answer;
[0201] checking whether the key points and factual statements in the answer are contradictory to the key points and factual statements in the session context after the current active large language model processes the previous dialogue text to obtain a contradiction check result;
[0202] checking the reference accuracy of information in the answer to obtain a reference accuracy check result;
[0203] checking the style consistency of the answer with the session context after the current active large language model processes the previous dialogue text to obtain a style consistency check result;
[0204] Based on the contradiction checking result, the application accuracy checking result and the style consistency checking result, determine the response quality score of the consistency dimension after the current active large language model processes the previous dialogue text.
[0205] The consistency dimension can involve whether there is a contradiction between the key points and the factual statements, the reference accuracy, the segmentation consistency, etc. In this optional embodiment, the server 100 can first extract the key points and the factual statements in the session context after the current active large language model processes the previous dialogue text, and temporarily does not switch the large language model, adopts the current active large language model, processes the current dialogue text in combination with the session context after the current active large language model processes the previous dialogue text, obtains the answer corresponding to the current dialogue text, and extracts the key points and the factual statements in the answer. Then, check whether there is a contradiction between the key points and the factual statements in the answer and the key points and the factual statements in the session context after the current active large language model processes the previous dialogue text, obtain the contradiction checking result, then check the reference accuracy of the information in the answer to the current dialogue text, obtain the reference accuracy checking result, then check the style consistency of the answer and the session context after the current active large language model processes the previous dialogue text, obtain the style consistency checking result, and finally determine the response quality score of the consistency dimension after the current active large language model processes the previous dialogue text according to the obtained contradiction checking result, application accuracy checking result and style consistency checking result. In one example, a response quality score rule of the consistency dimension can be preset, a comparison table of the contradiction checking result, the application accuracy checking result, the style consistency checking result and the response quality score of the consistency dimension is set, and after obtaining the contradiction checking result, the application accuracy checking result and the style consistency checking result, the preset comparison table can be queried to determine the response quality score of the consistency dimension after the current active large language model processes the previous dialogue text.
[0206] Optionally, wherein obtaining the response quality score of the user satisfaction dimension after the current active large language model processes the previous dialogue text comprises:
[0207] Obtaining explicit feedback information of the user;
[0208] Based on a preset user behavior index, analyzing the user behavior, taking the analysis result as implicit feedback information of the user, wherein the user behavior index at least includes: the number of repeated inquiries, whether there is a correction behavior and a satisfaction mark;
[0209] Inputting the session context after the current active large language model processes the previous dialogue text into a preset machine learning model to obtain a predicted user satisfaction;
[0210] Based on the explicit feedback information, the implicit feedback information and the predicted user satisfaction, a response quality score of a user satisfaction dimension after the current active large language model processing the previous dialogue text is determined.
[0211] The user satisfaction dimension can involve user explicit feedback, implicit feedback and predicted user satisfaction. In this optional embodiment, the server 100 can first obtain the explicit feedback information of the user, then analyze the user behavior (for example, according to the user historical dialogue text in the session) according to the preset user behavior indicators, and take the analysis result as the implicit feedback information of the user, wherein the user behavior indicators at least include: the number of repeated inquiries, whether there is a correction behavior and a satisfaction mark, etc., then input the session context after the current active large language model processing the previous dialogue text into a preset machine learning model to obtain the predicted user satisfaction, and finally determine the response quality score of the user satisfaction dimension after the current active large language model processing the previous dialogue text according to the obtained explicit feedback information, implicit feedback information and predicted user satisfaction. An exemplary response quality score rule of the user satisfaction dimension can be preset to set a comparison table of the explicit feedback information, the implicit feedback information, the predicted user satisfaction and the response quality score of the user satisfaction dimension. After obtaining the explicit feedback information, the implicit feedback information and the predicted user satisfaction, the preset comparison table can be queried to determine the response quality score of the user satisfaction dimension after the current active large language model processing the previous dialogue text.
[0212] Optionally, the large language model-based conversation processing method further comprises:
[0213] S106 returns the answer to the client to show to the user.
[0214] In this optional embodiment, the server 100 can also return the answer corresponding to the current dialogue text to the client 200 to show to the user at the client 200. Related data can also be sent to the client 200 to show to the user in a visual manner, which is not limited to the following:
[0215] Through the model indicator, the current active large language model name, identifier and other information are displayed; Large language model switching notification message, that is, when the current active large language model is switched to the target large language model, a lightweight notification message is displayed;
[0216] Unified session history view, which is not segmented due to large language model switching.
[0217] The client 200 can also interact with the user, at least including:
[0218] a display capability switch panel, allowing a user to turn on or off a specific capability of a related large language model;
[0219] a large language model recommender, which can automatically switch when it is detected that a more suitable large language model is available to process the current dialogue text, or which can make a suggestion to the user, who then decides whether to switch.
[0220] In the conversation processing method of the above embodiments and / or method embodiments, in a unified conversation, although the task types corresponding to the dialogue content input by the user at different times may be different, the dialogue content input at the same time usually includes a single task type, and a large language model suitable for the task type is used as a target large language model for processing, so that a higher-accuracy answer can be obtained. However, if the dialogue content input by the user at the same time includes multiple task types, the accuracy of the answer obtained by using a large language model to process the dialogue content may be affected.
[0221] Figure 3 A schematic diagram of a large language model-based conversation processing method according to another aspect of the present application is shown, wherein the method of one embodiment includes:
[0222] S301 obtaining current dialogue text input by a user through a client and analyzing the current dialogue text to determine a plurality of task orders of the current dialogue text and a task type of each task, and taking the first task as a current task according to the task orders;
[0223] S302 determining dialogue text corresponding to the current task in the current dialogue text, and judging whether a currently active large language model is suitable according to whether the dialogue text corresponding to the current task includes a model switching intent, the task type of the current task, a size of a conversation context after the currently active large language model processes a previous dialogue text, and a response quality evaluation result, and determining a target large language model if the currently active large language model is not suitable;
[0224] S303 converting the conversation context after the currently active large language model processes the previous dialogue text into a conversation context suitable for the target large language model, determining a quality problem type if the response quality evaluation result does not satisfy a preset response quality threshold, determining a requirement for the capability of the large language model according to the quality problem type, and performing capability compensation on the target large language model according to the requirement and the capability of the target large language model;
[0225] S304 processing the dialogue text of the current task based on the target large language model after the capability compensation and in combination with the conversation context suitable for the target large language model, to obtain an answer corresponding to the dialogue text of the current task;
[0226] S305 takes the target large language model after the capability compensation as the current active large language model, and updates the answer to the conversation context applicable to the target large language model, obtains the conversation context after the updated current active large language model processes the previous dialogue text, and obtains the response quality evaluation result of the conversation context after the updated current active large language model processes the previous dialogue text.
[0227] S306 sequentially traverses each task, iterates according to the above steps until the last task, and obtains the answer corresponding to the dialogue text of the last task.
[0228] In the conversation of human-computer interaction, the user can input the current content to be asked or consulted through the client 200, which can be input in the form of text, voice, image and / or video, etc. The content can include multiple types of tasks. In this embodiment, in step S301, the server 100 can obtain the current dialogue text input by the user through the client 200 and analyze it, determine the task order of the current dialogue text and the task type of each task, and take the first task as the current task according to the task order.
[0229] In this application, if the current dialogue text includes dialogue text of multiple types of tasks, the conversation context of the current dialogue text is not completely the same as the conversation context after the current active large language model processes the previous dialogue text. The conversation context content of the current dialogue text refers to the historical conversation content after the previous dialogue text before the current dialogue text is processed by the current active large language model, including the previous dialogue text before the current dialogue text and the corresponding answer, the specific information of the large language model used to process the previous dialogue text, etc. If the current dialogue text includes dialogue text of multiple types of tasks, the conversation context after the current active large language model processes the previous dialogue text includes not only the conversation context of the current dialogue text, but also the dialogue text and the corresponding answer of the task before the current task in the current dialogue text, the specific information of the corresponding large language model, etc.
[0230] Continuing in this embodiment, in step S302, the server 100 can determine the dialogue text corresponding to the current task in the current dialogue text, and determine whether the current active large language model is applicable according to whether the content includes a model switching intention, the task type of the current task, the size of the conversation context after the current active large language model processes the previous dialogue text, and the response quality evaluation result. If not, determine the target large language model.
[0231] In the embodiment, in step S303, the server 100 can convert the session context after the current active large language model processes the previous dialogue text into the session context suitable for the target large language model. If the response quality evaluation result of the session context after the current active large language model processes the previous dialogue text does not satisfy the preset response quality threshold, the server 100 can determine the quality problem type, determine the requirement for the capability of the large language model according to the determined quality problem type, and perform capability compensation on the target large language model according to the determined requirement and the capability of the target large language model.
[0232] In the embodiment, in step S303, the server 100 can convert the session context after the current active large language model processes the previous dialogue text into the session context suitable for the target large language model. If the response quality evaluation result of the session context after the current active large language model processes the previous dialogue text does not satisfy the preset response quality threshold, the server 100 can determine the quality problem type, determine the requirement for the capability of the large language model according to the determined quality problem type, and perform capability compensation on the target large language model according to the determined requirement and the capability of the target large language model.
[0233] In the embodiment, in step S303, the server 100 can convert the session context after the current active large language model processes the previous dialogue text into the session context suitable for the target large language model. If the response quality evaluation result of the session context after the current active large language model processes the previous dialogue text does not satisfy the preset response quality threshold, the server 100 can determine the quality problem type, determine the requirement for the capability of the large language model according to the determined quality problem type, and perform capability compensation on the target large language model according to the determined requirement and the capability of the target large language model.
[0234] Continuing in this embodiment, in step S304, the server 100 can process the dialogue text of the current task based on the target large language model after capability compensation in combination with the obtained conversation context applicable to the target large language model, to obtain the answer corresponding to the dialogue text of the current task.
[0235] Among them, the server 100 can take the target large language model after capability compensation as the current active large language model, and process the dialogue text of the current task in combination with the obtained conversation context applicable to the target large language model, to obtain the answer corresponding to the dialogue text of the current task.
[0236] Continuing in this embodiment, in step S305, the server 100 can take the target large language model after capability compensation as the current active large language model, and update the answer corresponding to the dialogue text of the current task to the conversation context applicable to the target large language model, to obtain the updated conversation context after the current active large language model processes the last dialogue text, and obtain the response quality evaluation result of the updated conversation context after the current active large language model processes the last dialogue text.
[0237] Continuing in this embodiment, in step S306, the server 100 can sequentially traverse each task, repeat the operations according to the above steps S302-S305, iterate until the last task, and obtain the answer corresponding to the dialogue text of the last task.
[0238] An exemplary, the user inputs the current dialogue text currently asked or consulted through the client 200, including "Can you help me write a poem and analyze the rhetorical devices in it?", the server 100 analyzes the obtained current dialogue text, and can identify and determine that it includes two tasks: creative writing and analysis. The task types of the two tasks are different, and belong to the creative type and the analysis type respectively. In order to obtain the most accurate answer, it is best to use different large language models for different task types, for example, the Wenxin Yiyang large language model of Baidu is good at creativity, and the Deepseek large language model is good at analysis. The server 100 can sequentially divide the current dialogue text into dialogue texts corresponding to two task types "Can you help me write a poem" and "analyze the rhetorical devices in it". The task dialogue text of the creative type "Can you help me write a poem" can be taken as the first task (creative task), and it is taken as the current task first. If the current active large language model before processing the dialogue text of the current task is not the Wenxin Yiyang large language model of Baidu, after determining that the Wenxin Yiyang large language model of Baidu is used as the target large language model through steps S302-S305, the conversation context after the current active large language model processes the last dialogue text can be converted into the conversation context suitable for the Wenxin Yiyang large language model. If the response quality evaluation result of the conversation context after the current active large language model processes the last dialogue text meets the preset response quality threshold, it is not necessary to compensate the ability of the Wenxin Yiyang large language model, and the Wenxin Yiyang large language model can be directly used as the current active large language model for processing the dialogue text of the current task. The Wenxin Yiyang large language model suitable for the conversation context is combined to process the dialogue text "Can you help me write a poem" of the current task, and the corresponding answer, that is, a poem, is obtained, and the conversation processing of the dialogue text of the first task is completed.Then the second task (analysis task) is taken as the current task, and the current active large language model is the Wenxin Yiyang large language model of Baidu. Through steps S302-S305, if the large language model suitable for processing the second task is determined to be the Deepseek large language model, the conversation context after the current active large language model (the Wenxin Yiyang large language model of Baidu) processes the previous dialogue text (i.e., the dialogue text of the first task “Can you help me write a poem?”) can be converted into the conversation context suitable for the Deepseek large language model. If the response quality evaluation result of the conversation context after the Wenxin Yiyang large language model processes the previous dialogue text meets the preset response quality threshold, the Deepseek large language model does not need to be compensated for the capability, and the Deepseek large language model can be directly taken as the current active large language model for processing the dialogue text of the current task (the second task). In combination with the conversation context suitable for the Deepseek large language model, the dialogue text “analyze the rhetorical devices therein” of the current task is processed to obtain the corresponding answer, i.e., the analysis content of the poem obtained by the Wenxin Yiyang large language model processing the dialogue text of the first task, and the conversation processing of the dialogue text of the second task is completed. After all the dialogue texts of the tasks are processed, the server 100 can send the complete answer (a poem + analysis content of the poem) to the client 200 to show the user, and can also visually show the user that the Wenxin Yiyang large language model and the Deepseek large language model are used in this conversation processing.
[0239] The conversation processing method of this embodiment can cooperatively process a conversation including a single dialogue including multiple tasks by deploying multiple large language models of different types, can obtain more accurate conversation processing results, and can better meet the needs of various complex application scenarios.
[0240] Figure 4 A schematic diagram of a large language model-based conversation processing system according to another aspect of the present application is shown, wherein the system of one embodiment includes:
[0241] The client 200 and the server 100, wherein,
[0242] The client 200 is configured to provide a unified interaction interface to realize user interaction, conversation management, and local caching.
[0243] The server 100 includes:
[0244] The registration and management module 110 is configured to perform life cycle management of each large language model in the preset large language model list, including registration, initialization, state monitoring and destruction, capability maintenance of the large language model.
[0245] The unified dialogue context management module 120 is configured to create a session and maintain a session context, wherein the session context includes a general representation and specific information corresponding to each large language model in the preset list of large language models.
[0246] The switching decision module 130 is configured to obtain and analyze current dialogue text of the session, determine a task type of the current dialogue text and whether the current dialogue text includes a model switching intention, and determine whether the currently active large language model is applicable according to whether the current dialogue text includes the model switching intention, the task type, a size of the session context after the currently active large language model processes a previous dialogue text, and a response quality evaluation result, and if not, determine a target large language model as the currently active large language model and trigger switching.
[0247] The context conversion adaptation module 140 is configured to, when the switching decision module triggers switching, convert the session context after the currently active large language model processes a previous dialogue text maintained in the unified dialogue context management module into a session context applicable to the target large language model.
[0248] The text processing module 150 is configured to, according to the switching trigger instruction of the switching decision module, take the target large language model as the currently active large language model, process the current dialogue text of the session based on the currently active large language model and the corresponding session context, and obtain an answer corresponding to the current dialogue text.
[0249] The capability compensation module 160 is configured to evaluate a response quality after the currently active large language model processes a previous dialogue text, determine a quality problem type if the evaluation result does not satisfy a preset response quality threshold, determine a requirement for a capability of the large language model according to the quality problem type, and compensate the capability of the target large language model according to the requirement and the capability of the target large language model.
[0250] In this embodiment, the client 100 of the session processing system has a software and hardware environment related to session processing, provides a unified interactive interface to realize user interaction, session management, and local caching. A user can interact through the unified interactive interface, for example, start a session, input dialogue content, view corresponding answers, browse historical dialogue content and corresponding answers, manage a session, and manage local caching, and the like.
[0251] In this embodiment, the server 100 of the session processing system includes a registration and management module 110, a unified dialogue context management module 120, a switching decision module 130, a context conversion adaptation module 140, a text processing module 150, and a capability compensation module 160.
[0252] The service end 100 has a preset large language model list, and the large language model list includes unique identifiers of a plurality of large language models deployed in the service end 100 and suitable for different task types and / or different application scenarios and having different strong types. Through the registration and management module 110 of the service end 100, the life cycle of each large language model in the preset large language model list can be managed, including registration, initialization, state monitoring and destruction, capability maintenance, and the like of the large language model.
[0253] The unified dialogue context management module 120 of the service end 100 can create a session and maintain the session context of each historical dialogue after receiving a session request sent by the user through the client 200, where the session context includes the general representation of the input and the answer of each historical dialogue and the specific information corresponding to each large language model in the preset large language model list used to process each dialogue.
[0254] The switching decision module 130 of the service end 100 can obtain and analyze the current dialogue text of the session. If the current dialogue content input by the user includes a single task type, the task type of the current dialogue text is determined, and whether the model switching intention is included. According to whether the current dialogue text includes the model switching intention, the task type thereof, the session context size after the current active large language model processes the previous dialogue text, and the response quality evaluation result, it is determined whether the current active large language model is suitable. If not, the target large language model is determined as the current active large language model, and a trigger switching instruction is issued.
[0255] When the switching decision module 130 receives the trigger switching instruction, the context conversion adaptation module 140 of the service end 100 can convert the session context after the previous dialogue text processed by the current active large language model (the large language model before switching, which is not the target large language model) in the unified dialogue context management module 120 into the session context suitable for the target large language model.
[0256] According to the trigger switching instruction of the switching decision module 130, the text processing module 150 of the service end 100 can take the target large language model as the current active large language model, process the current dialogue text of the session according to the current active large language model (i.e., the target large language model) and the session context corresponding to the target large language model, and obtain the answer corresponding to the current dialogue text. The service end 100 can also send the answer corresponding to the current dialogue text to the client 200, so as to display it to the user through the unified interaction interface of the client 200.
[0257] The response quality after the current active large language model (the large language model before switching, the non-target large language model) processes the previous dialogue text is evaluated by the capability compensation module 160 of the server 100. If the evaluation result does not meet the preset response quality threshold, the quality problem type is determined, the requirement for the capability of the target large language model is determined according to the determined quality problem type, and the target large language model is compensated for capability according to the requirement and the capability of the target large language model.
[0258] In this embodiment, if the current dialogue content input by the user includes multi-type task content, the dialogue text of different types of tasks and the processing order are determined, the dialogue text of the first task is processed, the target large language model for processing the dialogue text of the current task is determined and switching is triggered, the order is iteratively processed, and the answer to the dialogue text of the last type of task in the current dialogue text is obtained. Then the answers to the dialogue text of all types of tasks of the current dialogue text are integrated and summarized as the answer to the current dialogue text, which is displayed to the user through the unified interaction interface of the client.
[0259] In this embodiment, the method steps that are not mentioned in each component of the system can be the same as those in the foregoing method embodiments related to each other, and will not be described here.
[0260] According to another aspect of the present application, a computer readable medium is also provided, which stores computer readable instructions executable by a processor to implement part or all of the foregoing method embodiments and / or optional embodiments.
[0261] It should be noted that the method embodiments and / or optional embodiments in the present application are not strictly limited to the order of execution of each step, as long as the method embodiments and / or optional embodiments can solve the defects existing in the prior art, achieve the purpose of the present application, and obtain beneficial effects. The method embodiments and / or optional embodiments in the present application can be implemented in software and / or a combination of software and hardware. The software program involved in the present application can be executed by a processor to implement the steps or functions of the above embodiments. Similarly, the software program (including related data structures) of the present application can be stored in a computer readable recording medium.
[0262] In addition, part or all of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be invoked or provided. The program instructions invoking the method of the present application can be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal bearing medium, and / or stored in the working memory of the computer device running according to the program instructions.
[0263] According to still another aspect of the present application, a large language model based conversation processing device is also provided, which comprises a memory storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to run part or all of the methods and / or technical solutions of the above-mentioned embodiments.
[0264] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be regarded as exemplary and non-limiting, the scope of the present application is defined by the appended claims rather than the above description, and therefore all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any reference signs in the claims should not be regarded as limiting the claims involved.
[0265] In the present application, if the terms "upper", "lower", "left", "right", "front", "back", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal" and the like are used, the indicated orientation and / or positional relationship is based on the orientation and / or positional relationship shown in the drawings. These terms are mainly used to better describe the present application and its embodiments, and are not used to limit the indicated devices, elements or components to have a specific orientation, or to be constructed and operated in a specific orientation. In addition, in addition to being used to indicate orientation or positional relationship, some of the above terms can also be used to indicate other meanings, for example, the term "upper" can also be used to indicate a certain attachment relationship or connection relationship in some cases. Those skilled in the art can understand the specific meaning of these terms in the present application according to the specific circumstances.
[0266] In addition, the terms "mount", "set", "provided with", "connected", "linked" should be interpreted broadly. For example, it can be fixed connection, detachable connection, or integral structure; can be mechanical connection or electrical connection; can be directly connected or indirectly connected through intermediate medium; it can also be the internal communication between two devices, elements or components. For those skilled in the art, the specific meaning of the above terms in this application can be understood according to the specific circumstances.
[0267] In addition, the terms "first", "second" and the like are mainly used to distinguish different devices, units, modules, elements, circuits or components (the specific types and structures can be the same or different), and are not intended to indicate or imply the relative importance, sequence and / or quantity of the indicated devices, units, modules, elements, circuits or components. Unless otherwise stated, the meaning of "multiple" is two or more.
[0268] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The plurality of units or devices stated in the device claim can also be implemented by one unit or device through software and / or hardware.
Claims
1. A method for processing a conversation based on a large language model, characterized in that, The method comprises: acquiring current dialogue text of a session and analyzing the same, determining a task type of the current dialogue text, and whether a model switching intention is included; determining whether a currently active large language model is applicable according to whether the current dialogue text includes the model switching intention, the task type, a session context size after the currently active large language model processes a previous dialogue text, and a response quality evaluation result, and if not, determining a target large language model; converting the session context after the currently active large language model processes the previous dialogue text into a session context applicable to the target large language model; processing the current dialogue text in combination with the session context applicable to the target large language model to obtain an answer corresponding to the current dialogue text, with the target large language model as the currently active large language model.
2. The method of claim 1, wherein, The determination whether the currently active large language model is applicable according to whether the current dialogue text includes the model switching intention, the task type, the session context size after the currently active large language model processes the previous dialogue text, and the response quality evaluation result, and if not, the determination of the target large language model, comprises: if the current dialogue text includes the model switching intention, determining a large language model matching the model switching intention from a preset large language model list as the target large language model; if the current dialogue text does not include the model switching intention, and a comparison result of the session context size after the currently active large language model processes the previous dialogue text and a context window supported by the currently active large language model does not satisfy a preset context window limit threshold, determining that the currently active large language model is not applicable, determining a comprehensive matching degree of each large language model in the preset large language model list according to the task type, the session context size after the currently active large language model processes the previous dialogue text, and the response quality evaluation result, and taking a large language model with the highest comprehensive matching degree as the target large language model.
3. The method of claim 1, wherein, The session context after the currently active large language model processes the previous dialogue text comprises: a general representation and specific information corresponding to the currently active large language model, wherein the general representation comprises sequential text content of the session context after the currently active large language model processes the previous dialogue text, and a role identifier; the specific information comprises an instruction format, a control parameter, a system prompt word format, a role setting rule, an internal state memory, an enhancement instruction of a specific task, and a special function marker.
4. The method of claim 3, wherein, The conversion of the session context after the currently active large language model processes the previous dialogue text into the session context applicable to the target large language model comprises: converting the specific information corresponding to the currently active large language model into specific information corresponding to the target large language model; and taking the general representation and the specific information corresponding to the target large language model as the session context applicable to the target large language model.
5. The method of claim 1, wherein, Before the target large language model is taken as the currently active large language model, the method further comprises: If the response quality evaluation result does not satisfy the preset response quality threshold, a quality problem type is determined, and according to the quality problem type, a requirement for the capability of the large language model is determined, and according to the requirement and the capability of the target large language model, the capability of the target large language model is compensated; The target large language model as a current active large language model includes: The target large language model after capability compensation is used as a current active large language model.
6. The method of claim 5, wherein, The capability of the large language model includes: The capability profile of the large language model; The supported features of the large language model; The supported context window of the large language model; The technical response speed and Token efficiency of the large language model.
7. The method of claim 6, wherein, The capability profile of the large language model includes: Creative ability, reasoning ability, code ability, multilingual ability, and knowledge coverage ability.
8. The method according to claim 6 or 7, characterized in that, The supported features of the large language model include: Thinking chain, network search, code execution, image understanding, tool invocation, function invocation, plug-in, streaming output, and multi-modal input.
9. The method of claim 6, wherein, According to the requirement and the capability of the target large language model, the capability of the target large language model is compensated, including: The requirement and the capability of the target large language model are compared item by item, and the capability item with a score difference satisfying a preset threshold is determined as a to-be-compensated capability item of the target large language model; A preset instruction corresponding to the to-be-compensated capability item is executed to compensate the to-be-compensated capability item of the target large language model.
10. The method of claim 5, wherein, According to the quality problem type, the requirement for the capability of the large language model is determined, including: According to the quality problem type, the requirement for the capability of the large language model is determined, including: If the quality problem type includes an irrelevant type, the irrelevant problem is mapped to the relevance understanding ability requirement; If the quality problem type includes a factual error type, the factual error problem is mapped to the knowledge coverage ability and accuracy ability requirement; If the quality problem type includes an incomplete answer type, the incomplete answer problem is mapped to the comprehensiveness and detail grasping ability requirement; If the quality problem type includes a context inconsistency type, the context inconsistency problem is mapped to the context understanding and memory ability requirement; If the quality problem type includes an illusion type, the illusion problem is mapped to the fact checking ability requirement; If the quality problem type includes a self-contradictory type, the self-contradictory problem is mapped to the logical reasoning ability requirement; Based on preset weights corresponding to each quality problem type, the requirement for the capability of the large language model is determined.
11. The method of claim 1, wherein, The acquisition of the response quality evaluation result after the current active large language model processes the last dialogue text includes: The response quality score of the current active large language model after processing the last dialogue text is obtained; The response quality score is compared with a preset response quality score threshold, and according to the comparison result, the response quality evaluation result of the current active large language model after processing the last dialogue text is determined.
12. The method of claim 11, wherein, The response quality score of the current active large language model after processing the last dialogue text is obtained, including: obtaining a plurality of response quality scores of the current active large language model after processing the previous dialogue text in multiple dimensions, wherein the multiple dimensions at least include relevance, accuracy, completeness, consistency and user satisfaction; comparing the response quality scores of each dimension with the preset response quality score threshold of the corresponding dimension to obtain the comparison result of each dimension; determining the response quality evaluation result of the current active large language model after processing the previous dialogue text based on the comparison result of each dimension and the preset weight of the corresponding dimension.
13. The method of claim 12, wherein, obtaining the response quality score of the relevance dimension of the current active large language model after processing the previous dialogue text includes: extracting keywords and topics in the current dialogue text, and extracting keywords and topics in the conversation context of the current active large language model after processing the previous dialogue text; calculating the matching rate of the keywords in the current dialogue text and the keywords in the conversation context of the current active large language model after processing the previous dialogue text, and the matching rate of the topics in the current dialogue text and the topics in the conversation context of the current active large language model after processing the previous dialogue text; calculating the semantic similarity of the current dialogue text and the conversation context of the current active large language model after processing the previous dialogue text; based on the preset weight, the matching rate of the keywords, the matching rate of the topics and the semantic similarity are weighted and calculated to obtain the response quality score of the relevance dimension of the current active large language model after processing the previous dialogue text.
14. The method of claim 12, wherein, obtaining the response quality score of the accuracy dimension of the current active large language model after processing the previous dialogue text includes: extracting factual statements from the conversation context of the current active large language model after processing the previous dialogue text, and verifying each factual statement to obtain a verification result; based on the verification result, calculating the fact accuracy rate; calculating the logical matching rate of the conversation context of the current active large language model after processing the previous dialogue text; based on the preset weight, the fact accuracy rate and the logical matching rate are weighted and calculated to obtain the response quality score of the accuracy dimension of the current active large language model after processing the previous dialogue text.
15. The method of claim 12, wherein, obtaining the response quality score of the completeness dimension of the current active large language model after processing the previous dialogue text includes: determining the key points in the current dialogue text and the key points in the conversation context of the current active large language model after processing the previous dialogue text, and determining the key point coverage rate; checking whether there is an obvious truncation or incomplete mark in the conversation context of the current active large language model after processing the previous dialogue text to obtain a checking result; based on the key point coverage rate and the checking result, determining the response quality score of the completeness dimension of the current active large language model after processing the previous dialogue text.
16. The method of claim 12, wherein, obtaining the response quality score of the consistency dimension of the current active large language model after processing the previous dialogue text includes: extracting key points and factual statements in the conversation context of the current active large language model after processing the previous dialogue text; The current active large language model is used to process the current dialogue text in combination with the session context after the current active large language model processes the previous dialogue text, to obtain an answer corresponding to the current dialogue text, and to extract key points and factual statements in the answer; The key points and factual statements in the answer are checked for contradictions with the key points and factual statements in the session context after the current active large language model processes the previous dialogue text, to obtain a contradiction checking result; The reference accuracy of information in the answer to the current dialogue text is checked, to obtain a reference accuracy checking result; The style consistency of the answer with the session context after the current active large language model processes the previous dialogue text is checked, to obtain a style consistency checking result; Based on the contradiction checking result, the reference accuracy checking result, and the style consistency checking result, a response quality score of the consistency dimension after the current active large language model processes the previous dialogue text is determined.
17. The method of claim 12, wherein, Obtaining a response quality score of the user satisfaction dimension after the current active large language model processes the previous dialogue text includes: Obtaining explicit feedback information of a user; Based on a preset user behavior index, analyzing user behavior, and taking the analysis result as implicit feedback information of the user, wherein the user behavior index at least includes: the number of repeated inquiries, whether there is a correction behavior, and a satisfaction mark; Inputting the session context after the current active large language model processes the previous dialogue text into a preset machine learning model to obtain a predicted user satisfaction; Based on the explicit feedback information, the implicit feedback information, and the predicted user satisfaction, a response quality score of the user satisfaction dimension after the current active large language model processes the previous dialogue text is determined.
18. The method of claim 1, wherein, The method further includes: Returning the answer to the client to show to the user. 19.A method for a conversation based on a large language model, the method comprising: The method includes: Obtaining and analyzing the current dialogue text input by the user through the client to determine the task order of the current dialogue text and the task type of each task, and taking the first task as the current task according to the task order; Determining the dialogue text corresponding to the current task in the current dialogue text, and determining whether the current active large language model is applicable according to whether the dialogue text of the current task includes a model switching intent, the task type of the current task, the size of the session context after the current active large language model processes the previous dialogue text, and the response quality evaluation result, and if not, determining a target large language model; Converting the session context after the current active large language model processes the previous dialogue text into a session context suitable for the target large language model, and if the response quality evaluation result does not meet a preset response quality threshold, determining a quality problem type, and according to the requirement of the ability of the large language model and the ability of the target large language model, compensating the ability of the target large language model; based on the target large language model after capability compensation, and in combination with a conversation context applicable to the target large language model, processing the dialogue text of the current task to obtain an answer corresponding to the dialogue text of the current task; taking the target large language model after capability compensation as a current active large language model, and updating the answer to the conversation context applicable to the target large language model to obtain an updated conversation context after the current active large language model processes the previous dialogue text, and obtaining a response quality evaluation result of the updated conversation context after the current active large language model processes the previous dialogue text; sequentially traversing each task, and iteratively performing the above steps until the last task to obtain an answer corresponding to the dialogue text of the last task. 20.A large language model-based conversational processing system, characterized in that, The system comprises: a client and a server, wherein the client is configured to provide a unified interaction interface to realize user interaction, conversation management, and local caching; the server comprises: a registration and management module configured to perform life cycle management of each large language model in a preset large language model list, including registration, initialization, state monitoring and destruction, and capability maintenance of the large language model; a unified dialogue context management module configured to create a conversation and maintain a conversation context, wherein the conversation context comprises a general representation and specific information corresponding to each large language model in the preset large language model list; a switching decision module configured to obtain and analyze a current dialogue text of the conversation, determine a task type of the current dialogue text and whether the current dialogue text includes a model switching intention, and determine whether a current active large language model is applicable according to whether the current dialogue text includes the model switching intention, the task type, a size of the conversation context after the current active large language model processes the previous dialogue text, and a response quality evaluation result, and if not, determine a target large language model as the current active large language model and trigger switching; a context conversion and adaptation module configured to, when the switching decision module triggers switching, convert the conversation context after the current active large language model in the unified dialogue context management module processes the previous dialogue text into a conversation context applicable to the target large language model; a text processing module configured to, according to a trigger switching instruction of the switching decision module, take the target large language model as the current active large language model, process the current dialogue text of the conversation based on the current active large language model and the corresponding conversation context to obtain an answer corresponding to the current dialogue text; a capability compensation module configured to evaluate the response quality after the current active large language model processes the previous dialogue text, and if the evaluation result does not satisfy a preset response quality threshold, determine a quality problem type, determine a requirement for the capability of the large language model according to the quality problem type, and perform capability compensation on the target large language model according to the requirement and the capability of the target large language model.
21. A computer readable medium, characterized in that a computer readable medium having stored thereon computer readable instructions to be executed by a processor to implement part or all of the method of any of claims 1 to 19.
22. A large language model based conversational processing device, characterized by, The apparatus comprises: one or more processors; and a memory having stored thereon computer readable instructions to, when executed, cause the processor to perform part or all of the operations of the method of any of claims 1 to 19.
Citation Information
Cited By
Large model context processing method and device, equipment, storage medium and program product
CN121615794A
Large model context processing method and device, equipment, storage medium and program product
CN121615794B