Large language model watermarking method based on semantic consistency
By using the semantically consistent watermark method in the large language model inference stage to embed, extract and detect machine-generated text, we solve the problem of insufficient robustness in the existing technology, achieve efficient model validation and text detection, and resist attacks. Maintain text quality.
Patent Information
- Application Number
- CN202410724440.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-01
AI Technical Summary
Existing large language model watermarking technology lacks robustness in the model inference stage, making it difficult to detect machine-generated text and model traceability without affecting text quality, and faces the threat of rewriting and adversarial attacks.
Using a watermarking method based on semantic consistency, the watermark information is embedded into the generated text in the model inference stage, the watermark information is compressed through a hash function, and a lightweight semantic embedding extraction model and a semantic transformation model are used to generate semantic logic values, combined with message logic Dynamically regulate the value to ensure that the watermark information does not affect the original logical value distribution during the text generation process, and realize text embedding and extraction detection.
This method improves the robustness and detection efficiency of watermarks without modifying the original parameters of the model, can resist rewriting and adversarial attacks, maintains high text quality and low computational overhead, and achieves effective model confirmation and machine generation. Text detection.
Smart Images

Figure CN118734801A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a large language model watermark method based on semantic consistency, belonging to the field of artificial intelligence security technology. Background Art
[0002] As a disruptive emerging technology, large language models have gradually become a hot topic in fields such as artificial intelligence in recent years. They are usually used to solve common language tasks, have a very wide range of application scenarios, and have demonstrated powerful functions in many fields.
[0003] However, as the text generated by large language models becomes more diverse, fluent, and realistic, it has had a harmful impact in many fields. The unrestricted use of large language models is causing increasing harm to more and more fields. Therefore, how to accurately identify the text generated by large language models has become increasingly important and urgent. In addition, the powerful capabilities of large language models are usually based on their sophisticated structural design, massive training data, and a large amount of computing resources. It condenses the wisdom and energy of developers and should be regarded as the assets of developers. The theft of models by malicious third parties is an unethical and illegal act that infringes on the developer's intellectual property rights and model copyrights, and may cause corresponding economic losses. Therefore, it is very important to trace the source of large language models.
[0004] Since it is difficult for humans to distinguish whether suspicious text is generated by a large language model, and it is difficult to distinguish whether a suspicious model is stolen, watermarking technology is an effective way to solve the above problems. However, the current watermarking scheme is still imperfect. Watermarks designed to protect model copyrights usually work in the model training phase, which brings considerable resource consumption and affects the original effect of the model; watermarks designed for the purpose of detecting machine-generated text work in the model reasoning phase, but usually have low coding efficiency, making it difficult to complete the work of model authentication, and face many attacks and lack of robustness. Summary of the invention
[0005] The purpose of the present invention is to solve the technical problems such as the lack of robustness of watermarking technology in machine-generated text detection and model traceability, and creatively propose a large language model watermarking method based on semantic consistency. This method can embed watermark information into the generated text without modifying the original parameters of the model during the model reasoning stage, has excellent robustness, and at the same time maintains the high text quality of the generated text, meets high practicality, and realizes the utility of detecting machine-generated text and model confirmation.
[0006] The present invention is implemented by adopting the following technical solutions.
[0007] A large language model watermarking method based on semantic consistency includes two parts: watermark embedding and watermark extraction and detection.
[0008] Among them, watermark embedding includes the following steps:
[0009] Step 1: Watermark embedding initialization.
[0010] The watermark information to be embedded is compressed using a hash function.
[0011] Step 2: Acquisition of semantic logic value. This includes the following steps:
[0012] Step 2.1: Semantic extraction.
[0013] A lightweight semantic embedding extraction model and its corresponding tokenizer are used to tokenize the text prompt and the currently generated text segment. Then, the semantic embedding extraction model is used to obtain the semantic embedding of the next k tokens. k is a hyperparameter used to control the degree of acquisition of semantic embedding information.
[0014] Step 2.2: Semantic aggregation.
[0015] Through predefined explicit aggregation rules or implicit semantic aggregation models, the semantic embeddings of the extracted k-segment words are aggregated into an aggregated semantic embedding containing more semantic information.
[0016] Among them, the aggregated semantic embedding has the same dimension as any semantic embedding extracted previously.
[0017] Step 2.3: Semantic transformation.
[0018] The aggregated semantic embeddings are converted into semantic logical values through a pre-trained lightweight semantic transformation model.
[0019] Among them, the semantic conversion model should satisfy: the input dimension size is equal to the aggregated semantic embedding dimension, and the output dimension size is consistent with the vocabulary size of the large language model for text generation.
[0020] The semantic logical value should satisfy the following requirements: the semantic logical value distribution has no preference for each word, that is, in the semantic logical value distribution generated on large-scale data, the sum of the logical values of each word should approach 0; the semantic logical value distribution should be balanced, that is, the logical values of all words in any logical value distribution should also approach 0.
[0021] Step 3: Get the message logic value.
[0022] Specifically, the watermark information previously compressed using a hash function is encrypted using a key and an encryption function, and the obtained ciphertext is used as a random number seed to generate a message logic value.
[0023] Among them, the size of the message logical value distribution is consistent with the size of the large language model vocabulary for text generation, and the message logical value distribution has no preference for each word, that is, the sum of the logical values of each word in the semantic logical value distribution generated on large-scale data should be 0; the semantic logical value distribution should be balanced, that is, the logical values of all words in any logical value distribution should also be 0.
[0024] Step 4: Watermark logical value combination.
[0025] The influence of the semantic logic value and the message logic value is adjusted, and the weighted sum of the two is added to obtain a preliminary watermark logic value.
[0026] Step 5: Dynamically adjust the watermark logic value.
[0027] The original logical value generated by the large language model for text generation under the current word is obtained as the leading knowledge. According to the distribution value of the original logical value, the previously obtained watermark logical value is dynamically regulated through the explicit predefined rules or implicit dynamic regulation model to obtain the final watermark logical value.
[0028] Step 6: Watermark embedding.
[0029] The process of generating text using a large language model, including logical value generation and word unit sampling.
[0030] In the present invention, in the inference stage of the large language model for text generation, when the next word is about to be generated, steps 2 to 5 are repeated to obtain the current watermark logic value. The obtained watermark logic value is added to the original logic value generated by the large language model for text generation to obtain the final logic value distribution. Then, word unit sampling in the text generation process is performed to obtain the currently generated word unit.
[0031] Step 7: Watermark text generation.
[0032] Repeat step 6 until the end marker token is generated. Organize and decode the generated tokens to obtain the final generated text, which is embedded with the custom watermark information.
[0033] Watermark extraction and detection includes the following steps:
[0034] Step 8: Detection initialization.
[0035] First, a detection variable is maintained and initialized to 0. At the same time, the watermark information to be verified is compressed using a hash function.
[0036] Step 9: Obtain watermark logic value:
[0037] After the suspicious text is segmented by the word segmenter, each word unit is tested one by one: Steps 2 to 4 of watermark embedding are repeated to obtain the watermark logic value of each word unit and add it to the detection variable.
[0038] Step 10: Watermark extraction and detection.
[0039] Since the existence of the watermark logic value will affect the distribution of the original logic value, and since the normalized exponential function does not affect the size relationship, the change of the watermark logic value to the original logic value will directly affect the probability distribution of word unit sampling. A watermark logic value greater than 0 on a word unit will promote the word unit in the generation process, while a watermark logic value less than 0 on a word unit will suppress the word unit in the generation process. Therefore, in the final generated watermark text, word units with watermark logic values greater than 0 will appear more, while word units with watermark logic values less than 0 will appear less.
[0040] Specifically, the mean of the detected watermark logic values is calculated. If the final detection value mean is significantly higher than 0, the text is considered to be a watermarked text and the watermark is the watermark that needs to be verified. Otherwise, it is considered that the watermark does not exist.
[0041] Beneficial Effects
[0042] 1. The method of the present invention works in the inference stage of the model and does not modify the original parameters of the model, which can avoid excessive resource consumption of embedding watermarks in the model training stage.
[0043] 2. The method of the present invention can resist rewriting attacks, adversarial attacks, etc. and has excellent robustness.
[0044] 3. The method of the present invention maintains high text quality of the watermark text and low computational overhead of watermark embedding, and has good practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0046] In order to better illustrate the purpose and advantages of the present invention, the invention is further described below with reference to the accompanying drawings and examples.
[0047] Example 1
[0048] In this embodiment, the embedded custom watermark information is LeoStrange, which indicates the identity information of the user to whom the model belongs. The model owner hopes to embed the corresponding watermark information in the text generated by the model through the following steps to identify the text as machine-generated rather than human-generated content, and at the same time, it can still be determined that the text is machine-generated text after a certain degree of rewriting and other operations.
[0049] like Figure 1 As shown, a large language model watermarking method based on semantic consistency includes two parts: watermark embedding and watermark extraction and detection.
[0050] The watermark embedding process includes the following steps:
[0051] Step 1: Watermark embedding initialization.
[0052] The model owner prepares the watermark information m to be embedded and uses the hash function H to perform preliminary information compression.
[0053] Step 2: Get the semantic logic value.
[0054] Step 2.1: Semantic extraction.
[0055] Use a lightweight semantic embedding extraction model and its corresponding word segmenter to segment the text prompt and the currently generated text segment, and then use the semantic embedding extraction model M e Get the semantic embedding e of the last k words i-k+1 ,……,e i Wherein, k is a hyperparameter used to adjust the degree of acquisition of semantic embedding information. In this embodiment, k is 2, and the semantic embedding of the first two word units of the current word unit is extracted.
[0056] Step 2.2: Semantic aggregation.
[0057] Through predefined explicit aggregation rules f, or implicit semantic aggregation model M p , embed the semantics of the extracted k-segment word into e i-k+1 ,……,e i Aggregate into an aggregated semantic embedding containing more semantic information pooling Among them, the aggregated semantic embedding e pooling It is of the same dimension as any semantic embedding extracted previously.
[0058] In this embodiment, a predefined aggregation rule is used to assign a higher weight to the semantic embedding of the word segment close to the current word, so as to obtain the aggregated semantic embedding.
[0059] Step 2.3: Semantic transformation.
[0060] Through a pre-trained lightweight semantic transformation model M t , embedding the semantics of aggregation into pooling Convert to semantic logical value l semantic In the embodiment, a simple multi-layer perceptron is used for semantic conversion.
[0061] Among them, the semantic transformation model M t Should satisfy: input dimension size and aggregated semantic embedding e pooling The dimensions are equal, and the output dimension size is consistent with the vocabulary size of the large language model generated by text.
[0062] The output semantic logical value should satisfy the following requirements: the semantic logical value distribution has no preference for each word, that is, the sum of the logical values of each word in the semantic logical value distribution generated on large-scale data should be close to 0; the semantic logical value distribution should be balanced, that is, the logical values of all words in any logical value distribution should also be close to 0.
[0063] Step 3: Get the message logic value.
[0064] The watermark information compressed by the hash function H is encrypted using a key k and an encryption function Enc, and the ciphertext is used as a random number seed to generate a message logic value l. message .
[0065] Among them, the size of the message logical value distribution is consistent with the size of the large language model vocabulary for text generation, and: the message logical value distribution has no preference for each word, that is, the sum of the logical values of each word in the large number of semantic logical value distributions generated on large-scale data should be 0; the semantic logical value distribution should be balanced, that is, the logical values of all words in any logical value distribution should also be 0.
[0066] Step 4: Watermark logical value combination.
[0067] Adjust the influence of semantic logic value and message logic value, and add them together to get the preliminary watermark logic value l watermark =β1l semantic +β2l message Among them, β1 and β2 represent the influence degree of semantic logic value and message logic value.
[0068] In this embodiment, the value of β1 is 1, and the value of β2 is 0.3.
[0069] Step 5: Dynamically adjust the watermark logic value.
[0070] The original logical value generated by the large language model of the text generation under the current word is obtained as the leading knowledge. According to the distribution value of the original logical value, the previously obtained watermark logical value is dynamically regulated by the explicit predefined rule r or the implicit dynamic regulation model to obtain the final watermark logical value l w Among them, l w The watermark logic value l obtained previously watermark Are of the same dimension size.
[0071] In this embodiment, predefined rules are used for dynamic regulation, and the distribution value mean of the logical value distribution of a certain type of model is pre-calculated. In each step of generating text by a large language model, the original logical value distribution of the step is pre-processed to filter out negative infinite values, and then the distribution value mean is calculated as a regulation information value of the distribution. The obtained aggregated logical value is then scaled according to the ratio of this regulation information value to the distribution value mean of the logical value distribution of this type of model to obtain the final watermark logical value.
[0072] Step 6: Watermark embedding and watermark text generation.
[0073] In the inference stage of the text generation large language model, when the next word t is about to be generated, the above steps 2-5 are repeated to obtain the current watermark logic value, and the obtained watermark logic value is added to the original logic value generated by the text generation large language model to obtain the final logic value distribution l f , and then the word unit sampling and other stages in the text generation process are consistent with the original workflow of the text generation large language model to obtain the currently generated word unit.
[0074] Step 7: Watermark text generation.
[0075] Repeat step 6 until the end marker word is generated, organize the generated word units and decode them to obtain the final generated text, which is embedded with the custom watermark information.
[0076] In this embodiment, 500 sets of data from the C4-realnewslike dataset are used, and the first 30 of each set of data are segmented and used as prompt words to generate watermarked text. A third party can obtain these machine-generated texts and can disseminate or use them after making appropriate modifications. The detector hopes to detect whether these suspicious texts are machine-generated texts.
[0077] Watermark extraction and detection includes the following steps:
[0078] Step 8: Detection initialization.
[0079] First, a detection variable x is maintained and initialized to 0. At the same time, the watermark information m to be verified is preliminarily compressed using the hash function H.
[0080] Step 9: Obtain the watermark logic value.
[0081] After the suspicious text is segmented by the tokenizer, each word unit is tested one by one: steps 2-4 of watermark embedding are repeated to obtain the watermark logic value of each word unit and add it to the detection variable.
[0082] In this embodiment, the detector obtains the message logic value in step 3 of the watermark embedding end through the model owner.
[0083] Step 10: Watermark extraction and detection.
[0084] Calculate the mean of the detected watermark logic value. If the final detection value mean is significantly higher than 0, it can be determined that the text is a watermarked text and the watermark is the watermark that needs to be verified. Otherwise, it is considered that the watermark does not exist.
[0085] In this embodiment, after calculating the mean of the detection value for the suspicious text, if the mean of the detection value is higher than the set threshold of 0.2, it is determined to be watermarked, that is, it is detected as machine-generated text, otherwise it is natural text generated by humans. This can reduce the harm caused by the abuse of machine-generated text.
[0086] Example 2
[0087] The embodiment is to apply a semantic consistency-based large language model watermarking method of the present invention to solve the problem of model ownership confirmation. In the embodiment, the embedded custom watermark information is DJStrong, which represents the identity information of the user to whom the model belongs. The model owner hopes to embed a watermark for his own model through the following steps to indicate the ownership and copyright of the model.
[0088] A large language model watermarking method based on semantic consistency includes two parts: watermark embedding and watermark extraction and detection.
[0089] Watermark embedding includes the following steps.
[0090] Step 1: Watermark embedding initialization:
[0091] The model owner prepares the watermark information m to be embedded and uses the hash function H to perform preliminary information compression.
[0092] Step 2: Obtaining semantic logical values.
[0093] Step 2.1: Semantic extraction.
[0094] Use a lightweight semantic embedding extraction model and its corresponding word segmenter to segment the text prompt and the currently generated text segment, and then use the semantic embedding extraction model M e Get the semantic embedding e of the last k words i-k+1 ,……,e i .
[0095] Wherein k is a hyperparameter used to adjust the degree of acquisition of semantic embedding information. In the embodiment, k is 2, and the semantic embedding of the first two word-grams of the current word-gram is extracted.
[0096] Step 2.2: Semantic aggregation.
[0097] Through predefined explicit aggregation rules f, or implicit semantic aggregation model M p , embed the semantics of the extracted k-segment word into e i-k+1 ,……,e i Aggregate into an aggregated semantic embedding containing more semantic information pooling Among them, the aggregated semantic embedding e pooling It is of the same dimension as any semantic embedding extracted previously.
[0098] In this embodiment, a predefined aggregation rule is used to assign a higher weight to the semantic embedding of the word segment close to the current word, so as to obtain the aggregated semantic embedding.
[0099] Step 2.3: Semantic transformation.
[0100] Through a pre-trained lightweight semantic transformation model M t , embedding the semantics of aggregation into pooling Convert to semantic logical value l semantic In the embodiment, a simple multi-layer perceptron is used for semantic conversion.
[0101] Among them, the semantic transformation model M t Should satisfy: input dimension size and aggregated semantic embedding e pooling The dimensions are equal, and the output dimension size is consistent with the vocabulary size of the large language model generated by text.
[0102] The output semantic logical value should satisfy the following requirements: the semantic logical value distribution has no preference for each word, that is, the sum of the logical values of each word in the large number of semantic logical value distributions generated on large-scale data should be close to 0; the semantic logical value distribution should be balanced, that is, the logical values of all words in any logical value distribution should also be close to 0.
[0103] Step 3: Get the message logic value.
[0104] The watermark information compressed by the hash function H is encrypted using a key k and an encryption function Enc, and the ciphertext is used as a random number seed to generate a message logic value l. message .
[0105] Among them, the size of the message logical value distribution is consistent with the size of the large language model vocabulary for text generation, and: the message logical value distribution has no preference for each word, that is, the sum of the logical values of each word in the large number of semantic logical value distributions generated on large-scale data should be 0; the semantic logical value distribution should be balanced, that is, the logical values of all words in any logical value distribution should also be 0.
[0106] Step 4: Watermark logical value combination.
[0107] Adjust the influence of semantic logic value and message logic value, and add them together to get the preliminary watermark logic value l watermark =β1l semantic +β2l message .
[0108] Among them, β1 and β2 represent the influence degree of semantic logic value and message logic value.
[0109] In this embodiment, the value of β1 is 1, and the value of β2 is 0.3.
[0110] Step 5: Dynamically adjust the watermark logic value.
[0111] The original logical value generated by the large language model of the text generation under the current word is obtained as the leading knowledge. According to the distribution value of the original logical value, the previously obtained watermark logical value is dynamically regulated by the explicit predefined rule r or the implicit dynamic regulation model to obtain the final watermark logical value l w Among them, l w The watermark logic value l obtained previously watermark Are of the same size.
[0112] In this embodiment, predefined rules are used for dynamic regulation, and the distribution value mean of the logical value distribution of a certain type of model is pre-calculated. In each step of generating text by a large language model, the original logical value distribution of the step is pre-processed to filter out negative infinite values, and then the distribution value mean is calculated as a regulation information value of the distribution. The obtained aggregated logical value is then scaled according to the ratio of this regulation information value to the distribution value mean of the logical value distribution of this type of model to obtain the final watermark logical value.
[0113] Step 6: Watermark embedding and watermark text generation.
[0114] In the inference stage of the text generation large language model, when the next word t is about to be generated, the above steps 2-5 are repeated to obtain the current watermark logic value, and the obtained watermark logic value is added to the original logic value generated by the text generation large language model to obtain the final logic value distribution l f , and then the word unit sampling and other stages in the text generation process are consistent with the original workflow of the text generation large language model to obtain the currently generated word unit.
[0115] Step 7: Watermark text generation.
[0116] Repeat step 6 until the end marker word is generated, organize the generated word units and decode them to obtain the final generated text, which is embedded with the custom watermark information.
[0117] When a copyright dispute occurs and model confirmation is required, the model owner and the malicious model thief need to provide the message logic value obtained through their own identity respectively. By inputting the prompt text into the model that caused the dispute, and obtaining the watermarked output text. The model owner and the model thief need to use the message logic value obtained through their own identity to detect the watermark information of the output text respectively. The model owner can detect the watermark from it while the malicious third party cannot detect it, thereby achieving the utility of model confirmation. In the embodiment, 500 groups of data from the Wikipedia data set are used, and the first 30 of each group of data are split as prompt words to generate watermarked text for both parties to detect.
[0118] Watermark extraction and detection includes the following steps:
[0119] Step 8: Detection initialization.
[0120] First, a detection variable x is maintained and initialized to 0. At the same time, the watermark information m to be verified is preliminarily compressed using the hash function H.
[0121] Step 9: Obtain the watermark logic value.
[0122] After the suspicious text is segmented by the tokenizer, each word unit is tested one by one: steps 2-4 of watermark embedding are repeated to obtain the watermark logic value of each word unit and add it to the detection variable.
[0123] In the embodiment, the detector obtains the message logic value in step 3 of the watermark embedding end through the model owner.
[0124] Step 10: Watermark extraction and detection.
[0125] Calculate the mean of the detected watermark logic value. If the final detection value mean is significantly higher than 0, it can be determined that the text is a watermarked text and the watermark is the watermark that needs to be verified. Otherwise, it is considered that the watermark does not exist.
[0126] In the embodiment, after calculating the average of the detection values for the suspicious text, if the average of the detection values is higher than the set threshold value of 0.2, it is determined to be watermarked, otherwise it is not watermarked. The model owner can detect the watermark while the model thief cannot, thereby reducing the harm caused by model theft.
[0127] The specific description above further illustrates the purpose, technical solutions and beneficial effects of the invention in detail. It should be understood that the above is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A large language model watermarking method based on semantic consistency, It is characterized in that Including watermark embedding and watermark extraction detection; Among them, watermark embedding includes the following steps: Step 1: watermark embedding initialization; Step 2: Semantic logic value acquisition, including the following steps: Step 2.1: Semantic extraction; Use a lightweight semantic embedding extraction model and its corresponding tokenizer to tokenize the text prompt and the currently generated text segment. Then use the semantic embedding extraction model to obtain the semantic embedding of the next k tokens, where k is a hyperparameter used to adjust the degree of acquisition of semantic embedding information. Step 2.2: semantic aggregation; Aggregate the semantic embeddings of the k extracted word-units into an aggregated semantic embedding containing more semantic information through a predefined explicit aggregation rule or an implicit semantic aggregation model; Among them, the aggregated semantic embedding is of the same dimension as any previously extracted semantic embedding; Step 2.3: semantic transformation; The aggregated semantic embeddings are converted into semantic logical values through a pre-trained lightweight semantic conversion model; The semantic conversion model should satisfy the following requirements: the input dimension size is equal to the aggregated semantic embedding dimension, and the output dimension size is consistent with the vocabulary size of the large language model for text generation; The semantic logical value should satisfy the following requirements: the semantic logical value distribution has no preference for each word, that is, in the semantic logical value distribution generated on large-scale data, the sum of the logical values of each word should be close to 0; the semantic logical value distribution should be balanced, that is, the logical values of all words in any logical value distribution should also be close to 0; Step 3: Get the message logic value; The watermark information previously compressed by the hash function is encrypted through a key and an encryption function, and the obtained ciphertext is used as a random number seed to generate a message logic value; The size of the message logic value distribution is consistent with the size of the large language model vocabulary for text generation, and the message logic value distribution has no preference for each word, that is, the sum of the logic values of each word in the semantic logic value distribution generated on large-scale data should be 0; the semantic logic value distribution should be balanced, that is, the logic values of all words in any logic value distribution should also be 0; Step 4: Watermark logical value combination; Step 5: Dynamically adjust the watermark logic value; Step 6: watermark embedding; In the inference phase of the large language model for text generation, when the next word is about to be generated, steps 2 to 5 are repeated to obtain the current watermark logic value; the obtained watermark logic value is added to the original logic value generated by the large language model for text generation to obtain the final logic value distribution; then the word samples in the text generation process are performed to obtain the currently generated word; Step 7: watermark text generation; Repeat step 6 until the end marker word is generated; organize the generated word units and decode them to obtain the final generated text, which is embedded with the custom watermark information; Watermark extraction and detection includes the following steps: Step 8: Detection initialization; Step 9: Obtain watermark logic value: After the suspicious text is segmented by the word segmenter, each word unit sequence is tested one by one: Steps 2 to 4 of watermark embedding are repeated to obtain the watermark logic value of each word unit and add it to the detection variable; Step 10: Watermark extraction and detection; Calculate the mean of the detected watermark logic values. If the final detection value mean is significantly higher than 0, the text is considered to be a watermarked text and the watermark is the watermark that needs to be verified; otherwise, it is considered that the watermark does not exist.
2. A large language model watermarking method based on semantic consistency as claimed in claim 1, It is characterized in that In step 1, the watermark information to be embedded is compressed using a hash function.
3. A large language model watermarking method based on semantic consistency as claimed in claim 1, It is characterized in that In step 4, the influence of the semantic logic value and the message logic value is adjusted, and the weighted values are added together to obtain a preliminary watermark logic value.
4. A large language model watermarking method based on semantic consistency as claimed in claim 1, It is characterized in that In step 5, the original logical value generated by the large language model for generating text under the current word is obtained as the leading knowledge; according to the distribution value of the original logical value, the watermark logical value obtained previously is dynamically regulated through the explicit predefined rules or the implicit dynamic regulation model to obtain the final watermark logical value.
5. A large language model watermarking method based on semantic consistency as claimed in claim 1, It is characterized in that In step 8, first, a detection variable is maintained and initialized to 0; at the same time, the watermark information to be verified is compressed using a hash function.
Citation Information
Cited By
Big language model watermark detection method and system capable of being publicly verified
CN119577708A
Watermark implanting and detecting method, server side, trusted third party, medium and product
CN119598428A
Model copyright protection method and device based on kinship and text feature matching
CN120257271A
Generative text watermark embedding method based on semantic style and detection method thereof
CN121637464A
A semantic style-based generative text watermark embedding method and a detection method thereof
CN121637464B
