A method for judging information authenticity based on attention mechanism

Through the information authenticity judgment method based on the attention mechanism, multiple reasons for text content are generated and evaluated, and the interactive attention and reverse attention mechanism training model is used to solve the problem of difficult to utilize background knowledge in the existing methods, and the information authenticity judgment with higher accuracy and applicability is achieved.

CN120234415BActive Publication Date: 2025-08-12NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510702897.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-08-12
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

Existing methods for judging information authenticity are difficult to effectively utilize background knowledge and potential clues in text content, and require additional resources and time to accumulate, resulting in reduced applicability.

Method used

The information authenticity judgment method based on the attention mechanism is adopted, and by generating multiple reasons that support the text content as real and false information, the interactive attention mechanism and the reverse attention mechanism are used to evaluate the importance of reasons, and the information authenticity judgment model is trained in combination with the binary classification main loss function, the comparison loss function, the cause discrimination loss function and the KL divergence loss function.

Benefits of technology

It improves the accuracy and applicability of the judgment of information authenticity, can obtain more potential background information in the text content, and is suitable for automated detection of false information, especially in the case of data imbalance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234415B_ABST
    Figure CN120234415B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information detection technology, and discloses a method for judging the authenticity of information based on an attention mechanism, comprising: obtaining multiple first reasons supporting that sample text content is true information and multiple second reasons supporting that the sample text content is false information; training an information authenticity judgment model through the following steps: encoding the sample text content, multiple first reasons, and multiple second reasons respectively to obtain a sample text code, multiple first reason codes, and multiple second reason codes; adopting an interactive attention mechanism to aggregate the sample text code with each first reason code and each second reason code respectively to obtain multiple aggregated codes, and adopting a reverse attention mechanism from the sample text code to each first reason code and each second reason code to evaluate the importance of each aggregated code; detecting the authenticity of the target text content through the information authenticity judgment model to improve the judgment accuracy of the information authenticity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information detection technology, and in particular to a method, device, equipment and medium for judging the authenticity of information based on an attention mechanism. Background Art

[0002] With the continuous development of digital technology, online communication on social platforms has become increasingly common. However, this has also led to a rapid increase in the amount of false information and its widespread dissemination. Because false information is often deliberately fabricated to attract public attention, it affects people's daily lives and social stability. Therefore, there is an urgent need to detect false information.

[0003] Existing detection methods extract semantic and sentiment features from text content to determine information authenticity. However, text content often contains rich background knowledge and potential clues, which are difficult for smaller models to extract. Furthermore, while comments, publisher information, and social context can help detect false information during the dissemination of text information, this knowledge and experience requires additional resources and time to accumulate, reducing the applicability of such methods. Therefore, there is currently no method that can effectively determine information authenticity. Summary of the Invention

[0004] The purpose of the present invention is to provide a method, device, equipment and medium for judging the authenticity of information based on an attention mechanism, which can solve the problem that it is currently impossible to effectively judge the authenticity of information.

[0005] To solve the above technical problems, an embodiment of the present invention provides a method for determining information authenticity based on an attention mechanism, comprising the following steps:

[0006] Get sample text content;

[0007] Generating a plurality of first reasons supporting that the sample text content is true information and a plurality of second reasons supporting that the sample text content is false information; wherein the number of the first reasons and the number of the second reasons are the same;

[0008] Using sample text content, multiple first reasons, and multiple second reasons, the information authenticity judgment model is trained through the following steps:

[0009] Encode the sample text content, multiple first reasons, and multiple second reasons respectively to obtain a sample text code, multiple first reason codes, and multiple second reason codes; adopt an interactive attention mechanism to aggregate the sample text code with each first reason code and each second reason code respectively to obtain multiple aggregate codes; adopt a reverse attention mechanism from the sample text code to each first reason code and each second reason code to evaluate the importance of each aggregate code; wherein the importance of the aggregate code is used to represent the contribution of the corresponding first reason to supporting the sample text content as true information, or the contribution of the second reason to supporting the sample text content as false information;

[0010] The target text content and a plurality of first reasons and a plurality of second reasons corresponding to the target text content are input into an information authenticity judgment model to detect the authenticity of the target text content.

[0011] Optionally, the information authenticity judgment model is trained using sample text content, multiple first reasons, and multiple second reasons through the following loss functions: a binary classification main loss function, a contrast loss function, a cause discrimination loss function, and a KL divergence loss function;

[0012] Among them, the binary classification main loss function is constructed based on whether the sample text content is false information, the contrast loss function is constructed based on the similarity between the sample text content and the first reason and the second reason respectively, the cause discrimination loss function is constructed based on the contribution of the first reason to supporting the sample text content as true information and the contribution of the second reason to supporting the sample text content as false information, and the KL divergence loss function is constructed based on the difference between the first reason and the second reason.

[0013] Optionally, the binary classification main loss function is:

[0014] ;

[0015] ;

[0016] Where, represents the cross entropy loss, is a multi-layer perceptron; y is the label of the sample text content, indicating whether the sample text content is false information; express The weight of Sample text encoding enhanced by self-attention mechanism, The aggregated code is formed by aggregating the sample text code, the first reason code and the second reason code;

[0017] The contrast loss function is:

[0018] ;

[0019] Where, is an exponential function. When the label of the sample text content is true information, It is an aggregated code formed by aggregating the sample text code and the first reason code. When the label of the sample text content is false information, It is the aggregate code formed by aggregating the sample text code and the second reason code. The elements in The elements in are opposite; It is a random sampling operation, which means randomly taking an instance from the set; Used to measure the cosine similarity of two vectors. is the temperature parameter, which is used to adjust the kurtosis of the softmax distribution;

[0020] The cause discrimination loss function is:

[0021] ;

[0022] In the formula, CAT represents or To splice, It is the aggregate code formed by aggregating the sample text code and the first reason code. The aggregate code is formed by aggregating the sample text code and the second reason code;

[0023] The KL divergence loss function is:

[0024] ;

[0025] Where KL represents the calculation of KL divergence.

[0026] Optionally, there are multiple sample text contents, and the information authenticity judgment model is trained through the following steps:

[0027] For each sample text content, a base learner is obtained by training the sample text content and the corresponding multiple first reasons and multiple second reasons;

[0028] The base learners of multiple sample text contents are integrated using a boosting strategy to obtain an information authenticity judgment model.

[0029] Optionally, the boosting strategy is used to integrate base learners of multiple sample text contents to obtain an information authenticity judgment model, including:

[0030] S1. Generate an initial base learner of multiple sample text contents and initialize the weight of each sample text content to , X is a collection of multiple sample text contents;

[0031] S2, use with weight The sample text content trains the nth base learner , and calculate the error. The error calculation formula of the nth base learner is:

[0032] ;

[0033] Where, is the i-th sample text content, N is the number of sample text contents, It is an indicator function. When the input is True, the output is 1, and when the input is False, the output is 0. is the label of the i-th sample text content, indicating whether the sample text content is false information or true information;

[0034] If the error is greater than 0.5, the improvement strategy is terminated, otherwise it goes to S3;

[0035] S3. Update the weight of each sample text content according to the error. The update formula is as follows:

[0036] ;

[0037] Where, , is an exponential function;

[0038] Normalize the updated weights:

[0039] ;

[0040] Where, is the updated weight;

[0041] S4, repeat S2 and S3 N times to obtain N trained base learners;

[0042] The information authenticity judgment model is:

[0043] ;

[0044] Where, represents an ensemble of n base learners.

[0045] Optionally, generating a plurality of first reasons supporting that the sample text content is true information and a plurality of second reasons supporting that the sample text content is false information includes:

[0046] The system prompt for building a large language model is: Please understand the following text and provide multiple reasons why it is true and multiple reasons why it is false. In addition, since the text is scraped from the Internet, there may be some noise or defects, please ignore them.

[0047] The sample text content and the system prompt words are input into the large language model to obtain multiple first reasons supporting that the sample text content is true information and multiple second reasons supporting that the sample text content is false information.

[0048] Optionally, there are at least three first reasons and at least three second reasons respectively.

[0049] An embodiment of the present invention further provides an information authenticity judgment device based on an attention mechanism, comprising:

[0050] Sample acquisition module, used to obtain sample text content;

[0051] A sample processing module, configured to generate a plurality of first reasons supporting that the sample text content is true information and a plurality of second reasons supporting that the sample text content is false information; wherein the number of the first reasons and the number of the second reasons are the same;

[0052] The model training module is used to train an information authenticity judgment model using sample text content, multiple first reasons, and multiple second reasons through the following steps:

[0053] Encode the sample text content, multiple first reasons, and multiple second reasons respectively to obtain a sample text code, multiple first reason codes, and multiple second reason codes; adopt an interactive attention mechanism to aggregate the sample text code with each first reason code and each second reason code respectively to obtain multiple aggregate codes; adopt a reverse attention mechanism from the sample text code to each first reason code and each second reason code to evaluate the importance of each aggregate code; wherein the importance of the aggregate code is used to represent the contribution of the corresponding first reason to supporting the sample text content as true information, or the contribution of the second reason to supporting the sample text content as false information;

[0054] The text detection module is used to input the target text content and multiple first reasons and multiple second reasons corresponding to the target text content into the information authenticity judgment model to detect the authenticity of the target text content.

[0055] An embodiment of the present invention also provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned information authenticity judgment method based on the attention mechanism.

[0056] An embodiment of the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned information authenticity judgment method based on the attention mechanism.

[0057] The information authenticity judgment method based on the attention mechanism provided by the present invention has at least the following beneficial effects:

[0058] For text content, by generating multiple reasons to support it as true information and multiple reasons to support it as false information, more potential background information about the text content is obtained. However, not all generated reasons contribute equally to detecting whether the text content is false information. Therefore, an interactive attention mechanism and a reverse attention mechanism from text content to reasons are used to obtain the importance of each reason, and the contribution of each reason to supporting the sample text content as true information or false information is obtained. The information authenticity judgment model obtained based on this training can be used to judge the authenticity of the text content that needs to be detected. It can overcome the problem that potential background information in the text content is difficult to obtain, and has better applicability while effectively improving the accuracy of text content information authenticity judgment. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] One or more embodiments are exemplarily described by the figures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments.

[0060] Figure 1 This is a flowchart of a method for determining information authenticity based on an attention mechanism according to an embodiment of the present invention;

[0061] Figure 2 is a comparison chart of detection results of different language models provided according to an embodiment of the present invention;

[0062] Figure 3 is a comparison chart of detection results using different numbers of reasons provided according to an embodiment of the present invention;

[0063] Figure 4 This is a comparison chart of detection results of different models under different levels of false information scarcity, provided according to an embodiment of the present invention;

[0064] Figure 5This is a comparison chart of the detection results of the corresponding models using different large language models generated according to an embodiment of the present invention. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be understood by those skilled in the art that in the embodiments of the present invention, many technical details are provided to enable the reader to better understand the present invention. However, even without these technical details and the various changes and modifications based on the following embodiments, the technical solutions claimed in the present invention can be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with each other and referenced to each other under the premise that there is no contradiction.

[0066] One embodiment of the present invention relates to a method for determining the authenticity of information based on an attention mechanism. The specific process of the method for determining the authenticity of information based on an attention mechanism in this embodiment can be as follows: Figure 1 As shown, including:

[0067] Step 101: Obtain sample text content.

[0068] Step 102 : Generate a plurality of first reasons supporting that the sample text content is true information and a plurality of second reasons supporting that the sample text content is false information; wherein the number of the first reasons and the number of the second reasons are the same.

[0069] Step 103: Using the sample text content, multiple first reasons, and multiple second reasons, a model for determining information authenticity is trained through the following steps:

[0070] The sample text content, multiple first reasons and multiple second reasons are encoded respectively to obtain the sample text code, multiple first reason codes and multiple second reason codes; the interactive attention mechanism is used to aggregate the sample text code with each first reason code and each second reason code respectively to obtain multiple aggregate codes; the reverse attention mechanism from the sample text code to each first reason code and each second reason code is used to evaluate the importance of each aggregate code; wherein the importance of the aggregate code is used to characterize the contribution of the corresponding first reason to supporting the sample text content as true information, or the contribution of the second reason to supporting the sample text content as false information.

[0071] Step 104 : Input the target text content and the multiple first reasons and multiple second reasons corresponding to the target text content into the information authenticity judgment model to detect the authenticity of the target text content.

[0072] In this embodiment, for text content, by generating multiple reasons supporting that it is true information and multiple reasons supporting that it is false information, more potential background information about the text content is obtained. However, not all generated reasons contribute equally to detecting whether the text content is false information. Therefore, an interactive attention mechanism and a reverse attention mechanism from text content to reasons are used to obtain the importance of each reason, and obtain the contribution of each reason to supporting that the sample text content is true information or false information. The information authenticity judgment model obtained based on this training can be used to judge the authenticity of the text content that needs to be detected. It can overcome the problem that potential background information in the text content is difficult to obtain, and has better applicability while effectively improving the accuracy of text content information authenticity judgment.

[0073] The following is a detailed description of the implementation details of the information authenticity judgment method based on the attention mechanism of this embodiment. The following content is only the implementation details provided for the convenience of understanding and is not necessary for the implementation of this solution.

[0074] In step 102, a large language model (LLM), such as GPT-4.0 or Doubao, is selected. The system prompt for the large language model is: "Please understand the following text and provide multiple reasons why it is true and multiple reasons why it is false. Since the text is scraped from the internet, there may be some noise or flaws; please ignore them." Each piece of text is then fed into the large language model along with the system prompt to generate multiple first reasons supporting the claim that the text is true and multiple second reasons supporting the claim that the text is false. The number of first reasons and second reasons is the same, and at least three first reasons and three second reasons are generated, respectively.

[0075] This embodiment is specifically described below by taking the example that there are three first reasons and three second reasons respectively.

[0076] In step 103, the pre-trained BERT (Bidirectional Encoder Representations from Transformers) model is first used to encode the sample text content, multiple first reasons, and multiple second reasons. Assume that the sample text content C and the three generated first reasons , three second reasons , and encode them separately as follows:

[0077] ;

[0078] Where, 、 、 Represents sample text content C and the three first reasons supporting that the sample text content is true information And three second reasons supporting that the sample text content is false information The encoding vector is the sample text encoding, the first reason encoding and the second reason encoding. In this case, n is the number of first reasons and the number of second reasons, n=1,2,3.

[0079] Then, the interactive attention mechanism is used to aggregate the sample text encoding with each first reason encoding and each second reason encoding respectively, as follows:

[0080] ;

[0081] Where, ,and ; , , , are all preset learning parameters; d represents the encoding vector (i.e., the dimension of the sample text encoding, the first reason encoding, and the second reason encoding), then That is, the aggregated code formed by aggregating the sample text code with the first reason code and the second reason code.

[0082] The above aggregation operation obtains six different aggregation codes, which respectively aggregate six reasons.

[0083] Next, we use the reverse attention mechanism from the sample text encoding to each first reason encoding and each second reason encoding to evaluate each aggregate encoding. Importance:

[0084] ;

[0085] In the formula, the multilayer perceptron (MLP) converts the attention vector into a weight coefficient , the interpretable weight coefficient Ability to adapt text embeddings based on reason-attention The weight of each aggregate code is evaluated based on this importance.

[0086] Because not all generated justifications contribute equally to detection, this example employs an interactive attention module that dynamically focuses on the original text and each justification. This includes a strategy for reason aggregation and interpretability weight adjustment. The weight coefficient reflects the importance of each justification, helping to detect false text while maintaining interpretability, improving the effectiveness and transparency of the detection process.

[0087] In one example, after executing the above-mentioned interactive attention module to aggregate text content and reasons and dynamically reweighting six text embedded codes (i.e., aggregated codes) containing different reasons (i.e., evaluating the importance of each aggregated code), a contrastive learning strategy was also adopted to improve the encoding quality of the text content.

[0088] Specifically, we first use the self-attention mechanism to enhance the textual relations in the text content:

[0089] ;

[0090] Then, based on the label of the text content as true information (or false information), the distance between the text content and the reasons supporting that the text content is true information (or false information) is minimized, and the distance between the text content and the reasons supporting that the text content is false information (or true information) is maximized.

[0091] The contrast loss function is calculated as follows:

[0092] ;

[0093] Where, is an exponential function. When the label of the sample text content is true information, It is the aggregated code formed by aggregating the sample text code and the first reason code, that is, , when the label of the sample text content is false information, The aggregate code is formed by aggregating the sample text code and the second reason code, that is, ,and The elements in The elements in are opposite; It is a random sampling operation, which means randomly taking an instance from the set; Used to measure the cosine similarity of two vectors. is the temperature parameter used to adjust the kurtosis of the softmax distribution.

[0094] In a specific implementation, the information authenticity judgment model uses sample text content, multiple first reasons, and multiple second reasons, and is trained using the following loss functions: a binary classification main loss function, the aforementioned contrastive loss function, a cause discrimination loss function, and a relative entropy (Kullback-Leibler Divergence) loss function. The binary classification main loss function is constructed based on whether the sample text content is false information; the contrastive loss function is constructed based on the similarity between the sample text content and the first and second reasons, respectively; the cause discrimination loss function is constructed based on the contribution of the first reason to supporting the sample text content as true information, and the contribution of the second reason to supporting the sample text content as false information; and the KL divergence loss function is constructed based on the difference between the first and second reasons.

[0095] That is, this embodiment adopts the comprehensive loss function composed of the above loss functions The information authenticity judgment model is trained, which includes a binary classification main loss function, a contrast loss function for improving the encoding quality of the original text content, a cause discrimination loss function for aligning causes with labels, and a KL divergence loss function for distinguishing reasons supporting true information from those supporting false information, as follows:

[0096] First calculate the binary classification main loss function , through the attention weight calculation module based on dynamic concatenation, seven main embedded codes are calculated and normalized The weight of The weight calculation formula is as follows:

[0097] ;

[0098] Where, is the learnable matrix parameter in the attention model, yes The series attention coefficient, yes The series attention coefficient, , is the learnable matrix parameter in the attention mechanism, is a learnable vector parameter and T is a transpose operation.

[0099] After obtaining the weighted sum of the embedded code, the final prediction result is obtained through the multi-layer perceptron MLP, and the cross entropy loss is used to calculate the main loss function. The calculation method is as follows:

[0100] ;

[0101] Where, Represents the cross entropy loss, y is the label of the sample text content, indicating whether the sample text content is false information.

[0102] Then calculate the cause discrimination loss function , the reasons supporting whether the text content is false can be used as auxiliary evidence for judgment. The calculation formula is as follows:

[0103] ;

[0104] In the formula, CAT represents or To splice, It is the aggregate code formed by aggregating the sample text code and the first reason code. It is an aggregated code formed by aggregating the sample text code and the second reason code.

[0105] Next, in order to enhance the difference between the two types of reasons supporting whether the text content is false, the difference between them is calculated, that is, the KL divergence loss function of the reason :

[0106] ;

[0107] Where KL represents the calculation of KL divergence.

[0108] For the contrast loss function, see step 103.

[0109] The total loss function is the weighted sum of the above four loss functions, and the calculation formula is as follows:

[0110] ;

[0111] Where, , , is the weight hyperparameter of each loss function.

[0112] This embodiment specifically uses the pre-trained language model BERT to obtain embedded encodings of text content and its related reasons. The content-reason interaction attention module aggregates and reweights the text content and each reason, enabling the model to perceive the underlying contextual information within the text. A sampling-based contrastive learning module is then used to improve the encoding quality of the original text content. Finally, a composite loss function is designed to distinguish between the embedded encodings of true and false reasons and guide model training, resulting in a higher accuracy rate for the judgment method provided by the present invention.

[0113] In some embodiments, there are multiple sample text contents obtained, and the information authenticity judgment model is trained through the following steps: for each sample text content, a base learner is trained using the sample text content and the corresponding multiple first reasons and multiple second reasons, and then the base learners of the multiple sample text contents are integrated using a boosting strategy to obtain an information authenticity judgment model.

[0114] The following is a detailed description of how to use the boosting strategy to integrate multiple base learners, which includes the following steps:

[0115] S1. Generate an initial base learner of multiple sample text contents and initialize the weight of each sample text content to , X is a collection of multiple sample text contents;

[0116] S2, use with weight The sample text content trains the nth base learner , and calculate the error. The error calculation formula of the nth base learner is:

[0117] ;

[0118] Where, is the i-th sample text content, N is the number of sample text contents, It is an indicator function. When the input is True, the output is 1, and when the input is False, the output is 0. is the label of the i-th sample text content, indicating whether the sample text content is false information or true information;

[0119] If the error is greater than 0.5, the improvement strategy is terminated, otherwise it goes to S3;

[0120] S3. Update the weight of each sample text content according to the error. The update formula is as follows:

[0121] ;

[0122] Where, , is an exponential function;

[0123] Normalize the updated weights:

[0124] ;

[0125] Where, is the updated weight;

[0126] S4, repeat S2 and S3 N times to obtain N trained base learners;

[0127] The information authenticity judgment model is:

[0128] ;

[0129] Where, represents an ensemble of n base learners.

[0130] At this point, in the specific implementation, if the label data set is unbalanced or resources permit, the text content to be detected can be input into the trained false detection model , you can get the category of the text content, 1 represents that the text content is false information, and 0 represents that the text content is true information.

[0131] .

[0132] If low overhead is required, the text content to be detected can be directly input into the above base learner to obtain a text representation vector that integrates seven main encodings, and then the predicted text category is obtained through MLP:

[0133] = .

[0134] This example provides a flexible framework that can encode text using only base learners and predict the text category (i.e., whether it is false information) through an MLP, which can meet low overhead requirements. Alternatively, a model with an integrated boosting strategy can be used to predict text categories, achieving higher accuracy.

[0135] In summary, the information authenticity judgment method based on the attention mechanism of the present invention has the following beneficial effects:

[0136] (1) It can automatically detect false text information in information systems and make effective judgments even when there is an imbalance between true and false information data.

[0137] (2) Using a large language model to generate reasons for whether the text content is true or false information, which includes the background information of the text, can effectively improve the accuracy of model detection.

[0138] (3) We design an interpretable text detection base learner that can dynamically integrate text content and justification information and improve encoding quality. This lightweight base learner can directly detect the authenticity of text and achieves detection accuracy that is superior to the current state-of-the-art methods.

[0139] (4) The fake news detection model designed by this invention, which is an integration of multiple base learners, is referred to as the Large Language Model-assisted Fake News Detection method with Adaptive Boosting (LFND-AB). This is an adaptive boosting framework that addresses the label imbalance problem in text detection datasets. It can also dynamically adjust sample weights to improve detection performance, significantly outperforming existing methods. Both the base learner model and the LFND-AB model have excellent performance and can be flexibly selected in various situations.

[0140] The following is a verification of the information authenticity judgment method based on the attention mechanism of the present invention:

[0141] Figure 2 This is the detailed results of the LFND-AB model of the present invention and other comparative methods in detecting false text evaluation indicators in Chinese and English datasets. Figure 2 It can be seen that the proposed lightweight model (i.e., the explainable basis learner LFND) has the best detection performance. Compared with the best baseline, the Adaptive Rationale Guidance network for fake news detection (ARG), LFND improves by an average of 1.2% on the Chinese dataset and 1.1% on the English dataset. There are three reasons for this improvement: (1) The reasons generated by the LLM to support the authenticity of text information provide more detailed and specific background knowledge from a comprehensive perspective. In addition, by requiring three reasons for each aspect, the bias of the given reasons can be minimized and robustness can be enhanced. (2) The sampling-based contrastive learning not only introduces randomness to avoid overfitting, but also improves the quality of text content embedded encoding by narrowing the distance between positive pairs and pushing the distance between negative pairs away. (3) The joint loss function comprehensively considers the role of various embeddings in the fake news detection task, ensuring the quality of all embeddings, thereby optimizing model training.

[0142] Figure 3 The following is a comparison of the ablation experiment results with different reason settings and removal of each key module. LFND_1, LFND_2, LFND_R, and LFND_F represent the use of one pair of reasons, two pairs of reasons, only reasons supporting true information, and only reasons supporting false information, respectively. LFND_W is a model that uses an all-one matrix instead of an interpretable weight matrix. LFND- 、LFND- 、LFND- 、LFND- Respectively represent the model that removes the main loss function, contrast loss function, cause discrimination loss function and KL divergence loss function, and LFND-AB_AVG represents the model that keeps the sample weight of each base learner unchanged. Figure 3 As can be seen, the model using only one pair of reasons performs poorly. Increasing the number of reasons from one to two pairs improves performance, demonstrating that combining multiple reasons can enhance the model's ability to effectively detect misinformation. Furthermore, using only reasons supporting misinformation results in a slightly lower F1 score, indicating that focusing solely on reasons supporting misinformation does not provide sufficient information to effectively distinguish between textual information. Similarly, using only reasons supporting truthfulness leads to a further decline in performance, suggesting that using only truthfulness reasons is insufficiently informative for accurately detecting misinformation. Furthermore, the results show that removing key components from the model architecture leads to varying degrees of performance degradation. In particular, LFND_W, which replaces the interpretable weight matrix with a matrix of all ones, shows a significant performance degradation. This demonstrates the importance of the interpretable weight matrix in guiding the model's decision-making process. Removing various loss terms also results in a slight performance decrease, suggesting that the loss term aids model training. LFND-AB_AVG, which maintains the weight of each example in the new base learner, performs slightly worse than the full LFND-AB, demonstrating that the adaptive weight adjustment in LFND-AB improves performance by focusing on the most informative examples. In summary, each component including interpretable weight matrix, cause discrimination, contrastive learning, and adaptive weight adjustment plays an important role in improving model performance.

[0143] Figure 4 The performance of different methods under varying degrees of false information scarcity is shown. Even when the amount of false information is reduced to only 1 / 3 of the original dataset, the performance of our proposed method decreases minimally, demonstrating its robustness in the presence of label imbalance. Several factors contribute to these results. For the base learner LFND, the contrastive learning module improves the discriminative power of the embedded encodings by ensuring that the representations of false and real information remain separable despite the reduction in training samples. For the full LFND-AB, the boosting strategy dynamically reweights misclassified examples during training to give more weight to correctly classified instances. This procedure allows the model to focus on classes with fewer instances, thus avoiding the performance degradation caused by imbalanced data. Even when the amount of available false information is reduced, LFND-AB ensures that the model can learn effective classification boundaries.

[0144] To study the impact of using different large language models to generate reasons, experiments were conducted on Chinese datasets using ChatGPT-3.5, ChatGPT-4.0, and Doubao. Each LLM can generate reasons supporting whether the text content is true or false. Figure 5 The results shown compare the performance of LFND and LFND-AB when using the ground truths generated by these different LLMs. Figure 5 Experimental results in

[15] show that ChatGPT-4.0 performs slightly better than ChatGPT-3.5 and Doubao. This improvement is likely due to ChatGPT-4.0's ability to generate more detailed and context-rich justifications, which in turn provides the model with finer-grained representations. However, this has a minimal impact on the final performance of the detection model. This is likely because existing modules (such as contrastive learning and attention mechanisms) are able to effectively and selectively integrate and refine the information provided by the LLM, thereby minimizing the performance difference caused by the choice of LLM.

[0145] In summary, the interpretable large language model-assisted false text detection method provided by this invention leverages the large language model to fully exploit the contextual information of the text, improving the model's detection accuracy and interpretability. Furthermore, the adaptive boosting strategy employed to integrate base learners enhances the model's robustness in imbalanced data scenarios, achieving higher detection accuracy than existing methods. This makes the present method for determining information authenticity based on large model prompts highly relevant and practical.

[0146] The steps of the various methods above are divided only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are within the scope of protection of the present invention. Adding insignificant modifications or introducing insignificant designs to the algorithm or process without changing the core design of the algorithm and process are all within the scope of protection of the invention.

[0147] Another embodiment of the present invention relates to an information authenticity determination device based on an attention mechanism. The implementation details of the information authenticity determination device based on the attention mechanism of this embodiment are described in detail below. The following content is only provided for the convenience of understanding the implementation details and is not required for the implementation of this solution. The information authenticity determination device based on the attention mechanism of this embodiment includes:

[0148] Sample acquisition module, used to obtain sample text content;

[0149] A sample processing module, configured to generate a plurality of first reasons supporting that the sample text content is true information and a plurality of second reasons supporting that the sample text content is false information; wherein the number of the first reasons and the number of the second reasons are the same;

[0150] The model training module is used to train an information authenticity judgment model using sample text content, multiple first reasons, and multiple second reasons through the following steps:

[0151] Encode the sample text content, multiple first reasons, and multiple second reasons respectively to obtain a sample text code, multiple first reason codes, and multiple second reason codes; adopt an interactive attention mechanism to aggregate the sample text code with each first reason code and each second reason code respectively to obtain multiple aggregate codes; adopt a reverse attention mechanism from the sample text code to each first reason code and each second reason code to evaluate the importance of each aggregate code; wherein the importance of the aggregate code is used to represent the contribution of the corresponding first reason to supporting the sample text content as true information, or the contribution of the second reason to supporting the sample text content as false information;

[0152] The text detection module is used to input the target text content and multiple first reasons and multiple second reasons corresponding to the target text content into the information authenticity judgment model to detect the authenticity of the target text content.

[0153] It is not difficult to find that this embodiment is an apparatus embodiment corresponding to the above-mentioned method embodiment, and this embodiment can be implemented in conjunction with the above-mentioned method embodiment. The relevant technical details and technical effects mentioned in the above-mentioned embodiment are still valid in this embodiment, and to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above-mentioned embodiment.

[0154] It is worth noting that all modules involved in this embodiment are logical modules. In actual applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, to highlight the innovations of the present invention, this embodiment does not include units that are not closely related to solving the technical problems proposed by the present invention. However, this does not mean that other units do not exist in this embodiment.

[0155] Another embodiment of the present invention relates to a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the information authenticity judgment method based on the attention mechanism in the above-mentioned embodiments.

[0156] The memory and processor are connected using a bus, which can include any number of interconnected buses and bridges. The bus connects various circuits of one or more processors and memories. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits. These are all well known in the art and are therefore not described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over a wireless medium via an antenna. Furthermore, the antenna receives data and transmits it to the processor.

[0157] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0158] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.

[0159] That is, those skilled in the art will understand that all or part of the steps in the above-described method embodiments can be implemented by instructing the relevant hardware through a program. The program is stored in a storage medium and includes a number of instructions for causing a device (such as a microcontroller or chip) or a processor to execute all or part of the steps in the method embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0160] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present invention, and that in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.

Claims

1. A method for judging the authenticity of information based on an attention mechanism, characterized in that: include: Get sample text content; Generating a plurality of first reasons supporting that the sample text content is true information and a plurality of second reasons supporting that the sample text content is false information; wherein the number of the first reasons and the number of the second reasons are the same; Using sample text content, multiple first reasons, and multiple second reasons, the information authenticity judgment model is trained through the following steps: Encode the sample text content, multiple first reasons, and multiple second reasons respectively to obtain a sample text code, multiple first reason codes, and multiple second reason codes; adopt an interactive attention mechanism to aggregate the sample text code with each first reason code and each second reason code respectively to obtain multiple aggregate codes; adopt a reverse attention mechanism from the sample text code to each first reason code and each second reason code to evaluate the importance of each aggregate code; wherein the importance of the aggregate code is used to represent the contribution of the corresponding first reason to supporting the sample text content as true information, or the contribution of the second reason to supporting the sample text content as false information; Inputting the target text content and the multiple first reasons and multiple second reasons corresponding to the target text content into the information authenticity judgment model to detect the authenticity of the target text content; The information authenticity judgment model uses sample text content, multiple first reasons, and multiple second reasons, and is trained through the following loss functions: a binary classification main loss function, a contrast loss function, a cause discrimination loss function, and a KL divergence loss function; Among them, the binary classification main loss function is constructed based on whether the sample text content is false information, the contrast loss function is constructed based on the similarity between the sample text content and the first reason and the second reason respectively, the cause discrimination loss function is constructed based on the contribution of the first reason to supporting the sample text content as true information and the contribution of the second reason to supporting the sample text content as false information, and the KL divergence loss function is constructed based on the difference between the first reason and the second reason.

2. The information authenticity judgment method based on the attention mechanism according to claim 1 is characterized in that: The binary classification main loss function is: ; Where, represents the cross entropy loss, is a multi-layer perceptron; y is the label of the sample text content, indicating whether the sample text content is false information; express The weight of , To encode the sample text enhanced by the self-attention mechanism, The aggregated code is formed by aggregating the sample text code, the first reason code and the second reason code; The contrast loss function is: ; Where, is an exponential function. When the label of the sample text content is true information, It is an aggregated code formed by aggregating the sample text code and the first reason code. When the label of the sample text content is false information, It is the aggregate code formed by aggregating the sample text code and the second reason code. The elements in The elements in are opposite; It is a random sampling operation, which means randomly taking an instance from the set; Used to measure the cosine similarity of two vectors. is the temperature parameter used to adjust the kurtosis of the softmax distribution; The cause discrimination loss function is: ; In the formula, CAT represents or To splice, It is the aggregate code formed by aggregating the sample text code and the first reason code. The aggregate code is formed by aggregating the sample text code and the second reason code; The KL divergence loss function is: ; Where KL represents the calculation of KL divergence.

3. The information authenticity judgment method based on the attention mechanism according to claim 1 is characterized in that: There are multiple sample text contents, and the information authenticity judgment model is trained through the following steps: For each sample text content, a base learner is obtained by training the sample text content and the corresponding multiple first reasons and multiple second reasons; The base learners of multiple sample text contents are integrated using a boosting strategy to obtain an information authenticity judgment model.

4. The information authenticity judgment method based on the attention mechanism according to claim 3 is characterized in that: The boosting strategy is used to integrate the base learners of multiple sample text contents to obtain an information authenticity judgment model, including: S1. Generate an initial base learner of multiple sample text contents and initialize the weight of each sample text content to , X is a collection of multiple sample text contents; S2, use with weight The sample text content trains the nth base learner , and calculate the error. The error calculation formula of the nth base learner is: ; Where, is the i-th sample text content, N is the number of sample text contents, It is an indicator function. When the input is True, the output is 1, and when the input is False, the output is 0. is the label of the i-th sample text content, indicating whether the sample text content is false information or true information; If the error is greater than 0.5, the improvement strategy is terminated, otherwise it goes to S3; S3. Update the weight of each sample text content according to the error. The update formula is as follows: ; Where, , is an exponential function; Normalize the updated weights: ; Where, is the updated weight; S4, repeat S2 and S3 N times to obtain N trained base learners; The information authenticity judgment model is: ; Where, represents an ensemble of n base learners.

5. The information authenticity judgment method based on the attention mechanism according to claim 1 is characterized in that: The generating of multiple first reasons supporting that the sample text content is true information and multiple second reasons supporting that the sample text content is false information includes: The system prompts for building a large language model are: Please understand the following text and provide multiple reasons why it is true and multiple reasons why it is false. In addition, since the text is scraped from the Internet, there may be some noise or defects, please ignore them. The sample text content and the system prompt words are input into the large language model to obtain multiple first reasons supporting that the sample text content is true information and multiple second reasons supporting that the sample text content is false information.

6. The information authenticity judgment method based on the attention mechanism according to any one of claims 1 to 5, characterized in that: There are at least three first reasons and at least three second reasons respectively.

7. An information authenticity judgment device based on an attention mechanism, characterized in that: include: Sample acquisition module, used to obtain sample text content; A sample processing module, configured to generate a plurality of first reasons supporting that the sample text content is true information and a plurality of second reasons supporting that the sample text content is false information; wherein the number of the first reasons and the number of the second reasons are the same; The model training module is used to train an information authenticity judgment model using sample text content, multiple first reasons, and multiple second reasons through the following steps: Encode the sample text content, multiple first reasons, and multiple second reasons respectively to obtain a sample text code, multiple first reason codes, and multiple second reason codes; adopt an interactive attention mechanism to aggregate the sample text code with each first reason code and each second reason code respectively to obtain multiple aggregate codes; adopt a reverse attention mechanism from the sample text code to each first reason code and each second reason code to evaluate the importance of each aggregate code; wherein the importance of the aggregate code is used to represent the contribution of the corresponding first reason to supporting the sample text content as true information, or the contribution of the second reason to supporting the sample text content as false information; a text detection module, configured to input the target text content and the plurality of first reasons and the plurality of second reasons corresponding to the target text content into an information authenticity judgment model to detect the authenticity of the target text content; The information authenticity judgment model uses sample text content, multiple first reasons, and multiple second reasons, and is trained through the following loss functions: a binary classification main loss function, a contrast loss function, a cause discrimination loss function, and a KL divergence loss function; Among them, the binary classification main loss function is constructed based on whether the sample text content is false information, the contrast loss function is constructed based on the similarity between the sample text content and the first reason and the second reason respectively, the cause discrimination loss function is constructed based on the contribution of the first reason to supporting the sample text content as true information and the contribution of the second reason to supporting the sample text content as false information, and the KL divergence loss function is constructed based on the difference between the first reason and the second reason.

8. A computer device, characterized in that: include: at least one processor; And, a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the information authenticity judgment method based on the attention mechanism as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the information authenticity judgment method based on the attention mechanism as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and system for determining text tags

    CN111324738A

  • Text processing method and apparatus, and electronic device, computer-readable storage medium and computer program product

    WO2025066553A1