A question and answer processing method, system, device and medium based on three-dimensional entropy evaluation

By constructing a semantic graph and calculating a three-dimensional evaluation system of semantic entropy, available entropy, and sample entropy, the problems of illusion recognition and parameter updating in large-scale language model question-answering processing are solved, achieving more efficient and reliable question-answering processing results.

CN121009182BActive Publication Date: 2026-02-27HUNAN ZHITONG STAR TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511536093.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-02-27
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

Existing question-answering techniques for large-scale language models mostly employ single-dimensional evaluation, which fails to identify high-frequency and highly harmful hallucinations and cannot adapt to parameter updates across various domains in a timely manner, thus limiting the reliability and practical application value of model question-answering.

Method used

A question-answering processing method based on three-dimensional entropy evaluation is constructed. By building a semantic graph and calculating semantic entropy, available entropy and sample entropy, and combining dynamic threshold comparison and feedback adjustment mechanism, the method comprehensively detects semantic contradictions, prediction anomalies and sample deviations, thereby improving the reliability of the model question-answering system.

Benefits of technology

Through a multi-dimensional evaluation mechanism, semantic structure confusion, lack of prediction stability, and deviation from domain knowledge are effectively identified, reducing the risk of dangerous suggestion output and improving the reliability and security of model question answering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009182B_ABST
    Figure CN121009182B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on three-dimensional entropy evaluation question and answer processing method, system, equipment and medium, the method is processed by constructing the question and answer set to be handled according to target question, target reply and history context;Based on the question and answer set to be handled, the corresponding semantic atlas is constructed from the question and answer set to be handled;Based on semantic atlas and each to be verified combination, the semantic entropy, available entropy and sample entropy of target reply are calculated respectively;According to semantic entropy, available entropy and sample entropy, generate the three-dimensional entropy result of target reply, to execute the question and answer processing scheme corresponding to three-dimensional entropy result, can be through the three-dimensional evaluation system of constructing semantic atlas and calculating semantic entropy, available entropy and sample entropy, combined with dynamic threshold comparison and feedback adjustment mechanism, semantic contradiction is comprehensively detected, prediction anomaly and sample deviation problem is handled, to improve model question and answer system reliability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a question and answer processing method and system based on three-dimensional entropy evaluation, equipment and medium. BACKGROUND

[0002] With the wide application of large language models, model question and answer driven by large language models have appeared in various fields. With the ability to quickly generate natural language responses, they have become an important tool for improving service efficiency in various fields. However, the answers generated by large language models based on questions generally have illusion problems, which not only affect the accuracy of user decision-making, but also may cause safety risks in critical fields such as medicine.

[0003] Current model question and answer processing technologies mostly use single-dimensional evaluation, and the real sample library supporting illusion recognition lacks a normalizing update and maintenance mechanism, resulting in the inability to identify high-frequency and dangerous illusions in various fields, and the inability to adapt to changes such as parameter updates in various fields in a timely manner. This makes it impossible to accurately identify the illusion problems existing in model question and answer, and the processing efficiency is low, thereby restricting the overall reliability of model question and answer processing and its practical application value in various fields. SUMMARY

[0004] The following is a summary of the subject matter of the detailed description. This summary is not intended to limit the scope of the claims.

[0005] The main purpose of the embodiments of the present disclosure is to propose a question and answer processing method, system, device and storage medium based on three-dimensional entropy evaluation, which can construct a semantic graph and calculate the three-dimensional evaluation system of semantic entropy, available entropy and sample entropy, combined with a dynamic threshold comparison and feedback adjustment mechanism, to comprehensively detect and process semantic contradictions, abnormal predictions and sample deviation problems, thereby improving the reliability of the model question and answer system.

[0006] The first aspect of the embodiments of the present application provides a question and answer processing method based on three-dimensional entropy evaluation, for a central controller, the method comprising:

[0007] constructing a set of questions to be processed according to a target question, a target answer and historical context; the target answer is generated by a large language model based on the target question; the historical context is the context content associated with the target question;

[0008] constructing a corresponding semantic graph based on the set of questions to be processed; each node in the semantic graph is obtained based on the target entity in the set of questions to be processed, each edge in the semantic graph is obtained based on the target attribute and the target association relationship in the set of questions to be processed; the target association relationship represents the logical relationship between the target entities in the set of questions to be processed;

[0009] extract a plurality of to-be-verified combinations from the set of to-be-processed question and answer sets; each of the to-be-verified combinations is composed of a target entity in the set of to-be-processed question and answer sets, a target attribute in the set of to-be-processed question and answer sets, and a target attribute value in the set of to-be-processed question and answer sets;

[0010] based on the semantic graph and each of the to-be-verified combinations, respectively calculate semantic entropy, available entropy, and sample entropy of the target reply; the semantic entropy is used to quantify the logical consistency of the target reply, the available entropy is used to quantify the prediction stability of the large language model when generating the target reply according to the target question, and the sample entropy is used to quantify the matching degree of the target reply and the real sample library of the corresponding field of the target question;

[0011] According to the semantic entropy, the available entropy and the sample entropy, a three-dimensional entropy result of the target reply is generated to execute a question and answer processing scheme corresponding to the three-dimensional entropy result.

[0012] In some embodiments of the present application, the semantic graph corresponding to the set of to-be-processed question and answer sets is constructed based on the set of to-be-processed question and answer sets, comprising:

[0013] extract the target entity, the target attribute, and the target association relationship from the set of to-be-processed question and answer sets; the target entity represents a field-specific object in the set of to-be-processed question and answer sets; the target attribute represents the characteristics of the target entity; the target association relationship includes the subject-predicate-object relationship, the cause-effect relationship, the time sequence relationship, and the attribute association relationship between the target entities;

[0014] the target entity and the target attribute are taken as nodes of the semantic graph;

[0015] the target association relationship is taken as an edge of the semantic graph, and the confidence of each edge in the semantic graph is calculated based on the annotation confidence of the target entity and the annotation confidence of the target attribute;

[0016] Integrate the nodes of the semantic graph, the edges of the semantic graph, and the confidence of each edge in the semantic graph to obtain the semantic graph.

[0017] In some embodiments of the present application, the semantic entropy of the target reply is calculated by the following steps:

[0018] based on the confidence of each edge in the semantic graph, analyze the target association relationship of each edge in the semantic graph according to a preset semantic analysis model to obtain a rationality score of each target association relationship;

[0019] statistically determine a confusion degree of each node in the semantic graph and each edge in the semantic graph based on the rationality scores of the target association relationships; the confusion degree represents a semantic logical consistency degree between the target reply, the target question, and the historical context;

[0020] calculate a semantic entropy of the target reply according to the confusion degree; the semantic entropy represents a probability degree of semantic contradiction of the target reply.

[0021] In some embodiments of the present application, the available entropy of the target reply is calculated by the following steps:

[0022] retrieve candidate content probability distributions of each of the to-be-verified combinations in a process in which the large language model generates the target reply; the candidate content probability distribution is a probability distribution of multiple alternative contents when the large language model generates the to-be-verified combination;

[0023] statistically determine a dispersion degree of the candidate content probability distribution corresponding to each of the to-be-verified combinations;

[0024] calculate the available entropy of the target reply based on the probability distribution dispersion degrees of each of the to-be-verified combinations; the available entropy represents a probability degree of predicted abnormality of the target reply.

[0025] In some embodiments of the present application, the sample entropy of the target reply is calculated by the following steps:

[0026] retrieve a real sample library of a field corresponding to the target question;

[0027] calculate feature distances between the target reply and all samples in the real sample library of the field;

[0028] extract reference samples from the samples according to each of the feature distances; the reference samples are samples in the samples that satisfy a preset sample condition; the preset sample condition includes that the feature distance is less than a preset feature distance threshold;

[0029] statistically determine a feature distance probability distribution between the target reply and each of the reference samples;

[0030] calculate the sample entropy of the target reply based on the feature distance probability distribution; the sample entropy represents a matching degree of the target reply and the real sample library of the field corresponding to the target question.

[0031] In some embodiments of the present application, the generating, according to the semantic entropy, the available entropy, and the sample entropy, of a three-dimensional entropy result of the target reply to execute a question and answer processing scheme corresponding to the three-dimensional entropy result includes:

[0032] weighting and fusing the semantic entropy, the available entropy and the sample entropy to obtain a three-dimensional entropy result of the target reply; wherein the weights of the semantic entropy, the available entropy and the sample entropy in the weighting and fusing process are respectively determined according to the demand distribution of the field corresponding to the target reply;

[0033] calling an illusion threshold of the field corresponding to the set of questions and answers to be processed;

[0034] comparing the three-dimensional entropy result of the target reply with the illusion threshold of the field corresponding to the set of questions and answers to be processed to obtain a comparison result;

[0035] executing a corresponding question and answer processing scheme according to the comparison result;

[0036] if the three-dimensional entropy result of the target reply is lower than the illusion threshold of the field corresponding to the set of questions and answers to be processed, outputting the target reply; if the three-dimensional entropy result of the target reply is higher than or equal to the illusion threshold of the field corresponding to the set of questions and answers to be processed, analyzing the semantic entropy of the target reply, the available entropy of the target reply and the sample entropy of the target reply to determine the illusion type of the target reply; generating a question and answer exception prompt and preventing the output of the target reply according to the illusion type of the target reply.

[0037] In some embodiments of the present application, after the three-dimensional entropy result of the target reply is generated according to the semantic entropy, the available entropy and the sample entropy to execute the question and answer processing scheme corresponding to the three-dimensional entropy result, the method further comprises:

[0038] in response to error information of user abnormal feedback, obtaining an illusion type of the error information;

[0039] in a case where the illusion type of the error information is based on the semantic entropy exception, calculating a semantic error between the semantic entropy of the target reply and a semantic entropy threshold of the field corresponding to the target reply to adjust the calculation step of the semantic entropy according to the semantic error; the adjustment of the calculation step of the semantic entropy includes adjusting a judgment threshold of a rationality score output by a preset semantic analysis model in the semantic entropy;

[0040] in a case where the illusion type of the error information is based on the available entropy exception, calculating a prediction error between the available entropy of the target reply and an available entropy threshold of the field corresponding to the target reply to adjust the calculation step of the available entropy according to the prediction error; the adjustment of the calculation step of the available entropy includes adjusting a statistical standard of dispersion in the available entropy;

[0041] In a case where the illusion type of the error information is based on the sample entropy anomaly, a real error between the sample entropy of the target reply and a sample entropy threshold of a field corresponding to the target reply is calculated to adjust the calculation of the sample entropy according to the real error; the adjustment of the calculation of the sample entropy includes updating of a real sample library in the field of the sample entropy.

[0042] To achieve the above object, a second aspect of an embodiment of the present application provides a question and answer processing system based on three-dimensional entropy evaluation, the system comprising:

[0043] A first module is configured to construct a set of question and answer to be processed according to a target question, a target reply and historical context; the target reply is generated by a large language model according to the target question; the historical context is context content associated with the target question;

[0044] A second module is configured to construct a corresponding semantic graph based on the set of question and answer to be processed; each node in the semantic graph is obtained based on a target entity in the set of question and answer to be processed; each edge in the semantic graph is obtained based on a target attribute and a target association relationship in the set of question and answer to be processed; the target association relationship represents a logical relationship between target entities in the set of question and answer to be processed;

[0045] An extraction module is configured to extract a plurality of verification combinations from the set of question and answer to be processed; each of the verification combinations is composed of a target entity in the set of question and answer to be processed, a target attribute in the set of question and answer to be processed and a target attribute value in the set of question and answer to be processed;

[0046] A calculation module is configured to calculate a semantic entropy, an available entropy and a sample entropy of the target reply based on the semantic graph and each of the verification combinations; the semantic entropy is used to quantify the logical consistency of the target reply; the available entropy is used to quantify the prediction stability of the large language model in generating the target reply according to the target question; and the sample entropy is used to quantify the matching degree between the target reply and a real sample library in a field corresponding to the target question;

[0047] An execution module is configured to generate a three-dimensional entropy result of the target reply according to the semantic entropy, the available entropy and the sample entropy, so as to execute a question and answer processing scheme corresponding to the three-dimensional entropy result.

[0048] To achieve the above object, a third aspect of an embodiment of the present application provides an electronic device, comprising: at least one control processor and a memory connected in communication with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the above-mentioned question and answer processing method based on three-dimensional entropy evaluation.

[0049] To achieve the above object, a fourth aspect of the embodiments of the present application provides a computer readable storage medium, which stores computer executable instructions for causing a computer to execute the above-mentioned three-dimensional entropy evaluation based question and answer processing method.

[0050] The embodiments of the present application provide a three-dimensional entropy evaluation based question and answer processing method, which constructs a to-be-processed question and answer set according to a target question, a target answer and historical context; constructs a corresponding semantic graph based on the to-be-processed question and answer set; extracts a plurality of to-be-verified combinations from the to-be-processed question and answer set; calculates semantic entropy, available entropy and sample entropy of the target answer based on the semantic graph and the to-be-verified combinations; generates a three-dimensional entropy result of the target answer according to the semantic entropy, the available entropy and the sample entropy; and executes a question and answer processing scheme corresponding to the three-dimensional entropy result, which can detect semantic contradictions, predict abnormalities and sample deviation problems and process by constructing a semantic graph and calculating a three-dimensional evaluation system of semantic entropy, available entropy and sample entropy, combining a dynamic threshold comparison and feedback adjustment mechanism, thereby improving the reliability of a model question and answer system.

[0051] It can be understood that the beneficial effects of the above-mentioned second aspect to fourth aspect and related technologies are the same as the beneficial effects of the above-mentioned first aspect and related technologies, which can be referred to the related description in the first aspect and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0052] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the appended drawings, wherein:

[0053] Figure 1 FIG. 1 is a flow diagram of a three-dimensional entropy evaluation based question and answer processing method provided by an embodiment of the present application;

[0054] Figure 2 FIG. 3 is a structural diagram of a three-dimensional entropy evaluation based question and answer processing system provided by an embodiment of the present application;

[0055] Figure 3 FIG. 4 is a hardware structure diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0056] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application.

[0057] In the description of the present application, if the first, second, etc. are described, it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the sequence of indicated technical features.

[0058] In the description of the present application, it should be understood that the orientation description, such as the orientation or position relationship indicated by up, down, etc. is based on the orientation or position relationship shown in the drawings, only for the purpose of facilitating the description of the present application and simplifying the description, and therefore cannot be understood as indicating or implying that the device or element indicated must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.

[0059] In the description of the present application, it should be noted that, unless otherwise explicitly limited, the words such as setting, installing, connecting, etc. should be broadly understood, and those skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical solution.

[0060] With the wide application of large language models, large language model driven model question and answer has appeared in various fields. With the ability to quickly generate natural language responses, it has become an important tool for improving service efficiency in various fields. However, the answers generated by large language models according to the questions generally have illusion problems, which not only affects the accuracy of user decision-making, but also may cause safety risks in critical fields such as medical treatment.

[0061] Current model question and answer processing technology mostly uses single dimension evaluation, and the real sample library supporting illusion recognition lacks normal updating and maintenance mechanism, which leads to the inability to identify high-frequency and dangerous illusions in various fields, and the inability to adapt to parameter updates and other changes in various fields in a timely manner, so that the illusion problems existing in the model question and answer cannot be accurately identified, the processing efficiency is low, and the overall reliability of the model question and answer processing and the actual application value in various fields are restricted.

[0062] Based on this, the embodiment of the present application provides a question and answer processing method, system, electronic device and medium based on three-dimensional entropy evaluation, which aims to build a semantic graph and calculate the three-dimensional evaluation system of semantic entropy, available entropy and sample entropy, combined with dynamic threshold comparison and feedback adjustment mechanism, to comprehensively detect and process semantic contradiction, abnormal prediction and sample deviation problems, thereby improving the reliability of the model question and answer system.

[0063] The question and answer processing method, system, electronic device and medium based on three-dimensional entropy evaluation provided by the embodiment of the present application are specifically explained by the following embodiments. First, the question and answer processing method based on three-dimensional entropy evaluation in the embodiment of the present application is described.

[0064] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system of using digital computers or machine controlled by digital computers to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain the best results.

[0065] The basic technology of artificial intelligence generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The software technology of artificial intelligence mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0066] The three-dimensional entropy evaluation-based question and answer processing method provided by the embodiments of the present application relates to the field of artificial intelligence. The three-dimensional entropy evaluation-based question and answer processing method provided by the embodiments of the present application can be applied in a terminal, can also be applied in a server end, and can also be software running in a terminal or a server end. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server end can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, can also be configured as a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform; and the software can be an application implementing the three-dimensional entropy evaluation-based question and answer processing method, etc., but is not limited to the above forms.

[0067] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0068] It should be noted that in various specific embodiments of the present application, when relevant processing needs to be performed on data related to the identity or characteristics of the user, such as user information, user behavior data, user history data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or a jump to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for the normal operation of the embodiments of the present application will be obtained.

[0069] To this end, with reference to Figure 1 The embodiments of the present application provide a three-dimensional entropy evaluation-based question and answer processing method, which is applied to a central controller. The controller can be a server, an electronic device, a mobile terminal, or the like, which is not specifically limited here. The method includes the following steps S110 to S150.

[0070] Step S110, constructing a set of to-be-processed questions and answers according to a target question, a target answer, and historical context. The target answer is generated by a large language model according to the target question. The historical context is context content associated with the target question.

[0071] Step S120, constructing a corresponding semantic graph based on the set of to-be-processed questions and answers. Each node in the semantic graph is obtained based on target entities in the set of to-be-processed questions and answers. Each edge in the semantic graph is obtained based on target attributes and target association relationships in the set of to-be-processed questions and answers. The target association relationship represents a logical relationship between the target entities in the set of to-be-processed questions and answers.

[0072] Step S130, extracting a plurality of to-be-verified combinations from the set of to-be-processed questions and answers. Each to-be-verified combination is composed of a target entity in the set of to-be-processed questions and answers, a target attribute in the set of to-be-processed questions and answers, and a target attribute value in the set of to-be-processed questions and answers.

[0073] Step S140, respectively calculating semantic entropy, available entropy, and sample entropy of the target answer based on the semantic graph and each to-be-verified combination. The semantic entropy is used to quantify the logical consistency of the target answer. The available entropy is used to quantify the prediction stability when the large language model generates the target answer according to the target question. The sample entropy is used to quantify the matching degree between the target answer and a real sample library of the corresponding field of the target question.

[0074] Step S150, generating a three-dimensional entropy result of the target answer according to the semantic entropy, the available entropy, and the sample entropy, so as to execute a question and answer processing scheme corresponding to the three-dimensional entropy result.

[0075] In this step, first, a to-be-processed question and answer set is constructed according to the target question, the target answer and the historical context. The target answer is generated by the large language model according to the target question, the historical context is the context content associated with the target question, and the to-be-processed question and answer set refers to a data set formed by integrating the target question, the target answer and the historical context. Specifically, the natural language processing technology can be used to extract question entities, answer elements and context association information to provide a structured data basis for subsequent semantic graph construction and entropy calculation.

[0076] Further, a corresponding semantic graph is constructed based on the to-be-processed question and answer set. Each node in the semantic graph is obtained based on the target entity in the to-be-processed question and answer set, each edge is obtained based on the target attribute and the target association relationship in the to-be-processed question and answer set, and each target association relationship represents a logical relationship between the target entities in the to-be-processed question and answer set.

[0077] Specifically, the semantic graph refers to a knowledge network that expresses semantic relationships through nodes and edges. Specifically, the named entity recognition technology can be used to extract target entities as nodes, and the dependency syntax analysis technology can be used to extract subject-predicate-object relationships as edges to achieve the semantic graph. Through the visual expression of the logical relationship between entities, a structured analysis framework is provided for semantic contradiction detection, and the defect that traditional text matching methods cannot capture deep logical contradictions is overcome.

[0078] Further, a plurality of to-be-verified combinations are extracted from the to-be-processed question and answer set. Each to-be-verified combination is composed of a triple structure containing entities, attributes and attribute values, which are composed of target entities, target attributes and target attribute values in the to-be-processed question and answer set. Specifically, regular expression matching or sequence labeling model can be used to extract from the question and answer text to achieve the to-be-verified combination. By decomposing the answer content into the smallest semantic unit that can be quantitatively verified, the subsequent entropy calculation is supported for fine-grained analysis, and the limitation of traditional methods that only evaluate the overall sentence credibility is broken through.

[0079] Further, based on the semantic graph and each to-be-verified combination, the semantic entropy, the available entropy and the sample entropy of the target answer are calculated respectively. The semantic entropy is used to quantify the logical consistency of the target answer, the available entropy is used to quantify the prediction stability of the large language model when generating the target answer according to the target question, and the sample entropy is used to quantify the matching degree of the target answer and the real sample library corresponding to the target question in the corresponding field.

[0080] Preferably, the semantic entropy represents a quantitative indicator of logical consistency of the reply content, which can be specifically realized by calculating the dispersion of the relationship rationality score between nodes in the semantic graph, for detecting semantic confusion caused by contradictory relationships between entities; the available entropy represents a quantitative indicator of stability of the model generation process, which can be specifically realized by calculating the variance of the probability distribution of the language model generated candidate content, for identifying abnormal output caused by model prediction fluctuations; the sample entropy represents a quantitative indicator of the matching degree of domain knowledge, which can be specifically realized by calculating the cosine similarity distribution between the reply feature vector and the real sample library, for detecting hallucination content deviating from the domain common sense.

[0081] Further, according to the semantic entropy, the available entropy and the sample entropy, a three-dimensional entropy result of the target reply is generated to execute a question and answer processing scheme corresponding to the three-dimensional entropy result. The three-dimensional entropy result refers to a comprehensive quantitative value of fusion of semantics, generation stability and domain matching degree, which can be specifically realized by using a dynamic weighting algorithm to adjust the entropy value weight according to the domain requirements, to improve the comprehensiveness of hallucination recognition through a multi-dimensional evaluation mechanism, and to break through the problem of high misjudgment rate existing in single indicator evaluation.

[0082] Therefore, this step integrates entity relationship resolution by constructing a semantic graph, enhances the recognition ability of deep semantic contradictions, and improves the detection accuracy of prediction abnormalities and knowledge deviations by combining a multi-dimensional entropy value calculation mechanism, realizes multi-dimensional evaluation of large language model generated replies, effectively identifies complex hallucination features such as semantic structure confusion, prediction stability loss and domain knowledge deviation, and further improves the reliability of model question and answer processing, reduces the risk of dangerous suggestion output, and lays a foundation for safety applications in various fields.

[0083] In some embodiments, in step S120, a corresponding semantic graph is constructed based on the set of questions and answers to be processed, including the following steps S210 to S240:

[0084] Step S210, extracting target entities, target attributes and target association relationships from the set of questions and answers to be processed; the target entities represent domain-specific objects in the set of questions and answers to be processed; the target attributes represent the characteristics of the target entities; the target association relationships include subject-predicate-object relationships, cause-effect relationships, time sequence relationships and attribute association relationships between the target entities;

[0085] Step S220, taking the target entities and the target attributes as nodes of the semantic graph;

[0086] Step S230, taking the target association relationships as edges of the semantic graph, and calculating the confidence of each edge in the semantic graph based on the annotation confidence of the target entities and the annotation confidence of the target attributes;

[0087] Step S240, integrating the nodes of the semantic graph, the edges of the semantic graph, and the confidence of each edge in the semantic graph, to obtain the semantic graph.

[0088] In the embodiment, first, the target entity, the target attribute, and the target association relationship are extracted from the set of question and answer to be processed, wherein the target entity represents a domain-specific object in the set of question and answer to be processed, the target attribute represents a feature of the target entity, and the target association relationship includes a subject-predicate-object relationship, a cause-effect relationship, a time sequence relationship, and an attribute association relationship between the target entities.

[0089] Specifically, the target entity is extracted from the set of question and answer to be processed and is defined as a domain-specific object, for example, a disease name or a drug name in a medical scenario; the target attribute is extracted from the set of question and answer to be processed and is defined as a feature of the target entity, for example, the dose of a drug or the symptoms of a disease; and the target association relationship includes a subject-predicate-object relationship, a cause-effect relationship, a time sequence relationship, and an attribute association relationship, for example, a cause-effect relationship between a disease and a symptom.

[0090] Further, the target entity and the target attribute are taken as the nodes of the semantic graph, the target association relationship is taken as the edge of the semantic graph, and the confidence of each edge in the semantic graph is calculated based on the annotation confidence of the target entity and the annotation confidence of the target attribute. The annotation confidence of the target entity and the annotation confidence of the target attribute are both obtained by pre-annotation and assignment in the extraction process.

[0091] Preferably, the confidence of the edge is calculated by weighting the annotation confidence of the target entity and the annotation confidence of the target attribute, for example, using the arithmetic mean or the geometric mean of the annotation confidence, and the integration process of the semantic graph includes topologically connecting the nodes and the edges according to the graph structure and storing the confidence of the edge as an attribute value.

[0092] Therefore, the embodiment can construct a structured semantic graph, effectively capture the entity, attribute, and relationship information in the set of question and answer, provide a basis for subsequent semantic analysis and entropy calculation, and help more accurately evaluate the semantic consistency and reliability of the answer. Meanwhile, by introducing the confidence calculation, the reliability of each element in the graph can be quantified, and the accuracy of the semantic analysis is further improved.

[0093] In some embodiments, the semantic entropy of the target answer in step S140 is calculated by the following steps, including steps S310 to S330:

[0094] Step S310, based on the confidence of each edge in the semantic graph, analyzing the target association relationship of each edge in the semantic graph according to a preset semantic analysis model to obtain a rationality score of each target association relationship;

[0095] Step S320, based on the rationality score of each target association relationship, the confusion degree of each node in the semantic graph and each edge in the semantic graph is counted; the confusion degree represents the semantic logical consistency degree between the target reply, the target question and the historical context;

[0096] Step S330, according to the confusion degree, the semantic entropy of the target reply is calculated; the semantic entropy represents the probability degree of the semantic contradiction of the target reply.

[0097] In this embodiment, first, based on the confidence of each edge in the semantic graph, the target association relationship of each edge in the semantic graph is analyzed according to the preset semantic analysis model, and the rationality score of each target association relationship is obtained. Among them, the rationality score quantifies the logical rationality of the target association relationship through the preset semantic analysis model, for example, whether the subject-predicate-object relationship meets the grammatical rules or whether the cause-effect relationship meets the domain common sense.

[0098] Further, based on the rationality score of each target association relationship, the confusion degree of each node in the semantic graph and each edge in the semantic graph is counted. Among them, the confusion degree represents the semantic logical consistency degree between the target reply, the target question and the historical context, which can be calculated by calculating the variance of the rationality score to count the logical conflict frequency of the node and the edge, so as to determine the confusion degree.

[0099] Further, according to the confusion degree, the semantic entropy of the target reply is calculated. Among them, the semantic entropy represents the probability degree of the semantic contradiction of the target reply, which can be calculated by normalizing the confusion degree and combining the confidence weighting, for example, mapping the confusion degree to a probability distribution, and then calculating the semantic entropy using the information entropy formula. The higher the entropy value, the greater the probability of semantic contradiction.

[0100] Therefore, this embodiment can quantitatively evaluate the quality of the target reply from the perspective of semantic logical consistency, effectively identify the possible semantic contradiction in the reply, and improve the reliability of the question and answer system. Moreover, by introducing the semantic graph and the preset semantic analysis model, in-depth analysis of the semantic relationship of the reply content is realized, which can more accurately capture the semantic level of the problem compared with the method of simply relying on keyword matching.

[0101] In some embodiments, the available entropy of the target reply in step S140 is calculated by the following steps, including the following steps S410 to S430:

[0102] Step S410, retrieve the candidate content probability distribution of each to-be-verified combination in the process of generating the target reply by the large language model; the candidate content probability distribution is the probability distribution of multiple alternative contents when the large language model generates the to-be-verified combination;

[0103] Step S420, count the dispersion of the candidate content probability distribution corresponding to each to-be-verified combination;

[0104] Step S430, based on the probability distribution dispersion of each to-be-verified combination, the available entropy of the target reply is calculated; the available entropy represents the probability degree of the existence of the predicted anomaly of the target reply.

[0105] In this embodiment, first, the candidate content probability distribution of each to-be-verified combination in the process of generating the target reply by the large language model is called. The candidate content probability distribution is obtained by calling the model inference log, which is the probability distribution of multiple alternative contents when the large language model generates the to-be-verified combination, and contains the top-k candidate words and their probability values corresponding to each to-be-verified combination in the generation process.

[0106] Further, the dispersion of the candidate content probability distribution corresponding to each to-be-verified combination is counted. Specifically, first, the target unit is filtered from the to-be-processed question and answer set. For example, the entity with non-empty NER in token_info (such as "aspirin" and "5mg" in the medical scene), the attribute value in entity attribute (such as "dose: 5mg" and "interest rate: 3.5%"), and the fact statement phrase (such as "hypertension needs low-salt diet") are preferentially extracted, and the virtual word (such as "of" and "oh") without fact verification value is excluded, to ensure that the unit is information that can be verified by external knowledge or rules.

[0107] Further, the top-k candidate token probability of the target unit is extracted. The LLM generation log (containing logits output when each token is generated) captured in the preprocessing stage is called, if the target unit is a single token (such as "5mg"), the top-k (k-5 by default in the document, which can be adjusted in the field) candidate token and its probability when the token is generated are directly extracted (such as the top-5 candidates of "5mg" are "5mg", "10mg", "5q", "3mg", and "2mq7", and the probabilities are 0.82, 0.1, 0.05, 0.02, and 0.01, respectively); if the target unit is a multi-token (such as "aspirin"), the intersection probability distribution of the top-k probability of each token is taken to ensure the prediction stability of the whole unit.

[0108] Further, the dispersion of a single target unit is calculated. Specifically, the variance is used to quantify the dispersion degree of the top-k probability distribution (the larger the variance, the higher the dispersion, and the more unstable the model prediction), and the top-k candidate token probability of a single target unit is denoted as ,..., , where is the target unit number, is the th target unit, The probability mean is calculated first, and the formula is as follows:

[0109] ;

[0110] wherein, is the probability mean of the i-th target unit, is the total number of target units, is the probability of the i-th candidate token generated by the i-th target unit, is the probability of the i-th candidate token generated by the i-th target unit, is the probability mean of the i-th target unit. Then the formula of the variance is as follows:

[0111] ;

[0112] wherein, is the variance of the i-th target unit, is the total number of target units, is the probability of the i-th candidate token generated by the i-th target unit, is the probability of the i-th candidate token generated by the i-th target unit, is the probability mean of the i-th target unit. Then the formula of the variance is as follows:

[0113] Further, the dispersion of multiple target units is aggregated. Specifically, the average value of the variance of all screened target units is calculated, and the formula is as follows:

[0114] ;

[0115] wherein, is the total number of screened target units, is the variance of the i-th target unit, is the total number of target units,

[0116] Further, the available entropy of the target reply is calculated based on the probability distribution dispersion of each to-be-verified combination. Specifically, the available entropy integrates the weighted average value of the dispersion of all to-be-verified combinations, and the weight is dynamically adjusted according to the node level of the to-be-verified combination in the semantic graph, so as to realize the characterization of the probability degree of the existence of the predicted abnormality of the target reply through the available entropy.

[0117] ​​​​Therefore, by analyzing the probability distribution of the candidate content, the embodiment can evaluate the determination degree of the model for different options, quantify the prediction stability of the large language model when generating the target reply, reflect the reliability of the target reply through available entropy, and provide an important basis for identifying and processing the hallucination problem in the model question and answer.

[0118] In some embodiments, the sample entropy of the target reply in step S140 is calculated by the following steps S510 to S550:

[0119] Step S510, calling a domain real sample library corresponding to the target question;

[0120] Step S520, calculating the feature distance between the target reply and all samples in the domain real sample library;

[0121] Step S530, extracting reference samples from the samples according to the feature distances; the reference samples are samples in the samples that meet the preset sample condition; the preset sample condition includes that the feature distance is less than a preset feature distance threshold;

[0122] Step S540, calculating the feature distance probability distribution between the target reply and each reference sample;

[0123] Step S550, calculating the sample entropy of the target reply based on the feature distance probability distribution; the sample entropy represents the matching degree of the target reply and the domain real sample library corresponding to the target question.

[0124] In the embodiment, the domain real sample library corresponding to the target question is called. For example, for a medical question and answer system, a medical database containing a large number of real case records is called as a real sample library. Then, the feature distance between the target reply and all samples in the domain real sample library is calculated. Preferably, the cosine similarity algorithm is used to measure the directional difference between the target reply and each sample in the vector space.

[0125] Further, reference samples are extracted from the samples according to the feature distances. The reference samples are samples in the samples that meet the preset sample condition, and the preset sample condition includes that the feature distance is less than a preset feature distance threshold. For example, the feature distance threshold is set to 0.8, and the samples with a feature distance less than 0.8 from the target reply are extracted as reference samples.

[0126] Further, the feature distance probability distribution between the target reply and each reference sample is calculated. The kernel density estimation method is used to construct a continuous probability density function, and specifically, the feature distance can be divided into multiple intervals, the number of reference samples falling into each interval is counted, and the probability distribution is obtained.

[0127] Further, based on the feature distance probability distribution, the sample entropy of the target reply is calculated. Preferably, the sample entropy calculation adopts the Shannon entropy formula to perform integral operation on the probability density function, so as to realize the matching degree between the target reply and the real sample library of the corresponding field of the target question through the sample entropy.

[0128] Therefore, the embodiment can timely find abnormal replies that do not conform to the field knowledge, improve the accuracy and reliability of the question and answer system, effectively quantify the matching degree between the target reply and the real sample, and provide an important basis for evaluating the reliability of the reply generated by the large language model. Moreover, by introducing the real sample library as a reference benchmark, the characteristics of different fields can be adapted to, and the pertinence and effectiveness of hallucination recognition can be improved.

[0129] In some embodiments, in step S150, a three-dimensional entropy result of the target reply is generated according to the semantic entropy, the available entropy, and the sample entropy, so as to execute a question and answer processing scheme corresponding to the three-dimensional entropy result, including the following steps S610 to S650:

[0130] Step S610, the semantic entropy, the available entropy, and the sample entropy are weighted and fused to obtain the three-dimensional entropy result of the target reply; wherein the weights of the semantic entropy, the available entropy, and the sample entropy in the weighted fusion process are respectively determined according to the demand distribution of the corresponding field of the target reply;

[0131] Step S620, the hallucination threshold of the corresponding field of the question and answer set to be processed is called;

[0132] Step S630, the three-dimensional entropy result of the target reply is compared with the hallucination threshold of the corresponding field of the question and answer set to be processed to obtain a comparison result;

[0133] Step S640, a corresponding question and answer processing scheme is executed according to the comparison result;

[0134] Step S650, if the three-dimensional entropy result of the target reply is lower than the hallucination threshold of the corresponding field of the question and answer set to be processed, the target reply is output; if the three-dimensional entropy result of the target reply is higher than or equal to the hallucination threshold of the corresponding field of the question and answer set to be processed, the semantic entropy of the target reply, the available entropy of the target reply, and the sample entropy of the target reply are analyzed to determine the hallucination type of the target reply; according to the hallucination type of the target reply, a question and answer abnormality prompt is generated and the output of the target reply is prevented.

[0135] In the embodiment, the semantic entropy, the available entropy, and the sample entropy are first weighted and fused to obtain the three-dimensional entropy result of the target reply. In the weighted fusion process, the weights of the semantic entropy, the available entropy, and the sample entropy are respectively determined according to the demand distribution of the corresponding field of the target reply. For example, a higher sample entropy weight can be allocated in the medical field to strengthen the real sample matching degree, and a higher semantic entropy weight can be allocated in the education field to strengthen the logical consistency.

[0136] Further, the illusion threshold corresponding to the field of the question-answer set to be processed is called. Wherein, the dynamic parameter table in the field knowledge base needs to be associated when calling the illusion threshold, and the parameter table automatically adjusts the threshold reference value according to the field data update frequency. Further, the three-dimensional entropy result of the target reply is compared with the illusion threshold corresponding to the field of the question-answer set to be processed to obtain a comparison result. Wherein, the comparison result triggers a differentiated processing branch, when the three-dimensional entropy result exceeds the threshold value, the main abnormal source is located by entropy value component analysis, for example, semantic entropy anomaly corresponds to logical contradiction type illusion, available entropy anomaly corresponds to model prediction fluctuation type illusion, sample entropy anomaly corresponds to data deviation type illusion.

[0137] Specifically, if the three-dimensional entropy result of the target reply is lower than the illusion threshold corresponding to the field of the question-answer set to be processed, the target reply is output. For example, if the three-dimensional entropy result is 0.6, which is lower than the medical field illusion threshold 0.7, the target reply is directly output. If the three-dimensional entropy result of the target reply is higher than or equal to the illusion threshold corresponding to the field of the question-answer set to be processed, the semantic entropy of the target reply, the available entropy of the target reply and the sample entropy of the target reply are analyzed to determine the illusion type of the target reply. According to the illusion type of the target reply, a question-answer abnormal prompt is generated and the output of the target reply is prevented. For example, if the three-dimensional entropy result is 0.8, which is higher than the medical field illusion threshold 0.7, the entropy values of each dimension are further analyzed. If the semantic entropy is 0.9, the available entropy is 0.7, and the sample entropy is 0.8, it is determined that the illusion is of the semantic contradiction type, an abnormal prompt of "the reply has semantic contradiction, please use carefully" is generated, and the output of the target reply is prevented.

[0138] Therefore, by setting the field illusion threshold, the embodiment can effectively identify and filter illusion replies in different fields, can flexibly adjust the weight of each dimension entropy according to the characteristics of different fields, and realize accurate evaluation of the target reply. Moreover, for the reply with illusion, the illusion type is further analyzed, and the targeted abnormal prompt is generated, which helps users to understand the potential risk, and thus significantly improves the reliability and safety of the question-answer system, especially suitable for fields with high accuracy requirements.

[0139] In some embodiments, after generating the three-dimensional entropy result of the target reply according to the semantic entropy, the available entropy and the sample entropy in step S150, and executing the question-answer processing scheme corresponding to the three-dimensional entropy result, the following steps S710 to S740 are included:

[0140] Step S710, in response to the error information of the user abnormal feedback, the illusion type of the error information is obtained;

[0141] In step S720, in a case where the illusion type of the error information is based on semantic entropy anomaly, a semantic error between the semantic entropy of the target reply and a semantic entropy threshold value of a field corresponding to the target reply is calculated to adjust the calculation step of the semantic entropy according to the semantic error. The adjustment of the calculation step of the semantic entropy includes adjustment of a judgment threshold value of a rationality score output by a preset semantic analysis model in the semantic entropy.

[0142] In step S730, in a case where the illusion type of the error information is based on available entropy anomaly, a prediction error between the available entropy of the target reply and an available entropy threshold value of a field corresponding to the target reply is calculated to adjust the calculation step of the available entropy according to the prediction error. The adjustment of the calculation step of the available entropy includes adjustment of a statistical standard of dispersion in the available entropy.

[0143] In step S740, in a case where the illusion type of the error information is based on sample entropy anomaly, a real error between the sample entropy of the target reply and a sample entropy threshold value of a field corresponding to the target reply is calculated to adjust the calculation step of the sample entropy according to the real error. The adjustment of the calculation step of the sample entropy includes updating of a real sample library of the field in the sample entropy.

[0144] In the embodiment, first, in response to error information of user abnormal feedback, an illusion type of the error information is acquired. Specifically, in a case where the illusion type of the error information is based on semantic entropy anomaly, a semantic error between the semantic entropy of the target reply and a semantic entropy threshold value of a field corresponding to the target reply is calculated to adjust the calculation step of the semantic entropy according to the semantic error. The semantic error is determined by comparing a difference between the semantic entropy and the semantic entropy threshold value, and the adjustment of the semantic entropy calculation step includes dynamic correction of a judgment threshold value of a rationality score in a preset semantic analysis model.

[0145] Further, in a case where the illusion type of the error information is based on available entropy anomaly, a prediction error between the available entropy of the target reply and an available entropy threshold value of a field corresponding to the target reply is calculated to adjust the calculation step of the available entropy according to the prediction error. The prediction error is calculated by a deviation amount of the available entropy from the available entropy threshold value, and the adjustment of the available entropy calculation step includes optimization of a dispersion statistical standard of a candidate content probability distribution.

[0146] Further, in a case where the illusion type of the error information is based on sample entropy anomaly, a real error between the sample entropy of the target reply and a sample entropy threshold value of a field corresponding to the target reply is calculated to adjust the calculation step of the sample entropy according to the real error. The real error is obtained by a difference between the sample entropy and the sample entropy threshold value, and the adjustment of the sample entropy calculation step includes incremental updating of a real sample library of the field, for example, adding recent clinical case data in a medical field.

[0147] Thus, the embodiment can more accurately identify and process various hallucination problems by respectively adjusting the calculation steps of semantic entropy, available entropy and sample entropy for different types of hallucination abnormalities, can dynamically adjust the parameters of the three-dimensional entropy evaluation model according to the user feedback error information, and improve the accuracy and adaptability of the model question and answer processing. Moreover, by updating the field real sample library, the parameter changes in each field can be adapted in time, the application value of the model in different fields is improved, and thus the overall reliability of the model question and answer processing is improved, and the safety risk that may be caused in the key field is reduced.

[0148] In some embodiments, the problem processing of a large language model (LLM) is implemented by constructing a three-dimensional entropy evaluation model. Specifically, first, the initial question received by the large language model and the preliminary answer generated by the large model according to the initial question are preprocessed to prepare for subsequent hallucination recognition. The core goal of preprocessing is to convert the original, unstructured initial question and the preliminary answer generated by the large language model into clean, ordered, and rich semantic information intermediate data, providing accurate input for subsequent semantic entropy calculation, available entropy calculation, and sample entropy calculation. For example, first, text cleaning is performed to eliminate noise and unify the format. Second, the text is disassembled and the key information is extracted. Third, the standardized intermediate data is output.

[0149] Further, based on the preprocessed data, a "semantic entropy + available entropy + sample entropy" three-dimensional entropy evaluation model is used to finally determine whether the result output by the large model is reliable. Specifically, by quantifying the semantic logic consistency through "semantic entropy", quantifying the model prediction confidence through "available entropy", and quantifying the real scene adaptability through "sample entropy", efficient identification of factual errors, logical contradictions, and irrelevant content in the large language model is achieved.

[0150] Specifically, first, three-dimensional entropy calculation is performed, and the three entropy values are independent of each other and can be calculated in parallel. Since the three are dependent on different fields of structured data (semantic entropy uses entity_attribute and logical conjunction, available entropy uses the verifiable unit probability of token_info, and sample entropy uses scene and the sample library), there is no calculation dependency, and the definition and calculation method of each dimension are as follows:

[0151] For semantic entropy, a semantic dependency graph (such as subject-predicate-object relationship, cause-effect relationship, and time sequence relationship) is constructed to calculate the degree of confusion of nodes (entities / concepts) and edges (relationships) in the graph. The semantic entropy is used to quantify the semantic logic consistency between the content generated by the LLM and the input question and context.

[0152] Specifically, the semantic entropy calculation extracts the "entity-attribute-relation" triplets (such as "nifedipine tablets-dose-5mg") from the entity_attribute of structured data, extracts logical conjunctions (such as cause-effect, turning relation) from token_info, and constructs a semantic dependency graph; the rationality score of each semantic relation is calculated by the pre-trained model BERT-REL , and the formula is obtained. The semantic entropy (the higher the value, the more chaotic the logic) is as follows:

[0153] ;

[0154] Wherein, is the rationality score of the semantic relation (calculated by the pre-trained semantic model such as BERT-REL), is the probability distribution of the rationality score. The higher the semantic entropy, the more chaotic the semantic logic, and the higher the probability of logical contradiction or theme deviation. The semantic entropy is calculated each time, represents the i-th semantic relation to be evaluated in the current semantic dependency graph, and both depend on real-time generated data.

[0155] Specifically, the semantic dependency graph needs to be reconstructed before each calculation of semantic entropy, rather than constructing a general graph once. Because semantic entropy needs to quantify the semantic logic consistency of "current LLM output and corresponding input problem, context", and the content of each LLM output (such as different disease descriptions in the medical scene, different product parameters in the e-commerce scene), the theme of the input question, and the context association relationship are all different, a general graph cannot meet the personalized semantic logic verification needs of single calculation, and needs to be dynamically constructed based on the preprocessed exclusive structured data. Among them, the specific construction method of the semantic dependency graph is as follows:

[0156] 1. Node definition and extraction: "entity / concept" as the graph node, which is extracted from the standardized intermediate data. For example, "core entities" (such as diseases, drugs, and products) and "attribute concepts" (such as dose, volume) are obtained from the entity_attribute field, and high semantic value words (such as nouns, professional terms) are extracted from the token_info field, for example, "hypertension (disease entity)", "nifedipine tablets (drug entity)", and "5mg (dose concept)" are extracted as nodes in the medical scene.

[0157] ​2、Edge (relationship) definition and extraction: Take "semantic association" as the graph edge, covering three types of relationships. For example, extract the "subject-predicate-object relationship" (such as "patient-take-nifedipine tablets") from the part-of-speech tagging and dependency syntax analysis of token_info; extract the "cause-effect / chronological relationship" (such as "high blood pressure-so-take antihypertensive drugs") from the logic_conjunction field; extract the "attribute association relationship" (such as "nifedipine tablets-dose-5mg") from the entity_attribute field.

[0158] 3、Graph structure integration: Adopt a "node-edge-attribute" ternary structure organization, and label each edge with "relationship type" (such as subject-predicate, cause-effect, attribute) and "initial reasonableness score".

[0159] Specifically, core entity / concept data is extracted directly from the entity_attribute (entity-attribute-relation list) and token_info (entity with Named Entity Recognition (NER) annotation and confidence) fields of structured data, such as filtering NER non-empty entries (such as "hypertension (disease entity, confidence 0.97)") from token_info. Semantic relationship data is extracted from the logic_conjunction (logical conjunction position and type), dependency syntax annotation of token_info (implicit subject-predicate-object relationship), and entity_attribute "relation" field (such as "treatment" "have"), such as obtaining "so (causal conjunction)" from logic_conjunction, and forming "causal relationship edge" by associating the entities before and after the sentence. Initial reasonableness score data is assigned to the initial reasonableness score of the graph edge by entity annotation confidence and preliminary scoring of semantic association model, as the basis for subsequent semantic entropy calculation .

[0160] For available entropy, first extract the verifiable units (such as entities, numerical values, and factual statements) in structured data, and then calculate the top-k probability distribution dispersion generated by these units. Available entropy is used to quantify the "effective confidence" of the prediction probability distribution in the LLM generation process, which is different from the traditional single token probability, focusing on the prediction stability of "verifiable information".

[0161] Specifically, the available entropy is calculated by filtering the verifiable units (such as the entity "Nifedipine tablets" and the numerical value "5mg") from the token_info of the structured data, extracting the top-k candidate token probability generated at each unit (the LLM generation probability associated with the preprocessing stage), and substituting the variance of each unit candidate probability into the formula to obtain the available entropy (the higher the value, the more unstable the model's prediction of the fact), which is calculated as follows:

[0162] ;

[0163] wherein, is the probability of the i-th candidate token (standardized intermediate data) generated at the i-th verifiable unit, is the variance. The higher the available entropy, the more unstable the model's prediction of the verifiable information, and the higher the probability of factual errors. That is, the available entropy is a core indicator that quantifies the stability of the LLM's prediction of "verifiable information". The higher the value, the more unstable the prediction (the higher the hallucination risk); in the formula, the "N" in "N" refers to the total number of verifiable units, which is calculated based on the extracted entities, numerical values, and factual statements, and is not pre-set but dynamically changes with each LLM output content. For sample entropy, a domain-specific real sample library is constructed (such as disease diagnosis cases in the medical field and compliance documents in the financial field), and the feature distance distribution entropy of similar texts in the sample library is calculated. Among them, sample entropy is used to quantify the matching degree of LLM generated content and real scene sample library, to solve the hallucination problem of "model confidence but disconnected from reality". Specifically, the sample entropy calculation is based on the scene identifier (such as "medical") of the structured data, which calls the corresponding domain real sample library, and then calculates the feature distance between the generated text and the Top-5 similar samples in the library through Sentence-BERT, and calculates the probability distribution of the distance, and substitutes it into the formula to obtain the sample entropy (the higher the value, the greater the deviation from the real scene), which is calculated as follows:

[0164] ;

[0165] wherein,

[0166] is the feature distance between the generated text and the i-th similar sample (calculated by Sentence-BERT), is the probability distribution of the feature distance. The higher the sample entropy, the greater the deviation of the generated content from the real scene, and the higher the probability of fabricated information.

[0167] ​​​​​Sample entropy is a core metric for quantifying the matching degree between LLM-generated content and a real-world sample library. A higher value indicates a more dispersed distribution of feature distances between the generated text and similar texts in the sample library, resulting in a lower matching degree and a higher risk of the illusion that the model is "confident but out of touch with reality." Conversely, a lower value indicates a higher matching degree and stronger content credibility. The term refers to the "Top-m similarity number" used in feature distance calculation, which is the number of samples with the highest semantic similarity to the generated text selected from a domain-specific real-world sample library. One sample (document default) =5, which can be adjusted according to the needs of different fields. For example, in the medical field, it can be set to ensure accuracy. =8). The parameters need to be dynamically determined in conjunction with the size of the sample library to ensure that enough reference samples are covered and to avoid the influence of single sample bias on the calculation results. These parameters are the basis for constructing the feature distance distribution.

[0168] In this context, "similar samples" refers to the real data within the "domain-specific real sample library" mentioned earlier in the sample entropy calculation logic. Specifically, it refers to the samples selected from this library that have the highest semantic relevance to the currently generated LLM text. This sample library is a dedicated real dataset pre-built for scenarios such as education, healthcare, and finance. For example, it includes disease diagnosis cases and drug instructions in the healthcare scenario, and compliance documents and product descriptions in the financial scenario. All of these have undergone authoritative verification (e.g., medical samples conform to clinical guidelines, and financial samples come from regulatory agencies). During the calculation, the LLM-generated text and all samples in the sample library are first converted into semantic feature vectors using the Sentence-BERT model. Then, the samples are sorted by indicators such as cosine similarity to select the top-m samples (m=5 by default for documents, but can be adjusted). These highly relevant real samples selected are the "similar samples." That is, generating text and the first one of them indivual( Values ​​range from 1 to The feature distance of the sample.

[0169] Furthermore, the entropy value fusion decision is made by first standardizing the entropy values ​​and assigning weights. Specifically, since the three-dimensional entropy values ​​are calculated in different dimensions (semantic entropy is based on logical association, usable entropy is based on probability concentration, and sample entropy is based on scene matching degree), the three must first be standardized to the [0,1] interval to eliminate the difference in dimensions.

[0170] For example, using min-max normalization, the formula is as follows:

[0171] ;

[0172] in, To standardize the processing results, This corresponds to the maximum value of the entropy in the historical data. This corresponds to the minimum entropy value in historical data.

[0173] Furthermore, differentiated weights are assigned to the three-dimensional entropy values ​​based on the needs of different application scenarios. For example, in the medical scenario, "sample entropy" (the degree of matching with real medical knowledge) has the highest weight (0.4) because errors in medical facts can endanger lives; in the e-commerce scenario, "semantic entropy" (the logical coherence of customer service scripts) has a slightly higher weight (0.35) to avoid affecting the user experience due to logical confusion; in the education scenario, "usable entropy" (the model's confidence in knowledge points) has an increased weight (0.35) to help identify "seemingly correct but actually incorrect" knowledge point outputs from the model.

[0174] Furthermore, the fusion decision formula and threshold determination are determined. Specifically, the "comprehensive reliability score" output by the large model is calculated by weighted summation, and its formula is as follows:

[0175] ;

[0176] in, To calculate the overall reliability score, The weights of semantic entropy, The weights are the available entropy. The weights are the sample entropy, and , This is the standardized semantic entropy. This represents the standardized usable entropy. The standardized sample entropy indicates that the higher the overall reliability score, the stronger the reliability and the lower the probability of hallucination.

[0177] Furthermore, based on historical labeled data (text already labeled "hallucination / non-hallucination"), ROC curve analysis is used to set "hallucination judgment thresholds" for different scenarios. For example, in the medical scenario, a score < 0.6 indicates the presence of hallucination; in the e-commerce scenario, a score < 0.5 indicates the presence of hallucination. Simultaneously, the "abnormal fluctuations" of single-dimensional entropy values ​​are used to assist in the judgment: if the overall score of a text segment does not reach the threshold, and the entropy value of a certain dimension suddenly increases (e.g., semantic entropy increases by 2 times compared to the previous segment), the type of hallucination (e.g., logical contradiction) can be accurately located.

[0178] Furthermore, the real sample database needs to be updated and maintained regularly. This real sample database is the core support for calculating "sample entropy," and its sample quality (authenticity, domain suitability, and timeliness) directly determines the accuracy of sample entropy in identifying "factual errors / irrelevant content illusions." The specific update steps are as follows:

[0179] (1) According to the data source list planned in the early stage, adopt the combination of "automated collection + manual collection + API docking" to obtain the original data. Specifically, through "file MD5 value comparison" or "update timestamp", only collect the newly added / modified content (such as after the update of e-commerce product parameters, only replace the old parameter samples, do not re-enter the database).

[0180] (2) The original data often has problems such as "format confusion, redundant information, and incorrect expression" (such as the header and footer in the PDF guide, and the emoticon in the UGC evaluation), which need to be cleaned through "format standardization → redundancy filtering → error correction" to output "clean original text".

[0181] (3) Verification is the core link of "storing true samples from false", which needs to be combined with "cross-verification + domain rule verification + manual sampling review" to ensure that the sample meets the scene authenticity standard.

[0182] (4) Store the structured sample unit into the sample management library, and build "multi-dimensional index" to ensure that the sample entropy calculation can be quickly matched (such as input "nitrendipine tablets 5mg", retrieve the corresponding drug sample within 100ms). And you can set the update cycle according to the scene.

[0183] Further, according to the user's feedback (misjudgment cases, etc.), the parameters of the three-dimensional entropy calculation and entropy value fusion part are dynamically iterated and maintained. User feedback (especially misjudgment cases) is the core basis for exposing the "parameter deviation" and "insufficient scene adaptation" of the three-dimensional entropy model. For example, in the medical scene, the misjudgment of "LLM outputing the wrong drug dose without being identified" may be caused by the imbalance of the similarity weight of sample entropy; in the e-commerce scene, "logical contradiction is judged as normal", which may be caused by the too narrow time sequence correlation window of semantic entropy.

[0184] Specifically, first, locate the root cause of the misjudgment case through "case reproduction → dimension disassembly → cross-verification", accurately locate whether the misjudgment is caused by "parameter deviation of three-dimensional entropy calculation module" or "weight imbalance of fusion module", and avoid blind parameter adjustment. The steps are as follows:

[0185] I. Case reproduction and data backtracking. First, reproduce the misjudgment scene, backtrack the key intermediate data in the system calculation process, and check "which step deviates". Specifically, first extract the intermediate results in the semantic entropy, available entropy, and sample entropy calculation of the misjudgment case - for example, in the medical misjudgment case, backtrack the "similarity calculation log" of sample entropy, check whether the system matches the "aspirin dose" related sample, and what is the "cosine semantic similarity" and "BM25 keyword similarity" when matching (if only matching to the old sample of 3 years ago, and the dose is 3g, it may be that the timeliness weight is not effective).

[0186] Further, the "dimensional weight" at the time of checking the misjudgment case is calculated (such as the weight of the medical scene at that time: semantic entropy 0.25, available entropy 0.35, sample entropy 0.4), and it is judged whether the key error is not amplified due to the too low weight of a certain dimension (such as the sample entropy weight 0.4 is still insufficient to cover the dose error, which needs to be further improved).

[0187] Two, three-dimensional entropy dimension disassembly analysis. For each entropy dimension, verify "whether there is parameter deviation leading to misjudgment" one by one. For example, the core analysis logic and the case are as follows:

[0188] For semantic entropy, analyze whether the semantic association probability threshold is too low (such as normal association probability ≥ 0.8, actual set to 0.6 leading to logical contradiction not identified), whether the time sequence association window is too narrow (such as cross-wheel logical association only looking at 3 tokens, not covering long text logic), and whether the domain term association model is adaptive (such as the medical term "overdose" is not associated with "dose error"). It is found that the association probability of "aspirin-5g dose" in semantic entropy calculation is 0.75 (higher than the threshold 0.7 at that time), which is judged as "logical coherence" and no problem; the time sequence association window covers the complete sentence, and there is no cross-wheel omission - exclude semantic entropy parameter deviation.

[0189] For available entropy, analyze whether the probability concentration threshold is too high (such as concentration ≥ 0.6 is judged as confident, actual set to 0.5 leading to "false confidence" not identified), whether the sliding window size is too small (such as window = 3, not capturing the trend change of token probability), and whether the candidate probability, distribution entropy threshold is too low (such as distribution entropy ≥ 0.6 is marked as abnormal, actual set to 0.7 leading to uniform distribution not identified). It is found that the probability concentration of LLM generating "5g" is 0.82 (higher than the threshold 0.6), and the candidate probability distribution entropy is 0.35 (lower than the threshold 0.7), and the system judges as "model confident" - available entropy is normal, exclude available entropy parameter deviation.

[0190] For sample entropy, analyze whether the similarity calculation weight is imbalanced (such as overemphasizing semantic similarity and ignoring keyword / numerical matching), whether the sample timeliness weight is too low (such as old sample weight = 0.8, which does not significantly reduce the influence of old samples), and whether the sample library coverage is insufficient (such as no latest sample of "4g maximum dose" of aspirin). After analysis, it is found that when sample entropy matches, "cosine semantic similarity = 0.9 (high, due to semantic matching of "aspirin-dose"), BM25 keyword similarity = 0.3 (low, due to "5g" not matching the "4g" value in the sample library), but the BM25 weight is only 0.3, resulting in total similarity = 0.9x0.7+0.3x0.3=0.72 (higher than the threshold 0.6, judged as matching), and the matched sample is an old guideline in 2021 (timeliness weight = 0.9, not reducing the influence), without the 2023 updated "4g maximum dose" sample - the root cause is the "low BM25 weight" and "high sample timeliness weight" of sample entropy.

[0191] Three, cross-validation of fusion module weight. If there is no obvious deviation in three-dimensional entropy calculation, it is necessary to verify whether the abnormality of key dimensions is not amplified due to "imbalance of fusion weight":

[0192] 1. Weight sensitivity analysis: In the misjudgment case, fix the three-dimensional entropy value, adjust the weight of each dimension, and observe the change of the comprehensive score. For example, in a medical case, increase the sample entropy weight from 0.4 to 0.5, and recalculate the comprehensive score. The original score is: (0.25x0.32+0.35x0.28+0.4x0.35)=0.72 (normal); After adjustment, the score is: (0.25x0.32+0.35x0.28+0.5x0.35)=0.685 (still higher than the threshold 0.6, not solved); Further increase the sample entropy weight to 0.6, the score is: (0.25x0.32+0.35x0.28+0.6x0.35)=0.65 (close to the threshold); If the BM25 weight of sample entropy is also modified (from 0.3 to 0.5), the sample entropy value increases from 0.35 to 0.6, and the score is: (0.25x0.32+0.35x0.28+0.6x0.6)=0.52 (lower than the threshold 0.6, judged as hallucination), so the misjudgment can be solved by adjusting the sample entropy parameters and fine-tuning the weight.

[0193] 2. Cross-scene weight comparison: Compare the weight settings of the same type of case in other scenes (such as the sample entropy weight of "product parameter value error" in the e-commerce scene is 0.55), and judge whether the current scene weight is too low (the sample entropy weight of "dose value error" in the medical scene is 0.4, which is indeed too low).

[0194] Four, three-dimensional entropy calculation and fusion module parameter iteration. Based on the root cause positioning result, the parameter optimization is carried out in the "three-dimensional entropy calculation module" and the "fusion module". Specifically, for the three-dimensional entropy calculation module, the calculation parameters in the calculation process of the semantic entropy, the available entropy and the sample entropy are adjusted respectively, and for the fusion module, the scene basic weight is adjusted based on the "misjudgment frequency of each dimension" in the feedback semantic entropy weight, available entropy weight, = sample entropy weight), to ensure that the weight of the high misjudgment dimension is improved.

[0195] Further, for the semantic association probability threshold value in the semantic entropy calculation as the judgment "whether the semantic unit association is reasonable", when the threshold value is too low, the logical contradiction is not identified, or the threshold value is too high, the normal text is misjudged as a contradiction, the value is adjusted.

[0196] As Figure 2 shown, some embodiments of the present application provide a three-dimensional entropy evaluation-based question and answer processing system, which includes a first module 210, a second module 220, an extraction module 230, a calculation module 240, and an execution module 250. Specifically:

[0197] The first module 210 is configured to construct a set of questions and answers to be processed according to a target question, a target answer, and historical context; the target answer is generated by a large language model according to the target question; and the historical context is context content associated with the target question;

[0198] The second module 220 is configured to construct a corresponding semantic graph based on the set of questions and answers to be processed; each node in the semantic graph is obtained based on target entities in the set of questions and answers to be processed; each edge in the semantic graph is obtained based on target attributes and target association relationships in the set of questions and answers to be processed; and the target association relationship represents a logical relationship between the target entities in the set of questions and answers to be processed;

[0199] The extraction module 230 is configured to extract a plurality of verification combinations from the set of questions and answers to be processed; each verification combination is composed of target entities in the set of questions and answers to be processed, target attributes in the set of questions and answers to be processed, and target attribute values in the set of questions and answers to be processed;

[0200] The calculation module 240 is configured to calculate the semantic entropy, the available entropy, and the sample entropy of the target answer based on the semantic graph and each verification combination; the semantic entropy is used to quantify the logical consistency of the target answer, the available entropy is used to quantify the prediction stability of the large language model in generating the target answer according to the target question, and the sample entropy is used to quantify the matching degree of the target answer and the real sample library of the corresponding field of the target question;

[0201] The execution module 250 is configured to generate a three-dimensional entropy result of the target reply according to the semantic entropy, the available entropy and the sample entropy, so as to execute a question and answer processing scheme corresponding to the three-dimensional entropy result.

[0202] It should be noted that the question and answer processing system based on three-dimensional entropy evaluation provided in the embodiment and the question and answer processing method based on three-dimensional entropy evaluation described above are based on the same inventive concept, and therefore the related content of the question and answer processing method based on three-dimensional entropy evaluation described above is also applicable to the question and answer processing system based on three-dimensional entropy evaluation, and therefore, details are not described herein again.

[0203] To this end, the system constructs a set of to-be-processed questions and answers according to the target question, the target reply and historical context, constructs a corresponding semantic graph based on the set of to-be-processed questions and answers, extracts a plurality of to-be-verified combinations from the set of to-be-processed questions and answers, respectively calculates the semantic entropy, the available entropy and the sample entropy of the target reply based on the semantic graph and each to-be-verified combination, and generates a three-dimensional entropy result of the target reply according to the semantic entropy, the available entropy and the sample entropy, so as to execute a question and answer processing scheme corresponding to the three-dimensional entropy result. In this way, a three-dimensional evaluation system of constructing a semantic graph and calculating semantic entropy, available entropy and sample entropy can be realized, a dynamic threshold comparison and feedback adjustment mechanism can be combined, semantic contradiction, abnormality prediction and sample deviation problems can be comprehensively detected and processed, and therefore the reliability of a model question and answer system can be improved.

[0204] The embodiment of the present application also provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the question and answer processing method based on three-dimensional entropy evaluation described above when executing the computer program.

[0205] As Figure 3 , Figure 3 The hardware structure schematic diagram of the electronic device provided in the embodiment of the present application, the electronic device comprises:

[0206] at least one battery;

[0207] at least one memory;

[0208] at least one processor;

[0209] at least one program;

[0210] The program is stored in the memory, and the processor executes the at least one program to implement the question and answer processing method based on three-dimensional entropy evaluation described above.

[0211] The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a vehicle-mounted computer, etc.

[0212] The electronic device of the embodiment of the present application is described in detail below.

[0213] The processor 1600 can be implemented in a manner of a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute a related program to implement the technical solutions provided by the embodiments of the present disclosure.

[0214] The memory 1700 can be implemented in a form of a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1700 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present disclosure are implemented by software or firmware, the related program codes are stored in the memory 1700 and are called and executed by the processor 1600 to implement a three-dimensional entropy evaluation based question and answer processing method.

[0215] The input / output interface 1800 is configured to implement information input and output.

[0216] The communication interface 1900 is configured to implement communication interaction between the device and other devices. The communication can be implemented in a wired manner (for example, a USB, a network cable, etc.) or in a wireless manner (for example, a mobile network, WIFI, Bluetooth, etc.).

[0217] The bus 2000 is configured to transmit information between various components (for example, the processor 1600, the memory 1700, the input / output interface 1800, and the communication interface 1900) of the device.

[0218] The processor 1600, the memory 1700, the input / output interface 1800, and the communication interface 1900 are connected to each other in the device through the bus 2000.

[0219] The embodiments of the present disclosure further provide a storage medium, which is a computer readable storage medium and stores computer executable instructions for causing a computer to execute the above-mentioned three-dimensional entropy evaluation based question and answer processing method.

[0220] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include a high-speed random access memory and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory that is remotely disposed relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0221] The embodiments described in the embodiments of the present disclosure are used to more clearly illustrate the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art can know that, as technology evolves and new application scenarios appear, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.

[0222] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present disclosure, and can include more or fewer steps than the figures, or combine certain steps, or different steps.

[0223] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, they can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure.

[0224] Those skilled in the art can understand that all or some of the steps in the above disclosed method, the functional modules / units in the system and the device can be implemented as software, firmware, hardware and appropriate combinations thereof.

[0225] The terms "first", "second", "third", "fourth" and the like used in the specification of the present application and the above-described drawings, if any, are used to distinguish similar objects, and do not necessarily have to describe a particular order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0226] It should be understood that, in the application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" is used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, "A and / or B" can represent three cases of only A, only B and A and B existing at the same time, wherein A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b and c can be single or multiple.

[0227] In several embodiments provided in the application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0228] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on multiple network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiment.

[0229] In addition, the functional units in each embodiment of the application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0230] If the integrated unit is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for causing an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various program storage media.

[0231] The above is a specific description of the preferred implementation of the embodiments of the present application, but the embodiments of the present application are not limited to the above-mentioned implementation. Those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the embodiments of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the embodiments of the present application.

[0232] The embodiments of the present application have been described in detail above in combination with the drawings, but the present application is not limited to the above-mentioned embodiments. Those skilled in the art can make various changes within the scope of knowledge possessed by those skilled in the art without departing from the purpose of the present application.

Claims

1. A method for question answering based on three-dimensional entropy evaluation, characterized in that, The method comprises: According to the target problem, the target answer and the historical context, a set of questions and answers to be processed is constructed; the target answer is generated by a large language model according to the target problem; the historical context is the context content associated with the target problem; Based on the set of questions and answers to be processed, a corresponding semantic graph is constructed; each node in the semantic graph is obtained based on the target entity in the set of questions and answers to be processed, and each edge in the semantic graph is obtained based on the target attribute and the target association relationship in the set of questions and answers to be processed; the target association relationship represents the logical relationship between the target entities in the set of questions and answers to be processed; From the set of questions and answers to be processed, a plurality of verification combinations are extracted; wherein each verification combination is composed of a target entity in the set of questions and answers to be processed, a target attribute in the set of questions and answers to be processed, and a target attribute value in the set of questions and answers to be processed; Based on the semantic graph and each verification combination, the semantic entropy, the available entropy and the sample entropy of the target answer are calculated respectively; the semantic entropy is used to quantify the logical consistency of the target answer, the available entropy is used to quantify the prediction stability of the large language model when generating the target answer according to the target problem, and the sample entropy is used to quantify the matching degree of the target answer with the real sample library of the corresponding field of the target problem; According to the semantic entropy, the available entropy and the sample entropy, a three-dimensional entropy result of the target answer is generated to execute the corresponding question and answer processing scheme of the three-dimensional entropy result.

2. The three-dimensional entropy evaluation-based question answering processing method according to claim 1, characterized in that, The method comprises: From the set of questions and answers to be processed, the target entity, the target attribute and the target association relationship are extracted; the target entity represents a domain-specific object in the set of questions and answers to be processed; the target attribute represents the characteristics of the target entity; the target association relationship includes the subject-predicate-object relationship, the cause-effect relationship, the time sequence relationship and the attribute association relationship between the target entities; The target entity and the target attribute are taken as nodes of the semantic graph; The target association relationship is taken as an edge of the semantic graph, and the confidence of each edge in the semantic graph is calculated based on the annotation confidence of the target entity and the annotation confidence of the target attribute; The nodes of the semantic graph, the edges of the semantic graph and the confidence of each edge in the semantic graph are integrated to obtain the semantic graph.

3. The method of claim 2, wherein, The semantic entropy of the target answer is calculated by the following steps: Based on the confidence of each edge in the semantic graph, the target association relationship of each edge in the semantic graph is analyzed according to a preset semantic analysis model to obtain a rationality score of each target association relationship; Based on the rationality score of each target association relationship, the confusion degree of each node in the semantic graph and each edge in the semantic graph is calculated; the confusion degree represents the semantic logical consistency degree between the target answer and the target problem and the historical context; According to the confusion degree, the semantic entropy of the target answer is calculated; the semantic entropy represents the probability degree of semantic contradiction in the target answer.

4. The method of claim 1, wherein, The available entropy of the target reply is calculated by the following steps: retrieve candidate content probability distribution of each of the to-be-verified combinations in the process of generating the target reply by the large language model; the candidate content probability distribution is the probability distribution of multiple alternative contents when the large language model generates the to-be-verified combination; statistically analyze the dispersion of the candidate content probability distribution corresponding to each of the to-be-verified combinations; based on the probability distribution dispersion of each of the to-be-verified combinations, calculate the available entropy of the target reply; the available entropy represents the probability degree of the predicted abnormality of the target reply.

5. The method of claim 1, wherein, The sample entropy of the target reply is calculated by the following steps: retrieve the real sample library corresponding to the field of the target question; calculate the feature distance between the target reply and all samples in the real sample library of the field; extract reference samples from the samples according to each of the feature distances; the reference samples are the samples that meet the preset sample condition; the preset sample condition includes that the feature distance is less than a preset feature distance threshold; statistically analyze the feature distance probability distribution between the target reply and each of the reference samples; based on the feature distance probability distribution, the sample entropy of the target reply is calculated; the sample entropy represents the matching degree of the target reply with the real sample library corresponding to the field of the target question.

6. The method of claim 1, wherein, The three-dimensional entropy result of the target reply is generated according to the semantic entropy, the available entropy and the sample entropy, and the corresponding question and answer processing scheme is executed, including: weighting fusion of the semantic entropy, the available entropy and the sample entropy to obtain the three-dimensional entropy result of the target reply; wherein the weights of the semantic entropy, the available entropy and the sample entropy in the weighting fusion process are determined according to the demand distribution of the field corresponding to the target reply; retrieve the illusion threshold of the field corresponding to the to-be-processed question and answer set; compare the three-dimensional entropy result of the target reply with the illusion threshold of the field corresponding to the to-be-processed question and answer set to obtain a comparison result; execute the corresponding question and answer processing scheme according to the comparison result; if the three-dimensional entropy result of the target reply is lower than the illusion threshold of the field corresponding to the to-be-processed question and answer set, output the target reply; if the three-dimensional entropy result of the target reply is higher than or equal to the illusion threshold of the field corresponding to the to-be-processed question and answer set, analyze the semantic entropy of the target reply, the available entropy of the target reply and the sample entropy of the target reply to determine the illusion type of the target reply; generate a question and answer abnormality prompt according to the illusion type of the target reply and prevent the output of the target reply.

7. The method of claim 6, wherein, After the three-dimensional entropy result of the target reply is generated according to the semantic entropy, the available entropy and the sample entropy, and the corresponding question and answer processing scheme is executed, the method further includes: in response to the error information of the user abnormal feedback, obtain the illusion type of the error information; In the case of the illusion type of the error information being based on the semantic entropy anomaly, a semantic error between the semantic entropy of the target reply and a semantic entropy threshold of a field corresponding to the target reply is calculated to adjust the calculation of the semantic entropy according to the semantic error; the adjustment of the calculation of the semantic entropy includes adjustment of a judgment threshold of a preset semantic analysis model output rationality score in the semantic entropy; In the case of the illusion type of the error information being based on the available entropy anomaly, a prediction error between the available entropy of the target reply and an available entropy threshold of a field corresponding to the target reply is calculated to adjust the calculation of the available entropy according to the prediction error; the adjustment of the calculation of the available entropy includes adjustment of a statistical standard of dispersion in the available entropy; In the case of the illusion type of the error information being based on the sample entropy anomaly, a real error between the sample entropy of the target reply and a sample entropy threshold of a field corresponding to the target reply is calculated to adjust the calculation of the sample entropy according to the real error; the adjustment of the calculation of the sample entropy includes updating of a real sample library of a field in the sample entropy.

8. A question answering processing system based on three-dimensional entropy evaluation, characterized by, The system comprises: A first module configured to construct a set of to-be-processed questions and answers according to a target question, a target reply, and historical context; the target reply is generated by a large language model according to the target question; the historical context is context content associated with the target question; A second module configured to construct a corresponding semantic graph based on the set of to-be-processed questions and answers; each node in the semantic graph is obtained based on target entities in the set of to-be-processed questions and answers; each edge in the semantic graph is obtained based on target attributes and target association relationships in the set of to-be-processed questions and answers; the target association relationships represent logical relationships between the target entities in the set of to-be-processed questions and answers; An extraction module configured to extract a plurality of to-be-verified combinations from the set of to-be-processed questions and answers; each to-be-verified combination is composed of a target entity in the set of to-be-processed questions and answers, a target attribute in the set of to-be-processed questions and answers, and a target attribute value in the set of to-be-processed questions and answers; A calculation module configured to calculate a semantic entropy, an available entropy, and a sample entropy of the target reply based on the semantic graph and each to-be-verified combination; the semantic entropy is used to quantify the logical consistency of the target reply; the available entropy is used to quantify the prediction stability of the large language model when generating the target reply according to the target question; and the sample entropy is used to quantify the matching degree between the target reply and a real sample library of a field corresponding to the target question; An execution module configured to generate a three-dimensional entropy result of the target reply according to the semantic entropy, the available entropy, and the sample entropy, and execute a question and answer processing scheme corresponding to the three-dimensional entropy result.

9. An electronic device, comprising: comprising at least one control processor and a memory communicatively connected to the at least one control processor; the memory storing instructions executable by the at least one control processor, the instructions being executed by the at least one control processor to enable the at least one control processor to perform the three-dimensional entropy evaluation based question and answer processing method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions for causing a computer to perform the three-dimensional entropy evaluation based question and answer processing method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Three-dimensional back projection imaging method and device of array interference SAR (Synthetic Aperture Radar)

    CN119247361A

  • Online medical question and answer dynamic retrieval enhancement generation method

    CN120045662A