Text watermark embedding method in Logits generation period based on large language model
By analyzing the dependencies and implication scores between text sentences, selecting key positions to embed watermarks, and adjusting the selection probability of candidate word lists based on syntactic dependencies and contextual information, it solves the problem in the existing technology that watermark embedding affects text fluency and semantic integrity. It solves the problem of weak robustness and achieves efficient, covert and computational resource-saving text watermark embedding effect.
Patent Information
- Application Number
- CN202411206760.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art may affect the natural fluency and semantic integrity of the text when embedding text watermarks, and are not robust and are easily detected or removed by attackers. The watermark needs to be based on generated watermark technology and large-scale training. Retraining the model is expensive to compute resources and time-consuming.
By analyzing the dependence relationship between text sentences, obtain the dependent type collection, and sort the dependency type based on the containing scores, select the key position of the watermark embedding, combine the dependency relationship of the sentence method and the context information, adjust the probability of the candidate vocabulary, sample production and embedding Watermark text.
It improves the concealment and robustness of watermarks, reduces the consumption of computing resources, especially when processing long texts, significantly shortens the processing time, ensures the maintenance of text quality, and enhances the protection effect of text content.
Smart Images

Figure BDA0005019239860000031 
Figure BDA0005019239860000033 
Figure BDA0005019239860000035
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of natural language processing, and in particular relates to a text watermark embedding method during Logits generation based on a large language model. Background Art
[0002] Text watermarking technology aims to embed unique and imperceptible identifiers into text to protect the copyright and integrity of the content. This technology plays an important role in protecting copyright, document authentication, and preventing plagiarism. However, traditional text watermarking methods have certain limitations in application and effect, especially when embedding watermarks, which may affect the readability and meaning of the text.
[0003] With the development of Large Language Models (LLMs), text watermarking technology has been significantly improved. LLMs have advanced text understanding and generation capabilities, which makes them excellent in building and applying text watermarking algorithms. Specifically, LLMs can embed watermarks more accurately without distorting the semantics or readability of the original text. In addition, the high-quality text generated by LLMs improves the robustness and detection success rate of watermarks.
[0004] There are two main types of watermarking methods for text generated by large models. One is to add watermarks to the answer text generated by the large model, and the other is to embed watermarks into the text during the process of generating the answer by the large model.
[0005] There are mainly the following methods for watermarking the answer text generated by the large model. i. Format-based watermarking techniques include line / word offset encoding, Unicode homograph replacement, and EasyMark method. Line / word offset encoding embeds watermarks by vertically or horizontally shifting the position of text lines or words, and these offsets are identified by measuring the distance of the text line or word outline during detection. Unicode homograph replacement uses visually similar but differently encoded characters to embed watermarks, such as using different Unicode code points to represent the same letter. The EasyMark method uses different Unicode spaces, variant selectors, and printed characters to perform minor text format modifications to achieve watermark embedding. ii. Vocabulary-based watermarking techniques. Including synonym replacement and context-aware vocabulary replacement. Synonym replacement embeds watermarks by selectively replacing certain words in the text with synonyms, such as using WordNet as a synonym source. Context-aware vocabulary replacement uses the BERT model to generate context-appropriate vocabulary replacements and introduces binary encoding to achieve watermark embedding by replacing specific words with random binary values. iii. Syntax-based watermarking techniques. Watermarks are embedded by modifying the grammatical structure of the text, such as shifting adjuncts in sentences, converting topic sentences into inverted sentences, or changing active sentences into passive sentences. This type of method uses these grammatical changes to embed watermark information. iv. Generative watermarking technology: AWT and REMARK-LLM. The AWT method uses the Transformer model for end-to-end watermark embedding. This method combines watermark information with text content to generate watermarked text. The REMARK-LLM method uses a pre-trained language model for watermark insertion and produces a sparser token distribution through the Gumbel-Softmax technique, thereby increasing the load capacity of the watermark.
[0006] There are mainly the following methods for adding watermarks to text generated by large models. i. Watermarking during large model training: During the model training phase, watermark information is embedded in the training data, and the model output is affected by modifying the training data so that the generated text automatically contains the watermark. This method requires retraining the model. Common methods include inserting specific characters, words or sentences in the training data as triggers. ii. Watermarking during the generation of logits based on large models: Watermark information is inserted when the model generates logits without modifying the model parameters. The generated logarithm value is adjusted so that the final generated text contains the watermark. For example, the vocabulary is divided into a red list and a green list, and a bias is applied to the vocabulary in the green list to increase its probability of being selected. iii. Watermarking during token sampling: Watermark information is used to guide the selection of tags during the token sampling process of generating text, so that watermarked text is generated without affecting the logits. A series of pseudo-random numbers are generated by a pseudo-random number generator to guide the sampling of each token, and the alignment of the text token with the pseudo-random number is evaluated during detection.
[0007] However, there are still some shortcomings in the existing technology, which can be summarized as the following three points: First, the watermark technology based on format and vocabulary may affect the natural fluency and semantic integrity of the text when embedding the watermark. The synonym replacement method may select inappropriate replacement words, resulting in changes in the meaning of the text or unnaturalness; Second, many existing technologies are not robust in the face of advanced attacks and are easily detected or removed by attackers. The format-based watermark technology is easily removed by simple formatting operations (such as reformatting or copying and pasting); Third, the watermark technology based on generation and the watermark based on large model training require retraining of the model, which consumes a lot of computing resources and has a high time cost.
[0008] Therefore, it is necessary to propose a new text watermark embedding scheme to address the above three shortcomings. Summary of the invention
[0009] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and provide a text watermark embedding method during Logits generation based on a large language model. By embedding a watermark during Logits generation by a large model in combination with syntactic dependencies, the problem of insufficient anti-attack capability of adding watermarks to the generated text is compensated. At the same time, the problem of text quality and large amount of calculation for long texts in the current watermark method during Logits generation based on a large model is also solved.
[0010] In order to achieve the above object, the present invention adopts the following technical solutions:
[0011] In a first aspect, the present invention provides a method for embedding text watermarks during Logits generation based on a large language model, comprising the following steps:
[0012] Analyze the dependency relationship between text sentences, obtain a set of dependency types, sort the dependency types according to the implication scores of each dependency type, and select the key positions for watermark embedding in order;
[0013] The key position is defined, a candidate word list is generated, the probability distribution corresponding to each dependency type is calculated, the selection probability of the candidate word list is adjusted according to the probability distribution, and words are sampled and generated from the candidate word list according to the set rules to obtain the embedded watermark text; the candidate word list includes a first list and a second list, and the selection probability of the first list is higher than that of the second list;
[0014] Extract the fragment to be tested from the watermarked text, reconstruct the candidate word list according to the set rules, calculate the frequency of occurrence of the words in the first list in the fragment to be tested, calculate the deviation between the frequency of occurrence and the expected value, determine whether the watermarked text has a watermark based on the deviation value, and output the detection result.
[0015] As a preferred technical solution, the analysis of the dependency relationship between text sentences includes: given a generated text T l-1 , use the dependency parser to analyze each sentence X in the text, and replace the i-th word x i The dependency relationship d(x i ) is marked as a specific dependency type, and the dependency type of each word d(x i ) is defined by the relations in the syntax tree to obtain the set of dependent types.
[0016] As a preferred technical solution, the implication score according to each dependency type includes: i Remove, generate a new sentence X′, and calculate the implication score s(x i ), calculate all words x with the same dependency type i The average implication score of .
[0017] As a preferred technical solution, the method of sorting dependency types by using implication scores and selecting key positions for watermark embedding in order includes:
[0018] According to the implication score, all dependency types d j Sort in descending order to obtain an ordered list of dependency types; select the dependency type with a high implication score as the key position for watermark embedding according to the ordered list.
[0019] As a preferred technical solution, the selection probability of the candidate word list is adjusted according to the probability distribution, including increasing the selection probability δ of the first list G , as follows:
[0020]
[0021] in, is the adjusted probability of selection, p(x i |X) is the original Logits probability distribution.
[0022] As a preferred technical solution, the selection probability of the candidate word list is adjusted according to the probability distribution, including reducing the selection probability of the second list δ R , as follows:
[0023]
[0024] in, is the adjusted probability of selection, p(x i |X) is the original Logits probability distribution.
[0025] As a preferred technical solution, the setting rule is specifically: introducing a control parameter λ, and determining the proportion of key positions by adjusting the control parameter λ; the control parameter λ is proportional to the embedded watermark density ρ, as shown in the following formula:
[0026]
[0027] Among them, 1 watermark (d j ) is an indicator function, indicating whether j The watermark is embedded at , and |L| is the total number of key positions.
[0028] As a preferred technical solution, the frequency of occurrence of the words in the first list in the to-be-checked segment is calculated as f(G test ), as follows:
[0029]
[0030] in, is the indicator function, when word x i Belongs to the first list G test 1 if the value is 0, otherwise it is 0.
[0031] As a preferred technical solution, the deviation value z between the calculated occurrence frequency and the expected value is as follows:
[0032]
[0033] Among them, f(G test) is the actual number of occurrences of the first list vocabulary, γ is the expected proportion of the first list, T test The total number of words in the text.
[0034] As a preferred technical solution, the method of judging whether the watermark-embedded text has a watermark according to the deviation value and outputting the detection result is specifically as follows:
[0035] If the deviation value exceeds a preset threshold, it is considered that there is a watermark in the text;
[0036] If there is a watermark in the text, verify whether the watermark is a real watermark and record the detection result;
[0037] If the verification watermark is public, the detection algorithm and related statistics are provided to a third party for independent verification;
[0038] Output the results of the above steps and print the test report.
[0039] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0040] (1) The present invention determines the Logits position of the embedded watermark by analyzing the syntactic dependency of the generated text. By combining the syntactic dependency and context information, the concealment and robustness of the watermark are effectively improved, and the amount of calculation is reduced when generating long texts, thereby ensuring the quality of the generated text.
[0041] (2) The dependency syntactic analysis of the present invention is applied to the text t generated by the large model. l-1 Perform analysis and construct generated text t l-1 The dependency syntactic tree is sorted according to the scores of the dependency syntactic relations to select the Logits to add bias, so as to establish the semantics of the embedded watermark information and the context to improve the robustness and concealment of the watermark.
[0042] (3) The present invention selectively embeds watermarks according to the determined Logits position of the embedded watermark, which not only maintains the quality of the text, but also significantly reduces the consumption of computing resources, especially when processing long texts, which can significantly shorten the processing time; at the same time, the positioning method can make the subsequent watermark embedding process more efficient and difficult to be identified or removed by attackers, thereby achieving effective protection of the text content. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 It is a flow chart of a method for embedding text watermarks during Logits generation based on a large language model according to an embodiment of the present invention;
[0045] Figure 2 Schematic diagram of syntactic dependency sorting based on entailment scores according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0047] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0048] See also Figure 1 This embodiment provides a text watermark embedding method during Logits generation based on a large language model, comprising the following steps:
[0049] S1. Analyze the dependency relationship between text sentences, obtain a set of dependency types, sort the dependency types according to the implication scores of each dependency type, and select the key positions for watermark embedding in order.
[0050] The current solution of watermarking during the generation of Logits by a large model can achieve copyright protection for the large model, but it does not analyze the text generated by the large model, and directly and gradually adds biases to Logits to embed the watermark, making the embedded watermark information irrelevant to the semantics of the context. As a result, the watermark has low anti-attack capability and low robustness.
[0051] In order to solve the above problem, this embodiment proposes dependency syntactic analysis on the text t generated by the large model. l-1 Perform analysis and construct generated text t l-1The dependency syntactic tree is sorted according to the scores of the dependency syntactic relations to select the logits to add the bias. In order to define the order of syntactic dependencies, this embodiment masks each dependency in the training set and then fills in the masked dependencies. The filled sentences are compared with the original sentences. For a sample, this embodiment provides the following steps:
[0052] S11. Given a generated text T l-1 , use the dependency parser to analyze each sentence X in the text, and replace the i-th word x i The dependency relationship d(x i ) is marked as a specific dependency type, and the dependency type of each word d(x i ) is defined by the relations in the syntax tree to obtain the set of dependent types.
[0053] The so-called dependency relationship essentially describes the relationship between words in a sentence. This relationship is grammatically expressed as a dependency relationship between a dependent word and the core word (head) on which it depends. The dependency type is the classification of these dependency relationships, such as root nodes, modifiers, noun subjects, direct objects, and noun combination forms. Taking "redwooden bookshelf" as an example, its dependency relationship can be analyzed as follows: "bookshelf" is the core word and the center of the entire compound noun. "wooden" is an adjective that modifies "bookshelf" to form an "amod" relationship. "Red" is also an adjective, but it modifies the overall concept of "wooden bookshelf", but in a simplified dependency analysis, it may directly depend on "bookshelf" and also form an "amod" relationship. Note that in actual dependency analysis software, more complex hierarchies may be considered.
[0054] S12, replace the i-th word x in sentence X i Remove, generate a new sentence X′, and calculate the implication score s(x i ), calculate all words x with the same dependency type i The average implication score of .
[0055] Among them, a natural language inference model (NLI model such as RoBERTa-Large-NLI) is used to calculate the implication score s(x) between the new sentence X′ and the original sentence X i ). This entailment score reflects the i After that, the degree of semantic change of the text. The formula is expressed as:
[0056] s(x i ) = NLI(X′,X)
[0057] Among them, s(x i ) is the word x i The degree of influence on the semantics of the text.
[0058] Because there may be words with the same dependency type in many sentences, and the entailment scores s(x i ) has a certain error, so in order to stably reflect the influence of the text semantics of the words corresponding to the dependency type, this embodiment performs a multiplication of all words with the same dependency type d(x i ) = d j Word x i Calculate the average of their implication scores. Average Implication Score Used to represent dependent type d j Overall importance in the sentence:
[0059]
[0060] Among them, D j The dependent type is d j The word set of |D j | is the number of words in the set.
[0061] S13. According to the implication score, all dependency types d j Sort in descending order to obtain an ordered list of dependency types; select the dependency type with a high implication score as the key position for watermark embedding according to the ordered list.
[0062] According to the average implication score of the dependency type calculated For all dependencies of type d j Sort in descending order. Select the dependency types with higher average implication scores as the key positions for watermark embedding. The sorting result generates an ordered list of dependency types L = {d 1 ,d 2 ,…,d k},in The goal of this algorithm is to determine which parts should be given priority when processing the text (such as embedding watermarks) by analyzing the stability and importance of different dependencies in the sentence, so as to improve the robustness of the system.
[0063] S2. Define key positions, generate a candidate word list, calculate the probability distribution corresponding to each dependency type, adjust the selection probability of the candidate word list according to the probability distribution, sample and generate vocabulary from the candidate word list according to the set rules, and obtain embedded watermark text; the candidate word list includes a first list and a second list, and the selection probability of the first list is higher than that of the second list.
[0064] In the above steps, this embodiment discusses in detail how to use syntactic dependency analysis to determine the key embedding positions in the text. The selection of these positions is not only based on their importance in semantic communication, but also takes into account their stability in the text structure. Through grammatical structure analysis, this embodiment can identify the parts that are critical to the fluency and semantic integrity of the text, and these positions are relatively difficult to be modified or removed, thereby improving the concealment and robustness of the watermark.
[0065] In addition, this analysis also enables the present embodiment to intelligently select the location to embed the watermark, rather than indiscriminately processing all text content. This selective embedding method can not only maintain the quality of the text, but also significantly reduce the consumption of computing resources, especially when processing long texts, which can significantly shorten the processing time.
[0066] Through this precise positioning method, this embodiment lays a solid foundation for watermark embedding, making the subsequent watermark embedding process more efficient and difficult for attackers to identify or remove. Next, this embodiment will introduce the specific steps and methods of watermark embedding in detail to achieve effective protection of text content, including:
[0067] S21. By performing syntactic dependency analysis on the generated text, key syntactic dependency relationships are determined and sorted. Watermarks are preferably embedded in these key positions to improve the robustness and concealment of the watermark.
[0068] S22. For each key syntactic dependency position d j , generate a list of candidate words, consider the first list as the "Green List" and the second list as the "Red List". The words G in the green list j The words R in the red list are selected first. j Will be avoided as much as possible.
[0069] S23. For each dependency type d j The corresponding Logits distribution p(x i |X), this embodiment is adjusted to increase the selection probability of green list words δ G :
[0070]
[0071] in, is the adjusted probability of selection, p(x i |X) is the original Logits probability distribution.
[0072] Similarly, for the words in the red list, reduce their selection probability δ R :
[0073]
[0074] In this way, the present embodiment ensures that the generated text is more likely to contain the intended watermark vocabulary.
[0075] S24, according to the adjusted logos distribution Sampling from the candidate vocabulary to generate actual text x i . Vocabularies in the green list are preferred to ensure watermark embedding.
[0076] S25. Introduce a control parameter λ, and adjust the control parameter λ to determine the proportion of key positions. By adjusting the value of λ, a balance can be achieved between watermark concealment and robustness. The control parameter λ can be used to see the control of the modified Logits density by this embodiment. The larger the λ, the more modified Logits, that is, the larger the embedded watermark density ρ. The difference is that density refers to the modified Logits relative to the entire text, and λ refers to the key positions selected relative to the syntactic dependency. The larger the λ value, the stronger the robustness and the lower the concealment. The embedded watermark density ρ is as follows:
[0077]
[0078] Among them, 1 watermark (d j ) is an indicator function, indicating whether j The watermark is embedded at , and |L| is the total number of key positions.
[0079] Complete the watermark embedding.
[0080] S3. Extract the fragment to be tested from the embedded watermark text, reconstruct the candidate word list according to the set rules, calculate the frequency of occurrence of the words in the first list in the fragment to be tested, calculate the deviation between the frequency of occurrence and the expected value, judge whether the embedded watermark text has a watermark according to the deviation value, and output the detection result.
[0081] After the watermark embedding process is completed, the generated text already contains the hidden watermark information. At this point, the embedding of the watermark achieves the protection of the text by selectively adjusting the probability of occurrence of words in specific positions, ensuring that the semantics and fluency of the text are not affected. This method not only enhances the concealment of the watermark, but also makes it difficult for attackers to detect and remove the watermark. However, in order to verify the existence of the watermark and ensure the effectiveness of the watermark, accurate watermark detection must be performed. The following will detail how to identify and confirm the watermark in the text through a systematic detection process, thereby achieving protection and review of the generated content. The watermark detection process is as follows:
[0082] S31, extract the text segment T that needs to be detected from the embedded watermark texttest . This snippet can be the entire text or a specific part.
[0083] S32, according to the same rules and algorithms used when embedding the watermark, reconstruct the green list G at each position in the detected text test and the red list R test .
[0084] S33. In the detected text, count the frequency of occurrence of words in the green list f(G test );
[0085]
[0086] in, is the indicator function, when x i Belongs to green list G test 1 if the value is 0, otherwise it is 0.
[0087] During the watermark embedding process, the words in the green list are tended to have their occurrence probability increased. Therefore, in the watermarked text, the frequency of occurrence of the green list words should be significantly higher than that of the non-watermarked text.
[0088] S34. Calculate a statistic, such as a z-score, to quantify the deviation between the frequency of occurrence of green-list words in the test text and the expected value. Specifically, the z-score can be calculated by the following formula:
[0089]
[0090] Among them, f(G test ) is the actual number of occurrences of green list words, γ is the expected proportion of green list, T test The total number of words in the text.
[0091] S35. Determine whether a watermark exists based on the calculated statistics. Usually, if the z-score exceeds a preset threshold z thresh , then it is considered that there is a watermark in the text. This means that the vocabulary usage of the text deviates from the normal distribution of the natural language model, indicating that a watermark may be embedded.
[0092] S36. If the detection result indicates that a watermark exists, further verify whether it is a real watermark and record the detection result. If the detection is public, the detection algorithm and related statistics can be provided to a third party for independent verification.
[0093] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.
[0094] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0095] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A text watermark embedding method during Logits generation based on a large language model, characterized in that: The steps include: Analyze the dependency relationship between text sentences, obtain a set of dependency types, sort the dependency types according to the implication scores of each dependency type, and select the key positions for watermark embedding in order; The key position is defined, a candidate word list is generated, the probability distribution corresponding to each dependency type is calculated, the selection probability of the candidate word list is adjusted according to the probability distribution, and words are sampled and generated from the candidate word list according to the set rules to obtain the embedded watermark text; the candidate word list includes a first list and a second list, and the selection probability of the first list is higher than that of the second list; Extract the fragment to be tested from the watermarked text, reconstruct the candidate word list according to the set rules, calculate the frequency of occurrence of the words in the first list in the fragment to be tested, calculate the deviation between the frequency of occurrence and the expected value, determine whether the watermarked text has a watermark based on the deviation value, and output the detection result.
2. According to the text watermark embedding method during Logits generation based on a large language model according to claim 1, it is characterized in that: The analysis of the dependency relationship between text sentences includes: given a generated text T l-1 , use the dependency parser to analyze each sentence X in the text, and replace the i-th word x i The dependency relationship d(x i ) is marked as a specific dependency type, and the dependency type of each word d(x i ) is defined by the relations in the syntax tree to obtain the set of dependent types.
3. According to the text watermark embedding method during Logits generation based on a large language model as claimed in claim 1, it is characterized in that: The implication score according to each dependency type includes: i Remove, generate a new sentence X′, and calculate the implication score s(x i ), calculate all words x with the same dependency type i The average implication score of .
4. According to claim 1, the text watermark embedding method during Logits generation based on a large language model is characterized in that: The method of sorting dependency types by using implication scores and selecting key positions for watermark embedding in order includes: According to the implication score, all dependency types d j Sort in descending order to obtain an ordered list of dependency types; select the dependency type with a high implication score as the key position for watermark embedding according to the ordered list.
5. According to claim 1, the text watermark embedding method during Logits generation based on a large language model is characterized in that: The adjusting the selection probability of the candidate word list according to the probability distribution includes increasing the selection probability δ of the first list G , as follows: in, is the adjusted probability of selection, p(x i |X) is the original Logits probability distribution.
6. According to claim 1, the text watermark embedding method during Logits generation based on a large language model is characterized in that: The adjusting the selection probability of the candidate word list according to the probability distribution includes reducing the selection probability δ of the second list R , as follows: in, is the adjusted probability of selection, p(x i |X) is the original Logits probability distribution.
7. According to claim 1, the text watermark embedding method during Logits generation based on a large language model is characterized in that: The setting rule is specifically as follows: introducing a control parameter λ, and determining the proportion of key positions by adjusting the control parameter λ; the control parameter λ is proportional to the embedded watermark density ρ, as shown in the following formula: Among them, 1 watermark (d j ) is an indicator function, indicating whether j The watermark is embedded at , and |L| is the total number of key positions.
8. According to claim 1, the text watermark embedding method during Logits generation based on a large language model is characterized in that: The calculation of the frequency of occurrence of the words in the first list in the segment to be checked is f(G test ), as follows: in, is the indicator function, when word x i Belongs to the first list G test 1 if the value is 0, otherwise it is 0.
9. The text watermark embedding method during Logits generation based on a large language model according to claim 1, characterized in that: The calculation of the deviation value z between the occurrence frequency and the expected value is as follows: Among them, f(G test ) is the actual number of occurrences of the first list vocabulary, γ is the expected proportion of the first list, T test The total number of words in the text.
10. The text watermark embedding method during Logits generation based on a large language model according to claim 1, characterized in that: The method of judging whether the watermark-embedded text has a watermark according to the deviation value and outputting the detection result is specifically as follows: If the deviation value exceeds a preset threshold, it is considered that there is a watermark in the text; If there is a watermark in the text, verify whether the watermark is a real watermark and record the detection result; If the verification watermark is public, the detection algorithm and related statistics are provided to a third party for independent verification; Output the results of the above steps and print the test report.
Citation Information
Cited By
Watermark adding method, watermark detection method and watermark adding model training method
CN119962541A
Watermark generation method and device based on large model, equipment and medium
CN120068027A
Text processing method, electronic equipment and storage medium
CN120409463A
Security guarantee method for large language model generated text
CN120524471A
Self-adaptive text watermarking method based on dynamic red and green list
CN122087788A