Information hiding method based on big language model backdoor
By using random character context embedding technology and trigger activation backdoor methods in large language models, the problem of limited information embedding amount and difficulty in backdoor detection in information hiding technology is solved, and information hiding with high concealment and security is achieved. , without affecting model performance.
Patent Information
- Application Number
- CN202410876213.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-24
AI Technical Summary
When existing information hiding technology uses large language models, the amount of information embedded is limited by the carrier, making it difficult to balance high concealment and security. At the same time, backdoor detection is difficult, which affects model performance.
Using random character context embedding technology based on a large language model, the secret information is encoded into meaningless random characters, and the backdoor output is activated through triggers, embedded in the large language model in segments, and fine-tuning technology is used to ensure the security of information hiding and extraction. sex and concealment.
It achieves covert transmission of large amounts of information, improves the concealment and security of information hiding, avoids carrier restrictions, and enhances the reliability of information hiding without affecting model performance.
Smart Images

Figure CN118690356A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of information security, and in particular relates to an information hiding method based on a large language model backdoor. Background Art
[0002] With the continuous development of digital information technology and network communication technology, the transmission of digital information in the network has become more and more convenient. However, due to the interoperability and openness of the Internet, digital information transmitted through the Internet is vulnerable to malicious attacks or theft, resulting in a great threat to the security of digital information. In order to solve this problem, information hiding technology was proposed, and it has developed rapidly with the development of science and technology, from traditional information hiding technology to information hiding technology combined with deep neural networks, and now information hiding technology combined with large models.
[0003] Traditional information hiding technology is based on the limitations of human senses. It encodes secret information and embeds it into a carrier. It also controls the carrier distortion rate (the impact and changes on the carrier) to a level that is difficult for human senses to detect. The secret information is then transmitted covertly through the transmission carrier to achieve covert communication between the two communicating parties. Traditional information hiding technology is the foundation of the entire information hiding field. It requires researchers to have certain knowledge of information hiding. In addition, in order to ensure the carrier distortion rate, the amount of information embedded in a carrier is usually low.
[0004] The information hiding technology combined with deep neural networks has developed in two directions: one is to use the neural network model to reduce the distortion rate of the carrier after the secret information is embedded, making it more difficult for humans to detect, and at the same time having a better information embedding amount than traditional information hiding technology; the second is to use the neural network model as a new carrier. There is no need to train the model, but to encode the secret information and embed it into the parameters of an existing neural network model using a replacement algorithm, and to ensure that the model will not cause any loss to the model's capabilities that can be detected by humans after the information is embedded.
[0005] With the rapid development of large models in recent years, researchers have begun to study the combination of information hiding technology and large models. By influencing the sampling process of large models when generating text or images to embed secret information, they can use the powerful generation ability of large models to generate a more natural, high-quality text or image with embedded secret information, further reduce the carrier distortion rate, and improve the imperceptibility of information hiding.
[0006] It can be seen that the amount of information embedded in information hiding technology has been continuously increasing from traditional to neural networks to large models, the carrier distortion rate has been continuously decreasing, and the concealment and security have been continuously improving, but none of them are separated from the carrier. Therefore, in order to ensure the carrier distortion rate, concealment and security, the amount of information embedded is greatly limited by the carrier. Researchers need to strike a good balance between the amount of information embedded and the carrier distortion rate.
[0007] With the continuous development of large models and their widespread popularity in society, researchers are paying more and more attention to the security of large models. Powerful large models can be injected with backdoors by attackers through data poisoning, so that when triggered by a trigger, they will exhibit the behaviors expected by the attacker, such as performance degradation, output of specific or malicious content, etc. The trigger for the backdoor can be a specific word, sentence, or style. However, due to the black box properties of large models and the general parameter scale of 1 billion, the injected backdoors are difficult to detect, and due to the discreteness of language, the triggers of the backdoors are even more difficult to reverse. Therefore, it is difficult to analyze the triggers and triggered behaviors of the backdoors when only the model is available. However, this feature just meets the concealment and security required by information hiding technology. Summary of the invention
[0008] In order to overcome the shortcomings of the prior art and make the information hiding method have both high concealment and security, and at the same time, the amount of information that can be transmitted at one time is no longer limited by the carrier, the present invention proposes an information hiding method based on the backdoor of a large language model. The method is based on the backdoor technology of the large language model and proposes a random character context embedding technology of the large language model. A large number of random characters can be injected into the large language model, so as to realize the encoding or encryption of secret information and embed it into the knowledge system of the large language model. Only through the correct trigger can the large language model be triggered to output the embedded information (or hidden information) hidden in its knowledge system.
[0009] The specific technical solutions of the present invention are as follows:
[0010] An information hiding method based on a large language model backdoor includes two stages: an information hiding stage and an information extraction stage. The information hiding stage hides secret information into a large language model, and the information extraction stage extracts the secret information from the large language model.
[0011] The specific steps of the information hiding stage are:
[0012] Step 1: The sender of the information directly encodes the secret information to be transmitted using Base64 or other encoding methods, or first encrypts it using a reversible encryption algorithm such as AES ("reversible encryption algorithm" is a general term in cryptography. A reversible encryption algorithm means that the encrypted data can be restored to the original data through a decryption key), and then encodes it using Base64 or other encoding methods to ultimately obtain a meaningless random string (hereinafter referred to as a secret information random string).
[0013] Step 2: Assign triggers. The trigger selects a random short string and obtains n pairs of trigger-secret information random string fragments. The specific process of assigning triggers is:
[0014] 1) Select the first trigger. The first trigger can be intercepted or selected from the random string of secret information obtained in the first step (interception means that when a part of the characters of the random string of secret information is intercepted, then this part of the characters will no longer exist in the random string of secret information, while selection means that this part of the characters still exists in the random string of secret information), or it can be randomly generated or generated using some encryption algorithm.
[0015] 2) Segment the secret information random string according to the specified maximum length to obtain n secret information random string fragments.
[0016] 3) Pair the first trigger with the first secret information random string fragment, and assign triggers to the 2nd to nth secret information random string fragments, and finally obtain n trigger-secret information random string fragment pairs. In this process, two trigger generation strategies can be adopted, parallel trigger generation strategy or chain trigger generation strategy. Parallel trigger generation strategy: The trigger of each secret information random string fragment is only related to itself, and can be intercepted or selected from the secret information random string fragment, or it can be generated randomly or using some encryption algorithms. If it is generated by an encryption algorithm, it can also be used to check the integrity and correctness of the random string extracted in the subsequent extraction process. Chain trigger generation strategy: The i-th secret information random string fragment selects some consecutive characters in the i-1th secret information random string fragment as a trigger, so that only the trigger of the first secret information random string fragment needs to be passed, and subsequent triggers can be obtained through the previous secret information random string fragment.
[0017] Step 3: Embed the n trigger-secret information random string fragment pairs obtained in step 2 into several different meaningful contexts. The specific process is as follows:
[0018] Select several topics and select m groups of instruction pairs (instruction-output pairs) from them.
[0019] For each trigger-secret information random string fragment pair, insert the trigger into any position of the instruction in the m groups of instruction pairs, and then replace the output with the secret information random string fragment or insert it into any position of the output, thereby embedding the meaningless trigger-secret information random string fragment pair into a meaningful context.
[0020] Step 4: Based on the strategy in step 3, construct the training set and test set. The training set consists of two groups of instruction pairs, one group is the instruction pairs embedded with trigger-secret information random string fragment pairs, and the other group is the original instruction pairs without trigger-secret information random string fragments. There are three main test sets: test_trigger, test_noTrigger, and test_noTriggerInTrain. The instruction pairs selected by the test set test_trigger and the test set test_noTrigger are not repeated in the training set. The instruction pairs in the test set test_trigger are all embedded with trigger-secret information random string fragment pairs, which can be used to test the success rate and security of secret information extraction. The instruction pairs in the test set test_noTrigger are all original instruction pairs, which can be used to test the concealment of secret information. The instruction pairs in the test set test_noTriggerInTrain are the original instruction pairs in the training set, which can be used to test the security of secret information.
[0021] Step 5: Fine-tune the large language model based on the training set. Use instruction tuning and parameter efficient fine-tuning techniques in supervised learning (fine-tune only a small number or additional model parameters, while fixing most pre-trained parameters. For example: LoRA, QLoRA, and P-tuning v2, etc.) to fine-tune the large language model in the training set and inject these trigger-secret information random string fragment pairs into the knowledge system of the large language model.
[0022] Step 6: Test the fine-tuned large language model through the test set. The success rate, concealment, and safety of the fine-tuned large language model are tested in the three test sets to measure the information hiding performance of the fine-tuned large language model. If the test results do not meet the standards, return to step 5 and fine-tune again. Other fine-tuning strategies can be used during re-fine-tuning. Finally, a large language model that hides secret information is obtained (hereinafter referred to as the hidden model).
[0023] The specific steps of the information extraction stage are:
[0024] Step 1: The information receiver obtains the output corresponding to all triggers based on the information sent by the sender, specifically:
[0025] The information receiver embeds the first trigger received from the information sender into t2 instructions of different topics, and inputs the instructions embedded with the trigger into the latent model in sequence to obtain the corresponding t2 outputs. If >t2 / 2 of the t2 outputs are the same, then the output is taken as the final output. If the information sender adopts a parallel trigger generation strategy, the information receiver will receive multiple triggers, and all the remaining triggers will be processed in the same way to obtain all the corresponding outputs. If the information sender adopts a chain trigger generation strategy, the information receiver needs to first obtain the i-th trigger from the final output obtained by triggering the latent model backdoor with the i-1th trigger, and then obtain the final output corresponding to the i-th trigger in the same way.
[0026] Step 2: Concatenate the outputs corresponding to all the triggers to obtain a random string of secret information. The specific process is as follows:
[0027] (1) Concatenate the final outputs corresponding to all triggers. If a parallel trigger generation strategy is adopted, and all triggers are extracted from the corresponding random string fragments of secret information, then before concatenating the final outputs corresponding to all triggers in the trigger order, the triggers and the corresponding final outputs must be concatenated first. If a parallel trigger generation strategy is adopted, but all triggers are not extracted from the corresponding random string fragments of secret information, or a chain trigger generation strategy is adopted, then the final outputs corresponding to all triggers are directly concatenated in the trigger order or in the chain order.
[0028] (2) In the information hiding stage, if the first trigger is intercepted from the random string of the secret information, then the string obtained by concatenating the first trigger and all the final outputs in the second step (1) is concatenated to finally obtain the complete secret information string.
[0029] Step 3: Decode the random string of secret information obtained by concatenating in the second step. If it is encrypted, it needs to be decrypted again to obtain the secret information that the sender wants to transmit. Specifically, if the random string of secret information is directly encoded from the secret information, it only needs to be decoded using the specified encoding algorithm to obtain the secret information; if the random string of secret information is obtained by first encrypting and then encoding the secret information, it needs to be decoded using the specified encoding algorithm and then decrypted using the specified key to obtain the secret information.
[0030] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows:
[0031] The present invention proposes an information hiding method based on a large language model backdoor. The large language model is fine-tuned by embedding a large number of meaningless random characters into a meaningful context, so that the large language model can efficiently and accurately remember a large number of meaningless random characters after encoding or encrypting secret information with only some parameters fine-tuned, and ensures a low performance loss rate of the large language model after embedding a large number of meaningless random characters. In addition, the present invention utilizes backdoor triggering technology so that the large language model will trigger the backdoor and output the corresponding secret information only when receiving a trigger. Then, by dividing the secret information with a large amount of data into several fragments and specifying a corresponding trigger for each fragment, the secret information with a large amount of information can be effectively embedded into the large language model, while improving the confidentiality and security of information hiding.
[0032] In summary, the present invention proposes an information hiding method based on a large language model backdoor, which makes the information hiding method have both high concealment and security. At the same time, the amount of information that can be transmitted at one time is no longer limited by the carrier. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a flow chart of an information hiding method based on a large language model backdoor of the present invention;
[0034] Figure 2 A flowchart of a chained trigger generation strategy for the secret information embedding stage of the present invention;
[0035] Figure 3 A flowchart of a chain trigger generation strategy for the secret information extraction stage of the present invention;
[0036] Figure 4 The present invention is a flow chart of the present invention for concealedly transmitting secret information to the information receiver after the information sender completes the information hiding stage. DETAILED DESCRIPTION
[0037] The technical solution in one embodiment of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0038] like Figure 1 As shown, an information hiding method based on a large language model backdoor is provided. The method includes two stages: an information hiding stage and an information extraction stage. The information hiding stage hides secret information into the large language model, and the information extraction stage extracts the secret information from the large language model.
[0039] like Figure 2 As shown in Figure 2, the specific steps of the information hiding phase are:
[0040] Step 1: The information sender reads the secret information (text or image) to be transmitted in bytecode format, and then encodes it using Base64 to obtain a meaningless random string - Base64 string (hereinafter referred to as the secret information random string). In this embodiment, a 620*668 pixel photo is selected as the secret information, and the number of bits occupied is 4175344.
[0041] Step 2: Assign triggers. The triggers are random short strings, usually 5-10 characters. Selecting a random short string as a trigger has the advantages of good concealment and difficulty in detection. In this embodiment, a random short string of 10 characters is selected as the trigger. The specific process of assigning triggers is as follows:
[0042] 1) Select the first trigger. The first trigger is composed of the first 10 characters of the random string of secret information obtained in the first step.
[0043] 2) The random string of secret information is segmented according to the specified maximum length. The specified maximum length is generally set to 50-65% of the maximum input length of the large language model. For example, when the maximum input length is 1024, 650 can be taken to obtain n random string segments of secret information. In this embodiment, 1024 is used as the maximum input length of the large language model, and the specified maximum length is set to 650.
[0044] 3) Pair the first trigger with the first random string fragment of secret information, and assign triggers to the second to nth random string fragments of secret information, and finally obtain n trigger-secret random string fragment pairs. In this process, two trigger generation strategies can be adopted, namely parallel trigger generation strategy or chain trigger generation strategy. Parallel trigger generation strategy: The trigger of each random string fragment of secret information is only related to itself, and can be intercepted or selected from the random string fragment of secret information, or can be generated randomly or using some encryption algorithms. If it is generated by an encryption algorithm, it can also be used to check the integrity and correctness of the random string extracted in the subsequent extraction process. Chain trigger generation strategy: The i-th random string fragment of secret information selects some continuous characters in the i-1th random string fragment of secret information as a trigger, so that only the trigger of the first random string fragment of secret information needs to be passed, and subsequent triggers can be obtained through the previous random string fragment of secret information. The parallel trigger generation strategy requires more triggers to be passed, but the implementation difficulty is relatively small and the stability is relatively high. The chain trigger generation strategy requires less triggers to be passed, and only the first trigger needs to be passed, but the extraction difficulty will be greater and the relative security will be higher. In this embodiment, a chain trigger generation strategy is used, and the last 10 characters of the i-1th random character string fragment of the secret information are selected as the i-th trigger.
[0045] Step 3: Embed the n trigger-secret information random string fragment pairs obtained in step 2 into several different meaningful contexts. The specific process is as follows:
[0046] One or more topics are selected, and m groups of instruction pairs (instruction-output pairs) are selected from them. It is recommended that m>10. In this embodiment, m is set to 50.
[0047] For each trigger-secret information random string fragment pair, the trigger is inserted into the end of the instruction in the m groups of instruction pairs, and then the secret information random string fragment is replaced with the output, thereby embedding the meaningless trigger-secret information random string fragment pair into a meaningful context.
[0048] Step 4: According to the strategy in step 3, construct the training set and test set. The training set consists of two groups of instruction pairs, one group is the instruction pairs with embedded trigger-secret information random string fragment pairs, and the other group is the original instruction pairs without embedded trigger-secret information random string fragments. There are three main test sets: test_trigger, test_noTrigger, and test_noTriggerInTrain. The instruction pairs selected by the test set test_trigger and the test set test_noTrigger are not repeated in the training set. The instruction pairs in the test set test_trigger are all embedded with trigger-secret information random string fragment pairs. The purpose of its design is to detect whether the large language model accurately remembers the trigger and its corresponding secret information random string fragment, which can be used to test the success rate and security of secret information extraction. The instruction pairs in the test set test_noTrigger are all original instruction pairs. The purpose of its design is to detect whether the large language model can effectively answer normal instructions (without embedded triggers) instead of outputting meaningless random strings, which can be used to test the concealment of secret information. The instruction pairs in the test set test_noTriggerInTrain are the original instruction pairs in the training set. They are designed to detect whether the large language model can effectively and correctly answer the instructions that have appeared in the training set when the instructions are not embedded with triggers. They can be used to test the security of secret information. In this embodiment, the test set test_trigger selects 5 groups of different instruction pairs, and the test set test_noTrigger selects different instruction pairs with the same amount of data as test_trigger, so that the total number of instruction pairs of test_noTrigger and test_trigger is the same.
[0049] Step 5: Fine-tune the large language model. This embodiment uses instruction tuning in supervised learning and parameter-efficient fine-tuning technology that only fine-tunes the last three layers of the model and freezes other parameters to fine-tune the large language model Chatglm3-6B in the training set, and injects these trigger-secret information random string fragment pairs into the knowledge system of the large language model Chatglm3-6B.
[0050] Step 6: Test the fine-tuned large language model. The success rate, concealment, and safety of the fine-tuned large language model are tested in three test sets to measure the information hiding performance of the fine-tuned large language model. If the test results do not meet the standards, return to step 5 and fine-tune again. Other fine-tuning strategies can be used during re-fine-tuning. The test qualification standard is formulated according to the specific redundancy of the secret information and the adopted trigger generation strategy. If the redundancy of the secret information is high, the qualification standard of the success rate can be set lower, and the concealment and security can be set higher, such as the threshold of the success rate is 90%, and the threshold of the concealment and security is 98%; if the redundancy of the secret information is low, the qualification standard of the success rate can be set higher, and the concealment and security can be set lower, such as the threshold of the success rate is 95%, and the threshold of the concealment and security is 95%; if the parallel trigger generation strategy is adopted, that is, the trigger is only related to the corresponding random string, then the qualification standard of the success rate can be set lower, and the concealment and security can be set higher, such as the threshold of the success rate is 95%, and the threshold of the concealment and security is 98%; if the chain trigger generation strategy is adopted, the success rate must reach 100%, and the concealment and security can be set lower, such as the threshold of 95%, because the i-th trigger needs to be obtained through the random string corresponding to the i-1-th trigger, so the output obtained by using the i-1-th trigger to trigger the large language model backdoor must be a correct random string. Finally, a large language model (hereinafter referred to as a hidden model) that hides secret information is obtained. The present invention defines the success rate, concealment and safety as follows:
[0051]
[0052] Where total_num_1 represents the total number of instruction pairs in the test_trigger test set, and t1 represents t1 different instruction pairs selected by the test set. It represents the output obtained by embedding the trigger in the i-th trigger-secret information random string fragment pair into the j-th instruction in t1 instruction pairs and inputting it into the fine-tuned large language model. i Represents the secret information random string in the i-th trigger-secret information random string fragment pair.
[0053]
[0054] Where total_num_2 represents the total number of instruction pairs in the test_noTrigger test set, and fail_num_1 represents the number of times the large language model mistakenly outputs meaningless strings.
[0055]
[0056] Where total_num_3 represents the total number of instruction pairs in the test_noTriggerInTrain test set, and fail_num_2 represents the number of times the large language model mistakenly outputs meaningless strings.
[0057] Because the chain trigger generation strategy is used in this embodiment, the success rate threshold is set to 100%, and the concealment and security thresholds are set to 95%.
[0058] like Figure 3 As shown in Figure 2, the specific steps of the information extraction stage are:
[0059] Step 1: The information receiver embeds the first trigger received from the information sender into t2 (t2 is recommended to be greater than or equal to 5) different instructions, and inputs the instructions embedded with the trigger into the hidden model in sequence to obtain the corresponding t2 outputs. If there are >t2 / 2 outputs that are the same among the t2 outputs, then the output is taken as the final output. If the information sender adopts a parallel trigger generation strategy, the information receiver will receive multiple triggers, and all the remaining triggers will be processed in the same way to obtain all the corresponding outputs. If the information sender adopts a chain trigger generation strategy, the information receiver needs to first obtain the i-th trigger from the final output obtained by triggering the hidden model backdoor by the i-1th trigger, and then obtain the final output corresponding to the i-th trigger in the same way. In this embodiment, t2 is set to 5, and because the chain trigger generation strategy is used, the i-th trigger selects the last 10 strings of the final output of the i-1th trigger.
[0060] Step 2: Concatenate to get a random string of secret information. The specific process is as follows:
[0061] (1) Concatenate the final outputs corresponding to all triggers. If a parallel trigger generation strategy is adopted, and all triggers are extracted from the corresponding random string fragments of secret information, then before concatenating the final outputs corresponding to all triggers in the order of triggers, the triggers and the corresponding final outputs must be concatenated first. If a parallel trigger generation strategy is adopted, but all triggers are not extracted from the corresponding random string fragments of secret information, or a chain trigger generation strategy is adopted, then the final outputs corresponding to all triggers are directly concatenated in the order of triggers or in the order of chain. In this embodiment, a chain trigger generation strategy is adopted, so it is only necessary to concatenate the final outputs corresponding to all triggers in the order of chain.
[0062] (2) In the information hiding stage, the first trigger in this embodiment is intercepted from the random string of secret information, so it is necessary to concatenate the first trigger and the string obtained by concatenating all the final outputs in the second step (1) to finally obtain the complete secret information string.
[0063] Step 3: Use the Base64 algorithm to decode the random string of secret information obtained in the second step to obtain the secret information that the sender wants to transmit.
[0064] So far, the information hiding method based on the large language model backdoor includes two stages: information hiding stage and information extraction stage. Specifically, how the information sender transmits the secret information to the information receiver in a hidden way after completing the information hiding stage is as follows: Figure 4 As shown in the figure, the information sender and the information receiver agree on an API in advance. When the information sender needs to transmit secret information later, it first deploys the hidden model (a large language model that hides the secret information) on the server and sets up the API. Then, it transmits the trigger information (including chain or parallel, specific trigger, etc.) to the information receiver through a shared channel. After receiving the trigger information, the information receiver accesses the hidden model through the agreed API and uses the trigger to trigger the backdoor of the hidden model to extract the secret information. When the information sender and the information receiver transmit the trigger information on the shared channel, they can use some encryption methods to further improve security.
[0065] In order to verify the advantages of this embodiment, this embodiment is compared with several existing information hiding methods (Bin-LM, RNN-Stega, NeuralSteganography, SAAC, ADG and Discop) for testing, wherein Bin-LM uses fixed-length coding to complete information hiding and extraction, RNN-Stega uses Huffman coding to complete information hiding and extraction, NeuralSteganography uses arithmetic coding to complete information hiding and extraction, SAAC uses self-adjusting arithmetic coding to complete information hiding and extraction, ADG first uses a data set of a specified topic (such as movies) to train a natural language generation model, and then uses the trained model combined with a distributed sampling method that adapts to dynamic grouping to generate text, thereby achieving information hiding and extraction, and Discop replicates the probability distribution corresponding to the decoding time step to multiple copies, and completes secret information hiding and extraction by selecting the distribution copy. The test indicators use the extraction success rate Success and the carrier embedding amount Embedding (Embedding = number of bits / number of bytes), and the test results are shown in Table 1:
[0066] Table 1
[0067]
[0068] As can be seen from Table 1, the extraction success rate of this embodiment reaches 100%, which is better than Bin-LM, RNN-Stega, NeuralSteganography and SAAC in terms of the success rate of secret information extraction, and is comparable to ADG and Discop. The amount of carrier embedding is not limited by the carrier, which far exceeds existing information hiding methods such as Bin-LM, RNN-Stega, NeuralSteganography, SAAC, ADG and Discop.
[0069] In order to further test the hiddenness of the latent model, this embodiment tests the latent model and the original model Chatglm3-6B on several benchmark data sets commonly used by large language models. The benchmark data sets used are the arc data set, which contains 7787 natural science questions at the middle school level; the ceval data set, which is one of the authoritative Chinese AI large model evaluation data sets. It is used to examine the knowledge and reasoning ability of the large model. It consists of 13948 multiple-choice questions, involving 4 major subject categories and 52 minor subject categories; the cmmlu data set, which is a comprehensive Chinese large model benchmark, covering 67 topics involving natural sciences, social sciences, engineering, humanities, and common sense, etc., which can comprehensively evaluate the ability of the large model in Chinese knowledge reserves and language comprehension; the gsm8k data set , which is a primary school math dataset released by OpenAI; hellaswag dataset, which is a benchmark dataset for evaluating general language understanding developed by researchers at Stanford University, contains 100,000 question-answer pairs, each of which is an abnormal or unusual answer that requires in-depth understanding of the context; mmlu dataset, which contains an English evaluation dataset of 57 subtasks, covering elementary mathematics, American history, computer science, law, etc., with difficulty ranging from high school level to expert level, effectively measuring the comprehensive knowledge ability of multiple major categories such as humanities, social sciences, and science and engineering; race dataset, which is taken from the English reading comprehension test of junior and senior high schools in China between 12-18 years old, contains 28,000 short articles and nearly 100,000 questions. The scoring results of each benchmark dataset are shown in Table 2:
[0070] Table 2
[0071]
[0072] As can be seen from Table 2, compared with the original Chatglm3-6B model, the latent model obtained by fine-tuning Chatglm3-6B in this embodiment has no decrease in the scores of the arc and hellaswag benchmark datasets, no significant decrease in the scores of the cmmlu, gsm8k, mmlu and race benchmark datasets, and even a slight improvement in the score of the ceval benchmark dataset. This shows that the latent model in this embodiment has not suffered a significant loss in the general performance of the large language model.
[0073] Combining Table 1 and Table 2, it can be seen that this embodiment has the advantages of high extraction success rate, high carrier embedding amount, etc., while not causing obvious damage to the original performance of the large language model. Therefore, it is difficult for the attacker to analyze whether the model hides secret information by embedding a backdoor from the perspective of model performance damage, and thus it is difficult to discover the API agreed upon by the communicating parties.
[0074] The present invention proposes an information hiding method based on a large language model backdoor, which enables the information hiding method to have both high concealment and security. At the same time, the amount of information that can be transmitted at one time is no longer limited by the carrier.
[0075] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. An information hiding method based on a large language model backdoor, comprising an information hiding stage and an information extraction stage, characterized in that: The process includes: Information hiding stage: S1: The information sender encodes the transmitted secret information to obtain a random string of secret information; S2: Assign triggers, select random strings from triggers, and obtain n pairs of triggers and random string fragments of secret information; S3: embed n trigger-secret information random string fragment pairs into several contexts; S4: Based on step S3, construct a training set and a test set; S5: Based on the training set, fine-tune the large language model and inject trigger-secret information random string fragment pairs into the knowledge system of the large language model; S6: Test the fine-tuned large language model using the test set. If the test result does not meet the standard, fine-tune it again to finally obtain a large language model that hides secret information, i.e., the latent model. Information extraction phase: S7: The information receiver obtains the outputs corresponding to all triggers according to the information sent by the sender; S8: concatenate the outputs corresponding to all the triggers to obtain a random string of secret information; S9: Decode the concatenated random character string of secret information to obtain the secret information transmitted by the information sender.
2. The information hiding method based on a large language model backdoor according to claim 1 is characterized in that: The step S1 can also be implemented by the following process: The sender of the information first encrypts the transmitted secret information using a reversible encryption algorithm, then encodes it, and finally obtains a meaningless random string.
3. The information hiding method based on a large language model backdoor according to claim 1 is characterized in that: The trigger selects 5-10 characters. The specific process of assigning the trigger is as follows: S2.1: Select the first trigger; S2.2: segment the secret information random string according to the specified maximum length to obtain n secret information random string segments; S2.3: Pair the first trigger with the first secret information random string fragment, and assign triggers to the second to nth secret information random string fragments, and finally obtain n trigger-secret information random string fragment pairs.
4. The information hiding method based on a large language model backdoor according to claim 3 is characterized in that: The trigger generation strategy includes a parallel trigger generation strategy or a chain trigger generation strategy; The parallel trigger generation strategy: the trigger of each random string segment of secret information is only related to itself, one is intercepted or selected from the random string segment of secret information, and the other is generated randomly or using an encryption algorithm; The chain trigger generation strategy is as follows: the i-th secret information random string fragment selects some consecutive characters in the i-1-th secret information random string fragment as triggers, thereby only transmitting the trigger of the first secret information random string fragment, and subsequent triggers are all obtained through the previous secret information random string fragment.
5. The information hiding method based on a large language model backdoor according to claim 4 is characterized in that: The specific implementation process of step S3 is as follows: Select a number of topics, and select m groups of instruction pairs from them: instruction-output pairs; For each trigger-secret information random string fragment pair, insert the trigger into any position of the instruction in the m groups of instruction pairs, and then replace the output with the secret information random string fragment or insert it into any position of the output, so as to embed the meaningless trigger-secret information random string fragment pair into a meaningful context.
6. The information hiding method based on a large language model backdoor according to claim 5 is characterized in that: The training set consists of two groups of instruction pairs, one group is instruction pairs with trigger-secret information random string fragment pairs embedded, and the other group is original instruction pairs without trigger-secret information random string fragments embedded; There are three test sets: test_trigger, test_noTrigger, and test_noTriggerInTrain. The instruction pairs selected by the test set test_trigger and the test set test_noTrigger are not repeated in the training set. The instruction pairs in the test set test_trigger are all embedded with trigger-secret information random string fragment pairs, which are used to test the success rate and security of secret information extraction; the instruction pairs in the test set test_noTrigger are all original instruction pairs, which are used to test the concealment of secret information. The instruction pairs in the test set test_noTriggerInTrain are the original instruction pairs in the training set, which are used to test the security of secret information.
7. The information hiding method based on a large language model backdoor according to claim 6 is characterized in that: The specific implementation process of step S7 is as follows: The information receiver embeds the first trigger received from the information sender into t2 instructions of different topics, and inputs the instructions embedded with the trigger into the latent model in sequence to obtain the corresponding t2 outputs. If >t2 / 2 of the t2 outputs are the same, then the output is taken as the final output. If the information sender adopts a parallel trigger generation strategy, and the information receiver receives multiple triggers, all the remaining triggers will be processed in the same way to obtain all corresponding outputs; if the information sender adopts a chain trigger generation strategy, the information receiver first obtains the i-th trigger from the final output obtained by triggering the hidden model backdoor by the i-1-th trigger, and then obtains the final output corresponding to the i-th trigger in the same way.
8. The information hiding method based on a large language model backdoor according to claim 7 is characterized in that: The specific process of obtaining the random string of secret information in step S8 is as follows: Concatenate the final outputs corresponding to all triggers. If a parallel trigger generation strategy is adopted and all triggers are intercepted from the corresponding random string fragments of secret information, then before concatenating the final outputs corresponding to all triggers in the trigger order, first concatenate the triggers and the corresponding final outputs. If a parallel trigger generation strategy is adopted but all triggers are not intercepted from the corresponding random string fragments of secret information, or a chain trigger generation strategy is adopted, then directly concatenate the final outputs corresponding to all triggers in the trigger order or in the chain order. In the information hiding stage, if the first trigger is intercepted from the random string of secret information, the first trigger and the concatenated string are concatenated to finally obtain the complete secret information string.
9. The information hiding method based on a large language model backdoor according to claim 8 is characterized in that: The specific implementation process of step S9 is as follows: If the secret information random string is encoded from the secret information, it is decoded using the encoding algorithm to obtain the secret information; if the secret information random string is obtained by first encrypting and then encoding the secret information, it is first decoded using the encoding algorithm and then decrypted using the key to obtain the secret information.
10. The information hiding method based on a large language model backdoor according to any one of claims 1 to 9, characterized in that: The information sender and the information receiver agree on an API in advance. When the information sender subsequently transmits secret information, it first deploys the hidden model on the server and sets the API, and then transmits the trigger information to the information receiver through a shared channel. After receiving the trigger information, the information receiver accesses the hidden model through the agreed API, and uses the trigger to trigger the backdoor of the hidden model to extract the secret information.
Citation Information
Cited By
Information hiding method based on backdoors in large language models
WO2026007280A1
