Multi-detector watermark detection method, device, equipment, storage medium and product

By signing the initial prompt text and processing the large language model output text, and combining the public key set of multiple detectors for watermark detection, the high false positive rate, high false negative rate and output quality of text watermark detection in the existing technology are solved. Loss problem is solved, and effective text watermark detection is achieved in the environment of specifying multiple detectors.

CN118821087BActive Publication Date: 2025-01-21PENG CHENG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411305510.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-21
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

The existing text watermark detection scheme has high false alarm rates and/or missed alarm rates when specifying multiple detectors, which loses output quality and is not convenient for third-party detection.

Method used

Generate a watermark string by signing the initial prompt text, input the initial prompt text into the large language model, determine the target text based on the output text and watermark string, determine the model watermark signature and split it, and use the public key of the multi-detector Collection for watermark detection.

Benefits of technology

It implements effective text watermark detection when multiple detectors are specified, ensuring that other ordinary users cannot detect text watermarks except for the specified detectors, thus improving the accuracy and security of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821087B_ABST
    Figure CN118821087B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of artificial intelligence technology, and discloses a multi-detector watermark detection method, device, equipment, storage medium and product. The present application signs the initial prompt text, generates a watermark string based on the signature string, then inputs the initial prompt text into a large language model, and determines the target text based on the output text and the watermark string, then determines the model watermark signature based on the target text, and splits the model watermark signature to obtain the split signature, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature. The present application performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature, and can allow multiple specified detectors to detect text watermarks, that is, except for these specified detectors, other ordinary users will not be able to detect text watermarks, thereby effectively performing text watermark detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a multi-detector watermark detection method, device, equipment, storage medium and product. Background Art

[0002] Generative artificial intelligence (AI) techniques, such as large language models (LLMs), have been widely used in the field of language generation and have achieved excellent performance in a variety of downstream tasks, including machine translation, dialogue systems, code generation, and medicine. For text watermark detection in large language models, current watermark detection schemes have many problems, such as high false positive rate and / or false negative rate, loss of output quality, and inconvenience for third-party detection. Therefore, how to effectively perform text watermark detection when specifying multiple detectors has become a problem to be solved. Summary of the invention

[0003] The main purpose of this application is to provide a multi-detector watermark detection method, device, equipment, storage medium and product, aiming to solve the technical problem of how to effectively perform text watermark detection when multiple detectors are specified.

[0004] To achieve the above object, the present application provides a multi-detector watermark detection method, which comprises the following steps:

[0005] Sign the initial prompt text and generate a watermark string based on the signature string;

[0006] Inputting the initial prompt text into a large language model, and determining a target text according to the output text and the watermark character string;

[0007] Determine a model watermark signature according to the target text, and split the model watermark signature to obtain a split signature;

[0008] Watermark detection is performed on the target text according to the public key set corresponding to the multiple detectors and the split signature.

[0009] Optionally, the step of signing the initial prompt text and generating a watermark string according to the signature string specifically includes:

[0010] Sign the initial prompt text and concatenate the signature string to obtain the concatenated string;

[0011] Calculating a concatenated hash value corresponding to the concatenated string, and determining a truncated string according to the concatenated hash value;

[0012] An XOR calculation is performed on the concatenated character string and the truncated character string to obtain a watermark character string.

[0013] Optionally, the step of inputting the initial prompt text into a large language model and determining the target text according to the output text and the watermark character string specifically includes:

[0014] Inputting the initial prompt text into a large language model to obtain an output text;

[0015] Calculating an output hash value corresponding to the output text, and determining a comparison result between the output hash value and the watermark character string;

[0016] A target text is determined according to the comparison result and the output text.

[0017] Optionally, the step of determining a model watermark signature according to the target text, splitting the model watermark signature, and obtaining the split signatures specifically includes:

[0018] Dividing the target text according to the total length corresponding to the watermark character string to obtain a first text and a second text;

[0019] Determine a first string after being intercepted according to the first text, and determine a second hash value after being concatenated according to the second text;

[0020] Performing an XOR operation on the intercepted first character string and the concatenated second Hash value to obtain a model watermark signature;

[0021] The model watermark signature is split to obtain split signatures.

[0022] Optionally, the step of determining the truncated first character string according to the first text, and determining the concatenated second Hash value according to the second text specifically includes:

[0023] Converting a first hash value corresponding to the first text into a first string, and intercepting the first string to obtain an intercepted first string;

[0024] Segmenting the second text to obtain segmented second text;

[0025] Second Hash values ​​are calculated for the segmented second texts respectively, and the second Hash values ​​are concatenated to obtain concatenated second Hash values.

[0026] Optionally, the step of performing watermark detection on the target text according to the public key set corresponding to the multiple detectors and the split signatures specifically includes:

[0027] Traverse each public key in the public key set corresponding to the multiple detectors to obtain the identity element under the current traversal times;

[0028] Calculate a target hash value according to the unit element and the split signature;

[0029] The target text is watermarked according to the target hash value and the split signature.

[0030] In addition, to achieve the above-mentioned purpose, the present application also provides a multi-detector watermark detection device, the multi-detector watermark detection device comprising:

[0031] The text signature module is used to sign the initial prompt text and generate a watermark string based on the signature string;

[0032] A text output module, used for inputting the initial prompt text into a large language model, and determining a target text according to the output text and the watermark character string;

[0033] A signature splitting module is used to determine a model watermark signature according to the target text, and split the model watermark signature to obtain a split signature;

[0034] The watermark detection module is used to perform watermark detection on the target text according to the public key set corresponding to the multiple detectors and the split signature.

[0035] In addition, to achieve the above-mentioned objectives, the present application also proposes a multi-detector watermark detection device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the multi-detector watermark detection method as described above.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the multi-detector watermark detection method described above are implemented.

[0037] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the watermark detection method of the multi-detector as described above are implemented.

[0038] This application signs the initial prompt text and generates a watermark string based on the signature string, then inputs the initial prompt text into a large language model, and determines the target text based on the output text and the watermark string, then determines the model watermark signature based on the target text, and splits the model watermark signature to obtain the split signature, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature. This application inputs the initial prompt text into a large language model, and determines the target text based on the output text and the watermark string, so as to obtain the target text carrying the watermark, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature, and can allow multiple specified detectors to detect text watermarks, that is, except for these specified detectors, other ordinary users will not be able to detect text watermarks, thereby effectively performing text watermark detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] Figure 1 A schematic diagram of the flow chart of the first embodiment of the watermark detection method using multiple detectors of the present application;

[0042] Figure 2 A schematic diagram of the process of generating a watermark string according to an embodiment of a watermark detection method with multiple detectors of the present application;

[0043] Figure 3 A schematic diagram of the process of generating a target text according to an embodiment of a watermark detection method with multiple detectors of the present application;

[0044] Figure 4 This is a flow chart of a second embodiment of the watermark detection method using multiple detectors of the present application;

[0045] Figure 5 A schematic diagram of the watermark detection process of an embodiment of a watermark detection method with multiple detectors of the present application;

[0046] Figure 6 This is a structural block diagram of the first embodiment of the watermark detection device with multiple detectors of the present application;

[0047] Figure 7It is a structural diagram of a watermark detection device with multiple detectors in a hardware operating environment involved in an embodiment of the present application.

[0048] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0051] The main solution of the embodiment of the present application is: to sign the initial prompt text and generate a watermark string based on the signature string; to input the initial prompt text into a large language model, and to determine the target text based on the output text and the watermark string; to determine the model watermark signature based on the target text, and to split the model watermark signature to obtain the split signatures; to perform watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signatures.

[0052] Generative artificial intelligence (AI) technologies, such as large language models (LLMs), have been widely used in the field of language generation and have achieved excellent performance in a variety of downstream tasks, including machine translation, dialogue systems, code generation, and medicine. For text watermark detection in large language models, current watermark detection schemes have many problems, such as high false positive rate and / or false negative rate, loss of output quality, and inconvenience for third-party detection.

[0053] This application signs the initial prompt text and generates a watermark string based on the signature string, then inputs the initial prompt text into a large language model, and determines the target text based on the output text and the watermark string, then determines the model watermark signature based on the target text, and splits the model watermark signature to obtain the split signature, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature. This application inputs the initial prompt text into a large language model, and determines the target text based on the output text and the watermark string, so as to obtain the target text carrying the watermark, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature, and can allow multiple specified detectors to detect text watermarks, that is, except for these specified detectors, other ordinary users will not be able to detect text watermarks, thereby effectively performing text watermark detection.

[0054] It should be noted that the execution subject of this application can be a computing service device with data processing, network communication and program running functions, such as a computer, etc., or an electronic device that can realize the above functions, a multi-detector watermark detection device, etc. The following takes a multi-detector watermark detection device as an example to illustrate this embodiment and the following embodiments. This application can be applied to machine translation, code generation, medical and other fields, and is used for watermark detection of text output by a large language model.

[0055] Based on this, the embodiment of the present application provides a watermark detection method with multiple detectors, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the watermark detection method using multiple detectors of the present application.

[0056] In this embodiment, the watermark detection method of multiple detectors includes the following steps:

[0057] Step S10: Sign the initial prompt text and generate a watermark string based on the signature string.

[0058] It should be understood that the present embodiment proposes a multi-designated detector watermarking technology (MDDW) suitable for large language models (LLMs), which allows the model provider to generate watermark outputs with three key properties: (i) when generating text, the watermark is automatically embedded in the output text; (ii) only specific, possibly multiple designated detectors can recognize the watermark; (iii) for ordinary users, the model watermark is imperceptible and there is no obvious decline in the quality of the model output.

[0059] It is understandable that this embodiment formalizes the security definition of MDDW and proposes a framework for building MDDW of any LLM using multi-specified verification signatures (MDVS), which enables model providers to claim ownership of LLM outputs in a specified detector environment. The implementation of the MDDW scheme highlights its advanced functionality and flexibility relative to existing methods and has satisfactory performance indicators. The model watermarking scheme only coats the LLM with an MDDW framework and does not modify the structure of the LLM itself. The MDDW can be regarded as a black box outside the LLM, so the detection process will not access the inside of the LLM. Any LLM can use the MDDW framework without any additional configuration.

[0060] In the specific implementation, in MDDW, three roles are involved: model provider, designated detector, and user. Model provider is the person who provides LLM service to users and executes watermark scheme in the text generation stage. Designated detector is responsible for detecting whether certain text is output by the model (by extracting and verifying watermark). User is the person who uses the model. Model provider embeds model watermark algorithm in LLM service with MDDW framework as outer shell, and LLM output content is sorted into watermark-compliant results by model watermark algorithm and returned to users. From the user's point of view, the output result is not much different from the LLM output result without MDDW, there is no garbled code or unknown characters, and the content is smooth and meets the requirements. The core function of designated detector is composed of detection algorithm. The output content sorted by model watermark algorithm is input into designated detector, and calculated and verified by detection algorithm. The verification result can accurately determine whether the content has model watermark, and MDDW can further grant specific objects the right to detect whether the output content has watermark.

[0061] Furthermore, in order to effectively obtain the watermark string, in this embodiment, the step S10 includes: signing the initial prompt text, and splicing the signature string to obtain a spliced ​​string; calculating the spliced ​​hash value corresponding to the spliced ​​string, and determining the truncated string according to the spliced ​​hash value; performing an XOR calculation on the spliced ​​string and the truncated string to obtain the watermark string.

[0062] It is understandable that in this embodiment, initialization may be performed first. Is the initialization algorithm, input security parameters , the algorithm selects a secure hash function , a description of a cyclic group ,in is a prime number, , and They are all of the order The cyclic group of It is defined in the group and Bilinear mapping function on . and are the generators of these three groups respectively, and take a team of generators as . Package the above parameters into a common parameter set ,Right now , It is a hash value calculation method with only two calculation results: 0 or 1. You can design its implementation method yourself.

[0063] It should be understood that or It is a key generation algorithm that generates public and private key pairs for model providers and designated detectors. and The required function, the specific steps are as follows: select a random positive integer ,Right now , then calculate .remember is the private key, is the public key, output the public-private key pair , which can generate the public and private key pair of the model provider and the public-private key pair of the specified detector .

[0064] In the specific implementation, the model watermark algorithm WatMar is called by the model provider, which takes the public parameters , the model provider's secret watermark key pair (private and public keys respectively), the public keys of all specified detectors (where Specifies the index of the detector) and an initial hint text As initial input, output the text embedded with watermark , LLM service output times and the length of a single output content and the total length of the signature ,in, The size should be no less than ,Right now .

[0065] Specifically, refer to Figure 2 , Figure 2 This is a schematic diagram of the process of generating a watermark string according to an embodiment of the watermark detection method of multiple detectors of the present application. Sign, that is ,Will They are all converted into binary string representation, namely the signature string, and then the four binary strings are concatenated to obtain the concatenated string, namely ,make ,Right now is the total length of the signature. Note that The four parameters need to be equal in length when converted to binary. If they are not equal in length, the longest parameter should be used as a reference to complete the length. Calculate the concatenated hash value corresponding to the concatenated string, that is, ,Will Convert to a binary string and cut off the tail length The binary string is recorded as the intercepted string Finally, and Perform XOR operation to get the watermark string ,Right now .

[0066] Step S20: input the initial prompt text into the large language model, and determine the target text according to the output text and the watermark character string.

[0067] Furthermore, in order to effectively obtain the target text, in this embodiment, step S20 includes: inputting the initial prompt text into a large language model to obtain an output text; calculating an output hash value corresponding to the output text, and determining a comparison result between the output hash value and the watermark string; and determining the target text based on the comparison result and the output text.

[0068] It should be understood that large language models (LLMs), such as GPT-3 (Generative Pre-trained Transformer3), rely on autoregressive generation mechanisms for text generation. When generating text, autoregressive models use previously generated text as context to predict the next word or subword. LLMs learn the rich characteristics of language through pre-training on large-scale datasets, and capture long-range dependencies in text through a multi-layer model parameter structure to generate grammatically and semantically coherent text. In text generation tasks, LLMs usually adopt an autoregressive approach, that is, generating a word at each time step and using the previously generated word as input until the end tag is generated, for example ( <eos>), etc. The relevant calculation process is as follows:

[0069] i) Self-attention mechanism: The self-attention mechanism calculates the relationship between each word and other words in the input sequence by weighted summation. Given an input sequence X, generate a key matrix K, a query matrix Q, and a value matrix V: , , ,in , , is a trainable weight matrix.

[0070] ii) Attention score: The attention score is calculated by dot product and applied function: .in is the dimension of the key matrix.

[0071] iii) Output calculation: Multiply the attention score with the value vector to get the representation of each word, which is then transformed through a linear layer and an activation function to get the final output sequence.

[0072] Take the most common sentence in the computer field, "Hello World!", as an example. When we input "Hello" into the large language model LLM and prompt it to output the next word that is most likely to appear in the computer field, after the calculation of the three processes i), ii), and iii), the most likely output of LLM is: "World!", that is, .

[0073] Based on the above description of LLM functions, a packaging method for the LLM function is given: It is a text generation algorithm. The input parameters are model (can be any language model), prompt text And the length of the word generated text The specific operation process is Enter the LLM service for the prompt word to generate text, and return the length Output ,Right now , , and finally Output as a return value. In particular, It can be understood as the actual length of the output text, or the number of words or characters in the output text. It only needs to ensure that the generated text can be restored when the final generated text is reversely disassembled. In the entire MDDW framework, a text generation task should maintain Always consistent.

[0074] Understandably, referring to Figure 3 , Figure 3 This is a schematic diagram of the process of generating a target text according to an embodiment of the watermark detection method with multiple detectors of the present application. Figure 3 As shown, The length is ,set up , traverse All elements of , record the number of traversals as , each traversal generates a text and In a single loop, the initial prompt text Input into the large language model LLM to obtain output text ,make , calculate the output text The corresponding output hash value , compare and .like , then regenerate , until they are equal, and finally and To splice, , and then enter the next cycle. After the cycle is completed Traverse to obtain the target text embedded with the model watermark ,at this time The length is .

[0075] Step S30: determining a model watermark signature according to the target text, and splitting the model watermark signature to obtain split signatures.

[0076] It is understandable that this embodiment can determine the model watermark signature according to the target text, and split the model watermark signature to obtain the split signatures.

[0077] Step S40: Perform watermark detection on the target text according to the public key set corresponding to the multiple detectors and the split signature.

[0078] In the specific implementation, the public key set corresponding to multiple detectors can be The target text is watermarked using the split signature, that is, whether the target text output by the large language model carries a watermark.

[0079] This embodiment signs the initial prompt text and generates a watermark string based on the signature string, then inputs the initial prompt text into the large language model, determines the target text based on the output text and the watermark string, then determines the model watermark signature based on the target text, splits the model watermark signature to obtain the split signature, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature. This embodiment inputs the initial prompt text into the large language model, determines the target text based on the output text and the watermark string, and can obtain the target text carrying the watermark, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature, and can allow multiple specified detectors to detect text watermarks, that is, except for these specified detectors, other ordinary users will not be able to detect text watermarks, thereby effectively performing text watermark detection.

[0080] refer to Figure 4 , Figure 4 This is a flow chart of the second embodiment of the watermark detection method using multiple detectors of the present application.

[0081] Based on the above first embodiment, in this embodiment, step S30 includes:

[0082] Step S301: Divide the target text according to the total length corresponding to the watermark character string to obtain a first text and a second text.

[0083] Understandably, the detection algorithm Called by the specified detector with the public parameters , a public watermark key , specify the detector's secret key (where j'∈S), the public keys of all specified detectors and a target text As input, it outputs a bit b, indicating Whether a watermark is added.

[0084] It should be understood that the known text contains , then get the additional text generated purely by LLM Then split , according to the length of each text Perform equal division. If the division is correct, it must be divided into Equal parts, and , that is, each segmented text is consistent with the corresponding generated text. Each Elements are concatenated, that is ,... , ],in The meaning is to 0 to Elements are concatenated into a string in order. It should be noted that Not necessarily complete elements concatenated into a string, so It may not be used for watermark detection.

[0085] In the specific implementation, refer to Figure 5 , Figure 5 This is a schematic diagram of the watermark detection process of an embodiment of the watermark detection method with multiple detectors of the present application. Figure 5 As shown, this embodiment is based on and Take the watermark detection method as an example, that is, according to the total length of the watermark string Divide the target text and obtain the first text and the second text .

[0086] Step S302: determining a first string after being truncated according to the first text, and determining a second hash value after being concatenated according to the second text.

[0087] Furthermore, in order to effectively obtain the truncated first string and the concatenated second hash value, in this embodiment, step S302 includes: converting the first hash value corresponding to the first text into a first string, and truncating the first string to obtain the truncated first string; segmenting the second text to obtain a segmented second text; calculating the second hash values ​​for the segmented second texts respectively, and concatenating the second hash values ​​to obtain a concatenated second hash value.

[0088] Understandably, Figure 5 , calculate the first hash value corresponding to the first text ,Will Convert to a binary string, that is, the first string, and cut off the tail length The binary string is recorded as the first string after interception . Traverse the second text All elements of the segmentation are segmented to obtain the segmented second text , calculate the second hash value of each element , then all second hash values Splice in order to obtain the second hash value after splicing .

[0089] Step S303: performing an XOR operation on the intercepted first character string and the concatenated second Hash value to obtain a model watermark signature.

[0090] It should be understood that and Perform XOR operation to obtain the model watermark signature ,Right now .

[0091] Step S304: split the model watermark signature to obtain split signatures.

[0092] It is understandable that Split into four equal parts to get the split signature .

[0093] Furthermore, in order to effectively perform watermark detection on the target text, in the present embodiment, the step S40 includes: traversing each public key in the public key set corresponding to the multiple detectors to obtain the unit element under the current traversal times; calculating the target hash value according to the unit element and the split signature; performing watermark detection on the target text according to the target hash value and the split signature.

[0094] It should be understood that All elements in are converted to positive integers, denoted by . Call the signature verification algorithm ,remember In particular, if , then you can and Replace with and .

[0095] It is understandable that this embodiment has made some arrangements for the definition of multi-designated verifier signature (MDVS). An MDVS scheme associated with a message space M is an algorithm group MDVS = (Setup, SignKG, VerKG, Sign,Verify), where: Is the initialization algorithm, input security parameters , the algorithm selects a secure hash function , a description of a cyclic group ,in is a prime number, , and They are all of the order The cyclic group of It is defined in the group and Bilinear mapping function on . and are the generators of these three groups respectively, and take a team of generators as . Package the above parameters into a common parameter set ,Right now , It is a hash value calculation method with only two calculation results: 0 or 1. You can design its implementation method yourself. It is a user key generation algorithm, which mainly generates public and private key pairs for model providers and users. The specific steps are as follows: Select a random positive integer ,Right now , then calculate .remember is the private key, is the public key, output the public-private key pair .

[0096] is a signature algorithm. The input parameters are public parameter sets. 、LLM output content original 、Model provider public and private keys , the public key set of all specified detectors , there are n public keys of designated detectors in the public key set. The detailed steps of the whole signature process are as follows: i) First, initialize a cyclic group The unit element ,Right now ii) Traverse the public key set , every In the traversal, calculate the hash value For the calculation of the hash value, this embodiment provides a calculation method for reference, that is, all input parameters are spliced, and then the splicing result is hashed, and finally the calculation is performed. . Iterate the above calculation until the public key set is traversed iii) Generate three random positive integer parameters ,make , then calculate , iv) Take the calculation results of step ii) and step iii) and calculate the hash value For the calculation of the hash value, this embodiment provides a calculation method for reference, that is, all input parameters are concatenated, and then a hash operation is performed on the concatenated result. v) Calculation of variables And variables The calculation results of the above three steps iii), iv) and v) are sorted and combined into a set ,but That is, the model provider Signature.

[0097] It is a signature verification algorithm. The input parameters are the public parameter set 、LLM output content original , model provider public key ,sign and the public key set of all specified detectors The detailed steps of the whole verification process are as follows: i) First, initialize a cyclic group The unit element ,Right now ii) Traverse the public key set , every In the traversal, calculate the hash value , and finally calculate the current traversal times The unit element below iii) From the signature Get all parameters .calculate , iv) Calculate the target hash value .verify = If the equation holds, the algorithm outputs a bit b=1 (watermark verification is successful), if the equation does not hold, it outputs b=0 (watermark verification fails).

[0098] This embodiment divides the target text according to the total length corresponding to the watermark string to obtain the first text and the second text, then determines the truncated first string according to the first text, and determines the concatenated second Hash value according to the second text, then performs an XOR operation on the truncated first string and the concatenated second Hash value to obtain the model watermark signature, and then splits the model watermark signature to obtain the split signature. This embodiment first divides the target text according to the total length corresponding to the watermark string to obtain the first text and the second text, and can first divide the target text equally, and then perform an XOR operation on the truncated first string and the concatenated second Hash value to obtain an accurate model watermark signature, and then obtain an accurate split signature.

[0099] Reference Figure 6 , Figure 6 This is a structural block diagram of the first embodiment of the watermark detection device with multiple detectors of the present application.

[0100] like Figure 6 As shown, the multi-detector watermark detection device proposed in the embodiment of the present application includes:

[0101] The text signature module 10 is used to sign the initial prompt text and generate a watermark string according to the signature string;

[0102] A text output module 20, used for inputting the initial prompt text into a large language model, and determining a target text according to the output text and the watermark character string;

[0103] The signature splitting module 30 is used to determine the model watermark signature according to the target text, and split the model watermark signature to obtain the split signature;

[0104] The watermark detection module 40 is used to perform watermark detection on the target text according to the public key set corresponding to the multiple detectors and the split signature.

[0105] This embodiment signs the initial prompt text and generates a watermark string based on the signature string, then inputs the initial prompt text into the large language model, determines the target text based on the output text and the watermark string, then determines the model watermark signature based on the target text, splits the model watermark signature to obtain the split signature, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature. This embodiment inputs the initial prompt text into the large language model, determines the target text based on the output text and the watermark string, and can obtain the target text carrying the watermark, and then performs watermark detection on the target text based on the public key set corresponding to the multiple detectors and the split signature, and can allow multiple specified detectors to detect text watermarks, that is, except for these specified detectors, other ordinary users will not be able to detect text watermarks, thereby effectively performing text watermark detection.

[0106] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present application. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0107] In addition, for technical details not described in detail in this embodiment, please refer to the multi-detector watermark detection method provided in any embodiment of the present application, which will not be repeated here.

[0108] Based on the above-mentioned first embodiment of the watermark detection device with multiple detectors of the present application, a second embodiment of the watermark detection device with multiple detectors of the present application is proposed.

[0109] In this embodiment, the text signature module 10 is also used to sign the initial prompt text, and concatenate the signature string to obtain a concatenated string; calculate the concatenated hash value corresponding to the concatenated string, and determine the truncated string based on the concatenated hash value; perform an XOR calculation on the concatenated string and the truncated string to obtain a watermark string.

[0110] Furthermore, the text output module 20 is also used to input the initial prompt text into the large language model to obtain the output text; calculate the output hash value corresponding to the output text, and determine the comparison result between the output hash value and the watermark string; determine the target text according to the comparison result and the output text.

[0111] Furthermore, the signature splitting module 30 is also used to divide the target text according to the total length corresponding to the watermark string to obtain a first text and a second text; determine a truncated first string according to the first text, and determine a spliced ​​second Hash value according to the second text; perform an XOR operation on the truncated first string and the spliced ​​second Hash value to obtain a model watermark signature; and split the model watermark signature to obtain a split signature.

[0112] Furthermore, the signature splitting module 30 is also used to convert the first hash value corresponding to the first text into a first string, and truncate the first string to obtain a truncated first string; segment the second text to obtain a segmented second text; calculate the second hash value for each segmented second text, and concatenate the second hash values ​​to obtain a concatenated second hash value.

[0113] Furthermore, the watermark detection module 40 is also used to traverse each public key in the public key set corresponding to the multiple detectors to obtain the unit element under the current traversal times; calculate the target hash value according to the unit element and the split signature; and perform watermark detection on the target text according to the target hash value and the split signature.

[0114] Other embodiments or specific implementations of the watermark detection device with multiple detectors of the present application may refer to the above-mentioned method embodiments and will not be described in detail here.

[0115] The present application provides a multi-detector watermark detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the multi-detector watermark detection method in the above-mentioned embodiment one.

[0116] Reference below Figure 7 , which shows a schematic diagram of the structure of a watermark detection device with multiple detectors suitable for implementing the embodiment of the present application. The watermark detection device with multiple detectors in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The multi-detector watermark detection device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0117] like Figure 7 As shown, the multi-detector watermark detection device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the multi-detector watermark detection device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the multi-detector watermark detection device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a multi-detector watermark detection device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have instead.

[0118] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0119] The multi-detector watermark detection device provided by the present application adopts the multi-detector watermark detection method in the above embodiment, which can solve the technical problem of how to effectively perform text watermark detection when multiple detectors are specified. Compared with the prior art, the beneficial effects of the multi-detector watermark detection device provided by the present application are the same as the beneficial effects of the multi-detector watermark detection method provided by the above embodiment, and the other technical features of the multi-detector watermark detection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0120] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0122] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the multi-detector watermark detection method in the above-mentioned embodiment.

[0123] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0124] The computer-readable storage medium may be included in a watermark detection device with multiple detectors; or may exist independently without being assembled into a watermark detection device with multiple detectors.

[0125] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the watermark detection device of multiple detectors, the watermark detection device of multiple detectors: signs the initial prompt text, and generates a watermark string according to the signature string; inputs the initial prompt text into the large language model, and determines the target text according to the output text and the watermark string; determines the model watermark signature according to the target text, and splits the model watermark signature to obtain the split signatures; performs watermark detection on the target text according to the public key set corresponding to the multiple detectors and the split signatures.

[0126] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0128] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0129] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned multi-detector watermark detection method, and can solve the technical problem of how to effectively perform text watermark detection when multiple detectors are specified. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the multi-detector watermark detection method provided by the above-mentioned embodiment, and will not be repeated here.

[0130] The present application also provides a computer program product, comprising a computer program, which implements the steps of the watermark detection method of multiple detectors as described above when the computer program is executed by a processor.

[0131] The computer program product provided by the present application can solve the technical problem of how to effectively perform text watermark detection when multiple detectors are specified. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the watermark detection method with multiple detectors provided in the above embodiment, which will not be described in detail here.

[0132] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.< / eos>

Claims

1. A multi-detector watermark detection method, characterized in that: The multi-detector watermark detection method comprises the following steps: Sign the initial prompt text and generate a watermark string based on the signature string; Inputting the initial prompt text into a large language model, and determining a target text according to the output text and the watermark character string; Determine a model watermark signature according to the target text, and split the model watermark signature to obtain a split signature; Performing watermark detection on the target text according to the public key set corresponding to the multiple detectors and the split signature; The step of determining the model watermark signature according to the target text, splitting the model watermark signature, and obtaining the split signatures specifically includes: Dividing the target text according to the total length corresponding to the watermark character string to obtain a first text and a second text; Determine a first string after being intercepted according to the first text, and determine a second hash value after being concatenated according to the second text; Performing an XOR operation on the intercepted first character string and the concatenated second Hash value to obtain a model watermark signature; The model watermark signature is split to obtain split signatures.

2. The multi-detector watermark detection method according to claim 1, characterized in that: The step of signing the initial prompt text and generating a watermark string according to the signature string specifically includes: Sign the initial prompt text and concatenate the signature string to obtain the concatenated string; Calculating a concatenated hash value corresponding to the concatenated string, and determining a truncated string according to the concatenated hash value; An XOR calculation is performed on the concatenated character string and the truncated character string to obtain a watermark character string.

3. The multi-detector watermark detection method according to claim 1, characterized in that: The step of inputting the initial prompt text into the large language model and determining the target text according to the output text and the watermark character string specifically includes: Inputting the initial prompt text into a large language model to obtain an output text; Calculating an output hash value corresponding to the output text, and determining a comparison result between the output hash value and the watermark character string; A target text is determined according to the comparison result and the output text.

4. The multi-detector watermark detection method according to claim 1, characterized in that: The step of determining the intercepted first character string according to the first text, and determining the concatenated second Hash value according to the second text specifically includes: Converting a first hash value corresponding to the first text into a first string, and intercepting the first string to obtain an intercepted first string; Segmenting the second text to obtain segmented second text; Second Hash values ​​are calculated for the segmented second texts respectively, and the second Hash values ​​are concatenated to obtain concatenated second Hash values.

5. The multi-detector watermark detection method according to any one of claims 1 to 4, characterized in that: The step of performing watermark detection on the target text according to the public key set corresponding to the multiple detectors and the split signature specifically includes: Traverse each public key in the public key set corresponding to the multiple detectors to obtain the identity element under the current traversal times; Calculate a target hash value according to the unit element and the split signature; The target text is watermarked according to the target hash value and the split signature.

6. A multi-detector watermark detection device, characterized in that: The multi-detector watermark detection device comprises: The text signature module is used to sign the initial prompt text and generate a watermark string based on the signature string; A text output module, used for inputting the initial prompt text into a large language model, and determining a target text according to the output text and the watermark character string; A signature splitting module is used to determine a model watermark signature according to the target text, and split the model watermark signature to obtain a split signature; A watermark detection module, used for performing watermark detection on the target text according to the public key set corresponding to the multiple detectors and the split signature; The signature splitting module is also used to divide the target text according to the total length corresponding to the watermark character string to obtain a first text and a second text; determine a truncated first character string according to the first text, and determine a spliced ​​second Hash value according to the second text; perform an XOR operation on the truncated first character string and the spliced ​​second Hash value to obtain a model watermark signature; and split the model watermark signature to obtain a split signature.

7. A multi-detector watermark detection device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the multi-detector watermark detection method according to any one of claims 1 to 5.

8. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-detector watermark detection method according to any one of claims 1 to 5 are implemented.

9. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the watermark detection method of multiple detectors according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Watermark embedding and detecting method and device

    CN110457873A

  • Method for embedding and detecting digital watermark in large language model generated text

    CN117272253A