Method and system for eliminating illusion problem of generative large model
By defining sliding window, numerical amplification processing and negative feedback score mechanisms on the self-attention weight graph, and back-reassignment strategy, the problems of high data labeling cost and insufficient generalization ability in the cluster decoding method are solved, and the generation is significantly improved The accuracy and generalization ability of the large model of the type reduce the probability of generating hallucinations.
Patent Information
- Application Number
- CN202411144985.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-12-17
AI Technical Summary
The existing cluster decoding methods have problems such as high labor cost for data annotation, high data acquisition cost, low efficiency, and insufficient generalization capabilities for scenarios outside the data set.
Define the sliding window on the weight graph of self-attention, perform numerical amplification, and perform cluster search scores acting on the sequence through negative feedback scores, and correct the sequences caused by lag through backtrack-reassignment strategy.
It realizes more efficient and cost-effective generative large-scale model hallucination elimination, improves the accuracy and generalization ability of the model, and reduces the probability of generating hallucination content.
Smart Images

Figure CN119150986A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of network communication technology, digital twin applications, big data, artificial intelligence, the Internet of Things, edge computing, and 5G applications, and specifically to a method and system for eliminating the hallucination problem of a generative large model. Background Art
[0002] The hallucination phenomenon of large generative models has always been a difficult problem that cannot be ignored. When these models process images and queries provided by users, they sometimes give absurd answers due to hallucinations, incorrectly describe objects that do not exist in the image, or interpret the color, quantity, and position relationship of objects in the image in a way that is inconsistent with the facts. This hallucination phenomenon not only affects the reliability of the model, but may also cause serious misleading and errors in practical applications.
[0003] In order to solve the hallucination problem that plagues large generative models, traditional strategies mainly focus on two directions: one direction focuses on building and integrating additional training data, trying to optimize the performance of the model by increasing the amount of model training and reducing the occurrence of hallucinations. These methods expand the diversity and coverage of the data set, hoping that the model can correctly identify and reason in more scenarios. However, the implementation of these solutions is usually accompanied by high data collection costs and labor costs for data annotation, making it difficult to promote them on a large scale in practical applications.
[0004] Another direction is to seek assistance from external knowledge or more advanced models to provide more accurate information to guide the model's reasoning process. For example, some methods introduce knowledge graphs or expert systems to try to reduce the model's misjudgment by providing additional background information. However, such methods also have obvious limitations: the acquisition and integration of external knowledge is complex and costly, and the effectiveness of external knowledge may drop significantly when dealing with specific fields or new scenarios. In addition, many methods lack in-depth analysis and research on the intrinsic mechanisms and causes of hallucinations, resulting in insufficient generalization capabilities for scenarios outside the data set. Summary of the invention
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] Therefore, the technical problem solved by the present invention is that the existing cluster decoding method has the problems of high labor cost for data annotation, high cost for field data collection, low efficiency, and insufficient generalization ability for scenes outside the data set.
[0007] To solve the above technical problems, the present invention provides the following technical solutions: a method for eliminating the hallucination problem of generative large models, comprising defining a sliding window on a self-attention weight map; numerically amplifying the weights; directly applying the negative feedback score to the beam search score of the sequence; and correcting the sequence caused by lag through a backtracking-reallocation strategy.
[0008] As a preferred solution of the method for eliminating the hallucination problem of a generative large model according to the present invention, wherein: the step of defining a sliding window on a weight map of self-attention includes defining a sliding window on a weight map of self-attention and analyzing the attention distribution of the model during the reasoning process;
[0009] Defines the currently generated sequence and the corresponding causal self-attention weights
[0010] The weights are used to predict the next character token and are expressed as:
[0011]
[0012] Among them, Q, K, and D represent query features, key features, and feature dimensions, respectively;
[0013] To collect the previous self-attention weights, define the sliding window attention as Contains the attention weights from the tkth to the t-1th token, expressed as:
[0014]
[0015] in, k represents the size of the sliding window cropped on the attention map, ω i,j represents the attention weight assigned by the j-th token to the i-th token.
[0016] As a preferred solution of the method for eliminating the generative large model hallucination problem of the present invention, wherein: the numerical amplification of the weights includes numerically amplifying the weights and outputting a score vector by column multiplication;
[0017] The score vector reflects the degree to which the model relies on different information when generating sentences;
[0018] Output indicators to describe the size of the information aggregation pattern. Preprocessing is performed, including filling the upper triangular part of the matrix with zeros and scaling the attention values, expressed as:
[0019]
[0020] in, are all zero and σ represents a configurable scaling factor.
[0021] As a preferred solution of the method for eliminating the generative large model hallucination problem of the present invention, the numerical amplification of the weights includes performing column-by-column multiplication operations on the lower triangular part of the attention matrix and outputting a vector of column-by-column scores;
[0022] The score is proportional to the degree of over-reliance in the corresponding position;
[0023] The maximum value of the column-by-column score vector is selected as the feature of the knowledge aggregation mode, which is expressed as:
[0024]
[0025] Where c represents the subscript value of the column of the formula vector.
[0026] As a preferred solution of the method for eliminating the generative large model hallucination problem of the present invention, wherein: the direct effect of the negative feedback score on the beam search score of the sequence includes that in the beam search process, the sequences with scores below the threshold are gradually eliminated, and the sequences with scores above the threshold are selected as the final output;
[0027] Automatically suppress the feature sequences that are highly trusted during the decoding process, reducing the probability of generating hallucinatory content;
[0028] Select the top N of the log-probabilities for each beam can values to form a candidate set Y, |Y| = N can *N beam , N beam is the number of beams;
[0029] The prediction is restricted to the candidate set and φ(w ≤t ) is combined with the model’s log probability to predict the next token, expressed as:
[0030]
[0031] Among them, x t ∈Y,w ≤t represents a simplified representation of all attention weights obtained by passing the sequence {x0,x1,...,xt} forward.
[0032] As a preferred solution of the method for eliminating the generative large model hallucination problem of the present invention, wherein: the correction of the sequence caused by hysteresis by the backtracking-reallocation strategy includes that the highly trusted features are not revealed until the late stage of the decoding process, and the hysteresis causes the generated sequence to be unable to be corrected in time;
[0033] A backtracking-reallocation strategy is proposed. In this strategy, if the maximum subscript appears in the score vector of the most recent character and the number of consecutive subscript appearances is higher than a threshold, the model relies on specific information when generating characters.
[0034] The decoding process is backtracked to find the character position corresponding to the subscript, and the word with the second highest probability is selected from the word list again, excluding the previously selected words, and replaced to correct the generated hallucination content;
[0035] Given a sequence {x0,x1,...,xt-1} and the nearest position coordinate set C, check whether the coordinates are consistent. The number of overlaps is expressed as:
[0036]
[0037] Among them, 1 represents an indicator function that returns 1 when the condition is true and 0 otherwise, (Mode represents a function that obtains the mode of a set of values.
[0038] As a preferred solution of the method for eliminating the generative large model hallucination problem of the present invention, wherein: the correction of the sequence caused by hysteresis by the backtracking-reallocation strategy includes setting the threshold value of the number of overlaps to r;
[0039] If (N overlap ≥r), consider implementing backtracking and regard the mode (s = Mode (C)) as the position of the summary marker;
[0040] Assume that the sequence {x0,x1,...,xs,...,xt-1} exhibits a high confidence aggregation phenomenon at the summary mark (xs), roll back the decoding process to the sequence {x0,x1,...,xs} and select the corresponding sequence from the complementary set (Υ / x s+1 ) to reallocate and select a new tag;
[0041] Since subsequent rollbacks will go further than previous rollbacks, the rollback position(s) is monotonically non-decreasing;
[0042] Configure the maximum number of rollbacks (β). If (xs) has reached the maximum number of rollbacks, consider rolling back to {x0,x1,...,xs-1}.
[0043] Another object of the present invention is to provide a system for eliminating the problem of generative large model hallucination, which can solve the problem of insufficient generalization ability of current beam decoding methods for scenes outside the data set through a backtracking-reallocation strategy.
[0044] As a preferred solution of the system for eliminating the hallucination problem of generative large models described in the present invention, it includes: a sliding window definition module, an amplification processing module, a beam search module, and a backtracking-reallocation module; the sliding window definition module is used to analyze the attention distribution of the model during the reasoning process; the amplification processing module is used to reflect the degree of dependence of the model on different information when generating sentences; the beam search module is used to reduce the probability of generating hallucination content; and the backtracking-reallocation module is used to correct the sequence caused by lag.
[0045] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of a method for eliminating the hallucination problem of a generative large model.
[0046] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for eliminating the hallucination problem of a generative large model.
[0047] Beneficial effects of the present invention: The method for eliminating the hallucination problem of a generative large model provided by the present invention defines a sliding window on a weight map of self-attention, performs numerical amplification processing on the weights, reflects the degree of dependence of the model on different information when generating sentences through a score vector, does not rely on the integration of additional training data and external knowledge, is more efficient and cost-effective in the implementation process, directly acts on the beam search score of the sequence with negative feedback scores, corrects the sequence caused by lag through a backtracking-reallocation strategy, and discovers the internal mechanism and cause of the hallucination phenomenon from the root through the backtracking-reallocation strategy. Compared with traditional strategies, the present invention has better generalization ability and achieves better results in terms of accuracy, cost-effectiveness and generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0049] Figure 1 An overall flow chart of a method for eliminating the generative large model hallucination problem provided by the first embodiment of the present invention.
[0050] Figure 2 An overall flow chart of a system for eliminating the generative large model hallucination problem provided by the third embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0052] Example 1, reference Figure 1 , as an embodiment of the present invention, provides a method for eliminating the problem of hallucination of a generative large model, comprising:
[0053] S1: Define a sliding window on the self-attention weight map.
[0054] Furthermore, a sliding window is defined on the self-attention weight map to more accurately analyze the attention distribution of the model during inference.
[0055] It should be noted that the formula calculation process is as follows: a currently generated sequence is defined and the corresponding causal self-attention weights These weights are used to predict the next character token. These weights can be calculated using the following formula:
[0056]
[0057] Among them, Q, K, and D represent query features, key features, and feature dimensions, respectively.
[0058] In order to collect the previous self-attention weights, a sliding window attention is defined It contains the attention weights from the tkth to the t-1th token, expressed as:
[0059]
[0060] in, where k represents the size of the sliding window cropped on the attention map, and ω i,j represents the attention weight assigned by the j-th token to the i-th token.
[0061] S2: Numerically amplify the weights.
[0062] Furthermore, these weights are numerically amplified and a score vector is calculated by column multiplication. This score vector reflects the degree of reliance of the model on different information when generating sentences.
[0063] It should be noted that the formula calculation process is as follows: With the sliding window attention weight A simple metric can be calculated to describe the size of the information aggregation pattern. Specifically, first Some preprocessing is done, including padding the upper triangular part of the matrix with zeros and scaling up the attention values since these are usually small. That is,
[0064]
[0065] in, are all zero and σ is a configurable scaling factor.
[0066] It should also be noted that column-by-column multiplication is performed on the lower triangular part of the attention matrix, and a column-by-column score vector is obtained. Intuitively, a larger score indicates a stronger degree of over-trust at the corresponding position. Therefore, the maximum value of the column-by-column score vector is selected as the feature of the knowledge aggregation mode.
[0067] The formula is as follows:
[0068]
[0069] Where c represents the subscript value of the column of the formula vector.
[0070] S3: Apply the negative feedback score directly to the sequence’s beam search score.
[0071] Furthermore, the negative feedback score is directly applied to the sequence's beam search score. During the beam search process, sequences with lower scores will be gradually eliminated, while sequences with higher scores are more likely to be selected as the final output. In this way, sequences that show "high trust" characteristics can be automatically suppressed during the decoding process, thereby reducing the probability of generating hallucination content.
[0072] It should be noted that the calculation process of the formula is as follows: For the sake of computational efficiency and to avoid bias in producing unreasonable outputs for the model, we select the first N in the logarithmic probability of each beam can values to form a candidate set Y, where |Y| = N can *N beam , N beam is the number of beams. In this way, the prediction is restricted to the candidate set and φ(w ≤t ) is combined with the model’s log probability to predict the next token, i.e.,
[0073]
[0074] Among them, x t ∈Y. Here w ≤t is a simplified representation of all attention weights obtained by passing the sequence {x0,x1,...,xt} forward.
[0075] S4: Correcting the sequence caused by hysteresis through the backtracking-reallocation strategy.
[0076] Furthermore, since “high confidence” features usually appear only late in the decoding process, this lag may result in some already generated sequences not being corrected in a timely manner.
[0077] It should be noted that in order to solve this problem, a "backtracking-reallocation" strategy is further proposed. In this strategy, if a maximum subscript appears in the score vectors of the most recent characters and the number of consecutive occurrences of the subscript is too high, it means that the model may have over-reliant on a certain specific information when generating these characters. At this time, the decoding process will be backtracked to find the character position corresponding to the subscript, and the word with the second highest probability will be selected from the vocabulary (excluding the words that have been selected before) for replacement. In this way, the generated hallucination content can be corrected to a certain extent, improving the accuracy and reliability of the model.
[0078] The calculation formula is as follows:
[0079] Given a sequence {x0,x1,...,xt-1} and its nearest position coordinates set C, we can easily check whether these coordinates are consistent. The number of overlaps can be calculated using the following formula:
[0080]
[0081] Among them, 1 is an indicator function that returns 1 when the condition is true, otherwise it returns 0; (Mode) is a function that obtains the mode of a set of values.
[0082] Set the threshold of overlap times to r. If (N overlap ≥r), consider backtracking and regard the mode (s=Mode(C)) as the position of the summary mark. Assume that the sequence {x0,x1,...,xs,...,xt-1} exhibits a "high confidence aggregation" phenomenon at the summary mark (xs). It is intended to roll back the decoding process to the sequence {x0,x1,...,xs} and select the corresponding value from the complementary set (Υ / x s+1 ) is reallocated to select the next new mark. Since the subsequent rollback will go further than the previous rollback, the rollback position (s) must be monotonically non-decreasing. In addition, a maximum number of rollbacks (β) is configured. If (xs) has reached the maximum number of rollbacks, consider rolling back to {x0,x1,...,xs-1}.
[0083] A sliding window is defined on the self-attention weight map to more accurately analyze the attention distribution of the model during inference.
[0084] These weights are numerically amplified and a score vector is calculated by column multiplication. This score vector reflects the degree of reliance of the model on different information when generating sentences.
[0085] Apply the negative feedback score directly to the sequence's beam search score.
[0086] Since the “high confidence” feature usually appears later in the decoding process, this lag may cause some generated sequences to fail to be corrected in time. To solve this problem, a “backtracking-reallocation” strategy is further proposed.
[0087] Example 2, an embodiment of the present invention, provides a method for eliminating the generative large model hallucination problem. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0088] First, the experiment involves two groups: an experimental group (applying a new method) and a control group (applying existing technology). The experimental object is the output sequence of the generative large model, focusing on analyzing its attention distribution when generating text, the generation of hallucination content, and the quality of the final output. The experimental process is divided into several parts, including data preparation, model training, evaluation index setting, and experimental step implementation.
[0089] Data preparation: 50,000 images were randomly selected from the open source corpus as training data, and another 10,000 images were selected as verification data. The data used covered multiple scenarios to ensure that the model can be widely generalized.
[0090] Model training: Using the PyTorch deep learning framework, the Qwen-VL-base model was selected as the basic architecture for multiple rounds of training. The experimental group used the method proposed in this paper to define the sliding window, weight value amplification, and negative feedback score directly acting on the sequence beam search score, and used the backtracking-reallocation strategy to correct the lag. The control group used the conventional self-attention mechanism and beam search decoding algorithm without any special treatment.
[0091] Evaluation index setting: The evaluation index includes the accuracy (Accuracy), cost-effectiveness (CostEfficiency), generalization ability (GeneralizationAbility) and the incidence rate of hallucination content (IllusionRate) of the model-generated text. Among them:
[0092] Accuracy: The degree of match between the generated text and the reference answer.
[0093] Cost-effectiveness: The computing resources and time required for model training and inference.
[0094] Generalization: How well the model performs on unseen validation data.
[0095] Incidence of hallucinatory content: the proportion of illogical or factual errors in the generated text.
[0096] Experimental steps:
[0097] A sliding window is defined on the self-attention weight map, and the window size is set to 3 to analyze the attention distribution of the model during the reasoning process.
[0098] The self-attention weights are numerically scaled up by setting the scaling factor σ to 2.0 and filling the upper triangular part of the matrix with zeros.
[0099] In the process of cluster decoding, a negative feedback scoring mechanism is introduced to gradually eliminate sequences with scores below the threshold, and the threshold is set to -0.5.
[0100] A backtracking-reallocation strategy was implemented. For sequences caused by hysteresis, a check was performed every 5 steps during the generation process. The overlap threshold was set to 3 and the maximum rollback number was set to 10.
[0101] 5. Recording of results: The experimental results were recorded and compared in the experimental and control groups, and the data were presented in a tabular form.
[0102] Table 1 Experimental data table
[0103]
[0104] Data Analysis:
[0105] From the experimental data in the table, it can be seen that the experimental group showed significant advantages in accuracy, cost-effectiveness, generalization ability and the incidence of hallucination content.
[0106] 1. Accuracy: The average accuracy of the experimental group was 92.425%, which was an increase of about 3.525 percentage points compared to 88.9% of the control group.
[0107] 2. Cost-effectiveness: In terms of cost-effectiveness, the experimental group consumed an average of 8.35 units of resources and 15.25 units of time, which was significantly reduced compared to 10.2 / 18.5 in the control group.
[0108] 3. Generalization ability: The average generalization ability of the experimental group was 90.125%, while that of the control group was 85.7%.
[0109] 4. The incidence of hallucination content: The average incidence of hallucination content in the experimental group was 1.025%, while that in the control group was 3.75%. The experimental results show that through the numerical amplification and negative feedback scoring mechanism, the probability of the model generating hallucination content is significantly reduced, which verifies the effectiveness of the method.
[0110] In summary, the present invention achieves better results in terms of accuracy, cost-effectiveness and generalization ability.
[0111] Example 3, reference Figure 2 , as an embodiment of the present invention, provides a system for eliminating the generative large model hallucination problem, including a sliding window definition module, an amplification processing module, a beam search module, and a backtracking-reallocation module.
[0112] The sliding window definition module is used to analyze the attention distribution of the model during the reasoning process, the amplification processing module is used to reflect the model's dependence on different information when generating sentences, the beam search module is used to reduce the probability of generating hallucinatory content, and the backtracking-reallocation module is used to correct the sequence caused by lag.
[0113] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it 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 the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0114] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0115] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0116] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc. It should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and are not limited. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
[0117] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for eliminating the hallucination problem of generative large models, characterized in that: include: Define a sliding window on the self-attention weight map; Numerical amplification of weights; Apply the negative feedback score directly to the sequence's beam search score; Correcting the sequence caused by hysteresis through a backtracking-reallocation strategy.
2. The method for eliminating the generative large model hallucination problem as claimed in claim 1, characterized in that: Defining a sliding window on the weight map of self-attention includes defining a sliding window on the weight map of self-attention and analyzing the attention distribution of the model during the reasoning process; Defines the currently generated sequence and the corresponding causal self-attention weights The weights are used to predict the next character token and are expressed as: Among them, Q, K, and D represent query features, key features, and feature dimensions, respectively; To collect the previous self-attention weights, define the sliding window attention as Contains the attention weights from the tkth to the t-1th token, expressed as: in, k represents the size of the sliding window cropped on the attention map, ω i,j represents the attention weight assigned by the j-th token to the i-th token.
3. The method for eliminating the generative large model hallucination problem as claimed in claim 2, characterized in that: The numerically amplifying the weights includes numerically amplifying the weights and outputting a score vector by column multiplication; The score vector reflects the degree to which the model relies on different information when generating sentences; Output indicators to describe the size of the information aggregation pattern. Preprocessing is performed, including filling the upper triangular part of the matrix with zeros and scaling the attention values, expressed as: in, are all zero and σ represents a configurable scaling factor.
4. The method for eliminating the generative large model hallucination problem as claimed in claim 3, characterized in that: The numerical amplification of the weights includes performing column-by-column multiplication on the lower triangular part of the attention matrix and outputting a vector of column-by-column scores; The score is proportional to the degree of over-reliance in the corresponding position; The maximum value of the column-by-column score vector is selected as the feature of the knowledge aggregation mode, which is expressed as: Where c represents the subscript value of the column of the formula vector.
5. The method for eliminating the generative large model hallucination problem as claimed in claim 4, characterized in that: Directly acting the negative feedback score on the beam search score of the sequence includes that in the beam search process, the sequences with scores below the threshold are gradually eliminated, and the sequences with scores above the threshold are selected as the final output; Automatically suppress the feature sequences that are highly trusted during the decoding process, reducing the probability of generating hallucinatory content; Select the top N of the log-probabilities for each beam can values to form a candidate set Y, |Y| = N can *N beam , N beam is the number of beams; The prediction is restricted to the candidate set and φ(w ≤t ) is combined with the model’s log probability to predict the next token, expressed as: Among them, x t ∈Y,w ≤t represents a simplified representation of all attention weights obtained by passing the sequence {x0,x1,...,xt} forward.
6. The method for eliminating the generative large model hallucination problem as claimed in claim 5, characterized in that: The sequence caused by the hysteresis corrected by the backtracking-reallocation strategy includes that the highly trusted features are not revealed until the late stage of the decoding process, and the hysteresis causes the generated sequence to be unable to be corrected in time; A backtracking-reallocation strategy is proposed. In this strategy, if the maximum subscript appears in the score vector of the most recent character and the number of consecutive subscript appearances is higher than a threshold, the model relies on specific information when generating characters. The decoding process is traced back to find the character position corresponding to the subscript, and the word with the second highest probability is selected from the word list again, excluding the previously selected words, and replaced to correct the generated hallucination content; Given a sequence {x0,x1,...,xt-1} and the nearest position coordinate set C, check whether the coordinates are consistent. The number of overlaps is expressed as: Among them, 1 represents an indicator function that returns 1 when the condition is true and 0 otherwise, and (Mode) represents a function that obtains the mode of a set of values.
7. The method for eliminating the generative large model hallucination problem as claimed in claim 6, characterized in that: The method of correcting the sequence caused by hysteresis by the backtracking-reallocation strategy includes setting a threshold value of the number of overlaps to r; If (N overlap ≥r), consider implementing backtracking and regard the mode (s = Mode (C)) as the position of the summary marker; Assume that the sequence {x0,x1,...,xs,...,xt-1} exhibits a high confidence aggregation phenomenon at the summary mark (xs), roll back the decoding process to the sequence {x0,x1,...,xs} and select the corresponding sequence from the complementary set (Υ / x s+1 ) to reallocate and select a new tag; Since subsequent rollbacks will go further than previous rollbacks, the rollback position(s) is monotonically non-decreasing; Configure the maximum number of rollbacks (β). If (xs) has reached the maximum number of rollbacks, consider rolling back to {x0,x1,...,xs-1}.
8. A system using the method for eliminating the generative large model hallucination problem as claimed in any one of claims 1 to 7, characterized in that: It includes sliding window definition module, amplification processing module, beam search module, and backtracking-reallocation module; The sliding window definition module is used to analyze the attention distribution of the model during the reasoning process; The amplification processing module is used to reflect the degree of reliance of the model on different information when generating sentences; The beam search module is used to reduce the probability of generating hallucination content; The backtracking-reallocation module is used to correct the sequence caused by hysteresis.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for eliminating the generative large model hallucination problem according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for eliminating the generative large model hallucination problem according to any one of claims 1 to 7 are implemented.
