Watermark implanting and detecting method, server side, trusted third party, medium and product

By introducing watermark seeds generated by trusted third-party and hash functions into the watermark watermark technology of large language model, the problem of inaccurate identity recognition during watermark implantation and detection is solved, and the credibility and reliability of watermark implantation and detection is achieved, and the protection of copyright and content protection is enhanced.

CN119598428AInactive Publication Date: 2025-03-11SHANGHAI ARTIFICIAL INTELLIGENCE INNOVATION CENT

Patent Information

Application Number
CN202510142804.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-03-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing large-language model watermarking technology does not fully consider the credibility of the watermark method itself, resulting in the inability to identify identity during the watermark implantation and detection process.

Method used

By establishing interactions between the server and trusted third parties, using hash functions to generate watermark seeds, and implanting watermarks based on watermark seeds during the inference process of large language model, ensuring that the watermark seeds establish close connections with watermark implantation, thereby improving the credibility of watermark detection and identity recognition.

Benefits of technology

It improves the credibility and reliability of watermark implantation and detection of large language models, ensures the fairness and credibility of watermark detection results, and enhances the protection of copyright protection, intellectual property protection and content authenticity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598428A_ABST
    Figure CN119598428A_ABST
Patent Text Reader

Abstract

The invention discloses a watermark implantation method, a watermark detection method, a server, a trusted third party, a medium and a product. The watermark implanting method is applied to a server and comprises the following steps: generating a watermark request according to information of a large language model; the watermark request is sent to a trusted third party to obtain a watermark seed generated by the trusted third party according to the identity label of the server side, and the watermark seed is generated based on a hash function; and in a big language model reasoning process, implanting a watermark according to the watermark seed to obtain an output text with the watermark. According to the technical scheme, in the watermark implanting stage, the trusted third party provides the watermark seed, the server side implants the watermark in the big language model reasoning process by using the corresponding watermark seed, and through interaction between the trusted third party and the server side, a close relation is established for the watermark seed and watermark implanting, so that the watermark embedding efficiency is improved. Therefore, a reliable basis is provided for watermark detection and identity recognition, and the credibility and reliability of watermark implantation and detection of the large language model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a watermark implantation, a detection method, a server, a trusted third party, a medium and a product. Background Art

[0002] Large language models have been widely used in complex natural language processing tasks such as automated chatbots. However, their powerful generation capabilities bring many challenges, and the corresponding security, compliance and user privacy protection issues are becoming increasingly severe. The core reason for this is that the identity recognition and behavior tracing systems of artificial intelligence applications such as large language models have not yet been perfected.

[0003] Watermarking technology can be applied to copyright protection of images, audio, and video to embed secret information without compromising the quality of the original data. Through large language model watermarking technology, detectable but invisible signals to humans can be embedded in the text generated by the large language model to achieve content tracking and source attribution. Based on the large language model watermark, the text source of a specific large language model can be verified, thereby enhancing copyright protection, intellectual property protection, and content authenticity. It also helps track content dissemination, prevent misinformation, and ensure transparency and traceability in accordance with legal and regulatory standards.

[0004] There is a significant problem with the existing large language model watermarking technology: the credibility of the watermarking method itself is not fully considered. The current method is controlled by the technology user in both the watermark generation (also known as watermark implantation) and watermark detection (also known as watermark detection). When the watermark detection and watermark implantation are the same entity, the identity can be extracted through private watermarking technology. However, in the real large language model identity recognition application system, the credibility requirements for watermark information are usually high, and such a setting is not ideal. For example, if the same entity is required to determine whether the text is identified through watermark detection, it is obviously unreasonable and unconvincing.

[0005] In summary, how to improve the credibility and reliability of watermark implantation and detection in large language models is an urgent problem to be solved. Summary of the invention

[0006] The present application provides a watermark implantation and detection method, a server, a trusted third party, a medium and a product to efficiently determine appropriate watermark implantation and detection parameters and improve the quality and efficiency of watermark implantation and detection.

[0007] In a first aspect, an embodiment of the present application provides a watermark embedding method, which is applied to a server, and includes:

[0008] Sending a watermark request generated according to the information of the large language model to a trusted third party to obtain a watermark seed generated by the trusted third party according to the identity identifier of the server, wherein the watermark seed is generated based on a hash function;

[0009] In the large language model inference process, a watermark is implanted according to the watermark seed to obtain an output text with a watermark;

[0010] In the large language model inference process, implanting a watermark according to the watermark seed to obtain a watermarked output text includes:

[0011] In the large language model inference process, maximizing the difference between the token generation probability guided by the current watermark seed and the generation probability guided by other watermark seeds is taken as the optimization goal, and a token set is selected according to the watermark seed to obtain a watermarked output text;

[0012] Wherein, the objective function of the optimization target includes a model logic term and a watermark logic term;

[0013] The model logic item is used to represent the original model token generation probability, and the original model token generation probability represents the language ability and language naturalness of the original model;

[0014] The watermark logic item is used to represent the difference between the probability of the watermark being generated according to the identity identifier of the server and the probability of the watermark being generated according to the identity identifiers of other servers.

[0015] Optionally, taking maximizing the difference between the probability of token generation guided by the current watermark seed and the probability of generation guided by other watermark seeds as the optimization goal, selecting a token set according to the watermark seed includes:

[0016] Randomly shuffle token indexes according to the watermark seed;

[0017] For each selection of a token set, a peak entropy value of the next token distribution is calculated based on the model logic item, and a subset of tokens having a peak entropy value higher than a set threshold is selected;

[0018] Tokens whose token generation probability guided by the current watermark seed is higher than a set value are randomly added to the token subset to obtain a token set.

[0019] Optionally, the token generation probability guided by the current watermark seed is the sum of: a model logic term, and a product of a watermark bias and a watermark logic term.

[0020] In a second aspect, an embodiment of the present application provides a watermark embedding method, which is applied to a trusted third party, including:

[0021] Receive a watermark request generated by the server based on the information of the large language model;

[0022] A watermark seed is generated based on a hash function according to the identity of the server, and the watermark seed is sent to the server. The watermark seed is used to implant a watermark in the large language model inference process to obtain a watermarked output text.

[0023] In a third aspect, the embodiment of the present application further provides a watermark embedding method, which is applied to a server, comprising:

[0024] Obtaining the text to be verified and a watermark seed set from a trusted third party, wherein the watermark seed set includes a watermark seed corresponding to each server, and each watermark seed is generated based on a hash function according to the identity of the corresponding server;

[0025] Reproducing the reasoning process of the large language model using each of the watermark seeds respectively to determine the confidence of the text to be verified for each of the watermark seeds;

[0026] The confidence level of the text to be verified for each watermark seed is sent to the trusted third party.

[0027] In a fourth aspect, the present application also provides a watermark embedding method, which is applied to a trusted third party, including:

[0028] Sending the text to be verified and the watermark seed set to the target server, so that the target server uses each watermark seed in the watermark seed set to implant a watermark in the large language model inference process to determine the confidence information, wherein the watermark seed set includes a watermark seed corresponding to each server, each watermark seed is generated based on a hash function according to the identity of the corresponding server, and the confidence information includes the confidence of the text to be verified for each watermark seed;

[0029] Determining a watermark seed with the highest confidence according to the confidence information;

[0030] The watermark seed with the highest confidence is decoded to determine the corresponding identity, and the server corresponding to the text to be verified is determined.

[0031] Optionally, the number of the target servers is at least two;

[0032] Determining a watermark seed with the highest confidence according to the confidence information includes:

[0033] According to the confidence information determined by each of the target servers, a watermark seed with the highest confidence is comprehensively determined through sorting and / or voting.

[0034] In a fifth aspect, an embodiment of the present application provides a server, including:

[0035] one or more processors;

[0036] A storage device for storing one or more programs;

[0037] When the one or more programs are executed by the one or more processors, the one or more processors implement the watermark embedding method as described in the first aspect or the watermark detection method as described in the third aspect.

[0038] In a sixth aspect, an embodiment of the present application provides a trusted third party, including:

[0039] one or more processors;

[0040] A storage device for storing one or more programs;

[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the watermark embedding method as described in the second aspect or the watermark detection method as described in the fourth aspect.

[0042] In a seventh aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned watermark embedding method or watermark detection method is implemented.

[0043] In an eighth aspect, an embodiment of the present application further provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implement the above-mentioned watermark embedding method or watermark detection method.

[0044] The embodiment of the present application provides a watermark implantation and detection method, a server, a trusted third party, a medium and a product. The watermark implantation method is applied to the server, and includes: generating a watermark request based on the information of a large language model; sending the watermark request to a trusted third party to obtain a watermark seed generated by the trusted third party based on the identity of the server, wherein the watermark seed is generated based on a hash function; during the inference process of the large language model, implanting a watermark according to the watermark seed to obtain an output text with a watermark. In the above technical scheme, in the watermark implantation stage, a trusted third party provides a watermark seed, and the server uses the corresponding watermark seed to implant a watermark during the inference process of the large language model. Through the interaction between the trusted third party and the server, a close connection is established between the watermark seed and the watermark implantation, thereby providing a reliable basis for watermark detection and identity recognition, and improving the credibility and reliability of watermark implantation and detection of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0046] Figure 1 A flow chart of a watermark embedding method provided in an embodiment of the present application;

[0047] Figure 2 A flow chart of another watermark embedding method provided in an embodiment of the present application;

[0048] Figure 3 A flow chart of a watermark detection method provided in an embodiment of the present application;

[0049] Figure 4 A flowchart of another watermark detection method provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of a multi-party trusted watermark architecture provided by an embodiment;

[0051] Figure 6 A schematic diagram of a watermark embedding and detection process provided by an embodiment;

[0052] Figure 7 A schematic diagram of the structure of a watermark embedding device provided in an embodiment of the present application;

[0053] Figure 8 A schematic diagram of the structure of another watermark embedding device provided in an embodiment of the present application;

[0054] Fig. 9 A schematic diagram of the structure of a watermark detection device provided in an embodiment of the present application;

[0055] Fig.10 A schematic diagram of the structure of another watermark detection device provided in an embodiment of the present application;

[0056] Fig.11 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0057] Fig.12 A schematic diagram of the structure of a trusted third party provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.

[0059] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0060] It should be noted that the concepts of "first", "second", etc. mentioned in the embodiments of the present application are only used to distinguish different devices, modules, units or other objects, and are not used to limit the order or interdependence of the functions performed by these devices, modules, units or other objects.

[0061] In addition, the embodiments in this application and the features in the embodiments may be combined with each other if there is no conflict.

[0062] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0063] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the relevant content of the solution.

[0064] Watermark detection and identity recognition of large language models need to ensure that the implanted identity information is widely trusted and recognized, in order to prevent forgery and tampering, and to avoid malicious use of large language models to spread discriminatory, false or unfair information. Watermark implantation of large language models should be legal, safe and have sufficient user trust. Credible watermarks can be used as effective evidence to provide reliable protection and verification for the application of large language models, ensuring the fairness and credibility of watermark detection results. This application aims to establish a secure and reliable artificial intelligence identity recognition and behavior tracing method system with large language model watermark technology as the core.

[0065] Figure 1A flow chart of a watermark implantation method provided for an embodiment of the present application, this embodiment can be applied to the case of implanting a watermark in the output text of a large language model. Specifically, the watermark implantation method can be performed by a watermark implantation device, which can be implemented by software and / or hardware and integrated in the server. The server can be understood as an electronic device used by a large language model service provider, including but not limited to computers, smart phones or servers. In addition, a trusted third party can be understood as an electronic device that interacts with the server and cooperates with the server to jointly generate watermarks, including but not limited to computers, smart phones or servers.

[0066] like Figure 1 As shown, the method specifically comprises the following steps:

[0067] S110, sending a watermark request generated according to information of the large language model to a trusted third party to obtain a watermark seed generated by the trusted third party according to the identity identifier of the server, wherein the watermark seed is generated based on a hash function.

[0068] Among them, Large Language Model (LLM) mainly refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. The information of the large language model can include the type, model parameters and model identifier of the large language model, and can also include the name, version number and timestamp, etc., which can be used to represent the large language model and its server. When a user uses a large language model, the server can generate a watermark request based on the information of the large language model. The watermark request can be used to request a trusted third party to provide a watermark seed as the basis for generating or implanting a watermark.

[0069] The watermark seed can be used to generate or embed a watermark. For a specific server, its corresponding watermark seed is uniquely generated by a trusted third party, which can be generated based on the server's identity (ID) based on a hash function, thereby ensuring that different servers correspond to different watermark seeds.

[0070] For example, the trusted third party can assign a corresponding secret identity to each of the servers. The identity can be in the form of a multi-bit binary sequence. After receiving a watermark request from a server, the trusted third party can assign the server's identity (denoted as ) is sent to a hash function (such as a one-way hash function) for overall encoding to generate a watermark seed, recorded as ( ), and then returns the watermark seed to the server.

[0071] S120: In the large language model inference process, a watermark is implanted according to the watermark seed to obtain an output text with a watermark.

[0072] Among them, the large language model reasoning process can be understood as the process of using a large language model to process and generate natural language text. A token can be a word, a character set, or a fragment composed of words and punctuation marks for the large language model to decompose the text. During the large language model reasoning process, the large language model can analyze the semantic relationship between different tokens in the input sequence, such as the frequency of co-occurrence or whether they are used in similar contexts, and then generate and output the Token sequence based on these relationships, that is, the output text. In this embodiment, after the server receives the watermark seed, it can use the watermark seed to implant a watermark in the large language model reasoning process, that is, use the watermark seed to determine the output Token sequence, so that the output text is watermarked. This watermark implantation process can be closely related to the watermark seed provided by a trusted third party.

[0073] A watermark implantation method provided in an embodiment of the present application is mainly aimed at designing a secure and reliable multi-party trusted watermark architecture to meet the needs of large language model identity recognition. In the watermark implantation stage, a trusted third party provides a watermark seed, and the server uses the corresponding watermark seed to implant the watermark in the large language model reasoning process. Through the interaction between the trusted third party and the server, a close connection is established between the watermark seed and the watermark implantation, thereby providing a reliable foundation for watermark detection and identity recognition, and improving the credibility and reliability of watermark implantation and detection of large language models. Unlike the large language model watermark algorithm that is only aimed at a certain application entity (service provider or user), the watermark implantation algorithm provided in the embodiment of the present application requires additional trusted third parties or other entities to participate in the generation and detection processes to ensure the credibility of identity recognition. The watermark implantation algorithm can meet the needs of multi-information implantation and ensure availability, and the extraction of identity information is completed through cooperation between trusted third parties and service providers.

[0074] In one embodiment, in the large language model inference process, a watermark is implanted according to the watermark seed to obtain a watermarked output text, including: in the large language model inference process, taking maximizing the gap between the token generation probability guided by the current watermark seed and the generation probability guided by other watermark seeds as the optimization goal, selecting a token set according to the watermark seed to obtain a watermarked output text; wherein the objective function of the optimization goal includes a model logic item (model logits) and a watermark logic item (watermark logits); the model logits is used to represent the original model token generation probability, and the original model token generation probability represents the language ability and language naturalness of the original model; the watermark logits is used to represent the gap between the probability of the watermark generated according to the identity identifier of the server and the probability generated according to the identity identifiers of other servers.

[0075] Specifically, in the watermark implantation stage, the large language model is Step can generate Tokens.

[0076] For model logits, we can use the autoregressive token generation formula: , description based on the existing The text prediction consists of tokens The probability of generating tokens is, where Indicates that the large language model is in front The text sequence generated in the prediction step is Tokens, Represents the next ) tokens, Represents the token sequence (prompt) that the user inputs to the large language model. Its function is to control the behavior of the model to generate the expected output. Represents the predicted The probability of generating a token.

[0077] For watermark logits, the watermark probability function can be defined ( ), which is used to measure the generated text with a given watermark When the watermark is generated based on a certain identity. For example, the probability function of a good watermark should be The probability of generating under other identities is the largest. The probability of generation is as small as possible, that is, the watermark is based on the identity and other identification The generation probability of is quite different. On this basis, the watermark logits item can be designed in the form of entropy from the Bayesian formula:

[0078] ;

[0079] The watermark logits term can also be converted to:

[0080] ;

[0081] According to the above optimization goals, both the naturalness of the language model and the success rate of identity extraction are considered when selecting the token set, so as to complete reliable watermark implantation.

[0082] In one embodiment, the optimization goal is to maximize the difference between the token generation probability guided by the current watermark seed and the generation probability guided by other watermark seeds, and select a token set according to the watermark seed, including:

[0083] Randomly shuffle the token index according to the watermark seed;

[0084] For each selected token set, the peak entropy value of the next token distribution is calculated based on the model logic term, and a subset of tokens with peak entropy values ​​higher than a set threshold is selected;

[0085] Tokens whose token generation probability guided by the current watermark seed is higher than a set value are randomly added to the token subset to obtain a token set.

[0086] Specifically, the server uses the watermark seed provided by a trusted third party To select a token set , in the token collection For example, to ensure that the text generated according to the optimization goal has high semantic quality, we can first use Randomly shuffle the token index; then calculate the peak entropy value of the next token distribution based on the model logits probability distribution Represents the uncertainty of the model's prediction of the next Token, which is used to ensure diversity and solve the problem that the existing watermarking technology is not effective on low-entropy texts; then select Above the set threshold , and randomly add some tokens with higher optimization target values ​​(higher model logits values ​​and higher watermark logits values). The following conditions are met:

[0087] ;

[0088] ;

[0089] in, represents the probability distribution of token v (usually the Softmax probability output by the model), represents the logarithm of probability, Indicates that according to the threshold (The value of spike entropy is greater than ) The filtered token set, Represents the peak entropy of token v. Shuffle(V) means randomly shuffling the token set V. Appropriate random functions can be used to introduce randomness to avoid the screening results being too fixed. Indicates the predicted The probability of generating a token, is a probability threshold used to filter the generation probability greater than or equal to Token. Randomly shuffle the token index, which can be done using a one-way pseudo-random hash function. It can be used as the seed of HASH to randomly shuffle the original Token list according to the index; in the shuffled Token list, according to the above three conditions (calculate , Select Above the set threshold The token set is selected by randomly adding a token with a higher model logits value) to select the token set, that is, to select words.

[0090] In one embodiment, the token generation probability guided by the current watermark seed is the sum of: the model logical term, and the product of the watermark bias and the watermark logical term.

[0091] Specifically, a watermark bias can be added to the watermark logit in the optimization objective of the selected token set. To achieve watermark implantation. For the model logits, the generated watermark text needs to maintain the maximum generation probability of the language model: ; For watermark logits, the success rate of identity extraction needs to be guaranteed, and the objective function of the final optimization goal can be expressed as:

[0092] ;

[0093] in, is the model logit, is the watermark logits, Represents the watermark bias, which is used to adjust the watermark strength, thereby balancing the naturalness of the language model and the success rate of message extraction. The smaller the bias coefficient, the smaller the impact on the entire text generation, and the more it can maintain the ability of the original language model, that is, naturalness; The larger it is, the larger the watermark bias is, and the higher the success rate of watermark message extraction is.

[0094] In some embodiments, the token sets to which the bias is added may be fixedly divided, and / or different watermark biases may be added to different token sets.

[0095] Figure 2A flow chart of a watermark implantation method provided in an embodiment of the present application, this embodiment can be applied to the case of implanting a watermark in the output text of a large language model. Specifically, the watermark implantation method can be executed by a watermark implantation device, which can be implemented by software and / or hardware and integrated in a trusted third party. A trusted third party can be understood as an electronic device that interacts with a server and cooperates with the server to jointly generate a watermark, including but not limited to a computer, a smart phone or a server. It should be noted that the technical details not described in detail in this embodiment can be referred to any of the above embodiments.

[0096] like Figure 2 As shown, the method specifically comprises the following steps:

[0097] S210: Receive a watermark request generated by the server according to information of the large language model.

[0098] Among them, when the user uses a large language model, the server can generate a watermark request based on the information of the large language model. The watermark request can be used to request a trusted third party to provide a watermark seed as a basis for generating or implanting a watermark.

[0099] S220, generating a watermark seed based on a hash function according to the identity identifier of the server, and sending the watermark seed to the server, wherein the watermark seed is used to implant a watermark in the large language model inference process to obtain an output text with a watermark.

[0100] For a specific server, its corresponding watermark seed is uniquely generated by a trusted third party. Specifically, it can be generated based on a hash function according to the server's identity (ID), thereby ensuring that different servers correspond to different watermark seeds.

[0101] A watermark implantation method provided by an embodiment of the present application provides a watermark architecture with multi-party participation in large language model identity authentication, which has high credibility; the interaction between the trusted third party and the large language model server is limited to watermark messages, watermark seeds and other information, and will not leak user data and information; logits are only modified during the large model reasoning process, which is efficient and has little impact on model performance. Since the token set selected for modifying logits takes into account the semantic quality, the generated text is naturally smooth and encodes the identity message as a whole, which can achieve the maximum degree of not damaging the ability of the large language model itself, and the information capacity carried by the watermark is high, and the extraction success rate is high. In addition, the watermark architecture has good scalability, can easily adapt to the private watermark technology of different large language model servers, and can flexibly replace or upgrade related encryption and hash algorithms to cope with ever-changing security threats and technological advances. In addition, the watermark architecture has the characteristics of lightweight. Considering that the large language model watermark service request may be huge, the trusted third party only needs to complete the hash mapping of the watermark message, and does not require a large amount of computing resources, which ensures that the operation of the large language model server is not limited by the bottleneck of the trusted third party.

[0102] Figure 3 A flow chart of a watermark detection method provided in an embodiment of the present application, which can be applied to the case of detecting a watermark for identity authentication. Specifically, the watermark detection method can be performed by a watermark detection device, which can be implemented by software and / or hardware and integrated in the server. It should be noted that the technical details not described in detail in this embodiment can be referred to any of the above embodiments.

[0103] like Figure 3 As shown, the method specifically comprises the following steps:

[0104] S310, obtaining a text to be verified and a watermark seed set from a trusted third party, wherein the watermark seed set includes a watermark seed corresponding to each server, and each watermark seed is generated based on a hash function according to an identity identifier of the corresponding server.

[0105] In this embodiment, during the watermark detection phase, the trusted third party determines the identity of the text to be verified by sending the text to be verified to the server. The trusted third party can traverse the identity of all servers in the library, calculate the corresponding watermark seeds of each server, form a watermark seed set (such as a watermark seed table) and provide it to one or more service providers.

[0106] S320: Reproduce the reasoning process of the large language model using each of the watermark seeds to determine the confidence level of the text to be verified for each of the watermark seeds.

[0107] Specifically, after receiving the text to be verified and the watermark seed set, the service provider reuses each watermark seed to perform the watermark implantation process. According to the consistency between the selected token set and the token set in the text to be verified, the confidence of the text to be verified corresponding to each watermark seed can be calculated.

[0108] It is understandable that different servers have different identities, different servers implant different watermarks for the same text, and different watermark seeds obtained through hash conversion. Each server only uses its own watermark seed to implant watermarks. If the watermark seed of another server is used to implant the watermark, the verification process will be random and the watermark characteristics will not be reflected. In the case of using your own watermark seed to implant the watermark, since each step of Token generation adopts a fixed strategy, the more the selected token set is consistent with the token in the text to be verified, the more reliable the watermark message can be extracted, and the higher the confidence, the higher the probability that the watermark seed is generated based on the identity m of the server.

[0109] S330: Send the confidence level of the text to be verified for each watermark seed to the trusted third party.

[0110] Specifically, the server forms a watermark seed confidence lookup table based on the confidence of each watermark seed corresponding to the text to be verified, and returns it to the trusted third party. The trusted third party can identify the seed with a higher confidence (such as the highest) that meets the watermark bias rule, and decode the identity information corresponding to the seed, thereby verifying the identity of the text to be verified.

[0111] In a watermark detection method provided by an embodiment of the present application, in the watermark detection stage, a trusted third party provides a text to be verified and a watermark seed set, and the server uses each watermark seed to implant a watermark in the large language model reasoning process to determine the confidence of each watermark seed, and returns it to the trusted third party for identity identification. Since a close connection has been established between the watermark seed and the watermark implantation process, the watermark seed is used as the main condition for determining the confidence in the watermark detection and identity identification process, thereby improving the credibility and reliability of the watermark detection of the large language model.

[0112] Figure 4 The present invention provides a flowchart of a watermark embedding method according to an embodiment of the present invention. The present embodiment can be applied to the case of detecting a watermark for identity authentication. Specifically, the watermark detection method can be performed by a watermark detection device, which can be implemented by software and / or hardware and integrated in a trusted third party. It should be noted that the technical details not described in detail in the present embodiment can be referred to any of the above embodiments.

[0113] like Figure 4As shown, the method specifically comprises the following steps:

[0114] S410: Send the text to be verified and the watermark seed set to the target server, so that the target server uses each watermark seed in the watermark seed set to implant a watermark in the large language model inference process to determine the confidence information.

[0115] The watermark seed set includes a watermark seed corresponding to each server, each watermark seed is generated based on a hash function according to the identity of the corresponding server, and the confidence information includes the confidence of the text to be verified for each watermark seed. The target server can be understood as a server that cooperates with a trusted third party to perform watermark detection, that is, a server used to determine the confidence of the watermark seed. There can be one or more target servers.

[0116] S420: Determine a watermark seed with the highest confidence according to the confidence information.

[0117] Among them, if there is one target server, the trusted third party can determine the watermark seed with the highest confidence based on the confidence information returned by the target server; if there are multiple target servers, the trusted third party can comprehensively determine the watermark seed with the highest confidence based on the confidence information returned by each target server.

[0118] S430: Decode the watermark seed with the highest confidence to determine the corresponding identity, and determine the server corresponding to the text to be verified.

[0119] Among them, for the watermark seed with the highest confidence, the watermark seed is generated based on a hash function according to the identity of a server. Based on this, decoding and matching the watermark seed can determine its corresponding identity, that is, determine the server corresponding to the text to be verified, that is, determine the server described in the large language model.

[0120] A watermark detection method provided in an embodiment of the present application has established a close connection between the watermark seed and the watermark implantation during the watermark implantation process. The watermark seed is used as the main condition for determining the confidence level during the watermark detection and identity recognition process, thereby improving the credibility and reliability of watermark detection of large language models.

[0121] Optionally, the number of target servers is at least two; determining the watermark seed with the highest confidence according to the confidence information includes: comprehensively determining the watermark seed with the highest confidence through sorting and / or voting according to the confidence information determined by each of the target servers.

[0122] Among them, if there are multiple target servers, the trusted third party can send the same watermark seed set to multiple target servers respectively, and then comprehensively determine the watermark seed with the highest confidence based on the confidence information returned by each target server. For example, for any watermark seed, the confidence determined by different servers for the watermark seed can be averaged or weighted averaged to obtain a comprehensive confidence as the final confidence of the watermark seed, and then the watermark seeds can be sorted according to the total confidence to determine the watermark seed with the highest confidence. For another example, the watermark seed corresponding to the highest confidence can be directly selected based on the confidence determined by each target server. For example, if there are x watermark seeds and y servers, the trusted third party can find a total of x*y confidences. Directly decode the watermark seed corresponding to the highest confidence; for another example, vote for each watermark seed according to the confidence information determined by each target server, and use the watermark seed with the most votes as the watermark seed with the highest confidence. For example, if A servers determine that watermark seed a has the highest confidence, then watermark seed a will receive A votes, and if B servers determine that watermark seed b has the highest confidence, then watermark seed b will receive B votes. If A>B, the trusted third party can use watermark seed a as the watermark seed with the highest confidence. On this basis, the trusted third party determines the watermark seed with the highest confidence through sorting and / or voting according to the confidence information determined by the target server, thereby realizing the verification and identity recognition of the ownership of the text to be verified.

[0123] Figure 5 Schematic diagram of a multi-party trusted watermarking architecture provided by an embodiment. In this embodiment, a secure and reliable multi-party trusted watermarking architecture is mainly designed to meet the needs of large language model identity recognition. The watermarking architecture is a joint watermarking architecture in which a trusted third party and a large language model service provider participate. Figure 5 As shown in Figure 3, the architecture is divided into two stages: watermark embedding and watermark verification.

[0124] During the watermark embedding phase, when a user accesses the large language model service, the server of the large language model can package the model name, version number, timestamp and other information into a watermark request and send it to a trusted third party. The watermark request does not contain the user's input (i.e., input text, which is the text that needs to be watermarked). The trusted third party assigns a secret identity to each server. After receiving the watermark request, it can generate a watermark seed using a key-encrypted hash algorithm or a one-way hash function and return it to the server. The server can use a private watermarking method to embed the watermark into the text, that is, embed the watermark in the large language model inference phase, generate a watermarked output text, and return it to the user.

[0125] In the watermark detection stage, the identity of the text to be verified must be identified. The trusted third party can calculate the corresponding watermark seed list based on the identity information of the servers of all large language models in the database, and send it to one or more servers for verification. The trusted third party votes and / or sorts based on the extraction report containing the seed confidence returned by the server, and finally decodes the correct identity in the text to be verified, thereby inferring the identity of the large language model that is the source of the text to be verified.

[0126] Figure 6 FIG. 1 is a schematic diagram of a watermark embedding and detection process provided by an embodiment. Figure 6 As shown in the figure, in the watermark implantation stage, the server (model service provider) can send a watermark request to a trusted third party. If source identification is required (i.e., watermark implantation is required), the trusted third party assigns an identity to the server and calculates the corresponding watermark seed. The server uses the watermark seed to calculate the original logit vector (i.e., the model lotits item) of the next predicted (kth) Token each time a Token is selected, and then shuffles the candidate Tokens and selects the Token according to the optimization goal. The selected Token must meet the requirement that the generation probability gap is large and the peak entropy is greater than the set threshold. A watermark bias is added to the selected Token to achieve watermark implantation.

[0127] In the watermark detection stage, in order to identify the identity of the text to be verified, the trusted third party can send the text to be verified (i.e. the text to be tested) and the watermark seed set (i.e. the seed list) to the server. If source identification is required (i.e. the watermark needs to be extracted), the service provider can reuse the watermark implantation method using each watermark seed separately, select the token according to the watermark seed and related conditions (the generation probability gap is large and the peak entropy is greater than the set threshold), and determine the confidence of each watermark seed. A confidence report is generated and sent to the trusted third party. The trusted third party decodes the seed confidence to obtain the identity identifier corresponding to the text to be verified, thereby inferring the identity of the large language model of the source of the text to be verified.

[0128] A watermark implantation method provided by the embodiment of the present application provides a watermark architecture with multi-party participation in large language model identity authentication, which has high credibility. It not only improves the robustness of watermark verification through multi-party verification, but also makes the watermark process have the characteristics of public authentication, reduces the risk of forgery and tampering, and ensures the transparency and fairness of the watermark; the interaction between the trusted third party and the large language model server is limited to watermark messages, watermark seeds and other information, and will not leak user data and information; only logit is modified during the large model reasoning process, which is efficient and has little impact on model performance. Since the token set selected for modifying logit takes into account the semantic quality, the generated text is naturally smooth and the overall encoding of the identity message can be achieved without damaging the ability of the large language model itself to the greatest extent, and the information capacity carried by the watermark is high, and the extraction success rate is high. In addition, the watermark architecture has good scalability, can easily adapt to the private watermark technology of different large language model servers, and can flexibly replace or upgrade related encryption and hash algorithms to cope with ever-changing security threats and technological advances. In addition, the watermark architecture is lightweight. Considering that the watermark service requests for large language models may be huge, the trusted third party only needs to complete the hash mapping of the watermark message and does not require a large amount of computing resources. This ensures that the operation of the large language model server is not limited by the bottleneck of the trusted third party.

[0129] For the watermark implantation and extraction method of the embodiment of the present application, experiments were conducted on the open source large models LLaMA-2-7B, LLaMA-3-8B, Gemma-7B and Falcon-7B. Beam search is used by default as the large language model decoding algorithm. OpenGen, C4 news datasets and Essays datasets can be used as instruction datasets. A fixed length of 200 tokens is randomly intercepted from the dataset as the input prompt. Experiments show that the watermark implantation and extraction method of the embodiment of the present application has superior performance in success rate, robustness, text quality and identity recognition ability.

[0130] Figure 7 A schematic diagram of the structure of a watermark embedding device provided in an embodiment of the present application. The watermark embedding device provided in this embodiment includes:

[0131] A request module 510 is used to send a watermark request generated according to the information of the large language model to a trusted third party to obtain a watermark seed generated by the trusted third party according to the identity of the server, wherein the watermark seed is generated based on a hash function;

[0132] The implantation module 520 is used to implant the watermark according to the watermark seed during the large language model inference process to obtain the output text with the watermark.

[0133] Optionally, the implantation module 520 is specifically used for:

[0134] In the large language model inference process, maximizing the difference between the token generation probability guided by the current watermark seed and the generation probability guided by other watermark seeds is taken as the optimization goal, and a token set is selected according to the watermark seed to obtain a watermarked output text;

[0135] Wherein, the objective function of the optimization target includes a model logic term and a watermark logic term;

[0136] The model logic item is used to represent the original model token generation probability, and the original model token generation probability represents the language ability and language naturalness of the original model;

[0137] The watermark logic item is used to represent the difference between the probability of the watermark being generated according to the identity identifier of the server and the probability of the watermark being generated according to the identity identifiers of other servers.

[0138] Optionally, taking maximizing the difference between the probability of token generation guided by the current watermark seed and the probability of generation guided by other watermark seeds as the optimization goal, selecting a token set according to the watermark seed includes:

[0139] Randomly shuffle token indexes according to the watermark seed;

[0140] For each selection of a token set, a peak entropy value of the next token distribution is calculated based on the model logic item, and a subset of tokens having a peak entropy value higher than a set threshold is selected;

[0141] Tokens whose token generation probability guided by the current watermark seed is higher than a set value are randomly added to the token subset to obtain a token set.

[0142] Optionally, the token generation probability guided by the current watermark seed is the sum of: a model logic term, and a product of a watermark bias and a watermark logic term.

[0143] The watermark embedding device provided in the embodiments of the present application can be used to execute the watermark embedding method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0144] Figure 8 A schematic diagram of the structure of a watermark embedding device provided in an embodiment of the present application. The watermark embedding device provided in this embodiment includes:

[0145] A receiving module 610, configured to receive a watermark request generated by the server according to information of the large language model;

[0146] The seed generation module 620 is used to generate a watermark seed based on a hash function according to the identity of the server, and send the watermark seed to the server. The watermark seed is used to implant a watermark in the large language model inference process to obtain a watermarked output text.

[0147] The watermark embedding device provided in the embodiments of the present application can be used to execute the watermark embedding method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0148] Fig. 9 A schematic diagram of the structure of a watermark detection device provided in an embodiment of the present application. The watermark detection device provided in this embodiment includes:

[0149] The seed set acquisition module 710 is used to acquire the text to be verified and the watermark seed set from a trusted third party, wherein the watermark seed set includes a watermark seed corresponding to each server, and each watermark seed is generated based on a hash function according to the identity of the corresponding server;

[0150] A confidence determination module 720, configured to respectively use the watermark seeds to reproduce the reasoning process of the large language model to determine the confidence of the text to be verified for each watermark seed;

[0151] The confidence sending module 730 is used to send the confidence of the text to be verified for each watermark seed to the trusted third party.

[0152] The watermark detection device provided in the embodiments of the present application can be used to execute the watermark detection method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0153] Fig.10 A schematic diagram of the structure of a watermark detection device provided in an embodiment of the present application. The watermark detection device provided in this embodiment includes:

[0154] The seed set sending module 810 is used to send the text to be verified and the watermark seed set to the target server, so that the target server uses each watermark seed in the watermark seed set to implant a watermark in the large language model inference process to determine the confidence information, wherein the watermark seed set includes the watermark seed corresponding to each server, each watermark seed is generated based on the hash function according to the identity of the corresponding server, and the confidence information includes the confidence of the text to be verified for each watermark seed;

[0155] A seed determination module 820, configured to determine a watermark seed with the highest confidence according to the confidence information;

[0156] The detection module 830 is used to decode the watermark seed with the highest confidence to determine the corresponding identity, and determine the server corresponding to the text to be verified.

[0157] Optionally, the number of the target servers is at least two;

[0158] Determining a watermark seed with the highest confidence according to the confidence information includes:

[0159] According to the confidence information determined by each of the target servers, a watermark seed with the highest confidence is comprehensively determined through sorting and / or voting.

[0160] The watermark detection device provided in the embodiments of the present application can be used to execute the watermark detection method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0161] Fig.11 A schematic diagram of a server 10 that can be used to implement an embodiment of the present application is shown. The server 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The server 10 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, user equipment, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0162] like Fig.11 As shown, the server 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In RAM 13, various programs and data required for the operation of the server 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0163] Multiple components in the server 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the server 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, wireless networks.

[0164] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above.

[0165] In some embodiments, the method of the above embodiment may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the server 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute any of the above embodiment methods in any other appropriate manner (e.g., by means of firmware).

[0166] Fig.12 A schematic diagram of a trusted third party 20 that can be used to implement an embodiment of the present application is shown. The trusted third party 20 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The trusted third party 20 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, user equipment, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0167] like Fig.12As shown, the trusted third party 20 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the trusted third party 20 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0168] Multiple components in the trusted third party 20 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the trusted third party 20 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, wireless networks.

[0169] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above.

[0170] In some embodiments, the method of the above embodiment may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on a trusted third party 20 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute any of the above embodiment methods in any other appropriate manner (e.g., by means of firmware).

[0171] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0172] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0173] In the context of the present application, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0174] To provide interaction with a user, the systems and techniques described herein may be implemented on a server 10 or a trusted third party 20, which may have: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which a user may provide input to the server 10 or the trusted third party 20. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0175] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0176] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0177] An embodiment of the present application further provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implements the watermark embedding method or watermark detection method as described in any of the above embodiments.

[0178] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.

[0179] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A watermark embedding method, characterized in that: Applied to the server, the method includes: Sending a watermark request generated according to the information of the large language model to a trusted third party to obtain a watermark seed generated by the trusted third party according to the identity identifier of the server, wherein the watermark seed is generated based on a hash function; In the large language model inference process, a watermark is implanted according to the watermark seed to obtain an output text with a watermark; In the large language model inference process, implanting a watermark according to the watermark seed to obtain a watermarked output text includes: In the large language model inference process, maximizing the difference between the token generation probability guided by the current watermark seed and the generation probability guided by other watermark seeds is taken as the optimization goal, and a token set is selected according to the watermark seed to obtain a watermarked output text; Wherein, the objective function of the optimization target includes a model logic term and a watermark logic term; The model logic item is used to represent the original model token generation probability, and the original model token generation probability represents the language ability and language naturalness of the original model; The watermark logic item is used to represent the difference between the probability of the watermark being generated according to the identity identifier of the server and the probability of the watermark being generated according to the identity identifiers of other servers.

2. The method according to claim 1, characterized in that Taking maximizing the difference between the probability of token generation guided by the current watermark seed and the probability of generation guided by other watermark seeds as the optimization goal, a token set is selected according to the watermark seed, including: Randomly shuffle token indexes according to the watermark seed; For each selection of a token set, a peak entropy value of the next token distribution is calculated based on the model logic item, and a token subset having a peak entropy value higher than a set threshold is selected; Tokens whose token generation probability guided by the current watermark seed is higher than a set value are randomly added to the token subset to obtain a token set.

3. The method according to claim 1, characterized in that The token generation probability guided by the current watermark seed is the sum of the following two: the model logic term, and the product of the watermark bias and the watermark logic term.

4. A watermark embedding method, characterized in that: Applied to a trusted third party, the method includes: Receive a watermark request generated by the server based on the information of the large language model; A watermark seed is generated based on a hash function according to the identity of the server, and the watermark seed is sent to the server. The watermark seed is used to implant a watermark in the large language model inference process to obtain a watermarked output text.

5. A watermark detection method, characterized in that: Applied to the server, including: Obtaining the text to be verified and a watermark seed set from a trusted third party, wherein the watermark seed set includes a watermark seed corresponding to each server, and each watermark seed is generated based on a hash function according to the identity of the corresponding server; Reproducing the reasoning process of the large language model using each of the watermark seeds respectively to determine the confidence of the text to be verified for each of the watermark seeds; The confidence level of the text to be verified for each watermark seed is sent to the trusted third party.

6. A watermark detection method, characterized in that: Applied to trusted third parties, including: Sending the text to be verified and the watermark seed set to the target server, so that the target server uses each watermark seed in the watermark seed set to implant a watermark in the large language model inference process to determine the confidence information, wherein the watermark seed set includes a watermark seed corresponding to each server, each watermark seed is generated based on a hash function according to the identity of the corresponding server, and the confidence information includes the confidence of the text to be verified for each watermark seed; Determining a watermark seed with the highest confidence according to the confidence information; The watermark seed with the highest confidence is decoded to determine the corresponding identity, and the server corresponding to the text to be verified is determined.

7. The method according to claim 6, characterized in that The number of the target servers is at least two; Determining a watermark seed with the highest confidence according to the confidence information includes: According to the confidence information determined by each of the target servers, a watermark seed with the highest confidence is comprehensively determined through sorting and / or voting.

8. A server, characterized in that: include: at least one processor; a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the watermark embedding method according to any one of claims 1 to 3 or the watermark detection method according to claim 5.

9. A trusted third party, characterized in that: include: at least one processor; a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the watermark embedding method as described in claim 4 or the watermark detection method as described in any one of claims 6-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the watermark embedding method according to any one of claims 1 to 4 or the watermark detection method according to any one of claims 5 to 7 is implemented.

11. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by the processor, the watermark embedding method according to any one of claims 1 to 4 or the watermark detection method according to any one of claims 5 to 7 is implemented.

Citation Information

Patent Citations

  • Text watermark mark generation and detection method based on biased output large language model

    CN117494081A

  • Large language model watermarking method based on semantic consistency

    CN118734801A

Cited By

  • Big language model-based RAG enterprise data hierarchical decentralized management method

    CN120354395A

  • Watermarking large language model outputs

    US12737543B1