Watermark generation method and system based on large language model
By developing a watermark generation method and system based on a large language model, the problem of text watermarks being easily destroyed in existing technologies is solved, achieving text security and intellectual property protection. It is applicable to intelligent watermarking applications in multiple languages and fields.
Patent Information
- Application Number
- CN202411653644.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Existing digital watermarking technologies have limited applications in the text domain and are easily compromised during editing and format conversion, failing to effectively protect the intellectual property rights of the output content of large language models.
This paper proposes a watermark generation method based on a large language model. Through data preprocessing, word frequency and inverse document frequency calculation, Word2Vec model processing, high-dimensional word vector extraction, deep feature classification and watermark generation, combined with hash algorithm and intelligent watermark system, the method achieves the security protection of text data.
It enhances text security and intellectual property protection, ensuring that the watermark is not destroyed during text editing and format conversion, and is suitable for intelligent watermarking applications in multiple languages and fields.
Smart Images

Figure CN119577707B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of artificial intelligence, and particularly relates to a watermark generation method and system based on a large language model. BACKGROUND
[0002] With the rapid development of artificial intelligence technology, large language models have become an important tool for processing natural language. Through deep learning technology, large models can generate highly coherent and semantically rich text outputs, greatly promoting the development of human-computer interaction and automated text generation. However, the widespread application of large language models has also brought challenges to intellectual property protection. Traditional intellectual property protection methods, such as copyright declarations and digital watermarking technology, face a series of problems. First, simple copyright declarations in the digital environment cannot effectively prevent illegal copying and distribution of content. Second, existing digital watermarking technology is limited in its application in the text field. Digital watermarking technology is currently generally designed for image or audio content. Finally, the watermark may be damaged during the editing and format conversion of text content, reducing its effectiveness. Therefore, developing a new type of intelligent watermarking method that can both meet the text quality of large language model output content and provide effective intellectual property protection is a problem that needs to be solved in the current technical field. SUMMARY
[0003] To solve the above problems existing in the prior art, the present application proposes a watermark generation method based on a large language model, which comprises: obtaining a training data set, preprocessing the data in the training data set; presetting a watermark encoding rule; training the large language model using the preprocessed data according to the watermark encoding rule; obtaining text data to be processed; cleaning and standardizing the text data; calculating the word frequency and inverse document frequency of the standardized text data to generate an initial vector; processing the initial vector using a Word2Vec model to obtain a high-dimensional word vector; inputting the high-dimensional word vector into the trained neural network model to extract deep features; classifying the text according to the deep features; inputting the classified problem into the trained large language model to generate a watermark corresponding to the text type.
[0004] A watermark generation system based on a large language model, the system comprising: a data acquisition module, a data preprocessing module, a large language model, a vectorization module, a feature extraction module, a classification module, and an output module;
[0005] The data acquisition module is used to acquire text data;
[0006] The data preprocessing module is used to clean and standardize the text data; and input the standardized data into the vectorization module;
[0007] The vectorization module is used to convert the text data into a high-dimensional word vector;
[0008] The feature extraction module is used to extract features from high-dimensional word vectors to obtain deep features;
[0009] The classification module is used to classify deep features to obtain the corresponding categories of the text;
[0010] The large language model is used to process the classification results and generate corresponding watermarks;
[0011] The output module is used to output watermarked text data.
[0012] The beneficial effects of this invention are:
[0013] This invention designs a watermark encoding rule, which generates corresponding watermarks for classified text based on the watermark encoding rule, thereby improving the security of the text. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the intelligent watermark embedding process of the present invention;
[0015] Figure 2 This is a schematic diagram of the intelligent watermark detection process of the present invention;
[0016] Figure 3 This is a schematic diagram of the intelligent watermarking system architecture of the present invention;
[0017] Figure 4 This is a schematic diagram of the text vectorization implementation process of the present invention;
[0018] Figure 5 This is a schematic diagram of the watermark autoregressive production process of the present invention;
[0019] Figure 6 This is the overall flowchart of the present invention. Detailed Implementation
[0020] 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.
[0021] A watermark generation method based on a large language model, such as Figure 6As shown, the method includes: acquiring a training dataset and preprocessing the data in the training dataset; pre-setting watermark encoding rules; training the Big Oracle model using the preprocessed data according to the watermark encoding rules; acquiring text data to be processed; cleaning and standardizing the text data; calculating the word frequency and inverse document frequency of the standardized text data to generate an initial vector; processing the initial vector using the Word2Vec model to obtain high-dimensional word vectors; inputting the high-dimensional word vectors into the trained neural network model to extract deep features; classifying the text according to the deep features; and inputting the classified text into the trained Big Oracle model to generate a watermark corresponding to the text type.
[0022] Example 1
[0023] A key aspect of this invention is the use of a hash algorithm to encrypt the text, generating a hash value as a "watermark." This hash value serves as an identifier for the original text, verifying its integrity and authenticity. Specifically, it includes the following steps:
[0024] Step S11: Data preprocessing; Clean and standardize the training data to ensure data quality and provide an accurate training environment for watermark embedding.
[0025] Data processing is performed using a novel hypothesis testing method. Traditional hypothesis testing methods may fail to effectively control for Type I errors (i.e., incorrectly rejecting the true null hypothesis) when the sample size is large. This paper presents an efficient statistical hypothesis testing method that effectively controls for the probability of Type I errors as the sample size approaches infinity, and provides a quantifiable efficiency metric. Specifically, it includes:
[0026] Define the probability of a type I error: For a given hypothesis test, define the probability of a type I error and calculate the supremum of its nth root.
[0027] Calculating the average error rate: In large-scale watermark generation, the average error rate is defined. Let be the risk function of the watermark detector (h) over the family of probability distributions (P). It measures the average error rate of the detector (h) when detecting watermarks.
[0028]
[0029] Among them, E0 and E 1,P Let represent the expected values under the null and alternative hypotheses, respectively, where h is the detector (test statistic), and Y′ is the observed value. Expression This indicates an optimization of the parameters, seeking the infimum, i.e., minimizing the risk function. Here, theta is a non-negative real parameter. The expression (θE0h) represents the expected loss of the detector (h) in the watermark-free case, multiplied by the parameter theta. Here, E0 is the expectation operator in the watermark-free case. φ P,h (θ) is a function of theta, representing the maximum loss of the detector (h) under probability distribution (P). The expression is... This represents optimizing the probability distribution (P) to find its supremum, i.e., maximizing the loss function. Equation E 1,P e -θh(Y′) This represents the expected value of the detector (h) output (Y′) when the watermark exists, under the probability distribution (P), multiplied by e. -θh(Y′) Here E 1,P It is the expectation operator for the case with watermarks.
[0030] Assess the probability of Type I errors: based on the average error rate Evaluate the upper bound of the probability of Type I errors to ensure that the error rate is effectively controlled as the sample size increases. When the average error rate... In this case, the Bonferroni method is used to ensure the accuracy and reliability of hypothesis testing.
[0031] In this embodiment, a hypothesis testing problem is set up, including the null hypothesis H0 and the alternative hypothesis H1; and appropriate test statistic h and observation Y′ are selected.
[0032] The specific process for calculating the average error rate is as follows: Define a hypothesis testing problem, including the null hypothesis H0 and the alternative hypothesis H1; select appropriate test statistic h and observed values Y′; calculate the average error rate. The upper bound of the probability of a Type I error is evaluated; based on the calculation results, hypothesis testing is performed, and a conclusion is drawn.
[0033] By introducing the average error rate metric, the probability of Type I errors can be effectively controlled when the sample size is large, and the upper bound of the probability of Type I errors can be evaluated.
[0034] Step S12: Watermark Encoding Rule Design; Design a set of encoding rules, using a hash algorithm, a widely used cryptographic hash function, to convert an input (a piece of text) of arbitrary length into a fixed-length output (hash value). Convert the watermark information into a text-embedd format. The watermark can be a specific word, sentence structure, or semantic pattern. Convert the input text into a byte string for hash processing. Generate a unique hash value using the hash function; this value can serve as the "watermark" of the original text.
[0035] The processing incurs a cross-entropy loss, which measures the difference in probability distribution between the model's processed data and the true text. Here, we use a loss function (such as cross-entropy loss) that measures the difference between the model's predicted probability distribution and the true label distribution, expressed as:
[0036]
[0037] Where n is the number of categories in the classification task, i.e., how many different labels or categories there are; X i It is an indicator function, which typically takes the value 0 or 1. In multi-class classification problems, X... i X can represent whether the i-th sample belongs to class c. If sample i belongs to class c, then X... i =1; otherwise X i =0. y o,c It is the one-hot encoding (probability distribution) of the true label. In multi-class classification problems, y o,c P represents the true probability that sample o belongs to class c. o,c This is the probability distribution predicted by the model, representing the probability that sample o belongs to class c. (log) is the natural logarithm function used to calculate the logarithm of the probability. Therefore, for each sample o, the true label distribution y is calculated. o,c The probability distribution P predicted by the model o,c The cross-entropy loss is calculated between the original and processed texts, and then the losses of all samples are summed. By calculating the cross-entropy loss, it can be compared with the cross-entropy of the original text to obtain the difference in quality between the processed and original texts. The negative sign here is to ensure that the loss function is positive, since the range of the logarithmic function is from negative infinity to 0. The optimization process minimizes this loss function. This loss function is convex and can usually be minimized using gradient descent to train the model so that the model's predicted probability distribution is as close as possible to the true label distribution.
[0038] Step S13: Model Training; During the training of the large language model, a watermarking encoding rule is introduced to simulate the most likely event in a random process. In this way, we can approximately solve the original discrete optimization problem. The goal is to find the weights (w) in a certain weight set (W) that maximize a specific objective function.
[0039]
[0040] Where W is a discrete set of indices representing all possible values of the random variable, and U... w It is a score related to the weight w. P w This is the probability distribution function; for a given w, P... wIt represents the probability that a random variable will take this value; the symbol ~ here indicates that it follows a certain distribution. P is the probability distribution of the weights (w), where P w This represents the probability of weight (w).
[0041] This method uses the Gumbel-max approach, leveraging the properties of the Gumbel distribution to approximate the optimization problem of discrete random variables. By introducing Gumbel noise, the originally difficult discrete optimization problem can be transformed into a continuous optimization problem, which can then be solved using methods such as gradient descent.
[0042] Step S14: Text vectorization is the process of converting text data into numerical vectors, which is crucial for the text data processing in this invention. Common text vectorization methods include Word2Vec and TF-IDF. This invention employs a text vectorization system based on deep learning and traditional statistical methods. This system can efficiently and accurately convert text data into numerical vectors and achieve deep text processing and analysis in various application scenarios.
[0043] A watermark generation system based on a large language model, such as Figures 1-3 As shown, the system includes: a data acquisition module, a data preprocessing module, a large language model, a vectorization module, a feature extraction module, a classification module, and an output module;
[0044] The data acquisition module is used to acquire text data;
[0045] The data preprocessing module is used to clean and standardize the text data; and input the standardized data into the vectorization module.
[0046] The vectorization module is used to convert text data into high-dimensional word vectors;
[0047] The feature extraction module is used to extract features from high-dimensional word vectors to obtain deep features;
[0048] The classification module is used to classify deep features to obtain the corresponding categories of the text;
[0049] The large language model is used to process the classification results and generate corresponding watermarks;
[0050] The output module is used to output watermarked text data.
[0051] In this embodiment, the system includes a preprocessing module, a vectorization module, an application module, and a visualization module. The preprocessing module is used for text cleaning, word segmentation, and stop word removal. The vectorization module integrates various vectorization techniques, including TF-IDF, Word2Vec, BERT Embeddings, and neural network-based text vectorization models. The application module applies the vectorized text to tasks such as text classification, clustering, and information retrieval. The visualization module provides text vector visualization capabilities to help users intuitively understand text features.
[0052] In this embodiment, the specific process of the system processing data includes:
[0053] Step 1: Clean and standardize the input text using the preprocessing module.
[0054] Step 2: Calculate the term frequency and inverse document frequency of the text using the TF-IDF algorithm in the vectorization module to generate the initial vector.
[0055] Step 3: Use Word2Vec or BERT Embeddings to further enrich the semantic information of the text and generate high-dimensional word vectors.
[0056] Step 4: Use a neural network-based text vectorization model to perform deep learning on the text and extract deep features.
[0057] Step 5: Input the generated vectors into the application module to perform specific NLP tasks.
[0058] Step Six: Display text vectors through the visualization module to provide intuitive text feature analysis.
[0059] In this embodiment, taking patent text data as an example, the text analysis and processing includes:
[0060] Step 1: Input the Chinese patent text into the preprocessing module for word segmentation and cleaning.
[0061] Step 2: Calculate term frequencies and inverse document frequencies using the TF-IDF algorithm to generate initial vectors. Word-level vectorization: Convert individual words into numerical vectors, assigning each word a unique binary vector with only one 1 and the rest 0. Then, generate word vectors or document vectors by statistically analyzing term frequencies and inverse document frequencies. Finally, generate vectors based on the frequencies of n consecutive words, mapping each word to a high-dimensional real-valued vector; these vectors are semantically related.
[0062] Step 3: Use BERT Embeddings to extract deep semantic information from the patent text.
[0063] Step 4: Input the vectorized text into a neural network-based classification model for automatic classification.
[0064] Step 5: Display the classification results through the visualization module to verify the accuracy of the model.
[0065] Example 2
[0066] A key part of this invention is the implementation of the intelligent watermark detection algorithm, which is further explained in this embodiment. Specifically, it includes: Topic extraction: Extracting topics using the output or input text sequence of a non-watermarked Large Language Model (LLM). Generating watermark list pairs: Generating a pair of green (G) and red (R) label lists based on the extracted topics. Adjusting the label weights when the LLM generates text using the generated G and R lists. Generating watermarked text: The LLM generates watermarked text based on the adjusted label weights. Watermark detection: Detecting the watermark by comparing the distribution of G and R list labels in the target text.
[0067] In one embodiment, the watermarking method of the present invention includes the following steps:
[0068] a. Receive text prompts input by the user;
[0069] b. Use non-watermarked LLM to process input prompts and generate non-watermarked text output;
[0070] c. Extract the theme from the non-watermarked text output;
[0071] d. Generate G and R list pairs based on the extracted topics;
[0072] e. Use the G and R lists to adjust the label weights of the LLM and generate a hash value, which is the watermarked text;
[0073] f. Provide the user with watermarked text output.
[0074] Furthermore, this invention relates to natural language processing techniques, particularly autoregressive language models for text generation. It provides an efficient text generation method using an autoregressive language model, which improves the efficiency and quality of text generation by dynamically adjusting the vocabulary size and optimizing the conditional probability distribution.
[0075] Vocabulary definition: Define a dynamically adjustable vocabulary W containing K labels. The size of the vocabulary K is adjusted according to the model requirements.
[0076] Vocabulary size adjustment: The vocabulary size K is dynamically adjusted according to the complexity of the model and the application scenario to adapt to different model requirements.
[0077] Autoregressive generation process: Using an autoregressive mechanism, each tag in the text is generated sequentially by sampling from a conditional multinomial probability distribution.
[0078] Conditional probability distribution optimization: Optimizing the conditional probability distribution P t This makes it not only dependent on the first t-1 labels (the current label is denoted as t), but also takes into account the prompts within the model, thus improving the accuracy and relevance of the generated text.
[0079] Text generation control: By controlling the conditional probability distribution and vocabulary size, fine-grained control over the text generation process is achieved to generate high-quality and diverse text.
[0080] The following is a specific embodiment used to illustrate the application of the method of the present invention:
[0081] For an OPT-1.3B model with K=50,272 labels, high-quality text is generated by adjusting the vocabulary size and optimizing the conditional probability distribution.
[0082] For an LLaMA-7B model with K=32,000 labels, the method of this invention achieves efficient and accurate text generation.
[0083] This invention significantly improves the efficiency and quality of text generation by dynamically adjusting the vocabulary size and optimizing the conditional probability distribution, and is applicable to various natural language processing fields.
[0084] Example 3
[0085] An important component of this invention is the development of an intelligent watermarking system, which will be further explained in this embodiment.
[0086] Step 301: Design a system that includes text generation, watermark embedding, watermark detection, and user interface.
[0087] Step 302: Develop a simple user interface that allows users to upload text, set watermark features, and start the watermark embedding and detection process.
[0088] Step 303: Integrate the watermark embedding and detection algorithm into the system to achieve one-click operation.
[0089] Step 304: Conduct system testing, including unit testing, integration testing, and user acceptance testing, to ensure the stability and usability of the system.
[0090] Example of step 305: The user uploads a text through the interface, selects "Enable watermark", and the system automatically embeds a watermark in the article and provides a detection report.
[0091] Example 4
[0092] A key aspect of this invention is the multilingual and multi-domain adaptability of smart watermarking. For example... Figure 4 As shown in the figure, this embodiment will further illustrate this.
[0093] Step 401: Design an independent watermark feature library for each language and train the corresponding watermark embedding and detection model;
[0094] Step 402: Analyze the text features of different fields and adjust the watermark embedding strategy to adapt to professional terminology and expression;
[0095] Step 403: In the medical field, use specific medical terminology as watermark features; in the literary field, use specific literary rhetoric as watermark features.
[0096] Example 5
[0097] An important part of this invention is the principle of the red-green list method for intelligent watermarking. For example... Figure 5 As shown in the figure, this embodiment will further illustrate this.
[0098] Step 501: The proposed topic-based detection framework builds upon the G and R label list pair method, but introduces a novel mechanism for classifying text as human-generated or LLM-generated through topic extraction. This method involves extracting and analyzing topics present in the non-watermarked LLM output sequence. The detection process creates specific G and R list pairs for each identified topic, enabling the detection mechanism to traverse all list pairs for each topic to achieve accurate classification. Upon receiving the non-watermarked LLM output sequence, the detection framework utilizes topic modeling techniques. A test parameter z is used to evaluate the proportion of G in the list. Let T represent all labels in the text, G represent G list pairs, and y represent the proportion of G list pairs. Then, the z value can be expressed as:
[0099]
[0100] The presence of a watermark can be determined by comparing the value of z using the red-green list method.
[0101] An unbiased decoder can be used to determine whether a watermark exists and whether it has been attacked.
[0102]
[0103] Here, decoder S represents a function or procedure used to recover the original information from some encoded or encrypted information.
[0104] In watermarking or encrypted communication, a decoder is used to extract the original watermark or message from the encoded information. `w` represents an element in the watermark set, i.e., a specific watermark. `u()` represents the probability distribution function of the random variable `ζ`. Regardless of the value of `ζ` (as long as it follows a uniform distribution), the probability of the decoder `S` obtaining the watermark `w` is consistent with the probability distribution of `w` in the watermark set. This means that the decoder is not affected by `ζ`, thus ensuring the fairness of the decoding process.
[0105] Step 502: Encrypt the “Result” phrase using an encryption algorithm to generate a KGW. Enhancements include improved list partitioning, better logic processing, increased watermark information capacity, and the ability to resist watermark removal attacks and publicly detect watermarks. These improvements aim to improve the algorithm’s impact on text quality under low entropy conditions and increase the watermark information capacity.
[0106] This study employs an unbiased watermark decoding method based on probabilistic decision-making, aiming to improve the accuracy and reliability of watermarking technology. This method ensures the fairness and effectiveness of the watermark decoding process by introducing a probabilistic model and statistical detection mechanisms.
[0107] 1. Watermark definition: Define a binary watermark set W = {0, 1} and its associated probability distribution P = (P0, P1), where P0 and P1 represent the probabilities of the watermark value being 0 and 1, respectively.
[0108] 2. Decoder Design: At the current label t, based on the current probability distribution P and the signal S, the decoder is designed by comparing thresholds C and P. {t,0} Determine the watermark value w if C t ≤P t,0 If w = 0, then w = 0; otherwise w = 1.
[0109] 3. Optimization of the embedding signal: By adjusting the size of the embedding signal C, the watermark value can be controlled to tend towards 1 rather than 0, thereby optimizing the watermark embedding effect.
[0110] 4. Unbiasedness Guarantee: Ensures that the decoding process satisfies the unbiased condition, i.e., P(S(P,w)=w)=P w , where S(P,w) represents the decoding process and w represents the actual watermark value.
[0111] The following is a specific embodiment to illustrate the application of the method of the present invention: set the watermark set W = {0,1} and the probability distribution P = (0.5,0.5); at time t, determine w according to P and S; adjust C to optimize the embedding effect of w.
[0112] This method improves the accuracy and impartiality of watermark decoding while ensuring the watermark's concealment and security. Furthermore, it is highly adaptable and flexible, suitable for various digital media and communication scenarios.
[0113] Example 6
[0114] The implementation of this invention requires consideration of the legal and ethical issues related to smart watermarking.
[0115] Step 1: In the design and implementation of the watermark, ensure that user privacy is not infringed and data protection regulations are not violated. Here, an autoregressive text generation method for watermarks is used. This method can embed watermarks while generating text to enhance the security and verifiability of the text.
[0116] 1. Define prefix and vocabulary: Set a vocabulary and a starting prefix for text generation. The prefix consists of a series of tags.
[0117] 2. Probability distribution for generating the next label: Based on the prefix and vocabulary, a large language model (LLM) is used to generate the conditional probability distribution for the next label.
[0118] 3. Calculate the watermark: Calculate the watermark using a pseudo-random number generation function based on a specific part of the text sequence and a key.
[0119] 4. Embedded watermark: The calculated watermark is embedded into the text generation process to ensure text security and copyright protection.
[0120] 5. Text generation: Generate the next tag for the text based on the conditional probability distribution and the embedded watermark.
[0121] Step 2: Clearly explain to users the purpose and method of using the watermark, as well as users' rights;
[0122] Step 3: Provide detailed instructions on watermark usage on the user interface, including the option for users to consent to the use of watermarks.
[0123] The above-described embodiments further illustrate the purpose, technical solution, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made to the present invention within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A watermark generation method based on a large language model, characterized in that, include: Obtain the training dataset and preprocess the data in the training dataset; Pre-set watermark encoding rules; train the big oracle model using pre-processed data according to the watermark encoding rules; Acquire the text data to be processed; clean and standardize the text data; Calculate the word frequency and inverse document frequency of the standardized text data to generate an initial vector; process the initial vector using the Word2Vec model to obtain high-dimensional word vectors; input the high-dimensional word vectors into the trained neural network model to extract deep features; The text is classified based on deep features; the classified questions are then input into the trained Big Prophet model to generate watermarks for the corresponding text types. Training the Big Prophet model using preprocessed data according to watermarking encoding rules includes: selecting Transformer as the model architecture and performing distributed training, i.e., using a parallel strategy to input training data into the model for training, where the parallel strategy includes data parallelism, tensor parallelism, and pipeline parallelism; during the model training process, selecting the Adam optimizer to optimize the model parameters, using Next Token Prediction as the pre-training task, and fine-tuning through supervised learning and reinforcement learning methods after pre-training; thus completing the model training. Generating the initial vector involves: converting each word in the text into a numerical vector, that is, assigning each word a unique binary vector, where only one position is 1 and the rest are 0; generating word vectors by statistically analyzing word frequencies and inverse document frequencies; generating vectors based on the statistical frequencies of n consecutive words; and mapping each word to a high-dimensional real number vector, which is the initial vector.
2. The watermark generation method based on a large language model according to claim 1, characterized in that, Data preprocessing includes: cleaning and standardizing the data, and then optimizing the standardized data using an optimized hypothesis testing method.
3. The watermark generation method based on a large language model according to claim 2, characterized in that, The optimization of standardized data using the optimized hypothesis testing method includes: for a given hypothesis test, defining the probability of a Type I error and calculating the supremum of its nth root; defining the average error rate and determining its magnitude; when the average error rate is 0, using a special processing mechanism to process the data; when the average error rate is not 0, evaluating the upper bound of the probability of a Type I error based on the average error rate.
4. The watermark generation method based on a large language model according to claim 3, characterized in that, Special processing mechanisms are employed to process the data, including: deleting records with missing values, filling with the mean or median, or using interpolation methods to process the data, and using the SMOTE algorithm to sample the processed data to increase the number of samples in the minority class.
5. The watermark generation method based on a large language model according to claim 3, characterized in that, The upper bound for assessing the probability of Type I errors based on the average error rate includes: setting the significance level to 0.05 or 0.01; the upper bound for rejecting the null hypothesis if it is true; and controlling the error rate by adjusting the significance level using the Bonferroni method.
6. The watermark generation method based on a large language model according to claim 1, characterized in that, The watermark encoding rules are as follows: obtain watermark information, convert the watermark information into a format that can be embedded in text; convert the converted watermark information into a string; encrypt the string using a hash algorithm to generate a hash value, and use the hash value as the watermark of the original text.
7. The watermark generation method based on a large language model according to claim 1, characterized in that, Training the neural network model includes: using the Transformer neural network architecture; dividing the dataset into training and test sets, defining the number of layers and the number of neurons in each layer, and selecting activation and loss functions; calculating the difference between the predicted and true values using the loss function after calculating the predicted values, calculating the gradient based on the loss values, performing backpropagation, and finally updating the network parameters using the optimizer; and testing the trained neural network model using the test set to complete the model training.
8. A watermark generation system based on a large language model, the system being used to execute the watermark generation method based on a large language model as described in any one of claims 1 to 7, characterized in that, include: The system includes a data acquisition module, a data preprocessing module, a large language model, a vectorization module, a feature extraction module, a classification module, and an output module. The data acquisition module is used to acquire text data; The data preprocessing module is used to clean and standardize the text data; and input the standardized data into the vectorization module. The vectorization module is used to convert text data into high-dimensional word vectors; The feature extraction module is used to extract features from high-dimensional word vectors to obtain deep features; The classification module is used to classify deep features to obtain the corresponding categories of the text; The large language model is used to process the classification results and generate corresponding watermarks; The output module is used to output watermarked text data.
Citation Information
Patent Citations
Deep neural network black box watermarking method, device and terminal
CN116611037A
Data retrieval intention recognition method for complex regulation and control service of power grid
CN118114658A