A method and system for hallucination recognition and iterative control based on knowledge version difference verification
By identifying the difference fields between the current version and previous versions in the generative model, the problem of difficulty in distinguishing the source of historical knowledge content in the generative model is solved, which realizes accurate correction of the generated response and continuous updating of effective knowledge, and improves the consistency and reliability of the generated results.
Patent Information
- Application Number
- CN202611337306.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-17
AI Technical Summary
When existing generative models combine dynamic knowledge bases to generate content, they have difficulty accurately identifying the sources of historical knowledge content. This makes it difficult to specifically correct knowledge retrieval and model parameters, increases system maintenance costs, and affects the consistency of generated results.
By using a knowledge version difference verification method, the difference fields between the current version and the previous version are identified and isolated, forming a current version verification branch, a previous version verification branch, and a null value comparison branch. Knowledge call records are used to distinguish between knowledge version retrieval mismatch and model parameter knowledge lag, and the corresponding indexes and parameters are updated accordingly.
It improves the consistency between the generated response and the current valid knowledge, reduces invalid retrieval adjustments and model updates, and enhances the reliability of the knowledge update process.
Smart Images

Figure CN123115164A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence information processing technology, and in particular relates to a method and system for hallucination recognition and iterative control based on knowledge version difference verification. Background Technology
[0002] With the application of generative models in scenarios such as intelligent question answering, knowledge retrieval, and content generation, in order to improve the consistency between generated content and professional knowledge, generative models are usually used in conjunction with external knowledge bases, which provide knowledge content relevant to the task request. For constantly changing knowledge such as regulations, technical specifications, product information, and business rules, the same knowledge content may be updated over time, and the effective content in the knowledge base also needs to be maintained in accordance with business changes.
[0003] Even after knowledge content has been updated, the generative model may still output historical knowledge content that has been updated or replaced. The reasons for this problem are complex; for example, the knowledge retrieval process may fail to acquire currently valid knowledge in a timely manner, and the generative model itself may be affected by the existing knowledge state. Current technologies typically focus on determining whether the generated content is consistent with the current knowledge and correct it through methods such as re-retrieval, regeneration, knowledge base updates, or model adjustments. However, they usually lack effective means to distinguish which specific stage in the generation process introduced the erroneous knowledge content.
[0004] Therefore, when generative models continuously output outdated knowledge content, existing technologies struggle to pinpoint the specific areas requiring adjustment. This often leads to issues such as repeated modifications to knowledge retrieval configurations failing to eliminate erroneous outputs, or model updates being performed without any necessary adjustments. This not only increases system maintenance and model update costs but may also cause subsequent generated results to continue to be affected by outdated knowledge. Accurately determining the specific sources of historical knowledge content in the generated response and processing it accordingly is a problem that needs to be addressed when combining generative models with dynamic knowledge bases. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for illusion recognition and iterative control based on knowledge version difference verification, in order to solve the problem that when existing generative models combine with dynamic knowledge bases to generate content, it is difficult to distinguish the source of historical knowledge content, which makes it difficult to make targeted corrections on the knowledge retrieval side and the generative model parameter side. This invention aims to achieve accurate identification and corresponding processing of the causes of historical knowledge output, and improve the consistency between the generated response and the current effective knowledge.
[0006] To achieve the above objectives, the present invention employs the following technical solution:
[0007] A method for hallucination identification and iterative control based on knowledge version difference verification includes the following steps:
[0008] Obtain the task request, task time, and versioned knowledge base; generate candidate responses through the generative model, record the actual input knowledge items and version identifiers to form a knowledge call record; decompose the candidate responses to obtain atomic declarations, declaration values, and fact keys, determine the current version and direct predecessor version of the fact key according to the task time, and obtain the fact value corresponding to the current version and the fact value corresponding to the predecessor version;
[0009] Generate a verification request for masked declaration values, align fields between the current version and previous versions, determine version-invariant fields and version-difference fields, and form a common verification basis with the verification request and version-invariant fields;
[0010] Using the same generation model parameters as when generating candidate responses, and keeping the verification state starting point and decoding conditions consistent, version difference fields are selected one by one to form the current version verification branch, the previous version verification branch, and the null value comparison branch. The three branches write the current version field value, the previous version field value, and the placeholder value to the target version difference field, respectively, while the other version difference fields keep the placeholder values, thus obtaining three independent verification values and forming a version difference response relationship.
[0011] Based on the declared value, three independent verification values, version difference response relationship, and knowledge call records, the knowledge version retrieval mismatch and model parameter knowledge lag are determined respectively, and the corresponding response content is corrected or blocked.
[0012] When knowledge version retrieval mismatch occurs, update the knowledge retrieval index or version reference relationship; when model parameter knowledge lags behind, update the generated model parameters; only update the corresponding object and keep the unupdated object unchanged for three-branch verification; if the judgment condition is no longer met and the updated response content passes the current version consistency check, retain the update and output it; otherwise, restore the state before the update; if neither of the two causes is determined, output the candidate response.
[0013] A further improvement of the present invention is that the knowledge entries in the versioned knowledge base include fact keys, fact values, version identifiers, effective time, expiration time, and direct predecessor version identifiers;
[0014] Extract the fact subject, fact relationship and limiting condition from the atomic statement and determine the corresponding fact key. Determine the current version of the knowledge item whose effective time is no later than the task time and whose expiration time is empty or later than the task time as the current version corresponding to the fact key. Determine the predecessor version directly replaced by the current version according to the direct predecessor version identifier of the current version. Determine the fact value of the corresponding fact key in the current version and the predecessor version as the fact value corresponding to the current version and the fact value corresponding to the predecessor version, respectively.
[0015] Record the knowledge entries and version identifiers of the actual input model, associate them with the corresponding atomic declarations according to the fact keys to form a knowledge call record, and compare the version identifiers in the knowledge call record with the version identifiers of the current version and the previous version to determine the knowledge version of the actual input model of the corresponding atomic declaration.
[0016] A further improvement of the present invention is that the verification request for generating the mask declaration value includes:
[0017] Based on the task request, task time, and atomic declaration, construct the verification request, retain the fact subject, fact relationship, and limiting conditions corresponding to the atomic declaration, mask the declaration value and the content that can directly determine the declaration value, and set a placeholder value with the same data type as the declaration value in the corresponding position of the declaration value;
[0018] Placeholder values are used to identify the position and data type of the declared value, and do not include the fact value corresponding to the current version or the fact value corresponding to the previous version.
[0019] A further improvement of the present invention is that the step of aligning the fields of the current version and the previous version to form a common verification basis includes:
[0020] Verify that the version identifier of the previous version is consistent with the direct predecessor version identifier of the current version;
[0021] Establish the field correspondence between the current version and the previous version according to the field identifier; when the field identifier cannot be directly matched, establish the field correspondence according to the field semantics; normalize the data format of the corresponding field values, and normalize the unit of measurement of field values containing units of measurement.
[0022] Fields with the same normalized values are defined as version-invariant fields, and fields with different normalized values are defined as version-difference fields.
[0023] The verification request for the version-invariant field is combined with the masked declaration value to form a common verification basis. The common verification basis does not include the declaration value and the version difference field.
[0024] A further improvement of the present invention is that the step of forming the current version verification branch, the previous version verification branch, and the null value comparison branch and obtaining three independent verification values includes:
[0025] The common validation basis is processed using the same generative model parameters as when candidate responses are generated, to obtain the common validation state;
[0026] From the common verification state, the current version verification branch, the previous version verification branch, and the null value comparison branch are formed. The three verification branches keep the generated model parameters, the starting point of the verification state, and the decoding conditions consistent.
[0027] Select the target version difference fields in sequence, and write only the current version field value, the previous version field value, and the placeholder value that does not carry the current version corresponding fact value and the previous version corresponding fact value in the corresponding field position of the three verification branches. Other version difference fields remain as placeholder values, and obtain the current independent verification value, the previous independent verification value, and the null independent verification value respectively.
[0028] After each target version difference field verification is completed, the common verification state is restored, and three verification branches are re-formed for the next target version difference field until the verification of each version difference field is completed.
[0029] A further improvement of the present invention is that the formation of the version difference response relationship includes:
[0030] Using the same normalized fact consistency calculation rule, the normalized fact consistency between the current independent verification value, the previous independent verification value, and the null independent verification value corresponding to the difference field of each target version and the corresponding fact value of the current version and the previous version is calculated respectively.
[0031] The version orientation preference corresponding to the value to be evaluated is determined according to the following formula:
[0032] ;
[0033] In the formula, Indicates the atomic declaration number; Indicates the value to be evaluated; Indicates the first Each atomic declaration corresponds to a version-oriented preference of the value to be evaluated; Indicates the value to be evaluated. With fact value The normalized factual consistency, with a value range of . ; and They represent the first Each atomic declaration corresponds to the current version's corresponding fact value and the previous version's corresponding fact value;
[0034] Based on the version orientation preference of the current independent validation value, previous independent validation value, and null independent validation value corresponding to each target version difference field, the version difference response vector is determined according to the following formula:
[0035] ;
[0036] In the formula, Indicates the sequence number of the target version difference field; , and They represent the first The atomic declaration targets the first... The target version difference field yields the current independent verification value, the previous independent verification value, and the null independent verification value. Indicates taking The larger of the two values is zero; Indicates the first Version switching response corresponding to each target version difference field; Indicates the first Null response for each target version difference field; Indicates the first Version difference response vectors corresponding to each target version difference field;
[0037] Associating each target version difference field with its corresponding version difference response vector forms the first... Version difference response relationship of each atomic declaration.
[0038] A further improvement of the present invention is that the determination of knowledge version retrieval mismatch and model parameter knowledge lag, and the correction or blocking of the corresponding response content, includes:
[0039] When the normalized fact consistency between the declared value and the corresponding fact value of the previous version is higher than the normalized fact consistency with the corresponding fact value of the current version, the knowledge call record indicates that the knowledge version of the model generated by the actual input of the corresponding atomic declaration is the previous version, and there is a target version difference field where the version switching response reaches the preset version switching response threshold, it is determined that the knowledge version retrieval is mismatched; there is a target version difference field where the null value response reaches the preset null value response threshold, it is determined that the model parameter knowledge is lagging.
[0040] When a knowledge version mismatch occurs, keep the generator model parameters unchanged and replace the knowledge entries of the previous version that are actually input into the generator model with the knowledge entries corresponding to the same fact keys in the current version. When the model parameters are outdated, keep the knowledge entries that are actually input into the generator model unchanged and set the fact values corresponding to the current version as generator constraints and the fact values corresponding to the previous version as suppression constraints. After completing the corresponding corrections, regenerate the response content.
[0041] If the normalized fact consistency between the regenerated declaration value and the corresponding fact value in the current version reaches the preset consistency threshold for the current version and is higher than the normalized fact consistency with the corresponding fact value in the previous version, the response content is determined to pass the current version consistency check; otherwise, the output of the corresponding atomic declaration is blocked.
[0042] A further improvement of the present invention is that, when the knowledge version retrieval mismatch occurs, the knowledge retrieval index or version reference relationship is updated; when the model parameter knowledge lags, the generated model parameters are updated, including:
[0043] When a knowledge version retrieval mismatch occurs, the current version is set as the valid retrieval target for the corresponding fact key, the index association of the previous version as the current retrieval target is removed, the version reference relationship of the corresponding fact key is updated from the previous version to the current version, and the version substitution relationship between the previous version and the current version is retained.
[0044] When the model parameters are outdated, the knowledge retrieval index and version reference relationship remain unchanged. The fact value corresponding to the current version is used as the correction target, and the fact value corresponding to the previous version is used as the suppression target. The regenerated response content that has passed the consistency check of the current version is combined to form paired correction data, and the generated model parameters are updated based on the paired correction data.
[0045] When both knowledge version retrieval mismatch and model parameter knowledge lag exist simultaneously, the knowledge retrieval index and version reference relationship are updated first. After the knowledge call record indicates that the knowledge version of the corresponding atomic declaration is the current version of the actual input generated model, the generated model parameters are updated while keeping the updated knowledge retrieval index and version reference relationship unchanged.
[0046] A further improvement of the present invention is that the step of updating only the corresponding object and keeping the unupdated objects unchanged during the three-branch verification includes:
[0047] After the knowledge retrieval index or version reference relationship is updated, the retrieval and generation are re-executed while keeping the generation model parameters unchanged, and the knowledge call records are updated; after the generation model parameters are updated, the candidate responses are re-generated while keeping the knowledge retrieval index and version reference relationship unchanged.
[0048] Keeping the current version, previous version, common verification basis and decoding conditions unchanged, re-execute the three-branch verification for the fact key and target version difference field that were determined to have corresponding causes before the update, redetermine the version difference response relationship and judge the corresponding judgment conditions.
[0049] If the corresponding judgment condition is no longer met and the regenerated response content passes the consistency check of the current version, the corresponding update is retained and the updated response content is output; otherwise, the corresponding knowledge retrieval index, version reference relationship or generated model parameters are restored to the state before the update, and the output of the corresponding atomic declaration is blocked.
[0050] When both knowledge version retrieval mismatch and model parameter knowledge lag occur simultaneously, the following steps are executed sequentially: knowledge retrieval index and version reference relationship update, retrieval-side verification, generation model parameter update, and parameter-side verification.
[0051] A hallucination recognition and iterative control system based on knowledge version difference verification, used to execute the hallucination recognition and iterative control method based on knowledge version difference verification as described above, includes:
[0052] The version fact determination module is used to obtain the task request, task time and versioned knowledge base, generate candidate responses through the generative model, record the actual input knowledge items and version identifiers to form a knowledge call record; decompose the candidate responses to obtain atomic declarations, declaration values and fact keys, determine the current version and the direct predecessor version of the fact key according to the task time, and obtain the fact value corresponding to the current version and the fact value corresponding to the predecessor version;
[0053] The verification base building module is used to generate verification requests for masked declaration values, align fields between the current version and previous versions, determine version-invariant fields and version-difference fields, and form a common verification base with the verification requests and version-invariant fields.
[0054] The three-branch verification module uses the same generation model parameters as when the candidate response is generated, keeps the verification state starting point and decoding conditions consistent, selects version difference fields one by one and forms the current version verification branch, the previous version verification branch and the null value comparison branch; the three branches write the current version field value, the previous version field value and the placeholder value to the target version difference field respectively, while the other version difference fields keep the placeholder values, and obtain three independent verification values to form a version difference response relationship.
[0055] The cause determination module is used to determine the knowledge version retrieval mismatch and model parameter knowledge lag based on the declared value, three independent verification values, version difference response relationship and knowledge call record, and to correct or block the corresponding response content.
[0056] The update verification module is used to update the knowledge retrieval index or version reference relationship when the knowledge version retrieval is mismatched, and to update the generated model parameters when the model parameter knowledge is lagging behind. It performs a three-branch verification by only updating the corresponding object and keeping the unupdated object unchanged. If the judgment condition is no longer met and the updated response content passes the current version consistency check, the update is retained and output; otherwise, the state before the update is restored. When neither of the two causes is determined, candidate responses are output.
[0057] The beneficial effects of this invention are as follows: By aligning fields between the current version and its direct predecessor, while maintaining consistency in the generated model parameters, verification state starting point, and decoding conditions, this invention forms a verification branch for the current version, a verification branch for the predecessor version, and a null value comparison branch for the version difference fields, and establishes a version difference response relationship based on the three independent verification values. This isolates the impact of knowledge version changes on the generated results and, combined with knowledge call records, distinguishes between knowledge version retrieval mismatch and model parameter knowledge lag, improving the targeting of historical knowledge output cause identification.
[0058] This invention updates the knowledge retrieval index, version reference relationships, or generation model parameters according to different causes of anomalies, and performs a three-branch verification while keeping the unupdated objects unchanged; if the verification passes, the update is retained; if it fails, the state before the update is restored. This reduces invalid retrieval adjustments or model parameter updates caused by unclear anomaly causes, improves the consistency between the generated response and current valid knowledge, and enhances the reliability of the continuous knowledge update process. Attached Figure Description
[0059] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 This is a schematic diagram of the structure of the present invention; Figure 3 This is a schematic diagram illustrating the principle of the three-branch version difference verification of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention are within the scope of protection of the present invention.
[0061] like Figure 1 As shown, this is an embodiment of the present invention, which provides a method for hallucination identification and iterative control based on knowledge version difference verification, including the following steps:
[0062] S1. Obtain the task request, task time, and versioned knowledge base; generate candidate responses through the generative model, record the actual input knowledge items and version identifiers to form a knowledge call record; decompose the candidate responses to obtain atomic declarations, declaration values, and fact keys, determine the current version and direct predecessor version of the fact key according to the task time, and obtain the fact value corresponding to the current version and the fact value corresponding to the predecessor version;
[0063] Task requests include questions to be answered, instructions to be processed, or matters to be queried; the task time is used to determine the valid time reference for the knowledge content corresponding to the task request. The task time can be carried by the task request or extracted from the task request. If the task request does not specify a corresponding time, the system time of receiving the task request will be determined as the task time. The task time remains unchanged during the same task processing.
[0064] The versioned knowledge base stores knowledge entries according to version change relationships. Each knowledge entry includes a fact key, a fact value, a version identifier, an effective date, an expiration date, and a direct predecessor version identifier. The fact key identifies and associates knowledge entries with the same factual semantics across different versions; the fact value represents the specific knowledge content under the corresponding version; the version identifier distinguishes different knowledge versions corresponding to the same fact key; the effective date and expiration date define the valid time range of the knowledge entry; and the direct predecessor version identifier indicates the previous knowledge version directly replaced by the current knowledge entry.
[0065] Based on the task request, relevant knowledge entries are obtained from the versioned knowledge base. Following preset retrieval and processing rules, the final knowledge entries to be input into the generation model are determined. Both the task request and the actual input knowledge entries are then provided to the generation model to obtain candidate responses. Actual input knowledge entries refer to the knowledge entries that ultimately enter the generation model and are used to generate candidate responses. Knowledge entries obtained during the retrieval phase but not actually provided to the generation model are not considered as actual input knowledge entries in this process.
[0066] This step does not pre-define the actual input knowledge entry to the current version. When the retrieval process actually provides a previous version of the knowledge entry, it still records that knowledge entry and its version identifier, so that the knowledge retrieval record reflects the actual external knowledge input state that occurred when the candidate response was generated.
[0067] After candidate responses are generated, they are decomposed at the fact level to obtain one or more atomic statements. An atomic statement is a statement unit that can be independently verified; when a statement contains multiple factual relations that can be verified separately, atomic statements are formed according to different factual relations.
[0068] In one implementation, candidate responses are used as input for declaration decomposition processing, extracting fact subjects, fact relationships, limiting conditions, and declaration values according to a preset structure. Here, the fact subject represents the object described by the atomic declaration, the fact relationship represents the attribute or relationship to be verified, the limiting condition represents the applicable time, region, object category, or business condition, and the declaration value represents the specific content given by the atomic declaration for the fact relationship. Declaration decomposition can be performed by a generative model according to preset structured output rules, or it can be performed by a semantic parsing program.
[0069] The fact key corresponding to an atomic statement is determined based on the fact subject, fact relationship, and limiting conditions. The fact key does not contain the statement value or version identifier, ensuring that different versions of knowledge entries can still be associated using the same fact key even after version changes in the fact value. When the fact subject, fact relationship, or limiting conditions have different expressions, they can be normalized first, and then the corresponding fact key can be determined based on the fact key mapping relationship in the versioned knowledge base.
[0070] In the versioned knowledge base, search for knowledge entries with the same fact key. Identify the knowledge entry whose effective date is no later than the task's time and whose expiration date is empty or later than the task's time as the current version. Read the direct predecessor version identifier of the current version, identify the corresponding knowledge entry as the predecessor version directly replaced by the current version, and read the fact values of the corresponding fact keys in both the current and predecessor versions to obtain the fact values for the current and predecessor versions.
[0071] If there is no direct predecessor, the corresponding atomic declaration can be marked as having no direct predecessor, and will not be included in the version difference check between the current version and the predecessor.
[0072] While generating candidate responses, the knowledge entries and version identifiers of the actual input generation model are recorded, and linked to the corresponding atomic declarations according to the fact keys to form a knowledge retrieval record. The version identifiers in the knowledge retrieval record are compared with the version identifiers of the current version and the previous version; if they match the current version, the knowledge version of the actual input generation model is determined to be the current version; if they match the previous version, the knowledge version of the actual input generation model is determined to be the previous version; if they do not match either of them, the corresponding actual input version information is retained.
[0073] The knowledge version of the actual input generation model is determined based on the version identifier of the actual input knowledge item, and is not inferred backward from the declared value in the candidate response.
[0074] Simultaneously, the generator model parameter states and decoding conditions used during candidate response generation are recorded for reuse in subsequent verification processes. The generator model parameter states can be recorded using model version identifiers, parameter snapshots, or equivalent methods that can restore the same parameter states. S1 does not update the generator model parameters.
[0075] S2. Generate a verification request for the mask declaration value, align the fields of the current version with the previous version, determine the version-invariant fields and version-difference fields, and form a common verification basis with the verification request and the version-invariant fields.
[0076] The verification request is constructed based on the task request, task time, and atomic statement. The verification request retains the fact subject, factual relationship, and limiting conditions corresponding to the atomic statement, while masking the statement value and the content that can directly determine the statement value. This ensures that the verification request still points to the same fact to be verified as the atomic statement, but does not directly carry the factual result already given by the candidate response.
[0077] Set a placeholder value that matches the data type of the declared value at the corresponding position. The placeholder value is used to identify the position and data type of the declared value. It does not include the fact value corresponding to the current version or the fact value corresponding to the previous version, nor does it imply the above fact values through default values, encoding mappings, or equivalent expressions. For numeric, date, enumeration, and text declared values, you can set the corresponding data type placeholder content.
[0078] Next, field alignment is performed between the current version and its predecessor. First, the version identifier of the predecessor version is verified to be consistent with the direct predecessor version identifier of the current version to confirm that the two knowledge items being compared have a direct version substitution relationship.
[0079] Establish a field mapping between the current version and previous versions based on field identifiers. When a field identifier cannot be directly mapped, establish a mapping based on preset field semantics or field semantic mapping relationships to handle situations where field names change during version updates but the actual meaning of the fields remains unchanged.
[0080] Normalize the data format of the corresponding field values to eliminate representation differences caused by different date formats, character formats, numerical precision, or encoding methods; for field values containing units of measurement, convert them to the same unit of measurement before comparison.
[0081] Fields with the same normalized values are designated as version-invariant fields, while fields with different normalized values are designated as version-difference fields. For each version-difference field, the field identifier, the current version field value, and the previous version field value are retained.
[0082] The verification request for masked declared values and the version-invariant field are combined to form a common verification basis. The common verification basis does not include declared values and version difference fields, allowing the subsequent three verification branches to share common information between the current version and the previous version, while the version difference information is reserved for S3 to introduce separately.
[0083] S3. Using the same generation model parameters as when generating candidate responses, keeping the verification state starting point and decoding conditions consistent, select version difference fields one by one and form the current version verification branch, the previous version verification branch, and the null value comparison branch; write the current version field value, the previous version field value, and the placeholder value to the target version difference field in the three branches respectively, and keep the placeholder values in the other version difference fields to obtain three independent verification values and form a version difference response relationship.
[0084] The principle of three-branch version difference verification is as follows: Figure 3 As shown, the common verification basis is processed by the generative model to form a common verification state. For the target version difference field, a current version verification branch, a previous version verification branch, and a null value comparison branch are formed respectively. The three verification branches obtain the current independent verification value, the previous independent verification value, and the null value independent verification value respectively, and form a version difference response relationship based on this.
[0085] The common verification basis is processed using the generative model parameter status recorded in S1 to obtain the common verification status. The common verification status represents the initial verification state when the generative model has processed the common verification basis but has not yet received the current version field value, previous version field value, or placeholder value of the target version difference field.
[0086] For generation environments that can save intermediate states of the generative model, save the intermediate states corresponding to the common verification basis and use them to form three verification branches respectively; for generation environments that cannot directly save intermediate states, re-input the same common verification basis and keep the generative model parameters and decoding conditions consistent to form an equivalent verification state starting point.
[0087] The three validation branches maintain consistency in the generative model parameters, validation state starting point, and decoding conditions. Decoding conditions include the decoding strategy employed and the corresponding generation configuration. When using random decoding, the random control conditions remain consistent; when using deterministic decoding, the deterministic decoding configuration remains consistent.
[0088] Select one field at a time from the version difference fields determined in S2 as the target version difference field. Write the current version field value of the target version difference field into the corresponding field position in the current version verification branch, write the previous version field value into the previous version verification branch, and write a placeholder value that does not carry the corresponding fact value of the current version or the corresponding fact value of the previous version into the null value comparison branch; other version difference fields retain placeholder values in all three verification branches.
[0089] Three verification branches are executed separately, and the content to be evaluated corresponding to the factual relationship of the current atomic declaration is extracted from the output of each verification branch. These are identified as the current independent verification value, the preceding independent verification value, and the null independent verification value, respectively. The data types of the three independent verification values are kept comparable to the declaration values of the corresponding atomic declarations.
[0090] After each target version's difference field verification is completed, the common verification state is restored, and then the next version's difference field is selected to perform the same processing, until the verification of all version difference fields is completed.
[0091] Using the same normalized fact consistency calculation rule, the degree of consistency between each independent verified value and the corresponding fact value in the current version and the corresponding fact value in previous versions is calculated separately. The normalized fact consistency is denoted as: In the formula, This indicates the value to be evaluated, which originates from the current independent validation value, the previous independent validation value, or the null independent validation value. This indicates the fact value corresponding to the current version or the fact value corresponding to the previous version; This represents the normalized factual agreement between the value to be evaluated and the factual value, and its value range is: The closer the normalized factual consistency is to 1, the higher the degree of consistency between the value to be evaluated and the factual value.
[0092] For different data types, corresponding fact consistency calculation rules can be preset. For enumerated, Boolean, or facts that can be normalized to standard discrete values, the normalized fact consistency is set to 1 if the normalized values are the same, and 0 if they are different. For date-type facts, they are compared after being converted to a unified date format. For text-type facts, the comparison is prioritized based on mapping the normalization result to the standard fact value in the versioned knowledge base. If direct mapping is not possible, text semantic matching with fixed parameters can be used, and the result is normalized. .
[0093] For numerical facts, after data format and unit of measurement normalization, the consistency of normalized facts is determined in one implementation method according to the following formula: ;
[0094] In the formula, This represents the allowable deviation for the corresponding fact field, and satisfies: ;
[0095] The The value is determined based on the data precision, allowable error, or preset field comparison rules of the corresponding field, and remains unchanged across the three verification branches of the same atomic declaration.
[0096] Regarding the first For each atomic declaration, the version orientation preference corresponding to the value to be evaluated is determined according to the following formula:
[0097] ;
[0098] In the formula, Indicates the atomic declaration number; Indicates the value to be evaluated; Indicates the first Each atomic declaration corresponds to a version-oriented preference of the value to be evaluated; Indicates the value to be evaluated. With fact value The normalized factual consistency, with a value range of . ; and They represent the first Each atomic declaration corresponds to the current version's corresponding fact value and the previous version's corresponding fact value;
[0099] The range of values for version-oriented preferences is: ;
[0100] when When, it indicates that the value to be evaluated is relatively biased towards the fact value corresponding to the previous version; when When the value to be evaluated is relatively biased towards the factual value corresponding to the current version, it indicates that the value to be evaluated is relatively biased towards the factual value corresponding to the current version.
[0101] Based on the version orientation preference of the current independent validation value, previous independent validation value, and null independent validation value corresponding to each target version difference field, the version difference response vector is determined according to the following formula:
[0102] ;
[0103] In the formula, Indicates the sequence number of the target version difference field; , and They represent the first The atomic declaration targets the first... The target version difference field yields the current independent verification value, the previous independent verification value, and the null independent verification value. Indicates taking The larger of the two values is zero; Indicates the first Version switching response corresponding to each target version difference field; Indicates the first Null response for each target version difference field; Indicates the first Version difference response vectors corresponding to each target version difference field;
[0104] in: The version switching response is used to characterize whether the verification result changes in line with the version direction when the target version difference field changes from the previous version field value to the current version field value; the null value response is used to characterize whether the generative model still shows the previous version fact tendency when the version difference field does not carry the fact value corresponding to the current version and the fact value corresponding to the previous version.
[0105] Version switching response and null value response satisfy: ;
[0106] Normalized factual consistency, version orientation preference, version switching response, and null response are all dimensionless quantities.
[0107] The preset version switching response threshold, preset null value response threshold, and preset current version consistency threshold all adopt the same numerical scale as the above normalization results, with a value range of [0,1]. In one implementation, mismatched samples, model parameter knowledge-lagging samples, and normal samples are retrieved using known knowledge versions and corresponding response values are obtained according to the same three-branch validation rule. The corresponding thresholds are determined based on the distribution of response values for different categories of samples. Once each threshold is determined, it remains unchanged during the same candidate response judgment, update, and re-validation process.
[0108] Associate each target version difference field with the corresponding version difference response vector to form the version difference response relationship of the corresponding atomic declaration, and provide the three independent verification values and the version difference response relationship to S4.
[0109] S4. Based on the declared value, three independent verification values, version difference response relationship and knowledge call record, determine the knowledge version retrieval mismatch and model parameter knowledge lag respectively, and correct or block the corresponding response content.
[0110] Using the same normalized fact consistency calculation rules as S3, the normalized fact consistency between the declared value in the candidate response and the corresponding fact value in the previous version and the corresponding fact value in the current version is calculated respectively.
[0111] When the normalized fact consistency between the declared value and the corresponding fact value of the previous version is higher than the normalized fact consistency with the corresponding fact value of the current version, it is determined that the declared value exhibits fact bias of the previous version, and the two types of cause determination are continued; otherwise, the knowledge version retrieval mismatch or model parameter knowledge lag is not determined for the atomic declaration.
[0112] When the knowledge retrieval record indicates that the knowledge version of the corresponding atomic declaration's actual input to the generated model is the previous version, and there is a target version difference field where the version switching response reaches a preset version switching response threshold, a knowledge version retrieval mismatch is determined. The knowledge retrieval record is used to determine the external knowledge version of the actual input during the candidate response generation stage, and the version switching response is used to determine whether the generated result can produce a corresponding factual direction change with the version switching of the target version difference field.
[0113] When a target version difference field has a null response that reaches a preset null response threshold, the model parameter knowledge is considered to be lagging. The null comparison branch does not input the current version field value and the previous version field value of the corresponding version difference field. Therefore, when the null independent validation value still shows the previous version factual tendency, the corresponding null response is used to characterize the residual previous version knowledge tendency after excluding the corresponding external version difference fact input.
[0114] The mismatch between knowledge version retrieval and the lag in knowledge of model parameters are determined separately, and they can be determined individually or simultaneously.
[0115] When a knowledge version mismatch occurs, the generator model parameters remain unchanged. Based on the fact key, the previous version knowledge entry input into the generator model is replaced with the knowledge entry corresponding to the same fact key in the current version, and the corresponding response content is regenerated. This step does not persistently update the knowledge retrieval index or version reference relationship.
[0116] When the knowledge lag in the model parameters holds true, the knowledge entries generated from the actual input remain unchanged. The fact value corresponding to the current version is set as the generation constraint, and the fact value corresponding to the previous version is set as the suppression constraint. The response content is then regenerated. In one implementation, the fact value corresponding to the current version and the fact value corresponding to the previous version are written into preset generation constraint fields and suppression constraint fields, respectively, and provided to the generation model along with the task request and the original actual input knowledge entries. This step does not directly update the generation model parameters.
[0117] After completing the corresponding correction, the regenerated response content is processed in the same fact-level decomposition method as S1. Based on the original fact key, the corresponding regenerated atomic declaration is determined and the regenerated declaration value is extracted.
[0118] When the normalized fact consistency between the regenerated declaration value and the corresponding fact value in the current version reaches the preset consistency threshold for the current version, and is higher than the normalized fact consistency with the corresponding fact value in the previous version, the regenerated response content is determined to pass the current version consistency check; otherwise, the output of the corresponding atomic declaration is blocked.
[0119] The blocking refers to not outputting the corresponding atomic statement as a deterministic content that has passed fact verification; other atomic statements in the same response that meet the corresponding verification conditions are output according to the corresponding processing results.
[0120] The regenerated response content, anomaly cause, fact key, and target version difference fields used for the current version consistency check are provided to S5.
[0121] S5. When knowledge version retrieval mismatch occurs, update the knowledge retrieval index or version reference relationship. When model parameter knowledge lags behind, update the generated model parameters. Only update the corresponding object and keep the unupdated object unchanged for three-branch verification. If the judgment condition is no longer met and the updated response content passes the current version consistency check, retain the update and output it. Otherwise, restore the state before the update. Output candidate responses when neither of the two causes is determined.
[0122] Before updating, save the state of the corresponding updated object. For knowledge version retrieval mismatch, save the knowledge retrieval index and version reference relationship of the fact key; for model parameter knowledge lag, save the parameter state before the model update, parameter snapshot, or parameter version that can restore the same parameter state.
[0123] The knowledge retrieval index is used to establish the association between search criteria and searchable knowledge entries; the version reference relationship is used to indicate the valid knowledge version currently pointed to by the corresponding fact key; the version substitution relationship is used to indicate the version chain relationship between the current version and the previous version.
[0124] When a knowledge version retrieval mismatch occurs, the current version is set as the valid retrieval target for the corresponding fact key. The index association of the previous version as the current retrieval target is removed, and the version reference relationship of the corresponding fact key is updated from the previous version to the current version. At the same time, the knowledge entries of the previous version and the version substitution relationship between the current version and the previous version are retained.
[0125] After completing the retrieval-side update, keep the generated model parameters unchanged, re-execute the retrieval and candidate response generation, and update the knowledge call record. When the updated knowledge call record indicates that the knowledge version of the corresponding atomic declaration's actual input to the generated model is now the current version, perform a three-branch retrieval-side verification on the fact key and target version difference field that were previously judged to have a knowledge version retrieval mismatch.
[0126] The retrieval side verifies that the current version, previous version, common verification basis, generation model parameters and decoding conditions remain unchanged. The version difference response relationship is re-formed according to the same rules in S3, and the knowledge version retrieval mismatch is judged according to the same conditions in S4.
[0127] If the corresponding judgment condition is no longer met, and the regenerated response content passes the current version consistency check, the updated knowledge retrieval index or version reference relationship is retained and the updated response content is output; otherwise, the knowledge retrieval index or version reference relationship is restored to the state before the update, and the corresponding atomic declaration is blocked.
[0128] When the knowledge lag of the model parameters is true, the knowledge retrieval index and version reference relationship remain unchanged. The fact value corresponding to the current version is used as the correction target, the fact value corresponding to the previous version is used as the suppression target, and the regenerated response content that passes the consistency check of the current version in S4 is combined to form paired correction data.
[0129] Each pair of paired correction data may include a task request, the actual input knowledge entries that remain unchanged, the fact value corresponding to the current version, the fact value corresponding to the previous version, and the target response that passes the consistency check of the current version. The fact value corresponding to the current version and the target response are used to determine the correction direction, while the fact value corresponding to the previous version is used to determine the suppression direction.
[0130] The generated model can be updated using all trainable parameters, or the base model parameters can be kept unchanged, with only the preset trainable parameter components being updated. When using trainable parameter components, these components can be set in the part of the model parameters responsible for context processing or responding to the generated parameters.
[0131] When updating parameters, the task request and the unchanged actual input knowledge items are used as model inputs. The fact value corresponding to the current version and the target response that passes the consistency check of the current version are used as correction targets. The fact value corresponding to the previous version is used as suppression targets. The parameter update direction is formed according to the difference between the generated result and the correction target and the suppression target. The trainable parameters of the generated model are updated according to the preset parameter update configuration.
[0132] In one implementation, parameter updates are performed using gradient backpropagation. A correction update signal is generated based on the difference between the generated result and the correction target. A suppression update signal is generated based on the output tendency of the corresponding fact value of the previous version based on the generated result. The parameter gradients corresponding to the trainable parameters are calculated based on the above update signals. The trainable parameters are then iteratively updated according to a preset learning rate in the direction of reducing the correction difference and suppressing the output tendency of the fact value of the previous version.
[0133] The parameter update configuration includes the learning rate, batch size, maximum update epochs, trainable parameter range, and stopping conditions. These parameters are preset based on the amount of paired correction data, the size of the generated model, and actual computing resources, and remain unchanged during the same parameter update. The parameter update stops when the maximum update epochs are reached, or when the response generated for the paired correction data meets the preset consistency requirements of the current version.
[0134] After updating the generated model parameters, the candidate response is regenerated while keeping the knowledge retrieval index and version reference relationship unchanged. Then, a parameter-side three-branch verification is performed on the fact key and target version difference field that were determined to have model parameter knowledge lag before the update.
[0135] The parameter-side verification keeps the current version, previous version, common verification basis and decoding conditions unchanged. The updated generated model parameters are used to re-form the version difference response relationship according to the same rules in S3, and the judgment is re-made according to the judgment condition of model parameter knowledge lag in S4.
[0136] If the corresponding judgment condition is no longer met and the updated response content passes the consistency check of the current version, the updated generated model parameters are retained and the updated response content is output; otherwise, the generated model parameters are restored to the state before the update and the corresponding atomic declaration is blocked.
[0137] When both knowledge version retrieval mismatch and model parameter knowledge lag occur simultaneously, the following steps are executed sequentially: updating the knowledge retrieval index and version reference relationships, retrieval-side verification, updating the generated model parameters, and parameter-side verification. The generated model parameter update is only performed after the retrieval-side update passes verification and the knowledge call record indicates that the actual input knowledge version of the generated model is the current version.
[0138] When parameter-side verification fails, only the generated model parameters are restored, and the updates to the knowledge retrieval index or version reference relationship that have passed the retrieval-side verification are not revoked; when the retrieval-side update fails verification, the state before the retrieval-side update is restored, and subsequent updates to the generated model parameters are stopped.
[0139] For atomic declarations that do not determine knowledge version retrieval mismatch or model parameter knowledge lag, do not execute knowledge retrieval indexing, version reference relationships, or generate model parameter updates, and output the corresponding content in the candidate response.
[0140] Through the above S1-S5 steps, this invention sequentially completes the tracking of actual knowledge input and determination of version facts, construction of a common verification foundation, field-by-field three-branch verification, determination of anomaly causes, and updating and re-verification of corresponding objects. For knowledge version retrieval mismatch and model parameter knowledge lag, corresponding update objects are determined, and the update results are verified while keeping the unupdated objects unchanged. This allows retrieval-side updates and model parameter updates to be retained or restored respectively, forming an iterative control process adapted to the continuous updating of versioned knowledge.
[0141] As shown in Figure 2, another embodiment of the present invention also provides an illusion recognition and iterative control system based on knowledge version difference verification, used to execute the illusion recognition and iterative control method based on knowledge version difference verification as described above, including:
[0142] The version fact determination module is used to obtain the task request, task time and versioned knowledge base, generate candidate responses through the generative model, record the actual input knowledge items and version identifiers to form a knowledge call record; decompose the candidate responses to obtain atomic declarations, declaration values and fact keys, determine the current version and the direct predecessor version of the fact key according to the task time, and obtain the fact value corresponding to the current version and the fact value corresponding to the predecessor version;
[0143] The verification base building module is used to generate verification requests for masked declaration values, align fields between the current version and previous versions, determine version-invariant fields and version-difference fields, and form a common verification base with the verification requests and version-invariant fields.
[0144] The three-branch verification module uses the same generation model parameters as when the candidate response is generated, keeps the verification state starting point and decoding conditions consistent, selects version difference fields one by one and forms the current version verification branch, the previous version verification branch and the null value comparison branch; the three branches write the current version field value, the previous version field value and the placeholder value to the target version difference field respectively, while the other version difference fields keep the placeholder values, and obtain three independent verification values to form a version difference response relationship.
[0145] The cause determination module is used to determine the knowledge version retrieval mismatch and model parameter knowledge lag based on the declared value, three independent verification values, version difference response relationship and knowledge call record, and to correct or block the corresponding response content.
[0146] The update verification module is used to update the knowledge retrieval index or version reference relationship when the knowledge version retrieval is mismatched, and to update the generated model parameters when the model parameter knowledge is lagging behind. It performs a three-branch verification by only updating the corresponding object and keeping the unupdated object unchanged. If the judgment condition is no longer met and the updated response content passes the current version consistency check, the update is retained and output; otherwise, the state before the update is restored. When neither of the two causes is determined, candidate responses are output.
[0147] In summary, this invention can distinguish different sources of historical knowledge content in the generated response and perform correction and verification for corresponding abnormal objects, forming an iterative control process from anomaly identification and targeted updates to result verification. This reduces invalid updates, improves the knowledge consistency and operational reliability of the generative model in a dynamic knowledge environment, and is applicable to intelligent question answering, knowledge retrieval, and generative information processing scenarios under conditions of continuous knowledge content updates.
[0148] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for hallucination identification and iterative control based on knowledge version difference verification, characterized in that, Includes the following steps: Retrieve task requests, task timestamps, and versioned knowledge bases; Candidate responses are generated by a generative model, and the actual input knowledge items and version identifiers are recorded to form a knowledge call record. Decompose the candidate response to obtain atomic declarations, declaration values and fact keys. Determine the current version and direct predecessor version of the fact key according to the task time, and obtain the fact value corresponding to the current version and the fact value corresponding to the predecessor version. Generate a verification request for masked declaration values, align fields between the current version and previous versions, determine version-invariant fields and version-difference fields, and form a common verification basis with the verification request and version-invariant fields; Using the same generation model parameters as when generating candidate responses, keeping the verification state starting point and decoding conditions consistent, version difference fields are selected one by one to form the current version verification branch, the previous version verification branch, and the null value comparison branch; The three branches write the current version field value, the previous version field value, and the placeholder value to the target version difference field, respectively, while the other version difference fields keep the placeholder values, thus obtaining three independent verification values and forming a version difference response relationship; Based on the declared value, three independent verification values, version difference response relationship, and knowledge call records, the knowledge version retrieval mismatch and model parameter knowledge lag are determined respectively, and the corresponding response content is corrected or blocked. When knowledge version retrieval mismatch occurs, update the knowledge retrieval index or version reference relationship; when model parameter knowledge lags, update the generated model parameters. Only update the corresponding object and keep the unupdated object unchanged for three-branch verification. If the judgment condition is no longer met and the updated response content passes the current version consistency check, retain the update and output it; otherwise, restore the state before the update. When the two types of causes are not determined, output candidate responses.
2. The hallucination recognition and iterative control method based on knowledge version difference verification according to claim 1, characterized in that, The knowledge entries in the versioned knowledge base include fact keys, fact values, version identifiers, effective time, expiration time, and direct predecessor version identifiers; Extract the fact subject, fact relationship and limiting condition from the atomic statement and determine the corresponding fact key. Determine the current version of the knowledge item whose effective time is no later than the task time and whose expiration time is empty or later than the task time as the current version corresponding to the fact key. Determine the predecessor version directly replaced by the current version according to the direct predecessor version identifier of the current version. Determine the fact value of the corresponding fact key in the current version and the predecessor version as the fact value corresponding to the current version and the fact value corresponding to the predecessor version, respectively. Record the knowledge entries and version identifiers of the actual input model, associate them with the corresponding atomic declarations according to the fact keys to form a knowledge call record, and compare the version identifiers in the knowledge call record with the version identifiers of the current version and the previous version to determine the knowledge version of the actual input model of the corresponding atomic declaration.
3. The hallucination recognition and iterative control method based on knowledge version difference verification according to claim 2, characterized in that, The verification request for generating the mask declaration value includes: Based on the task request, task time, and atomic declaration, construct the verification request, retain the fact subject, fact relationship, and limiting conditions corresponding to the atomic declaration, mask the declaration value and the content that can directly determine the declaration value, and set a placeholder value with the same data type as the declaration value in the corresponding position of the declaration value; Placeholder values are used to identify the position and data type of the declared value, and do not include the fact value corresponding to the current version or the fact value corresponding to the previous version.
4. The hallucination recognition and iterative control method based on knowledge version difference verification according to claim 3, characterized in that, The process of aligning fields between the current version and previous versions to form a common verification basis includes: Verify that the version identifier of the previous version is consistent with the direct predecessor version identifier of the current version; Establish the field correspondence between the current version and the previous version according to the field identifier; when the field identifier cannot be directly matched, establish the field correspondence according to the field semantics; normalize the data format of the corresponding field values, and normalize the unit of measurement of field values containing units of measurement. Fields with the same normalized values are defined as version-invariant fields, and fields with different normalized values are defined as version-difference fields. The verification request for the version-invariant field is combined with the masked declaration value to form a common verification basis. The common verification basis does not include the declaration value and the version difference field.
5. The hallucination recognition and iterative control method based on knowledge version difference verification according to claim 4, characterized in that, The process of forming the current version verification branch, the previous version verification branch, and the null value comparison branch, and obtaining three independent verification values, includes: The common validation basis is processed using the same generative model parameters as when candidate responses are generated, to obtain the common validation state; From the common verification state, the current version verification branch, the previous version verification branch, and the null value comparison branch are formed. The three verification branches keep the generated model parameters, the starting point of the verification state, and the decoding conditions consistent. Select the target version difference fields in sequence, and write only the current version field value, the previous version field value, and the placeholder value that does not carry the current version corresponding fact value and the previous version corresponding fact value in the corresponding field position of the three verification branches. Other version difference fields remain as placeholder values, and obtain the current independent verification value, the previous independent verification value, and the null independent verification value respectively. After each target version difference field verification is completed, the common verification state is restored, and three verification branches are re-formed for the next target version difference field until the verification of each version difference field is completed.
6. The hallucination recognition and iterative control method based on knowledge version difference verification according to claim 5, characterized in that, The formation of version difference response relationships includes: Using the same normalized fact consistency calculation rule, the normalized fact consistency between the current independent verification value, the previous independent verification value, and the null independent verification value corresponding to the difference field of each target version and the corresponding fact value of the current version and the previous version is calculated respectively. The version orientation preference corresponding to the value to be evaluated is determined according to the following formula: ; In the formula, Indicates the atomic declaration number; Indicates the value to be evaluated; Indicates the first Each atomic declaration corresponds to a version-oriented preference of the value to be evaluated; Indicates the value to be evaluated. With fact value The normalized factual consistency, with a value range of . ; and They represent the first Each atomic declaration corresponds to the current version's corresponding fact value and the previous version's corresponding fact value; Based on the version orientation preference of the current independent validation value, previous independent validation value, and null independent validation value corresponding to each target version difference field, the version difference response vector is determined according to the following formula: ; In the formula, Indicates the sequence number of the target version difference field; , and They represent the first The atomic declaration targets the first... The target version difference field yields the current independent verification value, the previous independent verification value, and the null independent verification value. Indicates taking The larger of the two values is zero; Indicates the first Version switching response corresponding to each target version difference field; Indicates the first Null response for each target version difference field; Indicates the first Version difference response vectors corresponding to each target version difference field; Associating each target version difference field with its corresponding version difference response vector forms the first... Version difference response relationship of each atomic declaration.
7. The hallucination recognition and iterative control method based on knowledge version difference verification according to claim 6, characterized in that, The determination of knowledge version retrieval mismatch and model parameter knowledge lag, and the correction or blocking of corresponding response content, includes: When the normalized fact consistency between the declared value and the corresponding fact value of the previous version is higher than the normalized fact consistency with the corresponding fact value of the current version, the knowledge call record indicates that the knowledge version of the model generated by the actual input of the corresponding atomic declaration is the previous version, and there is a target version difference field where the version switching response reaches the preset version switching response threshold, it is determined that the knowledge version retrieval is mismatched; there is a target version difference field where the null value response reaches the preset null value response threshold, it is determined that the model parameter knowledge is lagging. When a knowledge version mismatch occurs, keep the generator model parameters unchanged and replace the knowledge entries of the previous version that are actually input into the generator model with the knowledge entries corresponding to the same fact keys in the current version. When the model parameters are outdated, keep the knowledge entries that are actually input into the generator model unchanged and set the fact values corresponding to the current version as generator constraints and the fact values corresponding to the previous version as suppression constraints. After completing the corresponding corrections, regenerate the response content. If the normalized fact consistency between the regenerated declaration value and the corresponding fact value in the current version reaches the preset consistency threshold for the current version and is higher than the normalized fact consistency with the corresponding fact value in the previous version, the response content is determined to pass the current version consistency check; otherwise, the output of the corresponding atomic declaration is blocked.
8. The hallucination recognition and iterative control method based on knowledge version difference verification according to claim 7, characterized in that, When a knowledge version retrieval mismatch occurs, the knowledge retrieval index or version reference relationship is updated. When model parameter knowledge lags, the generated model parameters are updated, including: When a knowledge version retrieval mismatch occurs, the current version is set as the valid retrieval target for the corresponding fact key, the index association of the previous version as the current retrieval target is removed, the version reference relationship of the corresponding fact key is updated from the previous version to the current version, and the version substitution relationship between the previous version and the current version is retained. When the model parameters are outdated, the knowledge retrieval index and version reference relationship remain unchanged. The fact value corresponding to the current version is used as the correction target, and the fact value corresponding to the previous version is used as the suppression target. The regenerated response content that has passed the consistency check of the current version is combined to form paired correction data, and the generated model parameters are updated based on the paired correction data. When both knowledge version retrieval mismatch and model parameter knowledge lag exist simultaneously, the knowledge retrieval index and version reference relationship are updated first. After the knowledge call record indicates that the knowledge version of the corresponding atomic declaration is the current version of the actual input generated model, the generated model parameters are updated while keeping the updated knowledge retrieval index and version reference relationship unchanged.
9. The hallucination recognition and iterative control method based on knowledge version difference verification according to claim 8, characterized in that, The three-branch verification process, which involves updating only the corresponding object while keeping the unupdated objects unchanged, includes: After the knowledge retrieval index or version reference relationship is updated, the retrieval and generation are re-executed while keeping the generation model parameters unchanged, and the knowledge call records are updated; after the generation model parameters are updated, the candidate responses are re-generated while keeping the knowledge retrieval index and version reference relationship unchanged. Keeping the current version, previous version, common verification basis and decoding conditions unchanged, re-execute the three-branch verification for the fact key and target version difference field that were determined to have corresponding causes before the update, redetermine the version difference response relationship and judge the corresponding judgment conditions. If the corresponding judgment condition is no longer met and the regenerated response content passes the consistency check of the current version, the corresponding update is retained and the updated response content is output; otherwise, the corresponding knowledge retrieval index, version reference relationship or generated model parameters are restored to the state before the update, and the output of the corresponding atomic declaration is blocked. When both knowledge version retrieval mismatch and model parameter knowledge lag occur simultaneously, the following steps are executed sequentially: knowledge retrieval index and version reference relationship update, retrieval-side verification, generation model parameter update, and parameter-side verification.
10. A hallucination recognition and iterative control system based on knowledge version difference verification, used to execute the hallucination recognition and iterative control method based on knowledge version difference verification as described in any one of claims 1-9, characterized in that, include: The version fact determination module is used to obtain the task request, task time and versioned knowledge base, generate candidate responses through the generative model, and record the actual input knowledge items and version identifiers to form a knowledge call record; Decompose the candidate response to obtain atomic declarations, declaration values and fact keys. Determine the current version and direct predecessor version of the fact key according to the task time, and obtain the fact value corresponding to the current version and the fact value corresponding to the predecessor version. The verification base building module is used to generate verification requests for masked declaration values, align fields between the current version and previous versions, determine version-invariant fields and version-difference fields, and form a common verification base with the verification requests and version-invariant fields. The three-branch verification module is used to adopt the same generation model parameters as when the candidate response is generated, keep the verification state starting point and decoding conditions consistent, select version difference fields one by one, and form the current version verification branch, the previous version verification branch, and the null value comparison branch. The three branches write the current version field value, the previous version field value, and the placeholder value to the target version difference field, respectively, while the other version difference fields keep the placeholder values, thus obtaining three independent verification values and forming a version difference response relationship; The cause determination module is used to determine the knowledge version retrieval mismatch and model parameter knowledge lag based on the declared value, three independent verification values, version difference response relationship and knowledge call record, and to correct or block the corresponding response content. The update verification module is used to update the knowledge retrieval index or version reference relationship when the knowledge version retrieval is mismatched, and to update the generated model parameters when the model parameter knowledge is lagging. It performs a three-branch verification by only updating the corresponding objects and keeping the unupdated objects unchanged. If the judgment condition is no longer met and the updated response content passes the current version consistency check, the update is retained and output; otherwise, the state before the update is restored. When the two types of causes are not determined, output candidate responses.
