Method and device for determining large model output

By analyzing the lexical relationships and updating lexical units in the initial response of the large model, the problem of inaccurate output of the large model was solved, achieving higher response accuracy and user satisfaction.

CN121524327APending Publication Date: 2026-02-13WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511770685.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Large models suffer from inaccurate output when generating responses, especially when faced with fuzzy user queries and cross-domain technical terms. Their generalization ability is insufficient and they cannot meet the stringent requirements for accuracy.

Method used

By analyzing the lexical relationships in the initial response, it is determined whether hallucination exists, high-risk lexical terms are identified, and lexical terms are updated based on the local knowledge base to replace high-risk lexical terms in order to generate a more accurate output response.

Benefits of technology

It improved the accuracy of large model output, reduced the illusion rate, and enhanced the accuracy of intent understanding and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121524327A_ABST
    Figure CN121524327A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for determining large model output, and the method comprises the steps: generating an initial response based on a query statement inputted by a user, determining whether the initial response has illusion or not according to the relation between lexical elements in the initial response, and if the initial response has illusion, outputting the large model output. Whether any lexical element in the initial response belongs to a mark set or not is determined, the lexical element with the illusion risk exists in the mark set, and if the lexical element belongs to the mark set, whether the lexical element is a high-risk lexical element or not is determined according to the trust degree of the lexical element in the initial response; if the lexical elements are high-risk lexical elements, the lexical elements are replaced by updating the lexical elements, so that the output response of the query statement is obtained. By adopting the method, hallucination suppression of the response of the large model to the text query statement can be realized, and the output accuracy of the large model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing, and in particular to a method and apparatus for determining the output of a large model. Background Technology

[0002] With the rapid development of artificial intelligence technology, large-scale models can generate corresponding responses based on user-input queries, greatly improving the efficiency and convenience of information interaction. However, in practical applications, large-scale models still face the problem of inaccurate output responses, that is, the generated responses do not match the facts, contain logical contradictions, or have information biases. This problem has a particularly prominent impact on the financial sector.

[0003] Currently, the solution to this problem is to train a large model using a large amount of sample data to generate relatively accurate responses. While this method improves the output accuracy of large models to some extent, it suffers from significant limitations in generalization ability and cannot meet the stringent requirements for output accuracy when faced with complex scenarios such as ambiguous user queries and cross-domain technical terms. Summary of the Invention

[0004] This application provides a method and apparatus for determining the output of a large model, which is used to suppress the illusion of the large model's response to text-based query statements and improve the accuracy of the large model's output.

[0005] In a first aspect, embodiments of this application provide a method for determining the output of a large model. This method is applicable to large models and can be executed by an apparatus for determining the output of a large model. The method includes: generating an initial response based on a query statement input by a user; determining whether the initial response is hallucinatory based on the relationship between terms in the initial response; if the initial response is hallucinatory, determining whether any term in the initial response belongs to a tag set, wherein the tag set contains terms with a risk of hallucination; if the term belongs to the tag set, determining whether the term is a high-risk term based on the degree of trust the term is in the initial response; if the term is a high-risk term, replacing the term with an updated term to obtain the output response of the query statement.

[0006] Using the above method, based on the relationships between the various terms in the initial response, it can be determined whether logical illusion exists in the initial response. Furthermore, if logical illusion exists, for each term in the initial response, based on the tag set and the degree of trust of the term, it can be determined whether the term belongs to a high-risk term. If it is a high-risk term, the updated term is determined, and replacing the term with the updated term yields a more accurate output response. In this way, logical illusion in the large model's response to text-based queries can be suppressed in real time, optimizing the accuracy of the large model's response to queries.

[0007] In one possible implementation, before replacing the terminology by updating the terminology, the method further includes: obtaining real-time data of the query statement according to the intent of the query statement and updating the local knowledge base based on the real-time data; the updated terminology is determined based on the local knowledge base.

[0008] By using the above method, the local knowledge base can be updated in a timely manner based on the real-time data of the query statement, enabling the large model to provide a better and more accurate real-time response and avoiding the impact of the lag in the local knowledge base on the response of the query statement.

[0009] In one possible implementation, obtaining real-time data of the query statement based on its intent includes: determining whether the intent of the query statement belongs to a time-sensitive intent; if it belongs to a time-sensitive intent, then determining real-time data whose similarity to the query statement meets the similarity requirement.

[0010] Using the above method, data that is highly similar to the intent of the query statement can be identified as real-time data.

[0011] In one possible implementation, replacing the word with an updated word includes: determining a first overall confidence level and a second overall confidence level corresponding to the initial response after replacing the word with the updated word; if the first overall confidence level is greater than the second overall confidence level, replacing the word with the updated word.

[0012] Using the above method, by calculating the overall confidence of the original sequence before word substitution and the overall confidence of the sequence after substitution, the overall confidence of the sequence after substitution is greater than that of the sequence before substitution, thus determining the correctness of the word substitution.

[0013] In one possible implementation, the method further includes: if the term does not belong to the tag set, then continue processing the next term; or if the initial response does not contain an illusion, then use the initial response as the output response of the query statement.

[0014] In one possible implementation, before generating the initial response, the method further includes: calculating the intent category corresponding to the query statement based on the query statement; outputting intent understanding questions and answers based on the intent category corresponding to the query statement; receiving user responses to the intent understanding questions and answers; and updating the query statement based on the responses to the intent understanding questions and answers.

[0015] By using the above method and through intent-based question answering, we can obtain more precise query intents from users, thereby improving the accuracy of intent understanding.

[0016] In one possible implementation, determining whether the initial response is hallucinatory based on the relationship between the lexical units in the initial response includes: constructing a covariance matrix corresponding to the initial response based on the feature vector of each lexical unit in the initial response; obtaining a hallucination score for the initial response based on the variance of each feature and the covariance between features calculated from the covariance matrix; and determining that the initial response is hallucinatory if the hallucination score meets a threshold requirement.

[0017] Secondly, embodiments of this application provide an apparatus for determining the output of a large model. The apparatus includes a generation module for generating an initial response based on a query statement input by a user; a determination module for determining whether the initial response is hallucinatory based on the relationship between lexical units in the initial response; and, if the initial response is hallucinatory, determining whether any lexical unit in the initial response belongs to a tag set, wherein the tag set contains lexical units with a risk of hallucination; if the lexical unit belongs to the tag set, determining whether the lexical unit is a high-risk lexical unit based on the degree of trust the lexical unit is in the initial response; and a processing module for replacing the lexical unit with an updated lexical unit if the lexical unit is a high-risk lexical unit, thereby obtaining the output response of the query statement.

[0018] In one possible implementation, the processing module is further configured to obtain real-time data of the query statement according to the intent of the query statement and update the local knowledge base based on the real-time data; the updated lexical units are determined based on the local knowledge base.

[0019] In one possible implementation, the processing module is specifically used to determine whether the intent of the query statement belongs to a time-sensitive intent; if it belongs to a time-sensitive intent, then determine real-time data that meets the similarity requirement with the query statement.

[0020] In one possible implementation, the processing module is further configured to: determine a first overall confidence level corresponding to the initial response after replacing the word with the updated word and a second overall confidence level corresponding to the initial response; if the first overall confidence level is greater than the second overall confidence level, replace the word with the updated word.

[0021] In one possible implementation, the processing module is further configured to: if the lexical does not belong to the tag set, continue processing the next lexical; or, if the initial response does not contain an illusion, use the initial response as the output response of the query statement.

[0022] In one possible implementation, the generation module is further configured to: calculate the intent category corresponding to the query statement based on the query statement; output intent understanding questions and answers based on the intent category corresponding to the query statement; receive user responses to the intent understanding questions and answers; and update the query statement based on the responses to the intent understanding questions and answers.

[0023] In one possible implementation, the determining module is specifically used to: construct a covariance matrix corresponding to the initial response based on the feature vector of each word in the initial response; obtain the hallucination score of the initial response based on the variance of each feature and the covariance between features calculated from the covariance matrix; and determine that the initial response contains hallucinations if the hallucination score meets a threshold requirement.

[0024] Thirdly, embodiments of this application also provide an apparatus for determining the output of a large model, the apparatus including a memory and a processor, the memory being used to store computer programs or instructions; the processor being used to invoke the computer programs or instructions stored in the memory to execute the method as in any possible implementation of the first aspect.

[0025] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when read and executed by a computer, cause the computer to perform a method as described in any possible implementation of the first aspect.

[0026] Fifthly, embodiments of this application provide a computer program product storing instructions that, when read and executed by a computer, cause the computer to perform the method in any possible implementation of the first aspect described above. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is a flowchart illustrating a method for determining the output of a large model, as provided in an embodiment of this application. Figure 2 A schematic diagram of a response interface based on a user query statement provided in an embodiment of this application; Figure 3 This is a schematic diagram of the internal modules of an output device provided in an embodiment of this application; Figure 4This is a schematic diagram of an output device structure provided in an embodiment of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0030] With the rapid development of large-scale models, their application in responding to user-input queries has become increasingly sophisticated. In the financial sector, ensuring the accuracy of large-scale model outputs is particularly crucial. However, during the response process, while the content generated by the model may not be directly erroneous at the factual level, its internal reasoning process or logical chain may contain fallacies, inconsistencies, or breaks. For example, a large-scale model might arrive at an illogical conclusion C based on correct factual premises A and B; this behavior can be termed a logical illusion.

[0031] To ensure large-scale models can accurately output corresponding responses, the following existing technologies exist. One existing technology trains the large model with a large amount of sample data. While this approach improves the accuracy of user intent recognition, the limited number of training samples still results in insufficient generalization ability, especially when dealing with ambiguous user commands and cross-domain terminology, where accuracy drops significantly. Another existing technology extracts entities and relationships between entities from the output text of the large model using entity recognition, relation extraction, and other techniques, thereby constructing a knowledge graph. Then, each triple in the knowledge graph is compared with a trusted knowledge base to verify the correctness of the facts stated by the triple. However, in the knowledge graph construction step, some subtle semantics, context, or modifiers may not be accurately converted into triples, leading to information loss and affecting the accuracy of the comparison with the knowledge base. Furthermore, the comparison process is post-verification and cannot achieve real-time illusion suppression.

[0032] Based on this, embodiments of this application provide a method for determining the output of a large model, which is used to suppress the illusion of the large model's response to text-based query statements and improve the accuracy of the large model's output.

[0033] Figure 1 This is a flowchart illustrating a method for determining a large model output according to an embodiment of this application. This process can be executed by a device for determining the large model output. Figure 1 As shown, the process includes the following steps: Step 101: The device for determining the output of the large model generates an initial response based on the user-input query.

[0034] Specifically, large models refer to a class of artificial intelligence models with a large number of parameters constructed from artificial neural networks. They are characterized by a large number of parameters, large training data, and large computational resources, and possess the ability to solve general tasks, follow human instructions, and perform complex reasoning. In recent years, large models have developed rapidly, with various large models such as GPT-2 and GPT-3 being launched successively. This application does not specifically limit the types of large models.

[0035] The device for determining the output of a large model is an intelligent device that has a large model installed, or an intelligent device that can call upon a large model, such as a computer or physical server. For the sake of simplicity in the following description, the device for determining the output of a large model can be simply described as an output device. The output device can receive query statements input by the user. The input method can be that the user types the query statement using the keyboard of the output device, or inputs the query statement using the voice module of the output device. Alternatively, the user's input can be received by other devices, and then those other devices send the user's input to the output device. The embodiments of this application do not limit the specific method of obtaining the query statement input by the user.

[0036] The output device invokes the large model to respond to the query statement. The large model generates an initial response to the query statement based on its learned knowledge base. If the user's query statement is relatively detailed and clear, the large model can directly output the initial response based on the query statement. It should be noted that user queries can be in addition to text, but also images. The large model can process not only text-based queries but also image-based queries.

[0037] In one possible implementation, before generating the initial response, the method further includes: calculating the intent category corresponding to the query statement based on the query statement; outputting intent understanding questions and answers based on the intent category corresponding to the query statement; receiving user responses to the intent understanding questions and answers; and updating the query statement based on the responses to the intent understanding questions and answers.

[0038] For example, if a user enters the query "I want to invest in Tesla stock, is now a good time?" the large model detects that the query is not detailed or clear enough. Therefore, the large model calls the Bidirectional Encoder Representations from Transformers (BERT) model to convert the user's query into a query vector. The query vector is then compared with the weight vectors and bias terms of multiple intent categories to calculate the score of the query statement in each intent category. These intent categories can be investment consultation intent, information query intent, and risk analysis intent. The calculation formula for each intent category is shown in Formula 1. Formula 1 Where w represents the weight vector of the intent category, and b represents the bias term of the intent category, the weight vector and bias term of each intent category can be different. For example, according to Formula 1 above, the score for investment consultation intent is 3.2, the score for information query intent is 1.5, and the score for risk analysis intent is 0.8. Further, a normalized index is calculated based on the scores of each intent category. The formulas for calculating the normalized index function of the three intent categories are shown in Formulas 2 to 4: Formula 2 Formula 3 Formula 4 Since the normalized index score of the aforementioned investment consultation intent is the highest and greater than the preset threshold of 0.6, the intent category of the user's input query can be determined as investment consultation intent. The threshold of the normalized index in this application can be adjusted according to actual needs; this application does not limit the size of the preset threshold.

[0039] If the normalized index scores of at least two intent categories are both higher than the preset threshold, the intent category with the highest score can be selected. If the normalized index scores of each intent category are lower than the preset threshold, a backup mechanism can be used, such as guessing the user's intent preferences through the user's historical conversations. Of course, there are other processing methods, which will not be elaborated on in this application.

[0040] After determining the intent category corresponding to the query, the large model outputs intent-understanding questions and answers related to that intent category. For example, if the intent category of the query is investment consultation, the large model can output intent-understanding questions and answers such as "How much should I invest?", "What is the investment period?", and "What is my risk appetite?". These questions and answers can be open-ended, meaning they don't provide answer options to the user, or they can be intent-understanding questions and answers with answer options, such as "How much should I invest? A. Less than 100,000, B. 100,000 to 500,000, C. More than 500,000." These intent-understanding questions and answers can be displayed on the output device's interface. After the user replies to the intent-understanding questions and answers, the large model receives the user's reply and updates the query. For example, the user's reply to the intent-understanding questions and answers could be an investment amount of 100,000 yuan, an investment period of 6 months, and a medium risk appetite. The updated query would then be "I want to invest in Tesla stock, with an investment amount of 100,000 yuan, an investment period of 6 months, and a medium risk appetite. Is now a good time?"

[0041] Therefore, the initial response of the large model can be generated based on the updated query statement. For example, the initial response could be: "Based on Tesla's Q3 financial report, net profit increased by 25%, investment is recommended...".

[0042] It should be noted that when the large model outputs each word, it selects the candidate word with the highest probability value from multiple candidate word values. For example, for the word "25%", the large model can determine that the candidate word with the highest probability value (25%) is the one with a probability of 10%, 15%, 20%, and 25% based on the other two candidate word values. Of course, this application does not limit the value or number of candidate word values.

[0043] Step 102: The device that determines the output of the large model determines whether there is an illusion in the initial response based on the relationship between the terms in the initial response.

[0044] After the large model determines the initial response, it determines whether the initial response is illusory based on the relationships between the lexical units in the initial response. These relationships can be attentional associations, calculated using a Transformer model to determine the strength of these associations. If the association strength is less than a preset threshold, the initial response is considered illusory. One possible implementation involves determining whether the initial response is illusory based on the relationships between the lexical units in the initial response. This includes constructing a covariance matrix for the initial response based on the feature vectors of each lexical unit, calculating the variance of each feature and the covariance between features using the covariance matrix, and obtaining an illusion score for the initial response. If the illusion score meets the threshold requirement, the initial response is considered illusory.

[0045] Specifically, a sequence embedding matrix is ​​generated based on each word in the initial response. ,in This is a 768-dimensional feature vector for each word. Taking an initial response with five words as an example, a sequence embedding matrix is ​​generated based on the feature vector of each word. Thus, the covariance matrix is ​​obtained as follows: Calculate the eigenvalues ​​of the covariance matrix. Assume we calculate the eigenvalues ​​of the covariance matrix described above. , , , , The eigenvalues ​​of the covariance matrix represent the variance of each feature and the covariance between features. Further, the hallucination score of the initial response is calculated based on the eigenvalues ​​of the covariance matrix. Hallucination score = If the set threshold is -0.1, then the hallucination score is less than the threshold of -0.1, which meets the threshold requirement, and it is determined that the initial response contains hallucinations.

[0046] In one possible implementation, if the initial response does not exhibit hallucination, i.e., if the hallucination score of the initial response does not meet the threshold requirement, the initial response is used as the output response of the query statement, and the output response is displayed on the interface of the output device.

[0047] Step 103: Determine whether any term in the initial response belongs to the tag set if the device for determining the output of the large model is in the case of an illusion in the initial response.

[0048] Specifically, if it is determined that the initial response involves hallucinations, a set of tags is obtained, which contains words that pose a risk of hallucination. It is then determined whether any word in the initial response belongs to this set of tags. Specifically, this can be done by starting with the first word in the initial response and sequentially determining whether it belongs to the set of tags. If the first word does not belong to the set of tags, the process continues with the next word.

[0049] Step 104: If the word belongs to the tag set, determine whether the word is a high-risk word based on the degree of trust it has in the initial response.

[0050] Specifically, if a word element belongs to the tag set, it indicates that the word element may be a high-risk word element. Therefore, the degree of trust in the word element during the initial response determines whether the word element is a high-risk word element. The degree of trust can be represented by a trust score; the higher the trust score, the higher the degree of trust in the word element; the lower the trust score, the lower the degree of trust in the word element. The trust score is obtained from the statistical behavior of a large model on a large amount of training data. It can be quantified as the confidence of the large model in generating this word element, reflecting the tendency of the large model to "over-rely on" or "habitually generate" this word element. The higher the trust score, the more likely the large model is to generate this word element without thinking.

[0051] Formula 5 can be used to determine whether a word is a high-risk word: Formula 5 in, This indicates an adjustable parameter, which can be 1 or 0.3, and can be adjusted according to actual needs. Let S represent the indicator function, and S represent the set of tags. For any given word, if the word belongs to the tag set, the indicator function evaluates to 1; otherwise, it evaluates to 0. TrustScore( ) represents the trust score of a word element. It indicates the risk of any term.

[0052] According to formula 5, if If the value meets the threshold requirement, it indicates that the word is a high-risk word; if If the value does not meet the threshold requirement, it means that the word is not a high-risk word. For example, after calculation by the above formula 5, the word "25%" is determined to be a high-risk word.

[0053] Step 105: If the term is a high-risk term, then the term is replaced by updating the term to obtain the output response of the query statement.

[0054] Specifically, if a term is a high-risk term, an updated term is determined for that term, and the updated term is used to replace the original term, updating the initial response of the query statement to obtain the output response of the query statement. Specifically, before replacing the term with the updated term, the process includes: obtaining real-time data of the query statement based on its intent, and updating the local knowledge base based on the real-time data; the updated term is determined based on the local knowledge base.

[0055] The intent of the query statement can be the updated query statement obtained in step 101 based on the user's response to the intent understanding question. Based on the intent of the query statement, real-time data of the query statement is obtained, including: determining whether the intent of the query statement belongs to a time-sensitive intent; if it does, then determining real-time data whose similarity to the query statement meets the similarity requirements.

[0056] Specifically, based on the intent of the query, it is determined whether the intent of the query is time-sensitive. Time-sensitive intent refers to a user's query intent that depends on a specific time window, such as real-time, recent, or a future period. For example, if the query is about the current stock market index, real-time traffic conditions in a certain location, whether registration for a certain event is open today, or what the weather will be like tomorrow, then the intent of the query is time-sensitive. If the query is about the penalty for running a red light in traffic regulations or the core principles of blockchain, then the intent of the query is not time-sensitive.

[0057] If it is determined that the user's query intent is time-sensitive, then real-time data that meets the similarity requirements with the query intent is identified. Real-time data can be data learned by the large model or data from an external database that has high similarity to the user's query intent. Specifically, the large model can convert the updated query intent into a query intent vector and each data file in the external database into a knowledge base vector. The similarity between the query intent vector and each knowledge base vector is calculated; the similarity calculation method can be cosine similarity or other similarity calculation methods, which are not specifically limited in this application. Then, data files that meet the similarity requirements are obtained as real-time data for the large model's learning, and the real-time data is updated in the large model's local knowledge base.

[0058] After updating the local knowledge base, the large model determines, based on the updated local knowledge base, that Tesla's net profit growth in its Q3 financial report was 15%. Therefore, the 25% of the updated terms are 15%, and thus, the updated terms can replace the original terms. Replacing terms with updated terms involves: determining the first overall confidence level and the second overall confidence level corresponding to the initial response after replacing the terms with updated terms. If the first overall confidence level is greater than the second overall confidence level, the updated term will replace the original term.

[0059] For example, the first overall confidence level corresponding to the initial response after replacing the word with the updated word is: =0.9 0.95 = 0.855, the second comprehensive confidence level corresponding to the original word in the initial response is 0.95 = 0.855. The first overall confidence level is greater than the second overall confidence level, therefore the replacement is valid, and the updated terminology will replace the original terminology.

[0060] Following the above processing rules, each term in the initial response is processed sequentially to obtain the output response of the query statement. For example, the output response is: "Based on Tesla's Q3 financial report, net profit increased by 15%, but the market share of electric vehicles increased by 5%. Considering your investment of 100,000 yuan, a term of 6 months, and a moderate risk appetite, short-term investment is advised to be cautious, and it is recommended to pay attention to the Q4 delivery data before making a decision."

[0061] Figure 2 This is a schematic diagram of a response interface based on a user query statement, provided as an embodiment of this application. Figure 2 As can be seen, after the large model receives the user's query, it can output intent-understanding questions and answers. After receiving the user's response to the intent-understanding questions and answers, if the generated initial response is illusory, it does not display the initial response on the interface. Instead, it displays the output response of the query obtained by updating and replacing the tokens.

[0062] The method for determining the output of a large model proposed in this application has significant improvements over traditional methods. Table 1 shows the comparison data obtained based on actual test data.

[0063] Table 1

[0064] As shown in Table 1, the accuracy of intent achieved by this solution is 15.8% higher than that of the traditional solution; the rate of illusion is reduced by 66.5%; the response latency is reduced by 42.3%; and user satisfaction is increased by 35.3%.

[0065] Figure 3 This is a schematic diagram of the internal modules of an output device provided in an embodiment of this application, such as... Figure 3 As shown, the device may include a generation module 301, a determination module 302, and a processing module 303. The generation module 301 is used to generate an initial response based on a user-input query. The determination module 302 is used to determine whether the initial response contains hallucinations based on the relationships between lexical terms in the initial response; and, if the initial response contains hallucinations, to determine whether any lexical term in the initial response belongs to a tag set containing lexical terms with a risk of hallucination; if the lexical term belongs to the tag set, to determine whether the lexical term is a high-risk lexical term based on its level of trust in the initial response; the processing module 303 is used to, if the lexical term is a high-risk lexical term, replace the lexical term with an updated lexical term to obtain the output response of the query.

[0066] In one possible implementation, the processing module 303 is further configured to obtain real-time data of the query statement according to the intent of the query statement and update the local knowledge base based on the real-time data; the updated lexical units are determined based on the local knowledge base.

[0067] In one possible implementation, the processing module 303 is specifically used to determine whether the intent of the query statement belongs to a time-sensitive intent; if it belongs to a time-sensitive intent, then determine real-time data whose similarity to the query statement meets the similarity requirement.

[0068] In one possible implementation, the processing module 303 is further configured to: determine a first comprehensive confidence level corresponding to the initial response after replacing the word with the updated word and a second comprehensive confidence level corresponding to the initial response; if the first comprehensive confidence level is greater than the second comprehensive confidence level, replace the word with the updated word.

[0069] In one possible implementation, the processing module 303 is further configured to: if the lexical does not belong to the tag set, continue processing the next lexical; or, if the initial response does not contain an illusion, use the initial response as the output response of the query statement.

[0070] In one possible implementation, the generation module 301 is further configured to: calculate the intent category corresponding to the query statement based on the query statement; output intent understanding questions and answers based on the intent category corresponding to the query statement; receive user responses to the intent understanding questions and answers; and update the query statement based on the responses to the intent understanding questions and answers.

[0071] In one possible implementation, the determining module 302 is specifically used to: construct a covariance matrix corresponding to the initial response based on the feature vector of each word in the initial response; obtain the hallucination score of the initial response based on the variance of each feature and the covariance between features calculated from the covariance matrix; and determine that the initial response contains hallucinations if the hallucination score meets the threshold requirement.

[0072] Figure 4 This is a schematic diagram of an output device structure provided in an embodiment of this application. Figure 4 As shown, it includes at least one processor 401 and a memory 402 connected to at least one processor 401. In this embodiment, the specific connection medium between the processor 401 and the memory 402 is not limited. Figure 4 Taking the connection between processor 401 and memory 402 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.

[0073] In this embodiment of the application, the memory 402 stores instructions that can be executed by at least one processor 401. By executing the instructions stored in the memory 402, the at least one processor 401 can implement the steps of the method for determining the output of the large model described above.

[0074] The processor 401 is the control center of the computer device, capable of connecting various parts of the computer device via various interfaces and lines. It performs resource configuration by running or executing instructions stored in the memory 402 and accessing data stored in the memory 402. Optionally, the processor 401 may include one or more processing units. The processor 401 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.

[0075] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0076] Memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 402 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 402 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 402 may also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0077] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0078] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0079] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0080] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0081] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for determining the output of a large model, characterized in that, The method is applicable to large models, including: Generate an initial response based on the user's query input; Based on the relationships between the terms in the initial response, determine whether the initial response is an illusion; In the case that the initial response is hallucinatory, determine whether any word in the initial response belongs to a tag set, wherein the tag set contains words that are at risk of hallucination; If the term belongs to the tag set, determine whether the term is a high-risk term based on the degree of trust the term is in the initial response; If the term is a high-risk term, then the term is replaced by an updated term to obtain the output response of the query statement.

2. The method according to claim 1, characterized in that, Before replacing the lexical unit by updating the lexical unit, the method further includes: Based on the intent of the query statement, real-time data of the query statement is obtained and the local knowledge base is updated based on the real-time data; the updated lexical units are determined based on the local knowledge base.

3. The method according to claim 2, characterized in that, Based on the intent of the query statement, obtain the real-time data of the query statement, including: Determine whether the intent of the query statement belongs to the time-sensitive intent; If the intent is time-sensitive, then real-time data that meets the similarity requirement with the query statement is identified.

4. The method according to claim 1, characterized in that, By updating the lexical replacement, including: Determine the first comprehensive confidence level corresponding to the initial response after replacing the word with the updated word and the second comprehensive confidence level corresponding to the initial response; If the first overall confidence level is greater than the second overall confidence level, the updated terminology replaces the original terminology.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: If the term does not belong to the tag set, then continue processing the next term; or If there is no hallucination in the initial response, the initial response will be used as the output response of the query statement.

6. The method according to any one of claims 1 to 4, characterized in that, Before generating the initial response, the method further includes: Calculate the intent category corresponding to the query statement based on the query statement; Based on the intent category corresponding to the query statement, output intent understanding questions and answers; Receive the user's response to the intent understanding question and answer, and update the query statement based on the response to the intent understanding question and answer.

7. The method according to any one of claims 1 to 4, characterized in that, Determining whether the initial response is hallucinatory based on the relationships between the terms in the initial response includes: Construct the covariance matrix corresponding to the initial response based on the feature vector of each word in the initial response; The illusion score of the initial response is obtained by calculating the variance of each feature and the covariance between features based on the covariance matrix. If the hallucination score meets the threshold requirement, then it is determined that the initial response contains hallucinations.

8. A device for determining the output of a large model, characterized in that, include: Memory is used to store computer programs or instructions; A processor is configured to invoke a computer program or instructions stored in the memory to perform the method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when read and executed by a computer, cause the computer to perform the method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product stores instructions that, when read and executed by a computer, cause the computer to perform the method as described in any one of claims 1 to 7.