Condition triggering type text watermarking method oriented to official content credibility verification
By employing a condition-triggered text watermarking method, combined with confidence information from a large language model and pseudo-random set partitioning, adaptive watermark embedding and public opinion monitoring are achieved. This solves the problems of text fluency and detection accuracy in existing technologies and is applicable to government documents and public opinion monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN POLICE COLLEGE
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-12
AI Technical Summary
Existing text watermarking methods result in decreased text fluency during the embedding process, lack an adaptive mechanism, and are difficult to achieve high-confidence detection and judgment in public opinion scenarios, thus failing to effectively prevent the spread of false content.
A condition-triggered text watermarking method is adopted. Confidence information is extracted during the generation process of a large language model, and the watermark embedding strength is controlled hierarchically. A pseudo-random function is used to divide the red and green sets, and statistical detection is combined to achieve adaptive watermark embedding and public opinion monitoring.
While maintaining the naturalness of the text, it enhances the adaptability of watermark embedding and the robustness of detection, enabling rapid identification of fake content. It is suitable for anti-counterfeiting of official texts such as government documents and press releases, as well as for monitoring online public opinion.
Smart Images

Figure CN122020682A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a condition-triggered text watermarking method for verifying the credibility of official content. It is applicable to the generation and anti-counterfeiting of official texts such as government documents and press releases, as well as the rapid identification of fake official texts in online public opinion monitoring. It belongs to the fields of natural language processing and information security technology. Background Technology
[0002] With the rapid development of artificial intelligence, especially Large Language Models (LLMs), the application scenarios of AI-Generated Content (AIGC) are becoming increasingly widespread. Government departments, media organizations, and large enterprises are gradually trying to use LLMs to automatically draft policy documents, press releases, public opinion responses, corporate statements, and other content to improve the efficiency and reach of information dissemination. The high naturalness and fluency of AI in text generation demonstrate its significant value in public administration, commercial communication, and social governance.
[0003] However, the widespread adoption of these applications has brought with it the problem of fake content impersonating official institutions or authoritative entities in cyberspace. Some criminals can utilize publicly available large language models to generate false statements, notices, or press releases that are highly similar in form and style to official texts, thereby spreading rumors, misleading public opinion, and even seriously impacting social security and public order. For example, false announcements may trigger financial market fluctuations, and forged statements may cause public panic, creating an urgent need to ensure the credibility of information. To address these risks, academia and industry have successively proposed text watermarking technology. The basic idea is to embed implicit, detectable features into the generated text so that its source and authenticity can be verified subsequently through algorithms. Current research mainly employs methods such as word substitution, probability distribution perturbation, or candidate set partitioning to embed statistical features into the generated text for source tracing and detection.
[0004] However, existing text watermarking methods still have significant shortcomings: (1) Forced embedding strategy: Many methods embed watermarks in all generation steps, which can easily lead to a decrease in text fluency and even produce unnatural semantics, affecting the credibility and readability of official documents.
[0005] (2) Lack of adaptive mechanism: Most methods use fixed strength or uniform rules for watermark embedding, and fail to make flexible adjustments according to the differences in the confidence of the model output. This results in the watermark signal being too weak in some scenarios and insufficient detection accuracy, while it is too strong in other scenarios, affecting the text quality.
[0006] (3) Insufficient adaptation to public opinion scenarios: Existing methods are mostly focused on general text generation and model source verification, lacking a systematic solution for the complete application chain of "official information generation - network dissemination monitoring - false content identification", which makes it difficult to meet the dual requirements of authority and timeliness in public opinion governance.
[0007] In summary, current technologies cannot simultaneously maintain the naturalness of text while ensuring robustness in watermark embedding strength and detection, nor do they offer a comprehensive solution for public opinion assessment. Therefore, there is an urgent need for a new technical approach that can adaptively embed implicit watermarks by combining the output features of large language models, and achieve high-confidence detection and judgment during the public opinion monitoring phase. This would effectively prevent the spread of fake and spoofed texts, maintain the credibility of information in cyberspace, and stabilize public opinion. Summary of the Invention
[0008] To overcome the problems of forced embedding leading to text distortion, lack of adaptive mechanisms, and insufficient adaptation to public opinion scenarios in existing text watermarking methods, this invention provides a condition-triggered text watermarking method for verifying the credibility of official content, enabling intelligent watermark embedding at the official text generation end and rapid authenticity verification at the public opinion monitoring end.
[0009] A condition-triggered text watermarking method for verifying the credibility of official content includes the following steps: Step 1: Use a large language model to generate the official document text, and extract the confidence information from the model output during the generation process as the basis for watermark embedding; Step 2: The generation process is controlled hierarchically based on the confidence level information. Watermark embedding is skipped under high confidence conditions, and watermark embedding is triggered under medium and low confidence conditions. The bias strength is adjusted according to the level. Step 3: When watermark embedding is triggered, a pseudo-random function combined with a preset seed is used to divide the candidate output into red and green sets to ensure that the division results at the generation end and the detection end are consistent. Step 4: Apply the appropriate bias to the green set according to the hierarchical strategy and complete the sampling to generate the official text carrying implicit watermark features; Step 5: During the public opinion monitoring phase, suspected official texts circulating online are detected. The detection end reconstructs the red and green sets based on the same pseudo-random rules as the generation end, and statistically analyzes the watermark features. Step Six: Determine the authenticity of the text based on the detection results and the preset threshold range. If a watermark is detected, it is considered to be officially generated; if no watermark is detected, it is considered to be unofficially generated, thus realizing the credible verification of authoritative content and the identification of public opinion.
[0010] Step one specifically includes: S1.1: Input the preset prompts or factual elements to initialize the language model and generate the official document text; S1.2: In each prediction step, obtain the set of candidate lexical units output by the large language model. and their corresponding probability distribution ,in ; S1.3: Determine the highest probability candidate word from the probability distribution P. and its probability value and the second highest probability candidate word and its probability value ; S1.4: Calculate the confidence index This value is then used as the confidence information for the current prediction step.
[0011] Step two specifically includes: S2.1: When the confidence index meets the following conditions... When the confidence level is high, the candidate token with the highest probability is directly output without watermark embedding. S2.2: When the confidence index meets the following conditions... At that time, it is determined to be of medium confidence level, and a linear bias is applied to the logits of candidate terms in the green set after the red-green set is divided. To achieve medium-strength watermark embedding, where This is the linear amplification factor; S2.3: When When the confidence level is low, an exponential bias is applied to the logits of candidate terms in the green set after the red-green set is partitioned. To achieve strong watermark embedding, in which For maximum bias strength, This is the exponential growth coefficient.
[0012] Step three specifically includes: S3.1: Set the candidate word set as And set a fixed random seed ; S3.2: Call the pseudo-random function For set Each candidate lexical generates a pseudo-random value. ,in This refers to the index of the candidate lexical element in the set; S3.3: Based on the division ratio parameters set Classified as red set With Green Collection ; S3.4: Fix the settings of the pseudo-random function and the random seed so that the detection end can reproduce the red set under the same conditions. With Green Collection This ensures that the partitioning results are consistent.
[0013] Step four specifically includes: S4.1: Determine the bias strength of the current prediction step based on the hierarchical control results. Among them, the high confidence level corresponds to The medium confidence level corresponds to a linear bias function, and the low confidence level corresponds to an exponential bias function. S4.2: Apply the bias value to the green set The logits score of each candidate term in the set, while maintaining the red set. The logits remain unchanged. S4.3: Normalize the corrected logits distribution to obtain a new probability distribution; S4.4: Perform sampling based on the corrected probability distribution, output the current predicted word, and use it as part of the generated text to generate official text carrying implicit watermark features.
[0014] Step five specifically includes: S5.1: Receive and parse the text to be detected, and divide it into a continuous sequence of tokens; S5.2: At each prediction step, call the same pseudo-random function and seed as at the generation end to reconstruct the corresponding red set. With Green Collection ; S5.3: Count whether the output words in the text belong to the green set and accumulate the number of green set hits. ; S5.4: Calculate the detection statistic based on the statistical results. , ,in To detect the number of locations, The proportion of green sets, and As a basis for determining watermark features.
[0015] Step six specifically includes: S6.1: Detection statistics With preset threshold range Compare; S6.2: When At that time, the text was determined to contain watermark features and was identified as officially generated; S6.3: When When the text does not contain watermark features, it is considered unofficially generated; when If necessary, the text will be marked as suspicious and submitted to a human or other system for review.
[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. Enhanced Adaptability of Watermark Embedding: This invention introduces a conditional triggering mechanism to dynamically adjust the watermark embedding strength based on the confidence index output by the large language model. Under high confidence conditions, the original text is output directly to avoid unnecessary interference; under medium and low confidence conditions, watermark embedding of different strengths is triggered, thus balancing text naturalness and watermark effectiveness, solving the problem of "forced embedding leading to text distortion" in existing methods.
[0017] 2. Multi-level control mechanism ensures flexibility: A three-level hierarchical strategy (high confidence / medium confidence / low confidence) is adopted to achieve differentiated processing. This can embed a watermark of sufficient strength while ensuring the fluency of the text, and can also significantly enhance the watermark signal when there is greater uncertainty, thereby improving the overall reliability and robustness of detection.
[0018] 3. Red-Green Set Partition Guarantees Reproducibility: This invention utilizes a pseudo-random function combined with a fixed seed to partition the red and green sets, ensuring that the generation and detection ends can reproduce consistent partitioning results under the same conditions. This design avoids the problem of "the detection end being unable to accurately reconstruct the candidate set" in traditional watermarking methods, improving the system's usability and stability in different implementation environments.
[0019] 4. Improved robustness of the detection method: This invention employs statistical methods to verify watermark features at the detection end. By calculating the z-score and comparing it with a preset threshold, it can effectively distinguish between officially generated text and unofficially generated text. This method has good adaptability to both long and short texts, and maintains a high detection rate even after the text has been partially edited or forwarded.
[0020] 5. High suitability for public opinion screening scenarios: This invention is designed for the complete application chain of "official content generation - network dissemination monitoring - fake text screening". It can embed implicit watermarks in the official text release process and quickly identify fake and impersonating content in the public opinion monitoring process. It is particularly suitable for scenarios such as network rumor governance, government document authentication and media information credibility verification.
[0021] 6. Enhanced interpretability of detection results: This invention not only outputs a binary judgment result on whether the text contains a watermark, but also provides three categories of conclusions based on the z-score and threshold range: "officially generated", "unofficially generated", and "suspicious and pending verification". This provides a basis for manual intervention or cross-validation of multiple systems, and improves the transparency and interpretability of public opinion governance decisions.
[0022] 7. Controllable impact on text quality: Through conditional triggering and hierarchical control, this invention does not embed watermarks under high confidence conditions, ensuring that the generated text maintains the same naturalness and readability as the unwatermarked state, effectively avoiding the negative impact of watermarking methods on the quality of official documents.
[0023] 8. Simple to implement and easy to integrate: This invention only requires applying a lightweight bias to the logits distribution during the text generation process, without relying on additional model training, with low computational overhead, and is easy to integrate with existing large language model generation systems, possessing good engineering feasibility and promotional value. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of the overall process of the condition-triggered text watermarking method for official content credibility verification and the condition-triggered text watermarking method for public opinion identification, showing the core steps of the generation end and the detection end. Figure 2 The diagram shows the confidence level control mechanism of a condition-triggered text watermarking method for official content credibility verification according to the present invention, reflecting the segmented variation law of watermark bias strength with confidence index g. Figure 3 This invention provides an example of an official typhoon warning text with implicit watermarking, demonstrating the text's natural readability. Figure 4 This is an example of watermark embedding position annotation for a condition-triggered text watermarking method for official content credibility verification according to the present invention, which identifies the specific word positions that trigger watermark embedding; Figure 5 This is a statistical result chart of the watermark detection for a condition-triggered text watermarking method for official content credibility verification according to the present invention, showing core detection indicators such as total number of lexical units, number of green sets, and Z-score; Figure 6 This is an example of a condition-triggered text watermarking method for verifying the credibility of official content, based on the present invention, which uses a green set of words for verification. It visually presents the distribution of green set words in the text to be detected. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] This invention provides a condition-triggered text watermarking method for verifying the credibility of official content, aiming to solve the following problems existing in the practical application of existing text watermarking methods: first, the forced embedding strategy leads to a decrease in text fluency; second, the fixed watermark embedding strength lacks adaptive adjustment capability; and third, existing methods are not well-suited to public opinion identification scenarios and are difficult to quickly distinguish between officially generated text and unofficially generated text. Figure 1 This diagram illustrates the overall workflow of a condition-triggered text watermarking method for public opinion screening. It shows the complete technical process from step one to step six, divided into two main modules: the official text generation end (steps one to four) and the public opinion monitoring and detection end (steps five to six). This invention extracts confidence information from the output of a large language model, employs a hierarchical watermarking control strategy, and combines pseudo-random set partitioning and statistical detection mechanisms to achieve implicit watermark embedding at the official text generation end and high-confidence discrimination at the public opinion monitoring end, effectively improving the naturalness, robustness, and detection reliability of the watermark.
[0028] A condition-triggered text watermarking method for verifying the credibility of official content includes the following steps: Step 1: Use a large language model to generate the official document text, and extract the confidence information from the model output during the generation process as the basis for watermark embedding; Step one specifically includes: S1.1: Input the preset prompts or factual elements to initialize the language model and generate the official document text; S1.2: In each prediction step, obtain the set of candidate lexical units output by the large language model. and their corresponding probability distribution ,in ; S1.3: Determine the highest probability candidate word from the probability distribution P. and its probability value and the second highest probability candidate word and its probability value ; S1.4: Calculate the confidence index This value is then used as the confidence information for the current prediction step.
[0029] Step 2: The generation process is controlled hierarchically based on the confidence level information. Watermark embedding is skipped under high confidence conditions, and watermark embedding is triggered under medium and low confidence conditions. The bias strength is adjusted according to the level. Step two specifically includes: S2.1: When the confidence index meets the following conditions... When the confidence level is high, the candidate token with the highest probability is directly output, and watermark embedding is not performed. S2.2: When the confidence index meets the following conditions... At that time, it is determined to be of medium confidence level, and a linear bias is applied to the logits of candidate terms in the green set after the red-green set is divided. To achieve medium-strength watermark embedding, where This is the linear amplification factor; S2.3: When When the confidence level is low, an exponential bias is applied to the logits of candidate terms in the green set after the red-green set is partitioned. To achieve strong watermark embedding, in which For maximum bias strength, This is the exponential growth coefficient.
[0030] In embodiments of the present invention, such as Figure 2 As shown, this invention employs a three-level hierarchical control strategy, based on confidence index. Adaptive watermark embedding is achieved by using different ranges of values, and the confidence level threshold is set to... and , among which when When a token is determined to be of high confidence level, the generator directly outputs the candidate token with the highest probability without embedding a watermark; when... If the token is determined to be of medium confidence level, then after the red-green set is partitioned, a linear bias is applied to the logits value of the candidate tokens in the green set. The linear amplification factor To achieve medium-strength watermark embedding; when If the token is determined to be of low confidence level, an exponential bias is applied to the logits value of the candidate tokens in the green set. The maximum bias strength Exponential growth coefficient To achieve strong watermark embedding. From Figure 2 It can be clearly observed that the watermark bias intensity With confidence index The changes exhibit piecewise function characteristics: the bias strength is zero in the high-confidence interval, shows a linear increasing trend in the medium-confidence interval, and exhibits an exponential rapid growth pattern in the low-confidence interval. Through the above-mentioned hierarchical control, the watermark signal can be enhanced in the prediction step with greater uncertainty while maintaining the naturalness of the high-confidence text, thus balancing readability and detectability.
[0031] Step 3: When watermark embedding is triggered, a pseudo-random function combined with a preset seed is used to divide the candidate output into red and green sets to ensure that the division results at the generation end and the detection end are consistent. Step three specifically includes: S3.1: Set the candidate word set as And set a fixed random seed ; S3.2: Call the pseudo-random function For set Each candidate lexical generates a pseudo-random value. ,in This refers to the index of the candidate lexical element in the set; S3.3: Based on the division ratio parameters set Classified as red set With Green Collection ; S3.4: Fix the settings of the pseudo-random function and the random seed so that the detection end can reproduce the red set under the same conditions. With Green Collection This ensures that the partitioning results are consistent.
[0032] In embodiments of the present invention, the candidate token set is set according to the entire vocabulary range. ,in This refers to the model vocabulary size. To ensure consistency between the segmentation results at the generation and detection ends, the system sets a fixed random seed during the initialization phase. Based on this seed, a pseudo-random function is called to shuffle the word index order, and then the order is determined according to the partitioning ratio parameter. The first half of the vocabulary is divided into the green set. The remaining vocabulary is divided into the red set. The red-green set remains unchanged throughout the generation process, and the partitioning result can be completely reproduced at the detection end using the same random seed and ratio parameters. This ensures the consistency of the candidate token set between the generation and detection ends, achieving reproducibility of watermark embedding and detection.
[0033] Step 4: Apply the appropriate bias to the green set according to the hierarchical strategy and complete the sampling to generate the official text carrying implicit watermark features; Step four specifically includes: S4.1: Determine the bias strength of the current prediction step based on the hierarchical control results. Among them, the high confidence level corresponds to The medium confidence level corresponds to a linear bias function, and the low confidence level corresponds to an exponential bias function. S4.2: Apply the bias value to the green set The logits score of each candidate term in the set, while maintaining the red set. The logits remain unchanged. S4.3: Normalize the corrected logits distribution to obtain a new probability distribution; S4.4: Perform sampling based on the corrected probability distribution, output the current predicted word, and use it as part of the generated text to generate official text carrying implicit watermark features.
[0034] In embodiments of the present invention, the bias strength of the graded control is dynamically determined based on a confidence index: when at a high confidence level, the bias is set... No adjustments are made to any candidate tokens; when at the medium confidence level, the bias value is calculated using a linear function. The linear amplification factor When at a low confidence level, the bias value is calculated using an exponential function. The maximum bias strength Exponential growth coefficient In each prediction step, the calculated bias value is applied only to the green set. The number of candidate tokens in the logits vector increases. And the red set The logits of the token remain unchanged. Then, softmax normalization is performed on the corrected logits vector to obtain a new probability distribution. Random sampling is then performed based on this distribution to obtain the current predicted token, which is then concatenated into the existing output sequence. By progressively repeating this operation throughout the generation process, the final official text is naturally readable and contains implicit watermark features, thus achieving detectable embedding without compromising semantic quality.
[0035] Step 5: During the public opinion monitoring phase, suspected official texts circulating online are detected. The detection end reconstructs the red and green sets based on the same pseudo-random rules as the generation end, and statistically analyzes the watermark features. Step five specifically includes: S5.1: Receive and parse the text to be detected, and divide it into a continuous sequence of tokens; S5.2: At each prediction step, call the same pseudo-random function and seed as at the generation end to reconstruct the corresponding red set. With Green Collection ; S5.3: Count whether the output words in the text belong to the green set and accumulate the number of green set hits. ; S5.4: Calculate the detection statistic based on the statistical results. , ,in To detect the number of locations, The proportion of green sets, and As a basis for determining watermark features.
[0036] In an embodiment of the invention, the detection end first receives the text to be detected transmitted over the network and divides it into a continuous token sequence using a word segmenter identical to that used by the generation end. Then, the same pseudo-random function with a fixed random seed is called at each position. According to the proportional parameters Reconstruct the red and green sets to ensure complete consistency between the set partitioning and the generation process. During the statistical analysis, check each token actually output in the text to see if it falls into the green set, and accumulate the number of hits. After completing the statistics of all valid locations, let the total number of detection locations be . Calculate the expected value With variance And calculate the detection statistic based on this. This statistic is used to quantify the significance of watermark features in text. If the text carries a watermark, the number of hits in the green set will significantly deviate from the random expectation, thus making the watermark more significant. The value is far higher than zero. This detection method can quickly verify suspected official texts during the public opinion monitoring stage, providing a reliable basis for subsequent authenticity determination.
[0037] Step Six: Determine the authenticity of the text based on the detection results and the preset threshold range. If a watermark is detected, it is considered to be officially generated; if no watermark is detected, it is considered to be unofficially generated, thus realizing the credible verification of authoritative content and the identification of public opinion.
[0038] Step six specifically includes: S6.1: Detection statistics With preset threshold range Compare; S6.2: When At that time, the text was determined to contain watermark features and was identified as officially generated; S6.3: When When the text does not contain watermark features, it is considered unofficially generated; when If necessary, the text will be marked as suspicious and submitted to a human or other system for review.
[0039] In an embodiment of the present invention, when the detection end performs threshold determination on the statistical results of suspected official text, a preset threshold range is used. As a standard for determining authenticity, the lower threshold is included. Upper limit threshold When the detection statistic satisfies At that time, the text was deemed to contain significant watermark features and was therefore identified as officially generated; when When the text does not contain watermark features, it is considered unofficially generated; when the detection statistics are in... When the text falls within the gray area, the judgment result is uncertain, and the text is marked as suspicious content, then submitted to manual review or other auxiliary systems for verification. This threshold judgment mechanism can reduce the risk of false judgments while ensuring detection accuracy, enabling credible verification of authoritative content and identification of public opinion.
[0040] To verify the effectiveness of the method of the present invention, the Qwen2.5-7B model was used to conduct watermark embedding tests on government typhoon warning announcements. Figure 3 The official text generated after conditional watermark embedding is shown. The text maintains good readability and semantic integrity, and the language is natural and fluent. There are no grammatical errors or expression abnormalities caused by watermark embedding. Figure 4The results demonstrate the precise annotation of watermark embedding locations, clearly identifying the specific words that triggered watermark embedding during text generation in blue font. From an overall distribution perspective, the watermark embedding locations are reasonably dispersed throughout the text, neither too densely packed to negatively impact the reading experience nor too sparse to reduce detection effectiveness; approximately 60%-70% of the keywords triggered the watermark embedding mechanism. The marked blue words cover various vocabulary types, including numerical expressions ("202406", "30", "8-9"), technical terms ("super typhoon level", "coastal area"), verb phrases ("move", "reinforce", "ensure"), and noun concepts ("Haiyan", "port facilities", "infrastructure"), indicating that the watermark embedding mechanism is not limited to specific parts of speech and has good universality and applicability. It is noteworthy that despite the large number of words embedding watermark features, the semantic logic and fluency of the entire text remain completely unaffected, fully ensuring the professionalism, authority, and readability of the announcement content. By comparing these locations with the unlabeled black words, it can be inferred that these locations had high model confidence during generation, thus failing to trigger watermark embedding. This fully demonstrates the core characteristic of the "conditionally triggered" mechanism of this invention. This precise location labeling verifies that the method of this invention can achieve the expected technical effect in practical applications, namely, intelligent watermark embedding while ensuring text quality. This provides a reliable embedding foundation for subsequent watermark detection and also provides effective technical support for public opinion identification and authoritative content authentication.
[0041] The statistical analysis results during the detection phase are as follows: Figure 5 As shown, among the 380 valid tokens, 263 tokens belonged to the green set, with a green set hit rate of 69.21%, significantly higher than the random expected value of 50%. Based on the binomial distribution principle, with an expected value μ = 190.00 and a standard deviation σ = 9.75, the Z-score calculated based on statistical tests is 7.49, far exceeding the preset detection threshold of 2.0, indicating that the text possesses significant watermark characteristics. This statistical result demonstrates sufficient watermark signal strength, extremely high detection confidence, and the ability to effectively distinguish between officially generated text and ordinary text. Figure 6Further shows the verification results of the words specifically identified as the green set. By labeling the attribution of each token one by one, it visually verifies the accuracy and consistency of the red-green set division. During the detection process, the system strictly reconstructs the red-green set according to the same pseudo-random seed and division rules as the generation end, ensuring the reliability and reproducibility of the detection results. The experimental results fully verify the technical effectiveness of the present invention: This method not only maintains the professionalism and authority that official documents should have in text generation quality, but also meets the high standards required for practical use in watermark detection accuracy. The statistical significance level corresponding to the Z-score value of 7.49 is much lower than 0.001, providing reliable technical support for the authenticity certification of official content and public opinion screening, and having the technical maturity for deployment and application in actual public opinion monitoring scenarios.
[0042] Balance between text naturalness and watermark effectiveness: Through the conditional trigger mechanism, no watermark is embedded at a high confidence level (g≥0.7) to ensure the fluency and authority of official texts. In the embodiment, the generated typhoon warning announcements have no grammar errors and are semantically complete; at medium and low confidence levels, watermarks are dynamically embedded, and the hit ratio of the green set reaches 69.21%, and the watermark signal is significantly detectable; Adaptive watermark intensity adjustment: Adopting a three-level classification strategy, a linear bias (k1 = 2.5) is applied at the medium confidence level, and an exponential bias (δ max = 4, k2 = 6) is applied at the low confidence level, solving the problem of over-strong / over-weak signals caused by fixed-intensity embedding. The detection statistic Z-score reaches 7.49, which is much higher than the preset threshold of 2.0, and the detection accuracy is greatly improved; Reproducibility of set division: By fixing the pseudo-random function and seed (s = 123), the generation end and the detection end can completely reproduce the red-green set division results, avoiding the problem that the detection end in traditional methods cannot accurately reconstruct the candidate set, and significantly enhancing the system stability and compatibility; High adaptability to public opinion governance scenarios: Designed a full-process solution of "generation - detection - screening", which can quickly identify false official texts during the public opinion monitoring stage. The suspicious text marking mechanism (0 < z < 2) minimizes the misjudgment risk and is suitable for public opinion governance scenarios such as government official document authentication and press release clarification; Strong engineering practicability: Only a lightweight bias needs to be applied to the logits distribution of the large language model, without additional model training, with low computational overhead, easy to integrate with existing large language model generation systems, and having the value of large-scale promotion.
[0043] In summary, the condition-triggered text watermarking method for public opinion screening proposed in this invention achieves an organic unity between the natural generation of official text and watermark embedding by introducing confidence level control and bias embedding mechanism at the generation stage, combined with pseudo-random partitioning and statistical detection strategies. This method not only ensures the readability and naturalness of the text, but also effectively distinguishes between official and non-official text during the public opinion monitoring stage, thereby enabling credible verification of authoritative information and rapid identification of false content.
[0044] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and these variations still fall within the protection scope of the present invention.
Claims
1. A condition-triggered text watermarking method for verifying the credibility of official content, characterized in that: Includes the following steps: Step 1: Use a large language model to generate the official document text, and extract the confidence information from the model output during the generation process as the basis for watermark embedding; Step 2: The generation process is controlled hierarchically based on the confidence level information. Watermark embedding is skipped under high confidence conditions, and watermark embedding is triggered under medium and low confidence conditions. The bias strength is adjusted according to the level. Step 3: When watermark embedding is triggered, a pseudo-random function combined with a preset seed is used to divide the candidate output into red and green sets to ensure that the division results at the generation end and the detection end are consistent. Step 4: Apply the appropriate bias to the green set according to the hierarchical strategy and complete the sampling to generate the official text carrying implicit watermark features; Step 5: During the public opinion monitoring phase, suspected official texts circulating online are detected. The detection end reconstructs the red and green sets based on the same pseudo-random rules as the generation end, and statistically analyzes the watermark features. Step Six: Determine the authenticity of the text based on the detection results and the preset threshold range. If a watermark is detected, it is considered to be officially generated; if no watermark is detected, it is considered to be unofficially generated, thus realizing the credible verification of authoritative content and the identification of public opinion.
2. The condition-triggered text watermarking method for official content credibility verification according to claim 1, characterized in that: Step one specifically includes: S1.1: Input the preset prompts or factual elements to initialize the language model and generate the official document text; S1.2: In each prediction step, obtain the set of candidate lexical units output by the large language model. and their corresponding probability distribution ,in ; S1.3: Determine the highest probability candidate word from the probability distribution P. and its probability value and the second highest probability candidate word and its probability value ; S1.4: Calculate the confidence index This value is then used as the confidence information for the current prediction step.
3. The condition-triggered text watermarking method for official content credibility verification according to claim 2, characterized in that: Step two specifically includes: S2.1: When the confidence index meets the following conditions... When the confidence level is high, the candidate word with the highest probability is directly output, and watermark embedding is not performed. S2.2: When the confidence index meets the following conditions... At that time, it is determined to be of medium confidence level, and a linear bias is applied to the logits of candidate terms in the green set after the red-green set is divided. To achieve medium-strength watermark embedding, where This is the linear amplification factor; S2.3: When When the confidence level is low, an exponential bias is applied to the logits of candidate terms in the green set after the red-green set is partitioned. To achieve strong watermark embedding, in which For maximum bias strength, This is the exponential growth coefficient.
4. The condition-triggered text watermarking method for verifying the credibility of official content according to claim 3, characterized in that: Step three specifically includes: S3.1: Set the candidate word set as And set a fixed random seed ; S3.2: Call the pseudo-random function For set Each candidate lexical generates a pseudo-random value. ,in This refers to the index of the candidate lexical element in the set; S3.3: Based on the division ratio parameters set Classified as red set With Green Collection ; S3.4: Fix the settings of the pseudo-random function and the random seed so that the detection end can reproduce the red set under the same conditions. With Green Collection This ensures that the partitioning results are consistent.
5. A condition-triggered text watermarking method for verifying the credibility of official content according to claim 4, characterized in that: Step four specifically includes: S4.1: Determine the bias strength of the current prediction step based on the hierarchical control results. Among them, the high confidence level corresponds to The medium confidence level corresponds to a linear bias function, and the low confidence level corresponds to an exponential bias function. S4.2: Apply the bias value to the green set The logits score of each candidate term in the set, while maintaining the red set. The logits remain unchanged. S4.3: Normalize the corrected logits distribution to obtain a new probability distribution; S4.4: Perform sampling based on the corrected probability distribution, output the current predicted word, and use it as part of the generated text to generate official text carrying implicit watermark features.
6. A condition-triggered text watermarking method for verifying the credibility of official content according to claim 5, characterized in that: Step five specifically includes: S5.1: Receive and parse the text to be detected, and divide it into a continuous sequence of tokens; S5.2: At each prediction step, call the same pseudo-random function and seed as at the generation end to reconstruct the corresponding red set. With Green Collection ; S5.3: Count whether the output words in the text belong to the green set and accumulate the number of green set hits. ; S5.4: Calculate the detection statistic based on the statistical results. , ,in To detect the number of locations, The proportion of green sets, and As a basis for determining watermark features.
7. A condition-triggered text watermarking method for verifying the credibility of official content according to claim 6, characterized in that: Step six specifically includes: S6.1: Detection statistics With preset threshold range Compare; S6.2: When At that time, the text was determined to contain watermark features and was identified as officially generated; S6.3: When When the text does not contain watermark features, it is considered unofficially generated; when If necessary, the text will be marked as suspicious and submitted to a human or other system for review.