Large language model generation method and program product

CN122988198APending Publication Date: 2026-10-27IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611214541.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]本发明提供一种大语言模型生成方法和程序产品,用以解决相关技术中大语言模型容易出现幻觉的缺陷

Benefits of technology

[0017]本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述大语言模型生成方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122988198A_ABST
    Figure CN122988198A_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence, and provides a large language model generation method and program product, the method comprising: obtaining source objects applied by a large language model in a generation process and generated candidate assertions; determining source sufficiency information based on at least one of timeliness, credibility and integrity of each source object and evidence association information between each source object and each candidate assertion, the source sufficiency information reflecting the sufficiency of all source objects in supporting a tentative output conclusion, the tentative output conclusion including all candidate assertions; based on the source sufficiency information, constraining the generation process of the large language model, and obtaining output information of the large language model under the constraint of the source sufficiency information. The method and program product provided by the present application can effectively reduce the probability of semantic drift and illusion of the large language model under insufficient evidence, and improve the factual reliability, source traceability and output controllability in high-risk scenarios of the output information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and program product for generating large language models. Background Technology

[0002] To address the hallucination problem that often occurs in the practical deployment of large language models, current common approaches include Retrieval-augmented Generation (RAG), post-output fact-checking, citation generation, self-consistent sampling, security filtering, or manual review, in order to improve the reliability of the responses output by large language models.

[0003] However, the above solutions all fall into the category of plug-ins or post-correction methods. Their core judgments usually occur after the large language model is generated and output, which cannot fundamentally prevent the generation of illusions and directly limit the reliability and controllability of the information output by the large language model. Summary of the Invention

[0004] This invention provides a method and program product for generating large language models, which addresses the shortcomings of related technologies where large language models are prone to illusions.

[0005] This invention provides a method for generating large language models, comprising: Obtain the source objects and generated candidate assertions used in the generation process of the large language model; Based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, source sufficiency information is determined. The source sufficiency information reflects the degree to which all source objects support the proposed output conclusion, which includes all candidate assertions. Based on the source sufficiency information, the generation process of the large language model is constrained, and the output information of the large language model under the constraint of the source sufficiency information is obtained.

[0006] According to a method for generating a large language model provided by the present invention, the source sufficiency information includes at least one of the following: local jump value of each candidate assertion, source support degree, and source conflict degree; and / or, at least one of the following: global jump value of the proposed output conclusion, proportion of unsupported assertions, source consistency, and retrieval support. The local jump value is the inference jump value from the source object supporting the candidate assertion to the candidate assertion; the source support level is the degree of support of all source objects for the candidate assertion; the source conflict level is the degree of conflict between all source objects and the candidate assertion. The global jump value is the inference jump value from the source object supporting the proposed output conclusion to the proposed output conclusion; the proportion of unsupported assertions is the percentage of candidate assertions in the proposed output conclusion that are not supported by any source object; the source consistency is the degree of semantic uniformity between all candidate assertions and all source objects; and the retrieval support is the degree of support of all source objects for the proposed output conclusion.

[0007] According to a large language model generation method provided by the present invention, the determination of source sufficiency information based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, includes at least one of the following: Based on the semantic distance between each candidate assertion and the source object supporting each candidate assertion, the local jump value of each candidate assertion is determined. The global jump value is determined based on the local jump values ​​of all candidate assertions; Based on the timeliness and credibility of each source object, and the support score in the evidence association information between each source object and each candidate assertion, the source support level of each candidate assertion is determined; Based on the source support level of all candidate assertions, determine the proportion of unsupported assertions and / or the retrieval support. Based on the credibility of each source object and the conflict score in the evidence association information between each source object and each candidate assertion, the degree of source conflict of each candidate assertion is determined; The source consistency is determined based on the degree of source conflict among all candidate assertions.

[0008] According to a method for generating a large language model provided by the present invention, the process of constraining the generation of the large language model based on the source sufficiency information includes at least one of the following: Based on at least one of the local jump value, source support degree, and source conflict degree of the candidate assertion, the large language model is controlled to include the expression form of the candidate assertion in the output information; Based on at least one of the global jump value, the proportion of no-support assertions, source consistency, and retrieval support of the proposed output conclusion, the content type included in the output information by the large language model can be controlled, or the large language model can be controlled to perform supplementary retrieval.

[0009] According to a method for generating a large language model provided by the present invention, the step of constraining the generation process of the large language model based on the source sufficiency information further includes: Based on the source support level of the candidate assertion, and at least one of the source fragment, source type, credibility, and timestamp of the source object supporting the candidate assertion, the large language model is controlled to mark the source status of the candidate assertion in the output information.

[0010] The method for generating a large language model according to the present invention further includes: Based on the source sufficiency information, the currently supported evidence boundary is determined, and the large language model is constrained to generate the output information within the evidence boundary.

[0011] According to a method for generating a large language model provided by the present invention, the step of constraining the generation process of the large language model based on the source sufficiency information includes: Based on the source sufficiency information, at least one of the following is determined: jump penalty, no support penalty, reference gain, and uncertainty expression gain; Based on at least one of the strong assertion markers, sourceless factual expression markers, citation generation markers, and uncertainty expression markers when the large language model generates lexical units in the output information, and at least one of the jump penalty, no support penalty, citation gain, and uncertainty expression gain, the first probability distribution of the lexical units is adjusted to obtain the second probability distribution of the lexical units; The large language model is controlled to generate the output information based on the second probability distribution of the lexical units.

[0012] According to a method for generating a large language model provided by the present invention, the step of constraining the generation process of the large language model based on the source sufficiency information includes: Obtain multiple candidate output information generated by the large language model; Output control is performed on the multiple candidate output information based on the source sufficiency information.

[0013] The method for generating a large language model according to the present invention further includes: Extract the source dependency features of the large language model in the process of generating or evaluating each candidate assertion, and determine the first association information between each source object and each candidate assertion based on the source dependency features; Based on the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object, the second association information between each source object and each candidate assertion is determined. Based on the first association information and / or the second association information, the evidence association information is determined.

[0014] According to a large language model generation method provided by the present invention, the step of determining the second association information between each source object and each candidate assertion based on the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object includes: If the semantic relevance between the assertion fragment of the candidate assertion and the source fragment of the source object is greater than the relevance threshold, the assertion fragment and the source fragment are input into the natural language inference model to obtain the implication probability, contradiction probability and neutral probability between the assertion fragment and the source fragment output by the natural language inference model. The second associated information is determined based on the implied probability, contradictory probability, and neutral probability between the assertion fragment and the source fragment.

[0015] According to a method for generating a large language model provided by the present invention, determining source sufficiency information based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion includes: Based on at least one of the timeliness, credibility, and completeness of each source object in the current generation process of the large language model, as well as the evidence association information between each source object and each candidate assertion in the current generation process, the sufficiency information of the new source is determined. Based on the source sufficiency information from the historical generation process and the newly added source sufficiency information, the source sufficiency information for the current generation process is determined.

[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the large language model generation methods described above.

[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the large language model generation method as described above.

[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the large language model generation methods described above.

[0019] The large language model generation method and program product provided by this invention combine the source objects and candidate assertions in the large language model generation process to construct source sufficiency information that reflects the sufficiency of all source objects in supporting the proposed output conclusion. This information is then used as an endogenous state constraint in the large language model generation process. As a result, without relying on post-generation verification, strong inferences without source support can be directly suppressed during the large model generation process. This effectively reduces the probability of semantic drift and hallucinations in large language models under insufficient evidence conditions, and improves the factual reliability, source traceability, and output controllability of the output information in high-risk scenarios. Attached Figure Description

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

[0021] Figure 1 This is one of the flowcharts of the large language model generation method provided by the present invention.

[0022] Figure 2 This is a schematic diagram of the large language model generation control process provided by the present invention.

[0023] Figure 3 This is a schematic diagram of the process for determining evidence association information provided by the present invention.

[0024] Figure 4 This is a schematic diagram of the data structure of the source object and candidate assertions provided by the present invention.

[0025] Figure 5 This is a schematic diagram of the recharge structure for the sufficiency of source information provided by the present invention.

[0026] Figure 6 This is the second flowchart of the large language model generation method provided by the present invention.

[0027] Figure 7 This is a schematic diagram of the structure of the large language model generation device provided by the present invention.

[0028] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this 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 this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0030] All actions involving the acquisition of signal information or data in this invention are carried out in compliance with the relevant data protection laws and policies of the country where the device is located, and with the authorization granted by the owner of the device.

[0031] To address the illusion problem that often occurs in the practical deployment of large language models, current research and engineering practices typically consider it as an output error caused by insufficient data or retrieval. To tackle the illusion problem, various technical solutions have been proposed, including retrieval-enhanced generation schemes, output-based fact-checking schemes, citation-based generation schemes, confidence-based or self-consistency-based schemes, and schemes based on security filtering or manual review.

[0032] Search-enhanced responses typically involve steps such as query rewriting, document retrieval, document fragment sorting, contextual assembly, and large language model-based response generation. They retrieve relevant fragments from a knowledge base or webpage based on the user's question, add them as prompts, and then use a large language model to generate the response. However, this approach relies heavily on retrieved materials to improve the response, without considering whether the materials are sufficient to support the conclusion, or distinguishing between factual statements, inferences, and unsubstantiated expansions. Therefore, it fails to fundamentally prevent the generation of illusions.

[0033] Post-output fact-checking schemes typically extract factual statements from the response after it has been generated by a large language model. These statements are then assessed using retrieval, knowledge base matching, natural language inference models, or manual review to determine if they are supported by external evidence. If the assessment is inconsistent, the response is annotated, rewritten, or rejected. While this approach can identify some unsupported conclusions, because the assessment occurs after response generation, post-output fact-checking struggles to prevent the large language model from forming erroneous intermediate conclusions in early stages, especially for long texts, multi-turn dialogues, and multi-step agent tasks. Furthermore, it is difficult to incorporate the verification results as control conditions for the next generation step.

[0034] Reference-based generation schemes require large language models to include document numbers, links, or reference fragments in their responses, typically achieved through prompt words, retrieving context labels, or post-processing to insert references. While this approach improves the traceability of the large language model's output to some extent, it may also generate responses that, in form, contain references but do not actually support the conclusions drawn from them—a problem of reference mismatch or reference decoration.

[0035] Schemes based on confidence or self-consistency can assess the reliability of responses using the confidence level of the large language model output, self-consistency sampling, multi-model voting, or uncertainty estimation. When multiple responses are inconsistent or have low confidence levels, the output certainty can be reduced or a review can be triggered. These schemes primarily measure the stability of the output within the large language model; however, even stable incorrect responses may lack external support. That is, self-consistency does not equate to sufficient source sufficiency, and the aforementioned schemes still cannot explicitly determine whether the current source is sufficient to support the proposed conclusion.

[0036] Solutions based on security filtering or manual review use manual review, output filters or business rules to prevent large language models from outputting unreliable conclusions. However, such solutions usually rely on external processes or manual judgment, which are costly and difficult to implement continuously in large-scale real-time generation scenarios.

[0037] In summary, the above solutions all fall into the category of plug-ins or post-correction methods. Their core judgments often occur after the answer is generated, or they simply input the searched materials as ordinary context into the large language model without delving into the internal process of the large language model's generation.

[0038] From the perspective of the generation mechanism of large language models, illusions often occur when there is insufficient evidence, conflicting sources, or broken inference chains, resulting in semantic drift due to insufficient evidence. Even with the above-mentioned solutions, large language models still lack intrinsic constraints and may still generate strong inferences that appear certain and semantically coherent but are factually unreliable. Therefore, the above solutions cannot fundamentally prevent semantic drift.

[0039] To address the aforementioned problems, embodiments of the present invention provide a method for generating large language models, thereby achieving the intrinsically reliable generation of large language models. Figure 1 This is one of the flowcharts illustrating the large language model generation method provided by this invention, such as... Figure 1 As shown, the method includes: Step 110: Obtain the source objects and generated candidate assertions used by the large language model during the generation process.

[0040] Here, "large language model" refers to a large-scale pre-trained language model trained on massive amounts of text data. A large language model can be an open-access model or a closed model accessible only through an application programming interface (API). Large language models can be applied to question-answering systems, legal and security auxiliary analysis, enterprise knowledge base retrieval, intelligent customer service, medical and health consultation, financial risk control report generation, and multi-step intelligent agent tasks, etc., and this embodiment of the invention does not specifically limit their applications.

[0041] During the generation process, large language models can utilize source objects to generate candidate assertions. Here, source objects refer to the material units used to support the large language model's output generation. For example, source objects can be input text directly provided by the user during interaction with the large language model, document fragments retrieved from a knowledge base or search engine, database query results, returns from external tool calls, historical dialogue context, manually uploaded files, or intermediate conclusions confirmed by the large language model in multiple rounds of generation.

[0042] In some embodiments, the source object may be obtained by modeling the materials used by the large language model during the generation process. For any source object, the source object may include at least one of the following: source fragment, source type, source location, timestamp, credibility, integrity identifier, and referrable identifier.

[0043] Among them, the source fragment is the text content in the source object that is related to the current generation task; the source type can be user input, retrieved documents, web pages, database records, tool returns, historical context, manually uploaded files, model-confirmed intermediate conclusions, etc.; the source location is used to reflect the source origin; the timestamp is used to reflect the generation time of the source fragment; the credibility is used to reflect the degree of trustworthiness of the source object; the integrity identifier is used to identify whether the source object itself is complete; and the referability identifier is used to identify whether the source object can be directly referenced in the output information of the large language model.

[0044] By modeling the source objects, the large language model generation scenario can distinguish between facts from user statements, facts from authoritative databases, statements from ordinary web pages, and content inferred from within the model, thereby avoiding treating all source objects the same.

[0045] Furthermore, a candidate assertion is the smallest semantic unit in a candidate response skeleton or draft response that can be supported or refuted by evidence, generated by the large language model before generating the final output information. Candidate assertions can include one or more of the following types of assertions: factual statements, time-sensitive facts, numerical facts, causal inferences, legal or policy judgments, advisory conclusions, summary conclusions, and statements of uncertainty.

[0046] Understandably, different types of candidate assertions may have different requirements for the support of the source object. For example, time-sensitive facts require the source object to have a relatively recent timestamp; numerical facts require the existence of locatable data records in the source object; legal or policy judgments need to come from authoritative text sources or clearly state that they are inferential conclusions; and advisory conclusions need to distinguish between their factual basis and scope of advice.

[0047] In some embodiments, for any candidate assertion, the candidate assertion may include at least one of the following: assertion fragment, assertion type, risk level, evidence type requirement, identifier of the source object supporting the candidate assertion, degree of source support, and evidence boundary crossing identifier.

[0048] Among them, the assertion fragment is the text content of the candidate assertion; the risk level is used to quantify the risk of the content expressed by the candidate assertion; the evidence type requirement is used to indicate the type of source object that can support the candidate assertion; the source support level is used to indicate the degree of support of all source objects for the candidate assertion. The source support level can be empty initially and is filled with a real value after obtaining evidence association information or source sufficiency information; the evidence boundary overrun indicator is used to indicate whether the candidate assertion exceeds the evidence boundary jointly defined by all source objects. The evidence boundary overrun indicator can be empty initially and is filled with a real value after obtaining source sufficiency information.

[0049] Step 120: Based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, determine the source sufficiency information, which reflects the sufficiency of all source objects in supporting the proposed output conclusion, which includes all candidate assertions.

[0050] Specifically, after obtaining each source object, at least one of the following can be determined: timeliness, credibility, and completeness.

[0051] For any source object, timeliness refers to the validity of the source object over time, or whether the source fragments contained within the source object still have reference value at the current time. Timeliness can be assessed through factors such as the difference between the timestamp of the source object and the current time, and the knowledge update cycle of the domain to which the source object belongs.

[0052] Credibility refers to the evaluation value of a source object on the dimension of source reliability, reflecting the degree to which the source fragments contained in that source object are trusted. Credibility can be determined based on at least one of the following information: source type, source authority, document quality, tool signature, completeness, timeliness, and human annotation. For example, records from authoritative databases are generally more credible than statements from ordinary social media.

[0053] Completeness refers to the evaluation status of the source object in terms of content, reflecting whether the source fragment itself is complete, thereby avoiding misunderstandings caused by incomplete source fragments or taking things out of context.

[0054] Furthermore, after obtaining each source object and each candidate assertion, we can also calculate the evidence association information between each source object and each candidate assertion pairwise. This evidence association information can be understood as the alignment relationship information between each source object and each candidate assertion, used to describe at least one of the following: the degree of source support, the degree of source conflict, and the type of semantic association between the two.

[0055] In some embodiments, the evidence association information can be represented in matrix form as the evidentiary support role of each source object for each candidate assertion. The matrix can be structured with each source object as a row and each candidate assertion as a column, or vice versa. Each element in the matrix represents the support score, conflict score, and semantic association type between the source object and the candidate assertion in the corresponding row and column. For example, the semantic association type can be supportive, conflicting, neutral, or insufficient.

[0056] For example, evidence association information can be obtained by calculating the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object; or, for example, in a deployment scenario where the intermediate states of the large language model are accessible, intermediate features related to source dependencies can be extracted during the generation or evaluation of each candidate assertion by the large language model, and these intermediate features can be mapped to the support scores and conflict scores of each source object for each candidate assertion, thereby obtaining evidence association information. This embodiment of the invention does not specifically limit this.

[0057] After obtaining at least one of the timeliness, credibility, and completeness of each source object, as well as the evidentiary association information between each source object and each candidate assertion, the source sufficiency information can be determined. Here, the source sufficiency information reflects the degree to which all source objects support the proposed output conclusion composed of all candidate assertions. Source sufficiency information can contain information in multiple dimensions, such as a computable state description composed of source objects, candidate assertions, evidentiary association information, and evidentiary boundaries. In this embodiment of the invention, source sufficiency information can be understood as an endogenous state variable in the large language model generation process.

[0058] In some embodiments, during the determination of source sufficiency information, for each candidate assertion, the support score in the evidence association information of each source object supporting the candidate assertion, the credibility of each source object, and the timeliness can be aggregated to calculate the source support degree of the candidate assertion. Furthermore, the source conflict degree of the candidate assertion can be determined based on the conflict score in the evidence association information of each source object for the candidate assertion and the credibility of each source object. The degree of inference jump from supported evidence to the candidate assertion can also be assessed based on the semantic distance between the semantic range already supported by sources and the candidate assertion, reflecting the extent to which the candidate assertion exceeds the semantic boundaries directly supported by existing source objects. Based on this, for the overall proposed output conclusion, information such as retrieval support, source consistency, proportion of unsupported assertions, and global jump value can be calculated, thereby collectively constituting source sufficiency information to comprehensively reflect the sufficiency of all source objects in supporting the proposed output conclusion.

[0059] Step 130: Based on the source sufficiency information, constrain the generation process of the large language model, and obtain the output information of the large language model under the constraints of the source sufficiency information.

[0060] Specifically, after obtaining the source sufficiency information, it can be used as a control signal in the large language model generation process. During the generation of the final output information of the large language model, the generation strategy of the large language model can be dynamically adjusted according to the degree of evidence sufficiency reflected by the source sufficiency information. This allows the large language model to output credible conclusions with source annotations when the evidence is sufficient, and to reduce the degree of certainty of the output, trigger supplementary retrieval, request users to supplement materials, or refuse to output strong inference conclusions without source support when the evidence is insufficient.

[0061] Therefore, under the constraint of sufficient source information, the large language model can ultimately generate and output answer information to the user, which is referred to here as output information. Output information may include conclusive answers with source annotations, answers expressing conditional or uncertainties, explanations of insufficient evidence, source conflict prompts, or interactive prompts requiring the user to provide supplementary materials, etc. The specific content of the output information depends on the degree of sufficiency of evidence reflected by the sufficient source information.

[0062] In the above process, the sufficiency of the source information can also be regarded as the endogenous state constraint of the large language model, thereby shifting the governance of illusion from result correction to generation condition control. This allows the reliable control of the large language model to occur before and during generation, thereby suppressing the semantic generation drift of the large language model in long-link reasoning.

[0063] The large language model generation method provided in this invention combines source objects and candidate assertions in the large language model generation process to construct source sufficiency information that reflects the sufficiency of all source objects in supporting the proposed output conclusion. This information is then used as an endogenous state constraint in the large language model generation process. As a result, without relying on post-generation verification, strong inferences without source support can be directly suppressed during the large model generation process. This effectively reduces the probability of semantic drift and hallucinations in the large language model under insufficient evidence conditions, and improves the factual reliability, source traceability, and output controllability of the output information in high-risk scenarios.

[0064] Based on any of the above embodiments, the source sufficiency information includes at least one of the local jump value of each candidate assertion, the degree of source support, and the degree of source conflict, and / or at least one of the global jump value, the proportion of unsupported assertions, the source consistency, and the retrieval support of the proposed output conclusion. The local jump value is the inference jump value from the source object supporting the candidate assertion to the candidate assertion; the source support level is the degree of support of all source objects for the candidate assertion; the source conflict level is the degree of conflict between all source objects and the candidate assertion. The global jump value is the inference jump value from the source object supporting the proposed output conclusion to the proposed output conclusion; the proportion of unsupported assertions is the percentage of candidate assertions in the proposed output conclusion that are not supported by any source object; the source consistency is the degree of semantic uniformity between all candidate assertions and all source objects; and the retrieval support is the degree of support of all source objects for the proposed output conclusion.

[0065] Specifically, when determining the source sufficiency information in step 120, the source sufficiency information corresponding to each candidate assertion and the overall proposed output conclusion can be calculated from two levels: assertion-level local dimension and conclusion-level global dimension, thereby forming a more refined and comprehensive source sufficiency description.

[0066] In the assertion-level local dimension, for each candidate assertion, at least one of its local jump value, source support degree, and source conflict degree can be calculated as source sufficiency information for the assertion-level local dimension.

[0067] Furthermore, for each candidate assertion, the local jump value refers to the inference jump value from the source object supporting the candidate assertion to the candidate assertion itself. It measures the semantic distance between the current source object supporting the candidate assertion and the candidate assertion, i.e., the extent to which the candidate assertion exceeds the semantic scope directly carried by the existing source object. A larger local jump value indicates a longer and less direct inference chain from the source object supporting the candidate assertion to the candidate assertion, and correspondingly, a less likely candidate assertion is to be fully supported by the existing source object.

[0068] Source support level refers to the overall support level of all source objects for the candidate assertion, reflecting the overall sufficiency of all currently available source objects in supporting the candidate assertion. The higher the source support level, the more sufficient the source support for the candidate assertion; the lower the source support level, the more insufficient the source basis for the candidate assertion, and correspondingly, the higher the credibility risk of generating output information containing the candidate assertion.

[0069] Source conflict level refers to the degree of conflict between all source objects and the candidate assertion, reflecting the extent to which there is content among all currently available source objects that contradicts or opposes the candidate assertion. The higher the source conflict level, the stronger the doubt about the correctness of the candidate assertion by the source objects, and correspondingly, the greater the credibility risk of directly outputting the candidate assertion in the output information.

[0070] Furthermore, at the conclusion-level global dimension, for the overall conclusion to be output, at least one of the following can be calculated as the sufficiency information of the source: global jump value, proportion of no-support assertions, source consistency, and retrieval support.

[0071] Furthermore, the global jump value refers to the inference jump value from the source objects supporting the proposed output conclusion to the proposed output conclusion as a whole. It reflects the extent to which the proposed output conclusion exceeds the range that all available source objects can directly support at the semantic level. The larger the global jump value, the longer the inference chain of the proposed output conclusion as a whole, the more prone it is to semantic drift, and the higher the risk of generating the illusion of the proposed output conclusion.

[0072] The proportion of unsupported assertions refers to the percentage of candidate assertions in the proposed output conclusion that lack any supporting evidence from any source. A higher proportion of unsupported assertions indicates a large number of statements in the proposed output conclusion that lack supporting evidence, and consequently, a lower overall credibility of the output.

[0073] Source consistency refers to the degree of semantic unity between all candidate assertions and all source objects, reflecting the semantic consistency and coordination between the proposed output conclusion and the existing source objects. Higher source consistency indicates greater semantic unity and fewer conflicts between the proposed output conclusion and the source objects; lower source consistency indicates more statements in the proposed output conclusion that contradict the source objects, and correspondingly, a higher risk of misleading the output of that conclusion.

[0074] Search support refers to the degree of support that all source objects provide for the overall proposed output conclusion. It reflects the overall sufficiency of support for the proposed output conclusion from all currently available source objects. The higher the search support, the more sufficient the overall support for the proposed output conclusion from existing source objects; the lower the search support, the less sufficient the overall support for the proposed output conclusion from existing source objects.

[0075] In this embodiment of the invention, by constructing multi-dimensional indicators such as local jump value, source support degree, source conflict degree, global jump value, proportion of unsupported assertions, source consistency, and retrieval support from the assertion-level local dimension and the conclusion-level global dimension respectively, the precision and completeness of source sufficiency information are ensured, thereby providing conditions for imposing constraints on the large language model generation process and effectively improving the credibility and traceability of the output information.

[0076] Based on any of the above embodiments, in step 120, determining the sufficiency information of sources based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, includes at least one of the following: Based on the semantic distance between each candidate assertion and the source object supporting each candidate assertion, the local jump value of each candidate assertion is determined. The global jump value is determined based on the local jump values ​​of all candidate assertions; Based on the timeliness and credibility of each source object, and the support score in the evidence association information between each source object and each candidate assertion, the source support level of each candidate assertion is determined; Based on the source support level of all candidate assertions, determine the proportion of unsupported assertions and / or the retrieval support. Based on the credibility of each source object and the conflict score in the evidence association information between each source object and each candidate assertion, the degree of source conflict of each candidate assertion is determined; The source consistency is determined based on the degree of source conflict among all candidate assertions.

[0077] Specifically, for a candidate assertion, the source object supporting the candidate assertion can be obtained, and the assertion fragment of the candidate assertion and the source fragment of the source object can be extracted respectively. The semantic distance between the two can be calculated, and then the semantic distance can be mapped to the local jump value of the candidate assertion.

[0078] Semantic distance, in this context, is a metric measuring the distance between the assertion fragment of a candidate assertion and the source fragment of the source object supporting that candidate assertion in the semantic vector space, reflecting the degree of difference between the two at the semantic level. Semantic distance can be obtained by calculating the cosine or Euclidean distance between the semantic vectors corresponding to the assertion fragment and the source fragment, or by other methods; this embodiment of the invention does not specifically limit this method.

[0079] It should be noted that when a candidate assertion is supported by multiple source objects, the semantic distance between the source fragment of each source object and the assertion fragment of the candidate assertion can be calculated separately, and the minimum semantic distance of each source object can be taken, or the semantic distance of each source object can be weighted and aggregated to obtain the local jump value of the candidate assertion. This embodiment of the invention does not make specific limitations on this.

[0080] After obtaining the local jump values ​​of each candidate assertion, the global jump value of the overall proposed output conclusion can be calculated by aggregating the local jump values ​​of all candidate assertions. For example, the average of the local jump values ​​of all candidate assertions can be used as the global jump value of the overall proposed output conclusion.

[0081] Furthermore, for a given candidate assertion, the degree of source support for that assertion can be determined based on the timeliness and credibility of each source object, as well as the support score in the evidence association information between each source object and the candidate assertion. The support score in the evidence association information is used to quantitatively represent the strength of positive support for the candidate assertion from the source fragments of the source objects.

[0082] For example, the degree of source support for a candidate assertion can be expressed as: In the formula, Indicates the first The degree of source support for each candidate assertion; An aggregate function that aggregates all source objects; Information indicating evidence association The Middle The candidate assertion and the first Support scores among source objects For the first The credibility of the source object For the first The timeliness of the source object.

[0083] After obtaining the source support level of each candidate assertion, the proportion of unsupported assertions in the intended output conclusion can be determined based on this. Specifically, a source support level threshold can be preset, and candidate assertions with a source support level below this threshold can be judged as candidate assertions without source object support. Based on this, the number of candidate assertions judged as having no source object support among all candidate assertions in the intended output conclusion is counted, and the ratio of this number to the total number of candidate assertions is calculated, thus obtaining the proportion of unsupported assertions.

[0084] It should be noted that the threshold value for source support here can be adjusted according to the specific application scenario and risk level. For example, for high-risk scenarios such as political and legal security, medical and health care, and financial risk control, a relatively high threshold value for source support can be set; for low-risk scenarios, a correspondingly lower threshold value for source support can be set. This embodiment of the invention does not impose specific limitations on this.

[0085] Furthermore, after obtaining the source support level of each candidate assertion, the retrieval support level of the proposed output conclusion can be determined based on this. For example, the average source support level of all candidate assertions in the proposed output conclusion can be taken as the retrieval support level of the proposed output conclusion.

[0086] Furthermore, for a given candidate assertion, the degree of source conflict can be determined based on the credibility of each source object and the conflict score in the evidentiary association information between each source object and the candidate assertion. The conflict score in the evidentiary association information is used to quantitatively represent the degree of semantic contradiction between the source fragments of the source objects and the candidate assertion.

[0087] For example, the source conflict degree of a candidate assertion can be determined by taking the maximum weighted conflict score of all source objects. Furthermore, the source conflict degree of the candidate assertion can be expressed as: In the formula, Indicates the first The degree of source conflict for each candidate assertion; To take the maximum value for all source objects; Information indicating evidence association The Middle The candidate assertion and the first Conflict scores between source objects For the first The credibility of the source object.

[0088] After obtaining the source conflict level of each candidate assertion, the overall source consistency of the proposed output conclusion can be calculated by aggregating the source conflict levels of all candidate assertions. For example, the source conflict level of all candidate assertions can be averaged, and 1 minus the average can be used as the source consistency.

[0089] In this embodiment of the invention, based on at least one of the timeliness, credibility, and completeness of each source object, as well as the evidence association information between each source object and each candidate assertion, source sufficiency information is calculated from the assertion-level local dimension and the conclusion-level global dimension respectively. This enables the source sufficiency information to accurately and objectively reflect the true sufficiency of the source object in supporting the proposed output conclusion, providing a reliable quantitative basis for subsequently imposing constraints on the large language model generation process.

[0090] Based on any of the above embodiments, step 130, constraining the generation process of the large language model based on the source sufficiency information, includes at least one of the following: Based on at least one of the local jump value, source support degree, and source conflict degree of the candidate assertion, the large language model is controlled to include the expression form of the candidate assertion in the output information; Based on at least one of the global jump value, the proportion of no-support assertions, source consistency, and retrieval support of the proposed output conclusion, the content type included in the output information by the large language model can be controlled, or the large language model can be controlled to perform supplementary retrieval.

[0091] Specifically, the generation control process based on source sufficiency information can impose constraints on the generation process of the large language model at two levels: assertion level and conclusion level. At the assertion level (local dimension), source sufficiency information can control the expression form of candidate assertions in the output information. At the conclusion level (global dimension), source sufficiency information can control the content type of the output information or control the large language model to perform supplementary retrieval.

[0092] The expression form of candidate assertions in the output information refers to the language expression method adopted by the large language model in the output information to present candidate assertions. For example, it may include deterministic conclusive expressions, conditional expressions, uncertain expressions, citation annotation expressions, and inferential explanatory expressions.

[0093] Understandably, controlling the expression of candidate assertions is a fine-grained generation constraint achieved at the assertion granularity. This enables large language models to use an expression that matches the degree of evidence support for candidate assertions from different sources in the same output information, thereby preventing high-source-risk candidate assertions from appearing in the output information with the same certainty as low-source-risk candidate assertions.

[0094] For example, when the source support level of a candidate assertion is higher than the preset high support level threshold and the source conflict level is lower than the preset conflict level threshold, the large language model can be controlled to include the candidate assertion in the output information in a deterministic conclusive expression, and require the inclusion of a citation label of the corresponding source object to reflect that the candidate assertion has sufficient source evidence.

[0095] For example, when the source support level of a candidate assertion is higher than the preset medium support level threshold and the local jump value is less than the preset jump value threshold, the large language model can be controlled to change the expression of the candidate assertion in the output information from a deterministic conclusive expression to a conditional expression or an inferential explanatory expression.

[0096] For example, when the local jump value of a candidate assertion is higher than the preset jump value threshold, the large language model can be controlled to change the expression of the candidate assertion in the output information from a deterministic conclusive expression to a conditional expression or an inferential explanatory expression, or the large language model can be controlled to distinguish between facts and inferences in the output information.

[0097] For example, when the source support, source conflict, and local jump value of a candidate assertion do not meet the above conditions, the large language model can be controlled to suppress or refuse to express the candidate assertion in the form of a strong conclusion in the output information.

[0098] In addition, the content type of the output information, that is, the overall category of information content contained in the output information by the large language model, can include complete and credible conclusive answers with source citations, partially conclusive answers with uncertainty statements, source conflict warnings, insufficient evidence statements, interactive prompts requiring users to provide supplementary materials, etc.

[0099] It is understandable that the control over the type of output information content or the control over supplementary retrieval are macro-level generation constraints implemented at the overall level of the proposed output conclusion. Together with the control over the assertion-level expression form, they can form a complete generation constraint system based on the sufficiency of source information.

[0100] For example, when the total number of source objects is less than a preset quantity threshold, or when the retrieval support of the intended output conclusion is less than a preset support threshold, the large language model can be controlled to perform supplementary retrieval. This means triggering the large language model to initiate new retrieval requests to knowledge bases, search engines, databases, or external tools, or the large language model can be controlled to generate interactive prompts that require users to provide supplementary materials, guiding users to provide additional evidence.

[0101] For example, when the source consistency of the proposed output conclusion is lower than the preset consistency threshold, it indicates that there is a significant semantic conflict between the proposed output conclusion and the existing source objects. In this case, the large language model can be controlled to add source conflict prompts to the content type of the output information, clearly explaining the conflict between the existing source objects, and prohibiting the large language model from giving a single definite conclusion in the output information.

[0102] For example, when the proportion of unsupported assertions in the proposed output conclusion is higher than the preset unsupported proportion threshold, it indicates that a large proportion of candidate assertions in the proposed output conclusion lack support from the source object. This can control the large language model to avoid strong conclusive answers in the content type of the output information and only include insufficient evidence statements in the content type of the output information.

[0103] It should be noted that the values ​​of the above-mentioned thresholds can be adjusted according to the specific application scenario and risk level. For example, for high-risk scenarios such as law enforcement, healthcare, and financial risk control, relatively high thresholds can be set; for low-risk scenarios, correspondingly lower thresholds can be set. Furthermore, for high-risk scenarios, cross-validation of sources can also be required.

[0104] In this embodiment of the invention, the expression form of each candidate assertion in the output information is finely controlled based on the local jump value, source support degree, and source conflict degree at the assertion level local dimension. At the same time, the content type of the output information or the triggering of supplementary retrieval is macroscopically controlled based on the global jump value, the proportion of unsupported assertions, source consistency, and retrieval support at the conclusion level global dimension. This achieves a two-level generation constraint from the assertion granularity to the overall conclusion, enabling the large language model to adjust the expression mode and content range of the output information according to the actual source support degree obtained by each candidate assertion and the overall proposed output conclusion. This effectively reduces the probability of strong assertions without source evidence entering the final output information, and improves the expression accuracy, conclusion traceability, and output controllability under different source sufficiency levels.

[0105] Based on any of the above embodiments, step 130, which involves constraining the generation process of the large language model based on the source sufficiency information, further includes: Based on the source support level of the candidate assertion, and at least one of the source fragment, source type, credibility, and timestamp of the source object supporting the candidate assertion, the large language model is controlled to mark the source status of the candidate assertion in the output information.

[0106] Specifically, based on the source sufficiency information such as the local jump value, source support degree, and source conflict degree of the candidate assertion, the expression form of each candidate assertion in the output information can be controlled. Furthermore, for each candidate assertion, based on its source support degree and at least one of the source fragments, source types, credibility, and timestamps of the source objects supporting the candidate assertion, the large language model can be controlled to mark the corresponding source status of the candidate assertion in the output information, thereby providing users with traceable source records at the source annotation level.

[0107] Here, source status refers to the tagging information attached to a candidate assertion in the output information, used to describe the relationship between the candidate assertion and its supporting source objects. Source status can be an identifier of the source object supporting the candidate assertion, or it can be an identifier indicating insufficient inference, hypothesis, or evidence for the candidate assertion when it lacks sufficient supporting source objects. This allows users to intuitively understand the source basis of each candidate assertion in the output information, effectively reducing the problems of false citations and citation decoration.

[0108] In some embodiments, for each allowed output candidate assertion, i.e., for each candidate assertion contained in the output information, a source chain is modeled, and the large language model is controlled to mark the source state for the candidate assertion in the output information based on the source chain.

[0109] Here, the source chain may include the identifier of the candidate assertion, the identifier of the source object supporting the candidate assertion, the source fragment in the source object supporting the candidate assertion, the source type in the source object supporting the candidate assertion, the credibility of the source object supporting the candidate assertion, the timestamp of the source object supporting the candidate assertion, the source support level of the candidate assertion, and the source status of the candidate assertion.

[0110] In the method provided in the embodiments of the present invention, based on the source support degree of the candidate assertion and at least one of the source fragment, source type, credibility and timestamp of the supporting source object, a structured source status is marked for each candidate assertion in the output information. This enables the output information of the large language model to not only reflect the sufficiency of evidence in the expression form, but also to provide a traceable source basis record for each candidate assertion at the source annotation level, effectively solving the problems of false citation and citation decoration in traditional citation generation schemes.

[0111] Based on any of the above embodiments, the large language model generation method further includes: Based on the source sufficiency information, the currently supported evidence boundary is determined, and the large language model is constrained to generate the output information within the evidence boundary.

[0112] Here, the evidence boundary is used to define the semantic range that all current source objects can support, and can also be understood as the boundary of the content range of output information that the large language model is allowed to generate. For example, the evidence boundary may only support the output of factual summaries, but not causal inferences or conclusive judgments; it may support the output of descriptions of historical facts, but not definitive statements of the current state; it may support the output of statements based on the perspective of a single source object, but not definitive conclusions integrating multiple sources; it may support the output of descriptive answers, but not advisable actions; or it may support the output of explanatory statements in low-risk scenarios, but not high-impact decision-making recommendations, etc.

[0113] Once the sufficiency of sources is determined, the boundaries of currently supported evidence can be generated based on this information. It is understandable that the higher the level of source support, the better the source consistency, and the smaller the leaps in inference reflected by the source sufficiency information, the wider the boundaries of currently supported evidence, and the more certain the conclusions that the large language model is allowed to output. Conversely, the lower the level of source support, the worse the source consistency, and the greater the leaps in inference, the narrower the boundaries of currently supported evidence, and the lower the degree of certainty in the conclusions that the large language model is allowed to output, potentially even being limited to outputting only statements of insufficient evidence or expressions of uncertainty.

[0114] For example, the boundaries of currently supported evidence can be generated based on the degree of source support for each candidate assertion in the source sufficiency information.

[0115] After determining the currently supported evidence boundary, the large language model can be constrained to generate output information based on this boundary. Furthermore, if a candidate assertion falls within the currently supported evidence boundary, the large language model is allowed to include the corresponding content in the output information. If a candidate assertion exceeds the currently supported evidence boundary, the large language model is controlled to perform deletion, downgrading, or annotation processing on that candidate assertion. For example, it might replace a definitive statement exceeding the evidence boundary with an uncertain expression, directly delete the content from the output information, or explicitly annotate the content in the output information to inform the user that it exceeds the current evidence support range.

[0116] In this embodiment of the invention, the currently supported evidence boundary can be determined based on the sufficiency information of the source, and the evidence boundary can be used as a constraint to limit the output information generated by the large language model, thereby effectively blocking strong inferential statements that exceed the scope of evidence support from entering the final output information, and further reducing the probability of the large language model generating hallucinations due to insufficient evidence in high-risk scenarios.

[0117] Based on any of the above embodiments, step 130, constraining the generation process of the large language model based on the source sufficiency information, includes: Based on the source sufficiency information, at least one of the following is determined: jump penalty, no support penalty, reference gain, and uncertainty expression gain; Based on at least one of the strong assertion markers, sourceless factual expression markers, citation generation markers, and uncertainty expression markers when the large language model generates lexical units in the output information, and at least one of the jump penalty, no support penalty, citation gain, and uncertainty expression gain, the first probability distribution of the lexical units is adjusted to obtain the second probability distribution of the lexical units; The large language model is controlled to generate the output information based on the second probability distribution of the lexical units.

[0118] Specifically, in deployment scenarios where the decoding probability distribution of a large language model is accessible, source sufficiency information can be directly applied to the probability distribution of each word in the output information generated by the large language model, thereby achieving dynamic constraints on the large language model generation process at the decoding level.

[0119] After obtaining source sufficiency information, at least one of the following can be determined: jump penalty, no support penalty, reference gain, and uncertainty expression gain.

[0120] Among them, the jump penalty refers to the penalty coefficient determined based on the degree of inference jump reflected in the source sufficiency information, used to suppress the generation of strongly inferential lexical units by the large language model. The no-support penalty refers to the penalty coefficient determined based on one or more of the following reflected in the source sufficiency information: the proportion of no-support assertions, the degree of source support, and source consistency, used to suppress the generation of factual lexical units without source object support by the large language model. The citation gain refers to the gain coefficient determined based on the source support reflected in the source sufficiency information, used to promote the generation of source annotations, citation descriptions, or restrictive expressions in the output information by the large language model. The uncertainty expression gain refers to the gain coefficient determined based on the degree of source conflict, the degree of inference jump, or the proportion of no-support assertions reflected in the source sufficiency information, used to promote the generation of uncertainty description lexical units in the output information by the large language model.

[0121] Based on this, at least one of the following tags—strong assertion tag, sourceless factual expression tag, citation generation tag, and uncertainty expression tag—that the large language model uses when generating lexical units in the output information can be combined with at least one of the following tags—jump penalty, no support penalty, citation gain, and uncertainty expression gain—determined based on source sufficiency information. This adjusts the first probability distribution of lexical units in the output information, resulting in a second probability distribution. It is understood that this adjustment to the first probability distribution can be continuously performed during the decoding process of the large language model; that is, the probability distribution can be adjusted for lexical units at each decoding time step.

[0122] Here, the first probability distribution refers to the original probability distribution calculated by the large language model for the lexical units in the generated output information based on the current context and decoding state, without imposing source sufficiency constraints. Strong assertion markers are identifiers indicating that the lexical units generated by the large language model belong to strong assertion lexical categories or conclusive expressions; jump penalties are used to adjust these strong assertion markers. Source-unsupported factual expression markers are identifiers indicating whether the current lexical unit belongs to a source-unsupported factual expression lexical unit during the large language model's lexical unit generation process; no-support penalties are used to adjust these source-unsupported factual expression markers. Citation generation markers are identifiers indicating whether the current lexical unit is conducive to generating source annotations, citation numbers, citation descriptions, or restrictive source expressions during the large language model's lexical unit generation process; citation gain is used to adjust these citation generation markers. Uncertainty expression markers are identifiers indicating whether the current lexical unit is conducive to generating uncertainty description lexical units during the large language model's lexical unit generation process; uncertainty expression gain is used to adjust these uncertainty expression markers.

[0123] Therefore, regarding the first part of the output information generated by the large language model When there are n words, assume that the first probability distribution of the word in the unconstrained state is as follows: The second probability distribution of the lexical units can be obtained by adjusting the above-mentioned markers and corresponding penalties or gains. : In the formula, for Information on the sufficiency of the sources of rounds, , , and Based on source sufficiency information Deterministic jump penalty, unsupported penalty, reference gain, and undetermined expression gain; , , and The first Strong assertion markers, sourceless factual expression markers, citation-generated markers, and uncertainty expression markers for each word element.

[0124] Understandably, in When there is sufficient evidence, , Reduce, large language models can be based on Generate a conclusive answer from the output information; In cases where the evidence is insufficient, , improve, and It also improves upon the large language model. The output information is more likely to include citations, qualifiers, explanations of insufficient evidence, or supplementary search suggestions.

[0125] This yields the second probability distribution of lexical units in the output information of the large language model. It can be understood that the second probability distribution is a dynamically adjusted lexical probability distribution under the constraint of source sufficiency information. Compared to the first probability distribution, the second probability distribution internalizes the source sufficiency state into a generation bias at the decoding level.

[0126] After obtaining the second probability distribution of lexical units, the large language model samples or decodes lexical units based on the second probability distribution of the corresponding position rather than the first probability distribution when generating each lexical unit in the output information. This ensures that the final output information is constrained by the sufficiency of the source information as a whole, and the lexical unit generation tendency in the output information is consistent with the sufficiency of the current evidence.

[0127] In the large language model generation method provided in this embodiment of the invention, the first probability distribution of each word in the large language model decoding process is adjusted based on the source sufficiency information to obtain a second probability distribution. Then, the large language model is controlled to generate output information based on the second probability distribution, realizing refined endogenous constraints on the large language model generation process at the decoding level. This improves the factual reliability and source traceability of the output information, and provides a feasible technical path for building a highly reliable large language model generation system in deployment scenarios with accessible model decoding layers.

[0128] Based on any of the above embodiments, step 130, constraining the generation process of the large language model based on the source sufficiency information, includes: Obtain multiple candidate output information generated by the large language model; Output control is performed on the multiple candidate output information based on the source sufficiency information.

[0129] Specifically, in closed model scenarios where the decoding probability distribution cannot be accessed, output control can be performed based on multiple candidate output information. Thus, without relying on access permissions to the model's internal state, effective constraints on the large language model generation process based on source sufficiency information can still be achieved.

[0130] Here, multiple candidate output information refers to multiple candidate response texts generated by the large language model for the same input request. These multiple candidate output information may differ from each other in terms of content, expression, degree of certainty, and source citations.

[0131] After obtaining multiple candidate output information, the sufficiency information of the source can be used as the evaluation basis to perform control operations such as screening, reordering, rewriting or replacing multiple candidate output information, thereby determining the final output information to be output to the user from multiple candidate output information, or triggering further supplementary retrieval or generating retry when all candidate output information does not meet the evidence boundary requirements reflected by the sufficiency information of the source.

[0132] For example, multiple candidate outputs can be reordered based on source sufficiency information, with the top-ranked candidate output becoming the final output of the large language model. Another example is filtering out strong inferences without a source from multiple candidate outputs based on source sufficiency information. Yet another example is performing source support verification on each assertion in the candidate outputs based on source sufficiency information, replacing unsupported assertions with insufficient evidence explanations, or triggering retrieval or tool calls to control the large language model to regenerate. Thus, the final output can be limited to within the evidence boundaries.

[0133] In this embodiment of the invention, by acquiring multiple candidate output information generated by a large language model and performing output control operations on the multiple candidate output information based on source sufficiency information, a generation control effect equivalent to internal decoding constraints is achieved without accessing the internal decoding state of the large language model. This enables the large language model generation method to be compatible with closed large language model deployment scenarios that only provide text output interfaces.

[0134] For example, Figure 2 This is a schematic diagram of the large language model generation control flow provided by the present invention, such as... Figure 2 As shown, after obtaining source sufficiency information, this information can be judged using thresholds and evidence boundaries, and then mapped to the following four types of control actions: allowing the large language model to output credible answers with citation annotations, controlling the large language model to output answers with reduced certainty, controlling the large language model to perform supplementary searches or request users to provide supplementary materials, and controlling the large language model to suppress or refuse to output strong assertion conclusions. For example, Figure 2 The source sufficiency information input can include the source support level, source conflict level, local jump value, as well as the number of source objects, the timeliness of the source objects, and the risk level of the source objects for each candidate assertion. Under the threshold and evidence boundary, the threshold can include a high support level threshold, a medium support level threshold, a conflict level threshold, and a jump value threshold for local jump values ​​for the source support level. Furthermore, the above thresholds can be adaptively increased when the risk level is high.

[0135] Furthermore, in order to achieve the above four types of control actions, in Figure 2The document provides two implementation paths: one for open models and one for closed APIs. The path for open models involves dynamically adjusting the probability distribution of each word during the decoding process to achieve the aforementioned control actions. The path for closed APIs involves reordering, filtering, automatically rewriting, and triggering retrieval retries from multiple candidate outputs generated by the large language model to achieve equivalent control actions.

[0136] Based on any of the above embodiments, the large language model generation method further includes: Extract the source dependency features of the large language model in the process of generating or evaluating each candidate assertion, and determine the first association information between each source object and each candidate assertion based on the source dependency features; Based on the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object, the second association information between each source object and each candidate assertion is determined. Based on the first association information and / or the second association information, the evidence association information is determined.

[0137] Specifically, Figure 3 This is a schematic diagram of the process for determining evidence association information provided by the present invention, such as... Figure 3 As shown, there are two types of computational paths that can be used in parallel or selectively for determining evidence association information. These correspond to the acquisition paths for the first association information and the second association information, respectively. The results obtained from the two types of paths can be used individually or in combination to jointly constitute the final evidence association information.

[0138] Specifically, the acquisition path of the first association information is based on the source dependency features of the large language model during the generation or evaluation of each candidate assertion. These source dependency features are intermediate feature information generated internally by the large language model that relates to source dependencies. They reflect the degree of dependence of the large language model on each source object during its internal computation process when processing source object content and candidate assertion content. This can be used to characterize the extent to which a candidate assertion is driven by the content of a particular source object.

[0139] Furthermore, in open deployment scenarios where the intermediate states within a large language model are accessible, source dependency features can include hidden activation vectors of each layer of the large language model, attention distribution, lexical-level source alignment weights, log probabilities of output lexical units, contribution of context fragments, and external attribution scores, etc.

[0140] For example, in large language models with encoder-decoder architectures that support cross-attention structures, retrieval-enhanced readers, or large language models with explicit source memory, the cross-attention weights of each word in the candidate assertion for each word in each source object can be extracted as source dependency features. In large language models with only decoder architectures, the degree of source dependency of each word in the candidate assertion for the content of each source object can be extracted as source dependency features based on self-attention attribution analysis, word contribution estimation within the context window, hidden layer similarity calculation, or output probability change estimation.

[0141] After extracting the source dependency features, the first association information between each candidate assertion and each source object can be determined based on the source dependency features of each candidate assertion.

[0142] For example, a pooling operation can be performed on the source dependency weights of all terms contained in a candidate assertion to obtain the source dependency distribution of the candidate assertion to each source object, i.e.: In the formula, Indicates the first Candidate assertions With the Source objects The degree of source dependence between them; Indicating targeting All morphemes Perform pooling, Indicates word elements and The source-dependent weights between them can specifically be attention weights.

[0143] Building upon this, a support mapping function can be used to map the aforementioned source dependency distribution into support scores and conflict scores for each source object on each candidate assertion, thereby forming the first association information. Here, the support mapping function can be a mapping head network or a regularized mapping function.

[0144] The second path for obtaining related information is specifically determined based on the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object. Here, semantic relevance refers to the degree of similarity or association between the assertion fragment and the source fragment at the semantic level, reflecting their closeness in semantic content. For example, the assertion fragment and the source fragment can be input into a vector embedding model to obtain their respective semantic vectors, and then the cosine similarity between the semantic vectors can be calculated to measure the semantic relevance between them.

[0145] Furthermore, in deployment scenarios with closed models or those accessible only via APIs, the second association information can be determined through semantic relevance. Additionally, in open deployment scenarios with access to the intermediate states within a large language model, the second association information can also be determined based on semantic relevance.

[0146] In some embodiments, at least one of the support score, conflict score, and semantic association between the candidate assertion and the source object can be directly evaluated based on semantic relevance to obtain the second association information; or, semantic relevance can be used as a recall condition for the source object to filter the source objects related to the candidate assertion, and then at least one of the support score, conflict score, and semantic association is evaluated for the candidate assertion and the source objects related to it to obtain the second association information. The embodiments of the present invention do not specifically limit this.

[0147] After obtaining the first and / or second association information, the first or second association information can be directly used as evidence association information, or the first and second association information can be combined as evidence association information. Evidence association information describes the alignment relationship between each source object and each candidate assertion, and its structured representation may include at least one of the following: support score, conflict score, and semantic relationship type for each pair of source object and candidate assertion combinations.

[0148] For example, in Figure 3 The matrix displays the support score, conflict score, and semantic relationship type between each source object and each candidate assertion. Figure 3 To simplify the expression, each element in the matrix only shows the semantic relationship type and the dominant score corresponding to that semantic relationship type. For example, the semantic relationship type between candidate assertion 1 and source object 1 is supportive, with a support score of 0.91; the semantic relationship type between candidate assertion 3 and source object 1 is insufficient, with a support score of 0.15; and the semantic relationship type between candidate assertion 2 and source object 3 is conflicting, with a conflict score of 0.62.

[0149] Figure 4 This is a schematic diagram of the data structure of the source object and candidate assertions provided by the present invention, as shown below. Figure 4 As shown, there are two different types of associations between the source object and the candidate assertion: quantitative support relationships and semantic relationship types. Quantitative support relationships can include the source object that supports the candidate assertion, as well as the support score and conflict score of the source object relative to the candidate assertion. Semantic relationship types are qualitative representations of the relationship between the candidate assertion and the source object, such as support, conflict, neutrality, or insufficiency.

[0150] In this embodiment of the invention, source dependency features within a large language model can be extracted to obtain first association information, and semantic correlation between assertion fragments and source fragments can be used to obtain second association information. Thus, evidence association information can be accurately calculated in both open and closed model deployment scenarios, providing a reliable data foundation for the accurate construction of source sufficiency information.

[0151] Based on any of the above embodiments, the step of determining the second association information between each source object and each candidate assertion based on the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object includes: If the semantic relevance between the assertion fragment of the candidate assertion and the source fragment of the source object is greater than the relevance threshold, the assertion fragment and the source fragment are input into the natural language inference model to obtain the implication probability, contradiction probability and neutral probability between the assertion fragment and the source fragment output by the natural language inference model. The second associated information is determined based on the implied probability, contradictory probability, and neutral probability between the assertion fragment and the source fragment.

[0152] Specifically, in determining the second association information, the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object can first be evaluated. For example, the cosine similarity of dense vectors can be calculated using a dual-tower network. Based on this, the semantic relevance can be compared with a pre-set relevance threshold. Only when the semantic relevance is greater than the threshold is the candidate assertion and the source object considered to have value for further logical inference analysis.

[0153] If the semantic relevance is greater than the relevance threshold, both the assertion fragment and the source fragment can be input into the Natural Language Inference (NLI) model. The NLI model can output probability distributions in three logical dimensions based on the input assertion fragment and source fragment: implication probability, contradiction probability, and neutral probability. The implication probability represents the probability that the source fragment logically fully supports and can deduce the candidate assertion; the contradiction probability represents the probability that the source fragment and the candidate assertion conflict or are mutually exclusive in fact or logic; and the neutral probability represents the probability that the source fragment neither proves nor disproves the candidate assertion, and there is no direct logical inference relationship between the two.

[0154] Therefore, the second association information can be determined by combining the implied probability, the conflict probability, and the neutral probability. For example, the implied probability can be multiplied by the cosine similarity, which represents semantic relevance, and the result can be used as the support score in the second association information; and the conflict probability can be directly used as the conflict score in the second association information. In addition, the semantic relationship type between the candidate assertion and the source object can be determined based on the support score, conflict score, and neutral probability, and then incorporated into the second association information.

[0155] In this embodiment of the invention, under the premise that the semantic relevance is greater than the relevance threshold, a natural language reasoning model is introduced to calculate the probability of implication, contradiction and neutrality to determine the second related information. Firstly, based on the relevance threshold, pre-filtering is performed, which greatly saves computing resources and improves processing efficiency. Secondly, based on the natural language reasoning model, deep logical inference is realized, which enables the second related information to more accurately quantify the degree of support or conflict of the source object for the candidate assertion.

[0156] Based on any of the above embodiments, in step 120, determining the sufficiency information of sources based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, includes: Based on at least one of the timeliness, credibility, and completeness of each source object in the current generation process of the large language model, as well as the evidence association information between each source object and each candidate assertion in the current generation process, the sufficiency information of the new source is determined. Based on the source sufficiency information from the historical generation process and the newly added source sufficiency information, the source sufficiency information for the current generation process is determined.

[0157] Specifically, in multi-turn question-answering scenarios or multi-step intelligent agent tasks, large language models do not execute a single, independent generation process, but rather there is a relationship of information transfer and state continuation between multiple generation processes. The source object obtained in each generation process, the generated candidate assertions, and the source sufficiency information determined based on the evidentiary association information between the source object and the candidate assertions may all change as the dialogue rounds progress, the user provides new materials, the tool returns new results, or updated sources are retrieved. To address these scenarios, this invention proposes a scheme that combines historical source sufficiency information with newly added source sufficiency information to determine the source sufficiency information in the current generation process, thereby achieving dynamic updates and reinjection of the source sufficiency state across rounds.

[0158] The newly added source sufficiency information here refers to the source objects newly collected during the generation process based on the large language model, as well as the evidentiary association information between each source object and each candidate assertion during the generation process. Following the aforementioned method for determining source sufficiency information, this information is specifically determined for the newly introduced source objects during the generation process. The newly added source sufficiency information only reflects the degree to which the newly added source objects support the proposed output conclusion during this generation process and does not include the source sufficiency status accumulated in previous generation processes.

[0159] The source sufficiency information in the historical generation process refers to the source sufficiency information identified and recorded by the system in one or more historical generation processes prior to the current generation process. This source sufficiency information reflects the assessment results of the adequacy of the accumulated source objects in supporting the intended historical output conclusion up to the start of the current generation process.

[0160] When determining the sufficiency information of sources in the current generation process, the sufficiency information of sources from historical generation processes can be fused with the newly added sufficiency information. For example, indicators such as the degree of source support, the degree of source conflict, and the degree of inference jump recorded in the historical sufficiency information can be weighted and merged with the corresponding indicators in the newly added sufficiency information to serve as the sufficiency information of sources in the current generation process. Therefore, the sufficiency information of sources in the current generation process not only reflects the sufficiency of evidence for newly introduced source objects but also incorporates the sufficiency states accumulated in the historical generation process. This allows for the continuous maintenance of a dynamically updated sufficiency state that evolves with the generation process in multi-turn dialogue or multi-step agent tasks.

[0161] For example, Figure 5 This is a schematic diagram of the recharge structure for the sufficiency of source information provided by the present invention, as shown below. Figure 5 As shown, in each generation process, the allowed candidate assertions and the source objects supporting those candidate assertions are jointly written into a source chain record. This source chain record can contain information such as candidate assertion identifier, source object identifier, source fragment, semantic relationship type, support score, control action, and evidence boundary. This source chain record then enters the audit module and, as source sufficiency information from the historical generation process, is fed back into the next generation process. It is used to combine with newly added source sufficiency information in the next generation process to determine the source sufficiency information in the next generation process, thus forming a closed loop of source sufficiency status updates across rounds. The audit module can store assertions, source chains, source sufficiency information, control strategies, final output information, and version information.

[0162] In some embodiments, historical adequacy information can be represented as: In the formula, That is, in the first The sufficiency of historical sources used in the generation process of the wheel. , 、 、 、 They were respectively in the second Source sufficiency information, newly added source objects, candidate assertions, and the first round of generation process. The output information of the wheel and the first User or tool feedback on the wheel. For pre-set or trained mapping functions.

[0163] Furthermore, during each generation process, source sufficiency information can be recalculated whenever the user provides new material, the tool returns new results, or an updated source is retrieved. Additionally, if a newly added source object conflicts with a historical source object, source consistency can be updated in real time; and if a newly added source object fills in previously missing evidence, the evidence boundaries can be updated, thereby allowing the large language model to generate more definitive output information.

[0164] In the method provided in this embodiment of the invention, by combining the source sufficiency information accumulated in the historical generation process with the newly added source sufficiency information determined by the newly added source object in the current generation process, the source sufficiency information is dynamically updated and fed back across rounds in multi-round question answering or multi-step intelligent agent tasks. This enables the large language model to make full use of the evidence state accumulated in the historical generation process in each generation process, thereby continuously maintaining source sufficiency information that accurately reflects the global evidence accumulation state, and further improving the factual reliability and traceability of the information output by the large language model in multi-round interaction scenarios.

[0165] Based on any of the above embodiments Figure 6 This is the second flowchart of the large language model generation method provided by the present invention, as shown below. Figure 6 As shown, the method may include: First, obtain the current user request and input the user request into the large language model.

[0166] In addition, user requests are parsed to obtain the task type or risk level corresponding to the user request.

[0167] Next, the source objects used by the large language model in the current generation process are collected, and the candidate assertions generated by the large language model in the current generation process are obtained. The source object obtained from modeling may include at least one of the following: source fragment, source type, source location, timestamp, credibility, integrity identifier, and citation identifier; the candidate assertion obtained from modeling may include at least one of the following: assertion fragment, assertion type, risk level, evidence type requirement, identifier of the source object supporting the candidate assertion, source support level, and evidence boundary crossing identifier.

[0168] Subsequently, evidence association information between each source object and each candidate assertion can be calculated. This evidence association information may include the support score and conflict score of each source object for each candidate assertion, as well as the semantic relationship type between each source object and each candidate assertion.

[0169] Once the evidence association information is obtained, source sufficiency information can be constructed. For example, source sufficiency information may include the number of source objects, the overall credibility score of the source objects, source consistency, retrieval support, global jump value, proportion of unsupported assertions, the timeliness of the source objects, evidence boundaries, source chains, and control actions. These control actions may include allowing credible generation, requiring citations, reducing certainty, supplementing retrieval, requesting users to provide additional information, rejecting strong assertions, or halting high-risk outputs.

[0170] Once the source sufficiency information is obtained, the information chain can be updated, thereby obtaining new source sufficiency information that incorporates source sufficiency information from the historical generation process prior to the current generation.

[0171] After this, the sufficiency of the current evidence can be determined based on the new source sufficiency information. If it is sufficient, a reliable generation process is run, and the large language model outputs the conclusion and cited sources as output information. If it is insufficient, a control strategy is triggered, which controls the large language model to perform supplementary retrieval, reduce certainty, request supplementation, or reject strong assertions.

[0172] In addition, after completing the supplementary search or requesting supplementation, that is, after obtaining the new source object, the above process can be re-triggered to update the source sufficiency information.

[0173] In some embodiments, the large language model generation method provided by the present invention can be applied to the trusted control module of the RAG system, or to the middleware between the large model application server and the large model API, or embedded in an intelligent agent framework to control the generation of factual conclusions, tool output summaries and reports in multi-step tasks. The present invention does not specifically limit this.

[0174] In other embodiments, the large language model generation method can be used to implement auxiliary analysis for political and legal security.

[0175] When a user requests the system to assess the risk of an event based on several materials, the system can segment user-uploaded materials, retrieved documents, and database query results into source fragments. For each source fragment, credibility and timeliness are calculated, thereby constructing a source object for each fragment. Furthermore, candidate assertions generated by a large language model are obtained, which may include, for example, event time, participating entities, confirmed facts, potential risks, and recommended actions.

[0176] For each candidate assertion, evidence association information can be calculated. Based on this, if the candidate assertion "confirmed fact" is supported by multiple highly credible sources, the large language model is allowed to output the candidate assertion along with the source number; if the candidate assertion "potential risk" is inferred indirectly from a single source, the large language model is required to use conditional expressions; if the candidate assertion "recommendation" lacks sufficient sources or involves high-impact decisions, the large language model is prohibited from outputting definitive recommendations and only outputs a list of supplementary materials.

[0177] In some other embodiments, the large language model generation method can be used to implement enterprise knowledge base question answering.

[0178] When a user inquires whether a product currently supports a specific function, product documentation, version logs, and support ticket records can be retrieved to model the source object. If the version log timestamp is old and there is a conflict between the support ticket record and the documentation, the source reliability is marked as low in the source sufficiency information, and the timeliness is marked as pending confirmation. This allows the large language model to avoid outputting a definitive answer, instead prompting "existing information contains a conflict," listing the sources of the conflict, and triggering a retrieval of the latest version of the documentation.

[0179] After obtaining the latest version of the description through supplementary retrieval, the source adequacy information can be updated. Furthermore, when the sources are consistent and support is high, the output of the large language model can be controlled to include cited conclusions.

[0180] In some other embodiments, the large language model generation method can be used in closed model API scenarios.

[0181] In deployments where the model's decoding probability distribution, attention, or hidden state is inaccessible, multiple candidate outputs can be generated first using a closed, large language model. Then, assertion extraction and source alignment can be performed on these candidate outputs to obtain source sufficiency information. Furthermore, the candidate outputs can be sorted based on this source sufficiency information, and assertions exceeding the evidence boundary can be deleted or rewritten. If all candidate outputs contain strong assertions without a source, the large language model can be controlled to trigger supplementary retrieval or output an explanation of insufficient evidence.

[0182] The large language model generation apparatus provided by the present invention is described below. The large language model generation apparatus described below and the large language model generation method described above can be referred to in correspondence.

[0183] Figure 7 This is a schematic diagram of the structure of the large language model generation device provided by the present invention, as shown below. Figure 7 As shown, the device includes: The acquisition unit 710 is used to acquire the source objects and generated candidate assertions applied by the large language model during the generation process; Information construction unit 720 is used to determine source sufficiency information based on at least one of the timeliness, credibility and completeness of each source object, and the evidence association information between each source object and each candidate assertion. The source sufficiency information reflects the sufficiency of all source objects in supporting the proposed output conclusion, which includes all candidate assertions. The constraint unit 730 is used to constrain the generation process of the large language model based on the source sufficiency information, and to obtain the output information of the large language model under the constraint of the source sufficiency information.

[0184] The large language model generation apparatus provided in this invention combines the source objects and candidate assertions in the large language model generation process to construct source sufficiency information that reflects the sufficiency of all source objects in supporting the proposed output conclusion. This information is then used as an endogenous state constraint in the large language model generation process. As a result, without relying on post-generation verification, strong inferences without source support can be directly suppressed during the large model generation process. This effectively reduces the probability of semantic drift and hallucinations in the large language model under insufficient evidence conditions, and improves the factual reliability, source traceability, and output controllability of the output information in high-risk scenarios.

[0185] Based on the above embodiments, the source sufficiency information includes at least one of the following: local jump value of each candidate assertion, source support degree, and source conflict degree; and / or, at least one of the following: global jump value of the proposed output conclusion, proportion of unsupported assertions, source consistency, and retrieval support. The local jump value is the inference jump value from the source object supporting the candidate assertion to the candidate assertion; the source support level is the degree of support of all source objects for the candidate assertion; the source conflict level is the degree of conflict between all source objects and the candidate assertion. The global jump value is the inference jump value from the source object supporting the proposed output conclusion to the proposed output conclusion; the proportion of unsupported assertions is the percentage of candidate assertions in the proposed output conclusion that are not supported by any source object; the source consistency is the degree of semantic uniformity between all candidate assertions and all source objects; and the retrieval support is the degree of support of all source objects for the proposed output conclusion.

[0186] Based on any of the above embodiments, the information construction unit is used for at least one of the following: Based on the semantic distance between each candidate assertion and the source object supporting each candidate assertion, the local jump value of each candidate assertion is determined. The global jump value is determined based on the local jump values ​​of all candidate assertions; Based on the timeliness and credibility of each source object, and the support score in the evidence association information between each source object and each candidate assertion, the source support level of each candidate assertion is determined; Based on the source support level of all candidate assertions, determine the proportion of unsupported assertions and / or the retrieval support. Based on the credibility of each source object and the conflict score in the evidence association information between each source object and each candidate assertion, the degree of source conflict of each candidate assertion is determined; The source consistency is determined based on the degree of source conflict among all candidate assertions.

[0187] Based on any of the above embodiments, the constraint unit is specifically used for at least one of the following: Based on at least one of the local jump value, source support degree, and source conflict degree of the candidate assertion, the large language model is controlled to include the expression form of the candidate assertion in the output information; Based on at least one of the global jump value, the proportion of no-support assertions, source consistency, and retrieval support of the proposed output conclusion, the content type included in the output information by the large language model can be controlled, or the large language model can be controlled to perform supplementary retrieval.

[0188] Based on any of the above embodiments, the constraint unit is further configured to: Based on the source support level of the candidate assertion, and at least one of the source fragment, source type, credibility, and timestamp of the source object supporting the candidate assertion, the large language model is controlled to mark the source status of the candidate assertion in the output information.

[0189] Based on any of the above embodiments, the constraint unit is further configured to: Based on the source sufficiency information, the currently supported evidence boundary is determined, and the large language model is constrained to generate the output information within the evidence boundary.

[0190] Based on any of the above embodiments, the constraint unit is specifically used for: Based on the source sufficiency information, at least one of the following is determined: jump penalty, no support penalty, reference gain, and uncertainty expression gain; Based on at least one of the strong assertion markers, sourceless factual expression markers, citation generation markers, and uncertainty expression markers when the large language model generates lexical units in the output information, and at least one of the jump penalty, no support penalty, citation gain, and uncertainty expression gain, the first probability distribution of the lexical units is adjusted to obtain the second probability distribution of the lexical units; The large language model is controlled to generate the output information based on the second probability distribution of the lexical units.

[0191] Based on any of the above embodiments, the constraint unit is specifically used for: Obtain multiple candidate output information generated by the large language model; Output control is performed on the multiple candidate output information based on the source sufficiency information.

[0192] Based on any of the above embodiments, the information construction unit is further configured to: Extract the source dependency features of the large language model in the process of generating or evaluating each candidate assertion, and determine the first association information between each source object and each candidate assertion based on the source dependency features; Based on the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object, the second association information between each source object and each candidate assertion is determined. Based on the first association information and / or the second association information, the evidence association information is determined.

[0193] Based on any of the above embodiments, the information construction unit is specifically used for: If the semantic relevance between the assertion fragment of the candidate assertion and the source fragment of the source object is greater than the relevance threshold, the assertion fragment and the source fragment are input into the natural language inference model to obtain the implication probability, contradiction probability and neutral probability between the assertion fragment and the source fragment output by the natural language inference model. The second associated information is determined based on the implied probability, contradictory probability, and neutral probability between the assertion fragment and the source fragment.

[0194] Based on any of the above embodiments, the information construction unit is specifically used for: Based on at least one of the timeliness, credibility, and completeness of each source object in the current generation process of the large language model, as well as the evidence association information between each source object and each candidate assertion in the current generation process, the sufficiency information of the new source is determined. Based on the source sufficiency information from the historical generation process and the newly added source sufficiency information, the source sufficiency information for the current generation process is determined.

[0195] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a large language model generation method, which includes: Obtain the source objects and generated candidate assertions used in the generation process of the large language model; Based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, source sufficiency information is determined. The source sufficiency information reflects the degree to which all source objects support the proposed output conclusion, which includes all candidate assertions. Based on the source sufficiency information, the generation process of the large language model is constrained, and the output information of the large language model under the constraint of the source sufficiency information is obtained.

[0196] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to related technologies, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0197] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the large language model generation method provided by the above methods, the method comprising: Obtain the source objects and generated candidate assertions used in the generation process of the large language model; Based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, source sufficiency information is determined. The source sufficiency information reflects the degree to which all source objects support the proposed output conclusion, which includes all candidate assertions. Based on the source sufficiency information, the generation process of the large language model is constrained, and the output information of the large language model under the constraint of the source sufficiency information is obtained.

[0198] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the large language model generation method provided by the above methods, the method comprising: Obtain the source objects and generated candidate assertions used in the generation process of the large language model; Based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, source sufficiency information is determined. The source sufficiency information reflects the degree to which all source objects support the proposed output conclusion, which includes all candidate assertions. Based on the source sufficiency information, the generation process of the large language model is constrained, and the output information of the large language model under the constraint of the source sufficiency information is obtained.

[0199] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0200] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0201] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating large language models, characterized in that, include: Obtain the source objects and generated candidate assertions used in the generation process of the large language model; Based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, source sufficiency information is determined. The source sufficiency information reflects the degree to which all source objects support the proposed output conclusion, which includes all candidate assertions. Based on the source sufficiency information, the generation process of the large language model is constrained, and the output information of the large language model under the constraint of the source sufficiency information is obtained.

2. The method for generating large language models according to claim 1, characterized in that, The source sufficiency information includes at least one of the following: local jump value of each candidate assertion, source support degree, and source conflict degree; and / or at least one of the following: global jump value of the proposed output conclusion, proportion of unsupported assertions, source consistency, and retrieval support. The local jump value is the inference jump value from the source object supporting the candidate assertion to the candidate assertion; the source support level is the degree of support of all source objects for the candidate assertion; The source conflict level refers to the degree of conflict between all source objects and the candidate assertion; The global jump value is the inferred jump value from the source object supporting the proposed output conclusion to the proposed output conclusion; The proportion of unsupported assertions is the percentage of candidate assertions in the proposed output conclusion that are not supported by any source object; the source consistency is the degree of semantic uniformity between all candidate assertions and all source objects; and the retrieval support is the degree of support of all source objects for the proposed output conclusion.

3. The method for generating large language models according to claim 2, characterized in that, The determination of source sufficiency information based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, includes at least one of the following: Based on the semantic distance between each candidate assertion and the source object supporting each candidate assertion, the local jump value of each candidate assertion is determined. The global jump value is determined based on the local jump values ​​of all candidate assertions; Based on the timeliness and credibility of each source object, and the support score in the evidence association information between each source object and each candidate assertion, the source support level of each candidate assertion is determined; Based on the source support level of all candidate assertions, determine the proportion of unsupported assertions and / or the retrieval support. Based on the credibility of each source object and the conflict score in the evidence association information between each source object and each candidate assertion, the degree of source conflict of each candidate assertion is determined; The source consistency is determined based on the degree of source conflict among all candidate assertions.

4. The method for generating large language models according to claim 2, characterized in that, The process of constraining the generation of the large language model based on the source sufficiency information includes at least one of the following: Based on at least one of the local jump value, source support degree, and source conflict degree of the candidate assertion, the large language model is controlled to include the expression form of the candidate assertion in the output information; Based on at least one of the global jump value, the proportion of no-support assertions, source consistency, and retrieval support of the proposed output conclusion, the content type included in the output information by the large language model can be controlled, or the large language model can be controlled to perform supplementary retrieval.

5. The method for generating large language models according to claim 4, characterized in that, The process of constraining the generation of the large language model based on the source sufficiency information further includes: Based on the source support level of the candidate assertion, and at least one of the source fragment, source type, credibility, and timestamp of the source object supporting the candidate assertion, the large language model is controlled to mark the source status of the candidate assertion in the output information.

6. The method for generating a large language model according to claim 1, characterized in that, Also includes: Based on the source sufficiency information, the currently supported evidence boundary is determined, and the large language model is constrained to generate the output information within the evidence boundary.

7. The method for generating a large language model according to claim 1, characterized in that, The process of constraining the generation of the large language model based on the source sufficiency information includes: Based on the source sufficiency information, at least one of the following is determined: jump penalty, no support penalty, reference gain, and uncertainty expression gain; Based on at least one of the strong assertion markers, sourceless factual expression markers, citation generation markers, and uncertainty expression markers when the large language model generates lexical units in the output information, and at least one of the jump penalty, no support penalty, citation gain, and uncertainty expression gain, the first probability distribution of the lexical units is adjusted to obtain the second probability distribution of the lexical units; The large language model is controlled to generate the output information based on the second probability distribution of the lexical units.

8. The method for generating large language models according to claim 1, characterized in that, The process of constraining the generation of the large language model based on the source sufficiency information includes: Obtain multiple candidate output information generated by the large language model; Output control is performed on the multiple candidate output information based on the source sufficiency information.

9. The method for generating a large language model according to any one of claims 1 to 8, characterized in that, Also includes: Extract the source dependency features of the large language model in the process of generating or evaluating each candidate assertion, and determine the first association information between each source object and each candidate assertion based on the source dependency features; Based on the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object, the second association information between each source object and each candidate assertion is determined. Based on the first association information and / or the second association information, the evidence association information is determined.

10. The method for generating large language models according to claim 9, characterized in that, The second association information between each source object and each candidate assertion is determined based on the semantic relevance between the assertion fragments of each candidate assertion and the source fragments of each source object, including: If the semantic relevance between the assertion fragment of the candidate assertion and the source fragment of the source object is greater than the relevance threshold, the assertion fragment and the source fragment are input into the natural language inference model to obtain the implication probability, contradiction probability and neutral probability between the assertion fragment and the source fragment output by the natural language inference model. The second associated information is determined based on the implied probability, contradictory probability, and neutral probability between the assertion fragment and the source fragment.

11. The method for generating a large language model according to any one of claims 1 to 8, characterized in that, The determination of source sufficiency information based on at least one of the timeliness, credibility, and completeness of each source object, and the evidentiary association information between each source object and each candidate assertion, includes: Based on at least one of the timeliness, credibility, and completeness of each source object in the current generation process of the large language model, as well as the evidence association information between each source object and each candidate assertion in the current generation process, the sufficiency information of the new source is determined. Based on the source sufficiency information from the historical generation process and the newly added source sufficiency information, the source sufficiency information for the current generation process is determined.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the large language model generation method as described in any one of claims 1 to 11.