A large model hallucination suppression training method and system fused with real-time fact base verification
By constructing a real-time fact base graph and using geometrically biased weight optimization to optimize the large model, the dependence of large-scale language models on high-exposure sources in literature review tasks is solved, improving the credibility and academic rigor of the generated content and achieving consistency between the generated content and real literature evidence.
Patent Information
- Application Number
- CN202511824750.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-12-05
AI Technical Summary
Large-scale language models pose a risk of illusion in literature review tasks, as they rely heavily on high-profile sources when generating content and ignore newly emerging real data, leading to a decline in the credibility and academic rigor of the generated content.
By constructing a real-time fact base graph, calculating the discrete Ricci curvature and in-degree of nodes, and combining geometric debiasing weights and tail exponential loss, the evidence distribution is optimized. The gradient descent method is used to update the hyperparameters of the large model, correcting the model's bias towards highly cited and cross-community literature, and ensuring that the generated content matches the real literature evidence.
It significantly improves the factual reliability and academic rigor of the model-generated content, reduces the probability of illusory information, ensures smooth generation, and provides safe and reliable applications in fields such as scientific research and knowledge-sharing.
Smart Images

Figure CN121257756B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hallucination suppression technology, and more specifically, to a large-scale hallucination suppression training method and system that integrates real-time fact base verification. Background Technology
[0002] With the increasing application of large-scale language models in scientific research and knowledge-based tasks, the scenarios in which these models are used to generate reviews, reports, and cited texts have significantly increased. Literature review tasks require models to identify and integrate multi-source academic facts to form logically coherent and reliable arguments. To enhance the credibility of the generated content, researchers often introduce real-time fact bases or academic knowledge graphs as support, enabling the model to call external literature data for verification during the output process. However, as the size of the fact base expands and the update frequency increases, the model exposes new structured bias problems when connecting with search results: search results often show significant differences in citation volume, and popular documents appear repeatedly during training due to extensive reuse, thus creating a dependence on high-exposure sources.
[0003] In traditional training and fact-checking processes, models primarily select fact fragments based on text similarity or semantic matching scores. Because highly cited papers or review articles are semantically closer to most research topics, their textual features are more likely to match query content, leading to repeated selection during the fact retrieval phase. Simultaneously, citation networks exhibit a "rich get richer" structural characteristic: heavily cited papers are more likely to be cited again, and their texts are more representative in the corpus. The model reinforces this bias through multiple training rounds, causing its inherent generation probability distribution to concentrate on authoritative nodes. When the training objective is solely based on text matching errors, this bias remains uncorrected, gradually creating a structured illusion risk: the model outputs seemingly accurate citations, but their logical support comes from overused high-impact literature, rather than the most relevant sources of fact.
[0004] The aforementioned problems are particularly pronounced in literature review tasks. Model-generated reviews often cite renowned papers, reviews, or entries from authoritative journals, even if these sources do not match the specific arguments or are not the best evidence. They are misjudged as the most credible facts simply because of their high frequency of appearance in academic corpora. Furthermore, when the real-time fact base is updated rapidly or includes the latest research findings, the model may still adhere to older, highly cited literature, thus ignoring newly emerging real data. This phenomenon can cause systematic misguidance in automatically generated reviews, technical reports, or research abstracts, weakening the reliability and academic rigor of the model's output. Summary of the Invention
[0005] This invention provides a large model hallucination suppression training method and system that integrates real-time fact base verification, solving the technical problems mentioned in the background art.
[0006] In a first aspect, the present invention provides a large model hallucination suppression training method that integrates real-time fact base verification, comprising:
[0007] Construct a real-time fact graph and calculate the discrete Ricci curvature and in-degree of nodes in the real-time fact graph;
[0008] Based on the input query, candidate documents are retrieved from the real-time fact base graph, a neutral retrieval distribution is generated by combining the distribution smoothing parameter, and the discrete Ricci curvature and in-degree of each candidate document are read.
[0009] The geometric debiasing parameters are used to calculate the geometric debiasing weights of candidate documents. The neutral retrieval distribution is then reweighted and normalized using the geometric debiasing weights to obtain the target evidence distribution.
[0010] Candidate documents are coded, processed by a gating network, and combined with distribution smoothing parameters to generate an evidence use distribution. Negative log-likelihood loss is calculated based on the evidence use distribution.
[0011] Using the shortest path distance between nodes in the real-time fact base graph as the cost, and combining regularization parameters, we calculate the optimal transmission loss from the evidence distribution to the target evidence distribution.
[0012] The in-degree tail index is calculated based on the evidence distribution, and the tail index loss is calculated by combining the baseline in-degree tail index of the neutral retrieval distribution with the tail adjustment parameter.
[0013] The negative log-likelihood loss, optimal transmission loss, and tail exponential loss are weighted by loss weight parameters to obtain the total loss. The hyperparameters of the large model are then jointly updated using gradient descent until convergence.
[0014] Secondly, a large model hallucination suppression training system integrating real-time fact base verification, applied to any of the large model hallucination suppression training methods integrating real-time fact base verification, includes:
[0015] The graph construction module builds a real-time fact base graph and calculates the discrete Ricci curvature and in-degree of nodes in the real-time fact base graph.
[0016] The graph analysis module retrieves candidate documents from the real-time fact base graph based on the input query, generates a neutral retrieval distribution by combining the distribution smoothing parameter, and reads the discrete Ricci curvature and in-degree of each candidate document.
[0017] The evidence distribution calculation module uses geometric debiasing parameters to calculate the geometric debiasing weights of candidate documents, and then reweights and normalizes the neutral retrieval distribution using the geometric debiasing weights to obtain the target evidence distribution.
[0018] The likelihood loss calculation module encodes candidate documents, processes them through a gating network, and generates an evidence use distribution by combining distribution smoothing parameters. Based on the evidence use distribution, it calculates the negative log-likelihood loss.
[0019] The transmission loss calculation module uses the shortest path distance of nodes in the real-time fact base graph as the cost, and combines regularization parameters to calculate the optimal transmission loss of evidence distribution to target evidence distribution.
[0020] The exponential loss calculation module calculates the in-degree tail index based on the evidence distribution, and calculates the tail exponential loss by combining the baseline in-degree tail index of the neutral retrieval distribution and the tail adjustment parameter.
[0021] The hallucination suppression training module calculates the total loss by weighting the negative log-likelihood loss, optimal transmission loss, and tail exponential loss using loss weight parameters. It then uses gradient descent to jointly update the hyperparameters of the large model until convergence.
[0022] The beneficial effects of this invention include: by introducing a real-time fact base verification mechanism into the training process of large models, and combining graph structure geometric analysis and optimal transmission optimization, the factual reliability and academic rigor of the model-generated content are significantly improved. By calculating the discrete Ricci curvature and in-degree features of nodes in the real-time fact base graph, the model can identify and suppress structural bias towards highly cited and cross-community literature; by utilizing geometric debiasing weights and tail exponential constraints, the long-tail bias of the literature citation distribution is effectively corrected, thereby reducing the probability of the model generating illusory information. Simultaneously, by employing joint optimization of optimal transmission loss and negative log-likelihood loss, the evidence distribution is more accurately aligned with the factual support data, achieving consistency between the generated content and real literature evidence. Overall, this invention, while ensuring the smoothness of model generation, strengthens its factual consistency and retrieval verifiability, providing a systematic solution for the safe and reliable application of large models in scientific research, knowledge answering, and automated reviews. Attached Figure Description
[0023] Figure 1 This is a flowchart of a large model hallucination suppression training method that integrates real-time fact base verification according to the present invention;
[0024] Figure 2 This is a block diagram of a large model illusion suppression training system that integrates real-time fact base verification according to the present invention. Detailed Implementation
[0025] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.
[0026] Example 1
[0027] like Figure 1 As shown, a large model hallucination suppression training method integrating real-time fact base verification includes:
[0028] Construct a real-time fact graph and calculate the discrete Ricci curvature and in-degree of nodes in the real-time fact graph;
[0029] Based on the input query, candidate documents are retrieved from the real-time fact base graph, a neutral retrieval distribution is generated by combining the distribution smoothing parameter, and the discrete Ricci curvature and in-degree of each candidate document are read.
[0030] The geometric debiasing parameters are used to calculate the geometric debiasing weights of candidate documents. The neutral retrieval distribution is then reweighted and normalized using the geometric debiasing weights to obtain the target evidence distribution.
[0031] Candidate documents are coded, processed by a gating network, and combined with distribution smoothing parameters to generate an evidence use distribution. Negative log-likelihood loss is calculated based on the evidence use distribution.
[0032] Using the shortest path distance between nodes in the real-time fact base graph as the cost, and combining regularization parameters, we calculate the optimal transmission loss from the evidence distribution to the target evidence distribution.
[0033] The in-degree tail index is calculated based on the evidence distribution, and the tail index loss is calculated by combining the baseline in-degree tail index of the neutral retrieval distribution with the tail adjustment parameter.
[0034] The negative log-likelihood loss, optimal transmission loss, and tail exponential loss are weighted by loss weight parameters to obtain the total loss. The hyperparameters of the large model are then jointly updated using gradient descent until convergence.
[0035] In one embodiment of the present invention, constructing a real-time fact base graph and calculating the discrete Ricci curvature and in-degree of nodes in the real-time fact base graph includes:
[0036] Each document record in the real-time fact base is treated as a node, and all nodes form a node set; any citation relationship is treated as a directed edge, and all directed edges form an edge set; the real-time fact base graph is formed by the node set and the edge set.
[0037] For any two nodes in the real-time fact base graph, calculate the shortest path length at the cost of the number of edges, and use it as the graph shortest path distance between the two nodes;
[0038] For any node in the real-time fact base graph, construct a random walk measure, which includes a lazy parameter, a measure concentrated on the node, a set of adjacent nodes that are directly connected to the node, and the number of adjacent nodes in the set of adjacent nodes.
[0039] For any pair of adjacent nodes in the real-time fact base graph, calculate the first-order Wasserstein distance between the random walk measures corresponding to each of the adjacent nodes based on the graph shortest path distance of the pair of adjacent nodes; calculate the discrete Ricci curvature of the edge between the pair of adjacent nodes based on the first-order Wasserstein distance and the graph shortest path distance of the pair of adjacent nodes.
[0040] For any node in the real-time fact graph, count the number of adjacent nodes of the node, calculate the average of the discrete Ricci curvature of all the adjacent edges of the node, and use it as the discrete Ricci curvature of the node.
[0041] For any node in the real-time fact graph, count the number of directed edges ending at that node, and use that number as the in-degree of the node.
[0042] A node is a concrete representation of a single document record in a real-time fact base. A document record (such as a complete record of a paper or a patent) corresponds to a unique node; the node set is the overall set of nodes corresponding to all document records.
[0043] A directed edge is a concrete representation of the citation relationship between documents. The direction is from the node corresponding to the citing document to the node corresponding to the cited document (e.g., if document A cites document B, the starting point of the edge is the node corresponding to A, and the ending point is the node corresponding to B). The edge set is the total set of directed edges corresponding to all document citation relationships.
[0044] Real-time fact graphs are network structures that characterize document and citation relationships. They consist of a set of nodes (documents) and a set of edges (citation relationships) and are used to calculate the geometric and statistical properties of nodes.
[0045] The shortest path distance in a graph is the path between two nodes that has the fewest directed edges, reflecting the tightness of the referential connections between the nodes. Specifically, the steps are as follows: First, find all possible connected paths from the first node to the second node, each path consisting of consecutive directed edges; second, count the number of directed edges in each path; third, select the value with the smallest number of directed edges as the shortest path distance between the two nodes; if the two nodes have no connected paths, the distance is set to infinity.
[0046] The set of adjacent nodes is the set of nodes that are directly connected to the current node by a directed edge. If the current node has a directly cited document, the corresponding node is an adjacent node; if the current node is directly cited by other documents, the corresponding node is also an adjacent node.
[0047] The number of adjacent nodes is the total number of nodes contained in the set of adjacent nodes, reflecting the number of documents directly cited or cited by the current node; specifically, the total number of different nodes in the set of adjacent nodes is counted, and the result is the number of adjacent nodes.
[0048] The indolence parameter controls the probability of staying at the current node during a random walk. It ranges from 0 to 1. The larger the value, the higher the probability of staying at the current node during the random walk. In engineering, it is usually set to 0.5 (to balance the probability of staying and moving to adjacent nodes).
[0049] The measure of concentration at a node is the probability weight assigned to the current node during a random walk, which is directly determined by the laziness parameter. Specifically, the measure of concentration at a node is equal to the laziness parameter multiplied by 1 (since the weight is assigned only to the current node, the weight coefficient is 1), that is, the measure of concentration at a node = the laziness parameter.
[0050] The random walk measure is a metric that describes the probability distribution among the current node and its neighboring nodes during a random walk, and is used to calculate the distance between nodes. Specifically, the random walk measure = (measure concentrated at the node × current node) + ((1 - indolence parameter) ÷ number of neighboring nodes) × each neighboring node in the neighboring node set; where × represents the probability distribution, that is, the probability that the current node receives the measure concentrated at the node, and the probability that each neighboring node receives (1 - indolence parameter) divided by the number of neighboring nodes.
[0051] The first-order Wasserstein distance measures the minimum total cost required for optimal transmission between two adjacent nodes when the shortest path distance in the graph is the cost. Specifically, the first step is to determine the probability of assigning the random walk measure of two adjacent nodes to each node (let the probability of assigning the measure of the first node to each node be p1, p2...pn, and the probability of assigning the measure of the second node to the corresponding node be q1, q2...qn); the second step is to calculate the shortest path distance in the graph for each pair of corresponding nodes (as the transmission cost c1, c2...cn); the third step is to calculate the first-order Wasserstein distance as (the sum of all |pi-qi|×ci) ÷ 2.
[0052] The discrete Ricci curvature of an edge is a geometric quantity that describes the curvature of the edge between adjacent nodes. The more negative the value, the stronger the cross-community bridging property of the edge (connecting different literature topic communities). Specifically, the discrete Ricci curvature of an edge = 1 - (first-order Wasserstein distance ÷ shortest path distance of the graph between the two adjacent nodes).
[0053] The discrete Ricci curvature of a node is the average of the discrete Ricci curvatures of all its adjacent edges, reflecting the overall cross-community bridging property of the node. Specifically, the discrete Ricci curvature of a node = (the sum of the discrete Ricci curvatures of all its adjacent edges) ÷ the number of its neighboring nodes.
[0054] The in-degree of a node is the total number of directed edges pointing to the current node, which is the number of other documents that cite the document corresponding to that node, reflecting the citation frequency of the document; specifically, the total number of directed edges that start from other nodes and end at the current node in the real-time fact base graph is counted, and the result is the node in-degree.
[0055] In one embodiment of the present invention, candidate documents are retrieved from a real-time fact base graph based on an input query, a neutral retrieval distribution is generated by combining a distribution smoothing parameter, and the discrete Ricci curvature and in-degree of each candidate document are read, including:
[0056] Get the input query;
[0057] Retrieve candidate documents related to the input query from the real-time fact base graph to form a candidate document set;
[0058] Calculate the retrieval similarity between the input query and each candidate document in the candidate document set;
[0059] Set a distribution smoothing parameter, and normalize the retrieval similarity of each candidate document according to the distribution smoothing parameter to generate a neutral retrieval distribution. The probability of each candidate document in the neutral retrieval distribution is obtained by normalizing the retrieval similarity of the candidate document.
[0060] Each candidate document in the candidate document set is mapped to a corresponding node in the real-time fact graph; the discrete Ricci curvature and in-degree of the node corresponding to each candidate document are read from the real-time fact graph.
[0061] Input queries are text content initiated by users or the system to retrieve relevant academic literature. They typically include information such as research topics, keywords, and core questions (e.g., research on the application of deep learning in image recognition) and serve as the basis for retrieving candidate literature.
[0062] Candidate documents are single document records selected from the real-time fact base graph that are related to the input query content and must meet the basic conditions of topic relevance or content matching.
[0063] The candidate literature set is a collection of all candidate literature that meets the conditions related to the input query. The size of the set can be set according to actual needs (such as selecting the Top 50 relevant literature).
[0064] Search similarity is an indicator that quantifies the relevance between an input query and the content of a single candidate document. A higher value indicates a stronger relevance, and cosine similarity is commonly used for calculation. Specifically, the first step is to convert the input query and candidate documents into text vectors (e.g., using the TF-IDF algorithm to count the term frequency and inverse document frequency of keywords in the text to generate vectors); the second step is to calculate the dot product of the two vectors (multiplying the corresponding elements of the two vectors and then summing them); the third step is to calculate the magnitude of the two vectors (squaring each element of the vector, summing them, and then taking the square root); the fourth step is to calculate the search similarity as the dot product divided by (the magnitude of the query vector multiplied by the magnitude of the candidate document vector).
[0065] The distribution smoothing parameter controls the degree of concentration of the probability distribution after normalization. Its value ranges from 0.01 to 0.1 (the smaller the value, the more concentrated the probability is in highly similar documents; the larger the value, the more uniform the probability distribution). It is used to avoid some documents having a probability of 0 after normalization. Specifically, the first step is to divide the search similarity of each candidate document by the distribution smoothing parameter to obtain the adjusted similarity. The second step is to calculate the exponent of the adjusted similarity of all candidate documents (with the natural constant as the base) and sum them to obtain the normalized sum. The third step is to determine the neutral search distribution probability of a single candidate document by dividing the exponent of its adjusted similarity by the normalized sum.
[0066] The neutral retrieval distribution is the probability distribution of each document in the candidate document set. The sum of the probabilities of all documents is 1. It only reflects the relevance of the text content and does not include geometric (curvature) or statistical (in-degree) bias. Specifically, the formula for calculating the distribution smoothing parameter is: probability of a single candidate document = (retrieval similarity of the document ÷ exponent value of the distribution smoothing parameter) ÷ (retrieval similarity of all documents ÷ sum of exponent values of the distribution smoothing parameter).
[0067] In one embodiment of the present invention, the geometrical debiasing weights of candidate documents are calculated using geometrical debiasing parameters. The neutral retrieval distribution is then reweighted and normalized using these geometrical debiasing weights to obtain the target evidence distribution, including:
[0068] Set the geometric debiasing parameters, which include the curvature suppression coefficient, the in-degree suppression power coefficient, and the smoothing constant;
[0069] For each candidate document, the geometric debiasing weight is calculated by combining the discrete Ricci curvature and curvature suppression coefficient of the corresponding node, the in-degree and in-degree suppression power coefficient of the corresponding node, and the smoothing constant.
[0070] Calculate the normalization constant, which is the sum of the products of the neutral retrieval probability of all candidate documents and their respective geometric debiasing weights;
[0071] For each candidate document, the product of the neutral retrieval probability distribution of the candidate document and the geometric debiasing weight is divided by the normalization constant to obtain the target evidence distribution probability of the candidate document. The target evidence distribution probabilities of all candidate documents constitute the target evidence distribution.
[0072] Geometric debiasing parameters are a set of parameters used to adjust the influence of the geometric attributes (curvature) and statistical attributes (in-degree) of candidate documents on the distribution of evidence. Their function is to suppress the excessive weighting of highly cited (high in-degree) and cross-community (negative curvature) documents and avoid model bias.
[0073] The curvature suppression coefficient is a coefficient that controls the degree of influence of discrete Ricci curvature on geometric debiasing weights. Its value ranges from 0.1 to 0.5 (the larger the value, the stronger the suppression of negative curvature literature), and the more obvious the reduction in weight of negative curvature literature (across communities).
[0074] The in-degree suppression power coefficient is a coefficient that controls the degree to which in-degree weakens the geometric debiasing weight. Its value ranges from 0.3 to 0.8 (the larger the value, the stronger the weakening of the weight of high-in-degree literature), and the more significant the reduction in the weight of highly cited literature.
[0075] The smoothing constant is an adjustment value used to prevent candidate documents with an in-degree of 0 from having a weight of 0. It is fixed at 1 (a common value in engineering to ensure that there is still a basic weight when the in-degree is 0) to prevent extreme values from disrupting the weight distribution.
[0076] Geometric debiasing weights are weights used to correct the curvature bias and in-degree bias of candidate documents. After correction, the weights of documents with high in-degree and negative curvature are reduced. Specifically, the first step is to calculate the curvature adjustment term, which is equal to the exponent (curvature suppression coefficient multiplied by the discrete Ricci curvature of the corresponding node of the candidate document) with the natural constant as the base. The second step is to calculate the in-degree adjustment term, which is equal to the power of (negative in-degree suppression coefficient) of (in-degree of the corresponding node of the candidate document plus the smoothing constant). The third step is to calculate the geometric debiasing weight, which is equal to the curvature adjustment term multiplied by the in-degree adjustment term.
[0077] The normalization constant is an adjustment value that ensures the sum of all probabilities of the target evidence distribution is 1, eliminating distribution anomalies caused by differences in the weights of different candidate documents; specifically, the normalization constant is equal to the sum of the (neutral retrieval distribution probability multiplied by their respective geometric debiasing weights) of all candidate documents.
[0078] The target evidence distribution probability is the probability of a candidate document being selected after being corrected by geometric debiasing weights, which has eliminated excessive bias towards high-degree and negative-curvature documents; specifically, the target evidence distribution probability is equal to (the neutral retrieval distribution probability of the candidate document multiplied by its geometric debiasing weights) divided by the normalization constant.
[0079] The target evidence distribution is the modified probability distribution of candidate documents, with the sum of all probabilities equal to 1.
[0080] In one embodiment of the present invention, candidate documents are encoded, processed by a gating network, and combined with distribution smoothing parameters to generate an evidence usage distribution. The negative log-likelihood loss is then calculated based on the evidence usage distribution, including:
[0081] Perform encoding operations on each candidate document to obtain the document representation vector corresponding to each candidate document;
[0082] Perform encoding operations on the input query to obtain the query representation vector corresponding to the input query;
[0083] The document representation vector of each candidate document and the query representation vector of the input query are respectively input into the gating network. Through the parameter configuration and feature processing of the gating network, the gating score corresponding to each candidate document is obtained.
[0084] Set a distribution smoothing parameter, and normalize the gating scores of all candidate documents according to the distribution smoothing parameter to obtain the evidence use probability distribution corresponding to each candidate document. The evidence use probability distribution of all candidate documents together constitutes the evidence use distribution.
[0085] Retrieve the target text, which contains multiple tags arranged in sequence;
[0086] The negative log-likelihood loss is calculated based on the evidence usage distribution, input query, candidate document set, and all tags preceding each tag in the target text.
[0087] Candidate documents are individual documents in the candidate document set and serve as the input for encoding operations.
[0088] Encoding is the process of converting textual documents / queries into numerical vectors. It requires a pre-trained language model and captures the semantic features of the text.
[0089] The document representation vector is a numerical vector encoded from candidate documents, typically with dimensions of 768 or 1024 (to adapt to the output of the pre-trained model), used for feature matching in subsequent gating networks. Specifically, the first step is to select a pre-trained language model (such as BERT-base) and concatenate the titles and abstracts of candidate documents into the input text. The second step is to input the input text into the model and extract the output vector at the [CLS] position. The third step is to perform L2 normalization on the vector (the square root of the sum of the squares of each element in the vector is taken, and each element is divided by the square root of the sum of squares) to obtain the document representation vector.
[0090] The input query here is the user / system retrieval request text, which is the input object for the encoding operation.
[0091] The query representation vector is a numerical vector encoded from the input query, with the same dimensions as the document representation vector (e.g., 768 dimensions), used for feature interaction with the document representation vector. Specifically, the first step is to use the same pre-trained language model (e.g., BERT-base) as the document encoding, and take the input query as text input; the second step is to take the output vector at the [CLS] position of the model; the third step is to perform L2 normalization on the vector to obtain the query representation vector.
[0092] Gated networks are neural network structures used to measure the matching degree between document representation vectors and query representation vectors. They adjust feature weights through parameter learning.
[0093] The gating score is a scalar value output by the gating network that quantifies the document-query matching degree; the larger the value, the higher the matching degree. Specifically, the first step is to calculate the dot product of the document representation vector and the query representation vector (multiply corresponding elements and then sum them); the second step is to input the dot product result into a fully connected layer containing a sigmoid activation function (the weights of the fully connected layer are randomly initialized and updated as the model is trained); the third step is to output the gating score (with a value ranging from 0 to 1).
[0094] The evidence use probability distribution is the normalized probability value of the gating score, reflecting the probability that the model actually selects the document as evidence, and the sum of all probabilities is 1. Specifically, the first step is to divide the gating score of each candidate document by the distribution smoothing parameter to obtain the adjusted score; the second step is to calculate the exponent values (with the natural constant as the base) of the adjusted scores of all candidate documents and sum them to obtain the normalized sum; the third step is to equal the evidence use probability distribution to the exponent value of the adjusted score of the document divided by the normalized sum.
[0095] The evidence usage distribution is a set of probability distributions of candidate documents, reflecting the model's preference for selecting evidence from different documents, and needs to be compared and optimized with the target evidence distribution.
[0096] A token is the basic unit of the target text after it has been split into semantic or character parts (such as words or sub-words, like the WordPiece splitting result of BERT), and is the smallest granularity for loss calculation.
[0097] Negative log-likelihood loss is a metric for measuring the error of a model in generating target text based on evidence; a smaller value indicates better generation performance. Specifically, the first step is to calculate the predicted probability of each tag in the target text based on the input query, the candidate document set, all tags preceding that tag, and the evidence distribution. The second step is to take the natural logarithm of the predicted probability for each tag and then take the negative value. The third step is to calculate the negative log-likelihood loss as the average of the negative log-predicted probabilities of all tags.
[0098] In one embodiment of the present invention, the optimal transmission loss from the evidence distribution to the target evidence distribution is calculated using the shortest path distance of a node in the real-time fact base graph as the cost, combined with regularization parameters, including:
[0099] For all candidate documents, a cost matrix is constructed using the shortest path distance between any two nodes as the cost of transporting a unit mass from one node to another.
[0100] Set the regularization parameters;
[0101] Define a transportation plan matrix, where each element represents the transportation quality from one candidate document node to another candidate document node. The transportation plan matrix must satisfy the following marginal constraints: the sum of all elements in any row of the transportation plan matrix is equal to the evidence use probability of the candidate document in that row, and the sum of all elements in any column of the transportation plan matrix is equal to the target evidence probability of the candidate document in that column.
[0102] Given that all elements in the transportation planning matrix are non-negative, the optimal transmission loss is calculated as follows: First, calculate the sum of the products of each element in the transportation planning matrix and the corresponding element in the cost matrix. Then, calculate the sum of the products of the regularization parameter and each element in the transportation planning matrix and the natural logarithm of that element minus one. Add the two sums together and take the minimum value. This minimum value is the optimal transmission loss.
[0103] The nodes corresponding to the candidate documents here are nodes in the real-time fact base graph. Each node uniquely corresponds to one document in the candidate document set and serves as the basis for the row / column dimensions of the cost matrix.
[0104] The shortest path distance here is the shortest path length between two nodes at the cost of the number of edges, which is the basic cost per unit of transport quality.
[0105] The cost matrix is a matrix that quantifies the transportation costs between nodes. The larger the value of the matrix element, the higher the cost per unit mass of transportation between the two nodes. Specifically, the first step is to determine the matrix dimension. If the number of nodes corresponding to the candidate documents is N, then the cost matrix is N rows and N columns. The second step is to set the element value of the i-th row and j-th column of the matrix to the shortest path distance between the i-th node and the j-th node. The third step is to set the element value to 0 if i=j (the same node) (no cost for its own transportation) to obtain the cost matrix.
[0106] The transportation plan matrix is a matrix that characterizes the quality transportation allocation between nodes. It needs to satisfy marginal constraints to match the probabilities of the source (evidence usage distribution) and the target (target evidence distribution). Specifically, the first step is to ensure that the matrix dimension is consistent with the cost matrix (N rows and N columns) and the elements are non-negative. The second step is to ensure that the sum of the elements in each row equals the evidence usage distribution probability of the corresponding node in that row, and the sum of the elements in each column equals the target evidence distribution probability of the corresponding node in that column. The third step is to set the initial matrix as (evidence usage distribution probability of the row × target evidence distribution probability of the column) ÷ the sum of the evidence usage distribution probabilities of all nodes, and then adjust it iteratively to satisfy the constraints to obtain the initial transportation plan matrix.
[0107] Marginal constraints are rules that ensure the transportation plan matrix matches the source / target distribution, avoiding discrepancies between the total transportation volume and the output of the source distribution or the received volume of the target distribution.
[0108] The evidence uses the probability distribution as the probability that a candidate document is selected by the model.
[0109] The probability distribution of the target evidence is the probability of the candidate documents after geometric debiasing.
[0110] The optimal transmission loss measures the minimum total cost of transporting evidence from the current evidence distribution to the target evidence distribution; a smaller value indicates that the two distributions are closer. Specifically, the first step is to calculate the sum of transportation costs, which is equal to the sum of the results of multiplying each element in the transportation plan matrix by the corresponding element in the cost matrix. The second step is to calculate the sum of regularization terms, which is equal to the sum of the results of multiplying the regularization parameter by (each element in the transportation plan matrix multiplied by (the natural logarithm of that element minus one)). The third step is to add the sum of transportation costs to the sum of regularization terms, and then use the Sinkhorn iteration method (iteratively adjusting the transportation plan matrix) to find the value that minimizes this sum. This minimum value is the optimal transmission loss.
[0111] In one embodiment of the present invention, the in-degree tail index is calculated based on the evidence-based distribution, and the tail index loss is calculated by combining the baseline in-degree tail index of the neutral retrieval distribution and the tail adjustment parameter, including:
[0112] Set the sample size parameters;
[0113] In descending order of in-degree, select nodes from the candidate documents whose number is equal to the sample size parameter to form the first node set;
[0114] At the same time, in descending order of node in-degree, nodes with a number equal to the sample size parameter are selected from the nodes corresponding to the candidate documents to form a second node set;
[0115] For the first node set, obtain the evidence usage probability distribution corresponding to each node, calculate the ratio of the evidence usage probability distribution of each node to the sum of the evidence usage probabilities distribution of all nodes in the first node set, and obtain the normalized weight of each node in the first node set.
[0116] Find the minimum in-degree of all nodes in the first node set, and use it as the first minimum in-degree;
[0117] For each node in the first set of nodes, calculate the difference between the natural logarithm of the node's in-degree and the natural logarithm of the first minimum in-degree. Multiply this difference by the normalized weight of the node, and then sum all the multiplication results to obtain the in-degree tail index based on the evidence use distribution.
[0118] For the second node set, obtain the neutral retrieval distribution probability corresponding to each node, calculate the ratio of the neutral retrieval distribution probability of each node to the sum of the neutral retrieval distribution probabilities of all nodes in the second node set, and obtain the normalized weight of each node in the second node set.
[0119] Find the minimum in-degree among all nodes in the second node set, and use it as the second minimum in-degree; for each node in the second node set, calculate the difference between the natural logarithm of the node's in-degree and the natural logarithm of the second minimum in-degree, multiply the difference by the node's normalized weight, and then sum all the multiplication results to obtain the baseline in-degree tail index based on the neutral retrieval distribution; set the tail adjustment parameters.
[0120] The target tail index is obtained by adding the baseline in-degree tail index to the tail adjustment parameter.
[0121] Calculate the difference between the target tail index and the in-degree tail index based on the evidence use distribution. If the difference is negative, take zero as the adjusted difference.
[0122] If the difference is non-negative, then the difference is directly used as the adjusted difference; the square of the adjusted difference is calculated to obtain the tail exponential loss.
[0123] The sample size parameter is used to determine the number of high-in-degree nodes for calculating the tail exponent. It is necessary to select a sufficient number of high-in-degree nodes to accurately characterize the tail of the distribution, and the value ranges from 20 to 50.
[0124] The candidate document nodes are nodes in the real-time fact base graph. Each node uniquely corresponds to one document in the candidate document set, which is the basis for selecting the first and second node sets.
[0125] The first node set is a set of high in-degree nodes used to calculate the in-degree tail index based on the evidence use distribution. It only contains nodes with the highest in-degree ranking among the nodes corresponding to candidate documents. Specifically, the first step is to obtain the in-degree of all nodes corresponding to candidate documents; the second step is to sort them in descending order of in-degree; and the third step is to select the top N nodes after sorting (N is the sample size parameter) to form the first node set.
[0126] The second node set is a set of high in-degree nodes used to calculate the baseline in-degree tail index based on the neutral retrieval distribution. The selection logic is the same as that of the first node set, and it can be the same as the first node set (if the in-degree order of the candidate nodes has not changed). Specifically, the first step is to obtain the in-degree of the nodes corresponding to all candidate documents; the second step is to sort them in descending order of in-degree (the same as the sorting of the first node set); the third step is to select the top N nodes after sorting (N is the sample size parameter) to form the second node set.
[0127] The normalized weights within the first node set are used to adjust the weights of each high-in-degree node's contribution to the tail index, ensuring that the total weights are equal to 1. Specifically, the first step is to calculate the sum of the evidence usage probability distributions of all nodes within the first node set. The second step is to equal the normalized weight of a single node to the evidence usage probability distribution of that node divided by the total sum.
[0128] The first minimum in-degree is the in-degree value of the node with the smallest in-degree in the first node set. It is used to calculate the logarithmic difference of in-degrees and eliminate the influence of the absolute in-degree size. Specifically, the first step is to obtain the in-degree of each node in the first node set; the second step is to compare all in-degree values and select the smallest value as the first minimum in-degree.
[0129] The in-degree tail index is an indicator that characterizes the degree of tail concentration of high-in-degree nodes under the evidence use distribution. The smaller the value, the heavier the tail. Specifically, the first step is to calculate the natural logarithm of the in-degree of each node in the first node set and subtract the natural logarithm of the first minimum in-degree to obtain the logarithmic difference. The second step is to multiply the logarithmic difference of each node by its normalized weight to obtain the weighted difference. The third step is to sum the weighted differences of all nodes, and the result is the in-degree tail index based on the evidence use distribution.
[0130] The normalized weights within the second node set are used to adjust the weights of each high-in-degree node's contribution to the baseline tail index, ensuring that the total weights are equal to 1. Specifically, the first step is to calculate the sum of the neutral retrieval distribution probabilities of all nodes within the second node set. The second step is to equalize the normalized weight of a single node by dividing the node's neutral retrieval distribution probability by the total weight.
[0131] The second minimum in-degree is the in-degree value of the node with the smallest in-degree in the second node set. Its function is the same as the first minimum in-degree, used to calculate the logarithmic difference of in-degrees. Specifically, the first step is to obtain the in-degree of each node in the second node set; the second step is to compare all in-degree values and select the smallest value as the second minimum in-degree.
[0132] The baseline in-degree tail index is a benchmark indicator that characterizes the degree of tail concentration of high-in-degree nodes without geometric bias. It is used to compare with the tail index of the evidence use distribution. Specifically, the steps are as follows: First, for each node in the second set of nodes, calculate the natural logarithm of its in-degree and subtract the natural logarithm of the second minimum in-degree to obtain the logarithmic difference. Second, multiply the logarithmic difference of each node by its normalized weight to obtain the weighted difference. Third, sum the weighted differences of all nodes to obtain the baseline in-degree tail index.
[0133] The tail adjustment parameter is a safety margin added to the baseline in-degree tail index to ensure that the target tail index is higher than the baseline and to avoid the evidence using a distribution with an overly light tail. The value range is 0.1 to 0.3 (too small a value results in insufficient safety margin, while too large a value results in over-constraint).
[0134] The target tail index is the minimum standard that the in-degree tail index of the evidence distribution must meet. The larger the value, the lower the allowable tail concentration. Specifically, the target tail index is equal to the baseline in-degree tail index plus the tail adjustment parameter.
[0135] The adjusted difference is the difference that eliminates cases where the tail index of the evidence use distribution is better than the target, ensuring that only cases with excessive tail weight are penalized. Specifically, the first step is to calculate the target tail index and subtract the in-degree tail index based on the evidence use distribution to obtain the original difference. The second step is to take the adjusted difference as 0 if the original difference is less than 0, and take the original difference if the original difference is greater than or equal to 0.
[0136] Tail exponential loss is an error metric that measures the deviation of the tail of the evidence distribution from the target. The larger the value, the more severe the tail weighting. Specifically, tail exponential loss is equal to the adjusted difference multiplied by the adjusted difference (i.e., the square of the adjusted difference).
[0137] In one embodiment of the present invention, the negative log-likelihood loss, optimal transmission loss, and tail exponential loss are weighted by loss weight parameters to obtain the total loss. Gradient descent is then used to jointly update the hyperparameters of the large model until convergence, including:
[0138] Two loss weight parameters are set, where the first loss weight parameter corresponds to the weighting coefficient of the optimal transmission loss, and the second loss weight parameter corresponds to the weighting coefficient of the tail exponential loss.
[0139] Calculate the total loss: The negative log-likelihood loss is directly included in the total loss, the optimal transmission loss is multiplied by the first loss weight parameter and included in the total loss, the tail exponential loss is multiplied by the second loss weight parameter and included in the total loss, and the three are added together to obtain the total loss.
[0140] Determine the set of hyperparameters to be updated, which includes: curvature suppression coefficient, in-degree suppression power coefficient, smoothing constant, distribution smoothing parameter, regularization parameter, tail adjustment parameter, first loss weight and second loss weight;
[0141] Set the learning rate;
[0142] The hyperparameters are updated using gradient descent: the gradient of the total loss with respect to each hyperparameter in the hyperparameter set is calculated, and the product of the learning rate and the corresponding gradient is subtracted from the hyperparameter value of the current round to obtain the hyperparameter value of the next round.
[0143] Set a convergence threshold;
[0144] Calculate the absolute value of the difference between the total loss of the current round and the total loss of the previous round; if the absolute value of this difference is less than or equal to the convergence threshold, stop the hyperparameter update;
[0145] If the absolute value of the difference is greater than the convergence threshold, the hyperparameter update step is repeated until the absolute value of the difference is less than or equal to the convergence threshold.
[0146] The first loss weight parameter is a coefficient that controls the proportion of the optimal transmission loss in the total loss. It needs to balance the evidence distribution matching degree with other losses, and its value ranges from 0.3 to 0.7 (the larger the value, the stronger the constraint on the alignment of the evidence distribution with the target distribution).
[0147] The second loss weight parameter is a coefficient that controls the proportion of the tail exponential loss in the total loss. It needs to balance the tail concentration constraint with other losses, and the value ranges from 0.2 to 0.5 (the larger the value, the stronger the penalty for excessive tail distribution of evidence).
[0148] Total loss is the core indicator that integrates generation error, distribution matching error, and tail deviation error. The smaller the value, the better the overall performance of the model. Specifically, total loss equals negative log-likelihood loss plus (optimal transmission loss multiplied by the first loss weight parameter) plus (tail exponential loss multiplied by the second loss weight parameter).
[0149] The set of hyperparameters to be updated is a combination of parameters that need to be optimized through gradient descent. It covers parameters for geometric debiasing, distribution generation, and loss weighting, including: curvature suppression coefficient, in-degree suppression power coefficient, smoothing constant, distribution smoothing parameter, regularization parameter, tail adjustment parameter, first loss weight, and second loss weight.
[0150] The learning rate is a parameter that controls the step size of hyperparameter updates. If the step size is too large, it will cause hyperparameter oscillations and non-convergence. If it is too small, the training efficiency will be low. The value range is 0.001 to 0.01 (the initial learning rate is usually 0.005, which decays with the training rounds).
[0151] The gradient is the rate of change of the total loss with respect to a single hyperparameter. The positive or negative sign indicates the direction of hyperparameter adjustment (a negative gradient indicates that increasing the hyperparameter reduces the loss, and a positive gradient indicates that decreasing the hyperparameter reduces the loss). Specifically, for a single hyperparameter, the gradient is equal to (the total loss after increasing the current hyperparameter value by the minimum value of 0.0001 minus the current total loss) divided by 0.0001, which gives an approximate gradient value for that hyperparameter.
[0152] The hyperparameter values for the current round are the values used in this round of training before gradient descent, providing a baseline for updates.
[0153] The hyperparameter values for the next round are the hyperparameter values used in the next training round after gradient descent, which adjust the hyperparameters in the direction of reducing the total loss; specifically, the hyperparameter values for the next round are equal to the hyperparameter values for the current round minus (learning rate multiplied by the gradient of the hyperparameter).
[0154] The convergence threshold is the standard for determining whether hyperparameter updates should stop. It reflects the allowable fluctuation range of the total loss and is fixed at 0.001 (a common engineering value that balances convergence accuracy and training efficiency).
[0155] The total loss for the current round is the total loss value calculated after this round of training, which is used to compare with the previous round to determine convergence.
[0156] The total loss of the previous round is the total loss value calculated after the end of the previous training round, which serves as the benchmark for comparison in the current round.
[0157] The absolute value of the difference is an indicator that measures the magnitude of change in the total loss and is used to determine whether the training has converged. Specifically, the absolute value of the difference is equal to the total loss of the current round minus the total loss of the previous round. If the result is negative, its opposite is taken; if it is positive, it is retained.
[0158] Example 2
[0159] A large model hallucination suppression training system integrating real-time fact base verification, applied to any of the large model hallucination suppression training methods integrating real-time fact base verification, includes:
[0160] The graph construction module builds a real-time fact base graph and calculates the discrete Ricci curvature and in-degree of nodes in the real-time fact base graph.
[0161] The graph analysis module retrieves candidate documents from the real-time fact base graph based on the input query, generates a neutral retrieval distribution by combining the distribution smoothing parameter, and reads the discrete Ricci curvature and in-degree of each candidate document.
[0162] The evidence distribution calculation module uses geometric debiasing parameters to calculate the geometric debiasing weights of candidate documents, and then reweights and normalizes the neutral retrieval distribution using the geometric debiasing weights to obtain the target evidence distribution.
[0163] The likelihood loss calculation module encodes candidate documents, processes them through a gating network, and generates an evidence use distribution by combining distribution smoothing parameters. Based on the evidence use distribution, it calculates the negative log-likelihood loss.
[0164] The transmission loss calculation module uses the shortest path distance of nodes in the real-time fact base graph as the cost, and combines regularization parameters to calculate the optimal transmission loss of evidence distribution to target evidence distribution.
[0165] The exponential loss calculation module calculates the in-degree tail index based on the evidence distribution, and calculates the tail exponential loss by combining the baseline in-degree tail index of the neutral retrieval distribution and the tail adjustment parameter.
[0166] The hallucination suppression training module calculates the total loss by weighting the negative log-likelihood loss, optimal transmission loss, and tail exponential loss using loss weight parameters. It then uses gradient descent to jointly update the hyperparameters of the large model until convergence.
[0167] The embodiments of this example have been described above. However, this example is not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms based on the guidance of this example, and all of them are within the protection scope of this example.
Claims
1. A method for hallucination suppression training of large models with real-time fact base verification, characterized in that, The method comprises the following steps: Constructing a real-time fact base graph, calculating discrete Ricci curvatures and in-degrees of nodes in the real-time fact base graph; Retrieving candidate documents from the real-time fact base graph based on an input query, generating a neutral retrieval distribution in combination with a distribution smoothing parameter, and reading the discrete Ricci curvatures and in-degrees corresponding to each candidate document; Calculating a geometric debiasing weight of each candidate document by using a geometric debiasing parameter, re-weighting and normalizing the neutral retrieval distribution by the geometric debiasing weight, and obtaining a target evidence distribution, comprising: Setting the geometric debiasing parameter, which comprises a curvature suppression coefficient, an in-degree suppression power coefficient and a smoothing constant; For each candidate document, calculating the geometric debiasing weight of the candidate document in combination with the discrete Ricci curvature of the node corresponding to the candidate document and the curvature suppression coefficient, the in-degree of the node corresponding to the candidate document and the in-degree suppression power coefficient, and the smoothing constant; Calculating a normalization constant, which is the sum of the products of the neutral retrieval distribution probabilities of all candidate documents and their respective geometric debiasing weights; For each candidate document, dividing the product of the neutral retrieval distribution probability of the candidate document and the geometric debiasing weight by the normalization constant to obtain the target evidence distribution probability of the candidate document, and the target evidence distribution probabilities of all candidate documents form the target evidence distribution; Encoding the candidate documents, processing them through a gating network, generating an evidence usage distribution in combination with the distribution smoothing parameter, and calculating a negative log-likelihood loss based on the evidence usage distribution; Calculating an optimal transport loss of the evidence usage distribution to the target evidence distribution in combination with a regularization parameter, taking the shortest path distance of the nodes in the real-time fact base graph as the cost; Calculating an in-degree tail index based on the evidence usage distribution, calculating a tail index loss in combination with a baseline in-degree tail index of the neutral retrieval distribution and a tail adjustment parameter, comprising: Setting a sample size parameter; Selecting nodes with a number equal to the sample size parameter from the nodes corresponding to the candidate documents in descending order of node in-degree to form a first node set; At the same time, selecting nodes with a number equal to the sample size parameter from the nodes corresponding to the candidate documents in descending order of node in-degree to form a second node set; For the first node set, obtaining the evidence usage distribution probability corresponding to each node, calculating the ratio of the evidence usage distribution probability of each node to the sum of the evidence usage distribution probabilities of all nodes in the first node set, and obtaining the normalization weight of each node in the first node set; Finding the minimum value of the in-degrees of all nodes in the first node set as the first minimum in-degree; For each node in the first node set, calculating the difference between the natural logarithm of the node in-degree and the natural logarithm of the first minimum in-degree, multiplying the difference by the normalization weight of the node, and adding all the multiplied results to obtain the in-degree tail index based on the evidence usage distribution; For the second node set, obtaining the neutral retrieval distribution probability corresponding to each node, calculating the ratio of the neutral retrieval distribution probability of each node to the sum of the neutral retrieval distribution probabilities of all nodes in the second node set, and obtaining the normalization weight of each node in the second node set; Find the minimum in-degree among all nodes in the second node set, and use it as the second minimum in-degree; for each node in the second node set, calculate the difference between the natural logarithm of the node's in-degree and the natural logarithm of the second minimum in-degree, multiply the difference by the node's normalized weight, and then sum all the multiplication results to obtain the baseline in-degree tail index based on the neutral retrieval distribution; set the tail adjustment parameters. The target tail index is obtained by adding the baseline in-degree tail index to the tail adjustment parameter. Calculate the difference between the target tail index and the in-degree tail index based on the evidence use distribution. If the difference is negative, take zero as the adjusted difference. If the difference is non-negative, then the difference is directly used as the adjusted difference; the square of the adjusted difference is calculated to obtain the tail exponential loss. The negative log-likelihood loss, optimal transmission loss, and tail exponential loss are weighted by loss weight parameters to obtain the total loss. The hyperparameters of the large model are then jointly updated using gradient descent until convergence.
2. The method of claim 1, wherein the method is characterized by, Construct a real-time fact graph and calculate the discrete Ricci curvature and in-degree of nodes in the real-time fact graph, including: Each document record in the real-time fact base is treated as a node, and all nodes form a node set; any citation relationship is treated as a directed edge, and all directed edges form an edge set; the real-time fact base graph is formed by the node set and the edge set. For any two nodes in the real-time fact base graph, calculate the shortest path length at the cost of the number of edges, and use it as the graph shortest path distance between the two nodes; For any node in the real-time fact base graph, construct a random walk measure, which includes a lazy parameter, a measure concentrated on the node, a set of adjacent nodes that are directly connected to the node, and the number of adjacent nodes in the set of adjacent nodes. For any pair of adjacent nodes in the real-time fact base graph, calculate the first-order Wasserstein distance between the random walk measures corresponding to each of the adjacent nodes based on the graph shortest path distance of the pair of adjacent nodes; calculate the discrete Ricci curvature of the edge between the pair of adjacent nodes based on the first-order Wasserstein distance and the graph shortest path distance of the pair of adjacent nodes. For any node in the real-time fact graph, count the number of adjacent nodes of the node, calculate the average of the discrete Ricci curvature of all the adjacent edges of the node, and use it as the discrete Ricci curvature of the node. For any node in the real-time fact graph, count the number of directed edges ending at that node, and use that number as the in-degree of the node.
3. The method of claim 2, wherein the method further comprises: Based on the input query, candidate documents are retrieved from the real-time fact base graph. A neutral retrieval distribution is generated by combining the distribution smoothing parameter, and the discrete Ricci curvature and in-degree of each candidate document are read, including: Get the input query; Retrieve candidate documents related to the input query from the real-time fact base graph to form a candidate document set; Calculate the retrieval similarity between the input query and each candidate document in the candidate document set; Set a distribution smoothing parameter, and normalize the retrieval similarity of each candidate document according to the distribution smoothing parameter to generate a neutral retrieval distribution. The probability of each candidate document in the neutral retrieval distribution is obtained by normalizing the retrieval similarity of the candidate document. Each candidate document in the candidate document set is mapped to a corresponding node in the real-time fact graph; the discrete Ricci curvature and in-degree of the node corresponding to each candidate document are read from the real-time fact graph.
4. The method of claim 3, wherein the method further comprises: Candidate documents are coded, processed by a gating network, and combined with distribution smoothing parameters to generate an evidence use distribution. The negative log-likelihood loss is calculated based on this evidence use distribution, including: Perform encoding operations on each candidate document to obtain the document representation vector corresponding to each candidate document; Perform encoding operations on the input query to obtain the query representation vector corresponding to the input query; The document representation vector of each candidate document and the query representation vector of the input query are respectively input into the gating network. Through the parameter configuration and feature processing of the gating network, the gating score corresponding to each candidate document is obtained. Set a distribution smoothing parameter, and normalize the gating scores of all candidate documents according to the distribution smoothing parameter to obtain the evidence use probability distribution corresponding to each candidate document. The evidence use probability distribution of all candidate documents together constitutes the evidence use distribution. Retrieve the target text, which contains multiple tags arranged in sequence; The negative log-likelihood loss is calculated based on the evidence usage distribution, input query, candidate document set, and all tags preceding each tag in the target text.
5. The method of claim 4, wherein the method further comprises: Using the shortest path distance between nodes in the real-time fact base graph as the cost, and combining regularization parameters, the optimal transmission loss from the evidence distribution to the target evidence distribution is calculated, including: For all candidate documents, a cost matrix is constructed using the shortest path distance between any two nodes as the cost of transporting a unit mass from one node to another. Set the regularization parameters; Define a transportation plan matrix, where each element represents the transportation quality from one candidate document node to another candidate document node. The transportation plan matrix must satisfy the following marginal constraints: the sum of all elements in any row of the transportation plan matrix is equal to the evidence use probability of the candidate document in that row, and the sum of all elements in any column of the transportation plan matrix is equal to the target evidence probability of the candidate document in that column. Given that all elements in the transportation planning matrix are non-negative, the optimal transmission loss is calculated as follows: First, calculate the sum of the products of each element in the transportation planning matrix and the corresponding element in the cost matrix. Then, calculate the sum of the products of the regularization parameter and each element in the transportation planning matrix and the natural logarithm of that element minus one. Add the two sums together and take the minimum value. This minimum value is the optimal transmission loss.
6. The method of claim 5, wherein the method further comprises: The negative log-likelihood loss, optimal transmission loss, and tail exponential loss are weighted by loss weight parameters to obtain the total loss. Gradient descent is then used to jointly update the hyperparameters of the large model until convergence, including: Two loss weight parameters are set, where the first loss weight parameter corresponds to the weighting coefficient of the optimal transmission loss, and the second loss weight parameter corresponds to the weighting coefficient of the tail exponential loss. Calculate the total loss: The negative log-likelihood loss is directly included in the total loss, the optimal transmission loss is multiplied by the first loss weight parameter and included in the total loss, the tail exponential loss is multiplied by the second loss weight parameter and included in the total loss, and the three are added together to obtain the total loss. Determine the set of hyperparameters to be updated, which includes: curvature suppression coefficient, in-degree suppression power coefficient, smoothing constant, distribution smoothing parameter, regularization parameter, tail adjustment parameter, first loss weight and second loss weight; Set the learning rate; The hyperparameters are updated using gradient descent: the gradient of the total loss with respect to each hyperparameter in the hyperparameter set is calculated, and the product of the learning rate and the corresponding gradient is subtracted from the hyperparameter value of the current round to obtain the hyperparameter value of the next round. Set a convergence threshold; Calculate the absolute value of the difference between the total loss of the current round and the total loss of the previous round; if the absolute value of this difference is less than or equal to the convergence threshold, stop the hyperparameter update; If the absolute value of the difference is greater than the convergence threshold, the hyperparameter update step is repeated until the absolute value of the difference is less than or equal to the convergence threshold.
7. A system for hallucination suppression training of large models fused with real-time fact base verification, applied to the method for hallucination suppression training of large models fused with real-time fact base verification according to any one of claims 1-6, characterized in that, include: The graph construction module builds a real-time fact base graph and calculates the discrete Ricci curvature and in-degree of nodes in the real-time fact base graph. The graph analysis module retrieves candidate documents from the real-time fact base graph based on the input query, generates a neutral retrieval distribution by combining the distribution smoothing parameter, and reads the discrete Ricci curvature and in-degree of each candidate document. The evidence distribution calculation module uses geometric debiasing parameters to calculate the geometric debiasing weights of candidate documents. It then reweights and normalizes the neutral retrieval distribution using these geometric debiasing weights to obtain the target evidence distribution, including: Set the geometric debiasing parameters, which include the curvature suppression coefficient, the in-degree suppression power coefficient, and the smoothing constant; For each candidate document, the geometric debiasing weight is calculated by combining the discrete Ricci curvature and curvature suppression coefficient of the corresponding node, the in-degree and in-degree suppression power coefficient of the corresponding node, and the smoothing constant. Calculate the normalization constant, which is the sum of the products of the neutral retrieval probability of all candidate documents and their respective geometric debiasing weights; For each candidate document, the product of the neutral retrieval probability distribution of the candidate document and the geometric debiasing weight is divided by the normalization constant to obtain the target evidence distribution probability of the candidate document. The target evidence distribution probabilities of all candidate documents constitute the target evidence distribution. The likelihood loss calculation module encodes candidate documents, processes them through a gating network, and generates an evidence use distribution by combining distribution smoothing parameters. Based on the evidence use distribution, it calculates the negative log-likelihood loss. The transmission loss calculation module uses the shortest path distance of nodes in the real-time fact base graph as the cost, and combines regularization parameters to calculate the optimal transmission loss of evidence distribution to target evidence distribution. The exponential loss calculation module calculates the in-degree tail index based on the evidence distribution, and combines the baseline in-degree tail index of the neutral retrieval distribution with the tail adjustment parameters to calculate the tail exponential loss, including: Set the sample size parameters; In descending order of in-degree, select nodes from the candidate documents whose number is equal to the sample size parameter to form the first node set; At the same time, in descending order of node in-degree, nodes with a number equal to the sample size parameter are selected from the nodes corresponding to the candidate documents to form a second node set; For the first node set, obtain the evidence usage probability distribution corresponding to each node, calculate the ratio of the evidence usage probability distribution of each node to the sum of the evidence usage probabilities distribution of all nodes in the first node set, and obtain the normalized weight of each node in the first node set. Find the minimum in-degree of all nodes in the first node set, and use it as the first minimum in-degree; For each node in the first set of nodes, calculate the difference between the natural logarithm of the node's in-degree and the natural logarithm of the first minimum in-degree. Multiply this difference by the normalized weight of the node, and then sum all the multiplication results to obtain the in-degree tail index based on the evidence use distribution. For the second node set, obtain the neutral retrieval distribution probability corresponding to each node, calculate the ratio of the neutral retrieval distribution probability of each node to the sum of the neutral retrieval distribution probabilities of all nodes in the second node set, and obtain the normalized weight of each node in the second node set. Find the minimum in-degree among all nodes in the second node set, and use it as the second minimum in-degree; for each node in the second node set, calculate the difference between the natural logarithm of the node's in-degree and the natural logarithm of the second minimum in-degree, multiply the difference by the node's normalized weight, and then sum all the multiplication results to obtain the baseline in-degree tail index based on the neutral retrieval distribution; set the tail adjustment parameters. The target tail index is obtained by adding the baseline in-degree tail index to the tail adjustment parameter. Calculate the difference between the target tail index and the in-degree tail index based on the evidence use distribution. If the difference is negative, take zero as the adjusted difference. If the difference is non-negative, then the difference is directly used as the adjusted difference; the square of the adjusted difference is calculated to obtain the tail exponential loss. The hallucination suppression training module calculates the total loss by weighting the negative log-likelihood loss, optimal transmission loss, and tail exponential loss using loss weight parameters. It then uses gradient descent to jointly update the hyperparameters of the large model until convergence.
Citation Information
Patent Citations
Knowledge retrieval recall method and device for generating knowledge base based on retrieval enhancement
CN119961427A
Method for reducing model output illusion based on knowledge retrieval
CN120745697A