Method, system, apparatus, device, and medium for protecting sensitive information

A local LLM replaces sensitive information in input text with equivalent descriptions, addressing inefficiencies in existing methods and ensuring secure and functional use of online LLMs by maintaining information security and readability.

WO2026090923A1PCT designated stage Publication Date: 2026-05-07SIEMENS AG +1
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
SIEMENS AG
Filing Date
2024-10-30
Publication Date
2026-05-07

AI Technical Summary

Technical Problem

Existing methods for protecting sensitive information when using online Large Language Models (LLM) are inefficient and do not fully utilize the capabilities of online LLMs, often requiring significant effort and failing to prevent exposure of sensitive information.

Method used

A local LLM is used to replace sensitive information in input text with equivalent descriptions, and a converter determines and records mapping relationships between instances and replacements, ensuring secure processing and readability of the output text.

Benefits of technology

This approach effectively prevents exposure of sensitive information to online LLMs while maintaining the functionality of online LLMs, ensuring information security and readability of the processed text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024128574_07052026_PF_FP_ABST
    Figure CN2024128574_07052026_PF_FP_ABST
Patent Text Reader

Abstract

A method, system, apparatus, device, and medium for protecting sensitive information. The system comprises: a first Large Language Model (LLM)(42) , configured to receive a first text(51) comprises a prompt and an input text, wherein the prompt instructs the first LLM(42) to perform a replacement processing on sensitive information in the input text to generate a second text(52), the input text comprises an instance of the sensitive information; and a converter(43), configured to determine a mapping relationship between the instance in the first text(51) and a replacement description of the instance in the second text(52), and replace the replacement description in a response text(53) of the second text(52) with the instance based on the mapping relationship. Replacing sensitive information in input text by the first LLM(42) prevents sensitive information exposure to a second LLM(45). Selecting a first LLM(42) that matches hardware capabilities improves applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Method, system, apparatus, device, and medium for protecting sensitive informationTECHNICAL FIELD

[0001] The present disclosure relates to the technical field of Artificial Intelligence (AI) and LLM (Large Language Model) , in particular to a method, system, apparatus, device, and medium for protecting sensitive information.BACKGROUND

[0002] Currently, there is an increasing number of applications based on AI and LLM. LLM refers to a deep learning model trained on a large amount of textual data, which can generate natural language text or understand the meaning of language text. LLM (especially online LLM) can handle a variety of natural language tasks, such as text classification, question answering, and dialogue, among others.

[0003] When using online LLM, there are often application scenarios related to sensitive information. Users do not expect to send sensitive information such as names, addresses, phone numbers, and other detailed information related to personal privacy to online LLMs. Meanwhile, users expect to freely access the powerful processing capabilities of online LLM.SUMMARY

[0004] Embodiments of the present disclosure propose a method, system, apparatus, device, and medium for protecting sensitive information.

[0005] In a first aspect, a system for protecting sensitive information is provided. The system includes:

[0006] a first LLM, configured to receive a first text comprises a prompt and an input text, wherein the prompt instructs the first LLM to perform a replacement processing on sensitive information in the input text to generate a second text, the input text comprises an instance of the sensitive information; and

[0007] a converter, configured to determine a mapping relationship between the instance in the first text and a replacement description of the instance in the second text, and replace the replacement description in a response text of the second text with the instance based on the mapping relationship.

[0008] In a second aspect, a method for protecting sensitive information, is provided. The method is applicable to a client, the method includes: receiving a first text for a first LLM, the first text comprises a prompt and an input text, wherein the prompt instructs the first LLM to perform a replacement processing on sensitive information in the input text to generate a second text, the input text comprises an instance of the sensitive information; determining a mapping relationship between the instance in the input text and a replacement description of the  instance in the second text; receiving a response text of the second text from a second LLM; and replacing the replacement description in the response text with the instance based on the mapping relationship.

[0009] In a third aspect, an apparatus for protecting sensitive information is provided. The apparatus includes: an receiving module configured to receive a first text for a first LLM, the first text comprises a prompt and an input text, wherein the prompt instructs the first LLM to perform a replacement processing on sensitive information in the input text to generate a second text, the input text comprises an instance of the sensitive information; a determining module, configured to determine a mapping relationship between the instance and a replacement description of the instance in the second text; a receiving module, configured to receive a response text of the second text from a second LLM; and a replacing module, configured to replace the replacement description in the response text with the instance based on the mapping relationship.

[0010] In a fourth aspect, an electronic device is provided. The electronic device comprising a processor and a memory, wherein an application program executable by the processor is stored in the memory for causing the processor to execute a method for protecting sensitive information as described in any of the above.

[0011] In a fifth aspect, a computer-readable medium comprising computer-readable instructions stored thereon is provided, wherein the computer-readable instructions for executing a method for protecting sensitive information as described in any of the above.

[0012] In a sixth aspect, a computer program product comprising a computer program, when the computer program is executed by a processor for executing a method for protecting sensitive information as described in any of the above.

[0013] According to the above technical solutions, a first LLM is configured to receive a first text comprises a prompt and an input text, the prompt instructs the first LLM to perform a replacement processing on sensitive information in the input text to generate a second text, the input text comprises an instance of the sensitive information; and a converter is configured to determine a mapping relationship between the instance in the first text and a replacement description of the instance in the second text, and replace the replacement description in a response text of the second text with the instance based on the mapping relationship. Therefore, text processing capability of the first LLM is utilized to replace instances of sensitive information in the input text with respective replacement descriptions, preventing exposure of sensitive information and improving information security. Moreover, storing mapping relationships between instances of sensitive information and respective replacement descriptions and reverse replacing respective replacement descriptions in the third text with respective instances based on the stored mapping relationships, ensures readability of response text. In addition, embodiments of the present disclosure select the first LLM that matches hardware attributes of device running the first LLM, which  extends applicability of the present disclosure.BRIEF DESCRIPTION OF THE DRAWINGS

[0014] To make technical solutions of examples of the present disclosure clearer, accompanying drawings to be used in description of the examples will be simply introduced hereinafter. Obviously, the accompanying drawings to be described hereinafter are only some examples of the present disclosure. Those skilled in the art may obtain other drawings according to these accompanying drawings without creative labor.

[0015] Fig. 1 is an exemplary schematic diagram of a system for protecting sensitive information according to an embodiment of the present disclosure.

[0016] Fig. 2 is an exemplary flowchart of a method for protecting sensitive information according to an embodiment of the present disclosure.

[0017] Fig. 3 is an exemplary schematic diagram of a process of protecting sensitive information according to an embodiment of the present disclosure.

[0018] Fig. 4 is an exemplary schematic diagram of a Table storing instances and respective replacement descriptions according to an embodiment of the present disclosure.

[0019] Fig. 5 is an exemplary schematic diagram of a system for protecting sensitive information according to an embodiment of the present disclosure.

[0020] Fig. 6 is an exemplary structural diagram of an apparatus for protecting sensitive information according to an embodiment of the present disclosure.

[0021] Fig. 7 is an exemplary structural diagram of an electronic device according to an embodiment of the present disclosure.

[0022] List of reference numbers: DETAILED DESCRIPTION

[0023] To make the purpose, technical scheme, and advantages of the disclosure clearer, the following examples are given to further explain the disclosure in detail. Nouns and pronouns related to people in this patent application are not limited to specific gender.

[0024] To be concise and intuitive in description, the scheme of the disclosure is described below by describing several representative embodiments. Many details in the embodiments are only used to help understand the scheme of the disclosure. However, it is obvious that the technical scheme of the disclosure can be realized without being limited to these details. To avoid unnecessarily blurring the scheme of the disclosure, some embodiments are not described in detail, but only the framework is given. Hereinafter, "including" refers to "including but not limited to" , "according to. . . " refers to "at least according to. . ., but not limited to. . . " . When the number of an element is not specifically indicated below, it means that the element can be one or more, or can be understood as at least one. The terms "a" or "an" in this disclosure should not be understood as one, but as at least one.

[0025] "LLM" stands for Large Language Model. These are types of deep learning models that have been trained on vast amounts of text data. They are capable of understanding and generating natural language and can be used for a variety of tasks such as text completion, translation, summarization, question-answering, and more. This ability enables LLM to handle various language processing tasks, such as machine translation, text summarization, code checking, and question answering systems, among others.

[0026] At present, there are often issues related to sensitive information when using online LLM. For example, inquiry text sent to online LLMs may contain sensitive information (such as email addresses) . If the inquiry text containing sensitive information is directly sent to online LLM, it may result in the exposure of sensitive information. For another example, the code to be modified sent to the online LLM may contain sensitive information (such as ID number, address or telephone number) too. If the code is sent directly to the online LLM, it may also lead to the exposure of sensitive information.

[0027] Some related research has already attempted to solve this problem. For example, some research tries to use prompt engineering methods to create special templates to shield sensitive information as much as possible. Others attempt to train a special small model to transform sensitive information. There are also attempts to send sensitive information to a local small model for processing and non-sensitive information to an online large model. These methods all have certain drawbacks; some require a large amount of work and are difficult to control, while others cannot fully utilize the advantages of online LLMs.

[0028] Therefore, how to use online LLM to complete various language processing tasks without exposing sensitive information to online LLM is a technical problem that needs to be solved.

[0029] In an embodiment of the present disclosure, an additional LLM (such as locally arranged) is used to process a text to be sent to online LLM provided by a client. The additional LLM replaces sensitive information contained in the text with equivalent descriptions that do not affect processing of online LLM. The processed text is sent to the online LLM. Then, reverse replace a response text provided by the online LLM and provide the reverse replaced response text to the client. Therefore, users can use online LLM normally without exposing sensitive information to the online LLM and throughout the entire process, the user is unaware of any extra steps. Once configured, it is the same as directly communicating with the online LLM. Although the user sends sensitive information, it is not sent to the online LLM but is processed only within the local LLM. The received response corresponds exactly to the information sent by the user.

[0030] The above disclosure provides a detailed explanation of the technical defects existing in the existing technology, the reasons for these defects, and the process of thinking and analyzing how to overcome them. In fact, the understanding of the above-mentioned technical defects is not universal knowledge in this field, but rather a  novel discovery made by the applicant in their research. In addition, the tracing of the causes of the technical defect and the process of thinking and analyzing how to overcome it are also the gradual analysis results of the applicant in the actual research process and are not universal knowledge in this field.

[0031] Fig. 1 is an exemplary schematic diagram of a system for protecting sensitive information according to an embodiment of the present disclosure. As shown in Figure 1, the system includes: a first LLM 42, configured to receive a first text 51 comprises a prompt and an input text, wherein the prompt instructs the first LLM 42 to perform a replacement processing on sensitive information in the input text to generate a second text 52, the input text comprises an instance of the sensitive information; and a converter 43, configured to determine a mapping relationship between the instance in the first text 51 and a replacement description of the instance in the second text 52, and replace the replacement description in a response text 53 of the second text 52 with the instance based on the mapping relationship.

[0032] In one embodiment, the converter 43 is configured to store a table storing the mapping relationship. In one embodiment, the system comprising: a selector 50, configured to determine a hardware attribute of a device running the first LLM 42, select a LLM that matches the hardware attribute from a LLM set comprising multiple LLMs, and determine the selected LLM as the first LLM 42.

[0033] In one embodiment, the system comprising: a second LLM, configured to generate the response text. In one embodiment, the first LLM 42 is located in a client, the second LLM is located in a server remotely located from the client, and the number of model parameters of the second LLM is greater than that of the first LLM 42.

[0034] Fig. 2 is an exemplary flowchart of a method for protecting sensitive information according to an embodiment of the present disclosure. The method is applicable to a client. As shown in Figure 1, the method includes:

[0035] Step 101: receiving a first text for a first LLM, the first text comprises a prompt and an input text, wherein the prompt instructs the first LLM to perform a replacement processing on sensitive information in the input text to generate a second text, the input text comprises an instance of the sensitive information.

[0036] For example, inputting a first text into a first LLM. Here, users can generate the first text by various text generation tools, such as text editors. The first text contains a prompt and input text. Among them, the prompt is a system command provided to the first LLM, configured to instruct the first LLM to replace sensitive information in the input text. For example, prompt can be implemented as several statements described in natural language. The input text contains instances of sensitive information. The input text can be implemented as natural language or code, and so on. The first LLM replaces instances of sensitive information in the input text based on the prompt.

[0037] In one embodiment, sensitive information may include biometric information, specific identity information, medical and health information, financial account information, tracking information, and other privacy information.

[0038] An instance of sensitive information is an actual example of sensitive information.

[0039] Example 1: A prompt represented in natural language in the first text instructs the first LLM to replace a personal phone number in the input text. That is to say, the prompt specifies personal phone number as sensitive information, without providing any specific personal phone numbers (i.e. instances of personal phone number) in the prompt. The input text contains instances of sensitive information. For example, an instance of phone number in the input text is: "133########" . Therefore, the first LLM recognizes "133########" in input text as phone number based on natural language processing and performs replacement processing on "133########" in input text.

[0040] Example 2: A prompt represented in natural language in the first text instructs the first LLM to replace personal address in the input text. That is to say, the prompt specifies personal address as sensitive information, without providing any specific personal addresses (i.e. instances of personal addresses) in the prompt. The input text contains instances of sensitive information. For example, an instance of personal address in the input text is: "########, Haidian district, Beijing city" . Therefore, the first LLM recognizes "########, Haidian district, Beijing city" in input text as personal address based on natural language processing and performs replacement processing on "########, Haidian district, Beijing city" in input text.

[0041] Example 3: A prompt represented in natural language in the first text instructs the first LLM to replace email address in the input text. That is to say, the prompt specifies Email address as sensitive information, without providing any specific Email address (i.e. instances of email address) in the prompt. The input text contains instances of sensitive information. For example, an instance of email address in the input text is: "abc@abc. com " . Therefore, the first LLM recognizes "abc@abc. com " in input text as email address based on natural language processing and performs replacement processing on "abc@abc. com" in input text.

[0042] In one embodiment, the prompt comprises a replacement method of the sensitive information, and the instance of the sensitive information is replaced in the second text based on the replacement method. Therefore, in the second text output by the first LLM, instances of sensitive information in the input text are replaced with equivalent descriptions that do not affect processing of second LLM.

[0043] Example: The specific prompt may include: "In any text where passwords appear, they usually start with 'password=' followed by the actual password value. Please replace these password values with 'pass to replace' " .

[0044] Therefore, by indicating replacement method of sensitive information in the prompt, it is convenient for the  first LLM to perform quick replacement of sensitive information.

[0045] In one embodiment, an example of a replacement method that further includes sensitive information is provided to facilitate the first LLM's understanding of the replacement method for sensitive information.

[0046] For example, the prompt may include: "For example, replace 'password=" 123456" ' with 'password=" pass to replace" " .

[0047] In one embodiment, the prompt further instructs the first LLM not to modify remaining text in the input text except for the sensitive information. Therefore, the first LLM does not modify the rest of the input text except for instances of sensitive information. That is to say, the rest of the input text, except for instances of sensitive information, remains unchanged. Therefore, merely replacing instances of sensitive information in the input text while retaining the rest of the content except for the instances of sensitive information.

[0048] In one embodiment, the first text contains a delimiter between the prompt and the input text. Among them, the delimiter can be implemented as:

[0049] (1) Pre defined special separators: For example, most Transformer based LLM models come with a set of pre-defined special tags (tokens) . For example, Llama-2 uses<<SYS>>as a special token to indicate the start and end of system prompts, while BERT uses [CLS] , [SEP] , and so on.

[0050] (2) Custom special tags: If there are specific use cases that require additional special tags, the tags can be defined by users. For example, both ##Instruction: and ##Input: are custom special tags used to inform the model that the next instruction or input is to follow.

[0051] Therefore, based on the delimiter contained in the first text, the first LLM can easily distinguish the prompt from the input text.

[0052] In one embodiment, the prompt is intermixed with the input text in the first text without using separators for differentiation.

[0053] For example, the prompt for the example is as follows:

[0054] "I need your help to process some text data. This data contains some sensitive information that I do not want to be seen externally. The specific tasks are as follows: In any text where passwords appear, they usually start with 'password=' followed by the actual password value. Please replace these password values with 'pass-to-replace' . For example, replace 'password= "123456" ' with 'password= "pass-to-replace" ' . For file paths, we need to hide the specific disk location. If the path starts with a drive letter, such as 'd: ', please replace the entire drive letter and path with a generic identifier, such as 'x: \path\to' . For example, replace 'd: \sec\ab' with 'x: \path\to\ab' . Please ensure the replacement operation does not change other parts of the text, only modifying the specified sensitive information. Please apply these operations to all the code I send you. Do not write a program to implement this,  but rather return the code I give you with the above replacements applied. "

[0055] In this scenario, if a user sends a piece of code to the online LLM for modification or improvement, the first LLM will replace sensitive information according to the custom prompt before sending it to the second LLM. For example, in the original code, 'password=mima' will be replaced with 'password=pass-to-replace' , and related file paths will be replaced with 'x: \path\to\ab' . This processed information is then sent to the second LLM for processing and response generation. Meanwhile, an assistant module (In the following description, this module is referred to as a converter) of the first LLM compares the original and processed texts to generate a list of changes, recording which texts were replaced. When the assistant module receives the response from the second LLM, it restores the replaced texts to ensure the user receives an effective result without needing to make adjustments. Thus, an interaction protected by the first LLM is completed.

[0056] The input text is the text that requires the second LLM to process. Before inputting the input text into the second LLM, text processing capability of the first LLM is utilized to replace instances of sensitive information in the input text, preventing direct exposure of sensitive information to the second LLM and improving information security.

[0057] Step 102: determining a mapping relationship between the instance in the input text and a replacement description of the instance in the second text.

[0058] Here, the second text is the text output by the first LLM after performing replacement processing on instances of sensitive information in the input text.

[0059] Example: Assuming the input text is: "The user's email address is: aaa@mail. com " , the second text can be: "The user's email address is email to replace" . Instance of email address ( "aaa@mail. com" ) has been replaced by a replacement description ( "email to replace" ) in the second text.

[0060] Here, a comparison is made between the second text and the input text to determine the text (i.e., the replaced description) in which the first LLM performs replacement processing on instances of sensitive information in the input text. Moreover, record the mapping relationship between instances and their replaced descriptions.

[0061] Example 1: Assuming the instance of sensitive information (password) in the input text is "123456" , which has been replaced as "pass to replace" , then establish a mapping relationship between "123456" and "pass to replace" .

[0062] Example 2: Assuming the instance of sensitive information (email) in the input text is "abc###@##. com" , which has been replaced with "email to replace" , then establish a mapping relationship between "abc###@##. com " and "email to replace" .

[0063] Step 103: receiving a response text of the second text from a second LLM.

[0064] After replacing instances of sensitive information in the input text, the second text is obtained. The second text serves as input text for a second LLM, which performs tasks such as text classification, question answering, and dialogue based on the second text, and generate a respective response text (hereinafter referred to as the third text) corresponding to specific task of the second LLM. The second LLM generates response text (i.e., third text) for the second text is based on a predetermined task such as machine translation, text summarization, code checking, and question answering systems.

[0065] Step 104: replacing the replacement description in the response text with the instance based on the mapping relationship.

[0066] Example 1: Assuming that the third text contains "pass to replace" , replace it with "123456" according to the mapping relationship.

[0067] Example 2: Assuming that the third text contains "email to replace" , replace it with "abc###@##. com" according to the mapping relationship.

[0068] Therefore, before inputting the input text into the second LLM, text processing capability of the first LLM is utilized to replace instances of sensitive information in the input text, preventing the exposure of sensitive information to the second LLM and improving information security. Moreover, the mapping relationship between instances and respective replacement descriptions is also recorded, and the replacement descriptions in the third text are replaced with respective instances based on the mapping relationship, thereby ensuring the readability of the output text of the second LLM. Moreover, embodiments of the present disclosure may select first LLM that matches hardware capability of a device running the first LLM, thus expanding its applicability.

[0069] In one embodiment, the method includes: determining a hardware attribute of a device running the first LLM; selecting a LLM that matches the hardware attribute from a LLM set comprising multiple LLMs; determining the selected LLM as the first LLM. Preferably, hardware attributes include GPU memory, floating-point computing capability, parallel processing capability, vertex and pixel processing, and general computing capability of the device running the first LLM. For example, if GPU memory of the device running the first LLM is small, LLM with fewer model parameters can be selected from the LLM set as the first LLM. The selected LLM should support the language format of the first text. For example, assuming the first text is in Chinese, the selected first LLM supports Chinese.

[0070] In one embodiment, the method includes: generating the first text on the device running the first LLM; wherein the second LLM is located remotely from the device, and the number of model parameters of the second LLM is greater than that of the first LLM.

[0071] Therefore, by replacing sensitive information in the input text on the device side running the first LLM, it prevents sensitive information from being exposed to the second LLM located remotely from the device, improves information security, and allows for normal calling of the second LLM with powerful capabilities (corresponding to a larger number of model parameters) . Moreover, by utilizing mapping relationship to replace the replacement descriptions in the third text with respective instances, the readability of the output text of the second LLM is ensured.

[0072] The first LLM and the second LLM may belong to same sequence of LLMs, or they can belong to different sequences of LLMs. For example, the first LLM and the second LLM can be implemented as different versions of GPT series. For example, the first LLM is implemented as GPT-3, and the second LLM is implemented as GPT-4. Alternatively, the first LLM may be implemented as GPT-3, while the second LLM may be implemented as BERT, T5, XLNet, PaLM, Galactica, LLaMA, ChatGLM, and so on.

[0073] Fig. 3 is an exemplary schematic diagram of a process of protecting sensitive information according to an embodiment of the present disclosure. As shown in Figure 3, user 20 inputs first text 22 in APP 21. The first text 22 contains a prompt and input text, the prompt is used to instruct a first LLM23 to perform replacement processing on sensitive information in the input text, and the input text contains specific instances of sensitive information.

[0074] The first text 22 is inputted into the first LLM23 at the hardware device where the application 21 is located. The first LLM23 performs text replacement on specific instances of sensitive information in the input text based on prompt guidance to generate the second text 24. Converter 27 compares the input text in the first text 22 with the second text 24, and determines mapping relationship between instances of sensitive information and their replacement descriptions based on the comparison results. Converter 27 stores the mapping relationship between instances and their replaced descriptions in Table 28. For example, establish the mapping relationship between the password instance "123456" and the replaced description "pass to replace" . The second text 24 is input into the second LLM25. The second LLM25 is located remotely from the hardware device where application 21 is located. The second LLM25 has stronger processing capabilities than the first LLM, for example, the number of model parameters in the second LLM25 is greater than that in the first LLM. The second LLM25 generates a response text for the second text 24, which is the third text 26, based on predetermined tasks such as machine translation, text summarization, code checking, and question answering systems.

[0075] Converter 27 replaces the replacement descriptions in third text 26 with respective instances based on Table 28. For example, assuming that the third text 26 contains a description of "pass to replace" , converter 27 replaces the "pass to replace" with the description of "123456" based on Table 28. Then, converter 27 provides the replaced  third text 29 to APP 21 for user viewing.

[0076] The technical features that distinguish embodiments of the present disclosure from the prior art include at least one of the followings.

[0077] (1) It is not limited to a specific local LLM (such as first LLM) . It may choose a suitable local model based on different scenarios and hardware, adapting to more situations. For example, if the GPU memory is small, a model with fewer parameters can be chosen. If the input is in Chinese, a model with good support for Chinese can be selected.

[0078] (2) Throughout the entire process, the user is unaware of any extra steps. Once configured, it is the same as directly communicating with the online LLM (such as second LLM) . Although the user sends sensitive information, it is not sent to the online LLM but is processed only within the local LLM. The received response corresponds exactly to the information sent by the user.

[0079] (3) The converter ensures the quality of the replacement, preventing errors due to incorrect judgments by the local LLM.

[0080] Fig. 4 is an exemplary schematic diagram of a Table storing instances and respective replacement descriptions according to an embodiment of the present disclosure. In the Table, there is mapping relationship between instances 30 and respective replacement descriptions 40.

[0081] Example 1: The mapping relationship between instance of the password: "123456" and its replacement description: "pass to replace" .

[0082] Example 2: The mapping relationship between instance of storage path: "d: \sec \ab" and its replacement description: "x: \path \to \ab" .

[0083] Example 3: The mapping relationship between instance of phone: "400-111-222" and its replacement description: "400-XXXX-XXXX" .

[0084] Fig. 5 is an exemplary schematic diagram of a system for protecting sensitive information according to an embodiment of the present disclosure. As shown in Figure 5, the system includes a client 41, a converter 43 and a server 44. The client 41 includes a first LLM 42 and the server 44 comprises a second LLM 45. The client 41 is configured to input a first text into the first LLM 42, the first text comprises a prompt and an input text, the prompt instructs the first LLM 42 to perform a replacement processing on sensitive information in the input text, and the input text comprises an instance of the sensitive information; receive a second text from the first LLM 42, and send the second text to the server 44. The converter 43 is configured to receive the second text from the first LLM 42, and determine a mapping relationship between the instance and a replacement description of the instance in the second text based on a comparison result of the second text and the input text. The server 44 is configured  to input the second text into the second LLM 45; and the converter 43 is further configured to receive a third text from the second LLM 45, replace the replacement description in the third text with the instance based on the mapping relationship, and send the replaced third text to the client 41.

[0085] In one embodiment, the converter 43 is integrated in the client 41, and the converter 43 comprises a Table storing the mapping relationship; the client 41 is further configured to determine a hardware attribute of a device running the first LLM 42, select a LLM that matches the hardware attribute from a LLM set comprising multiple LLMs, and determine the selected LLM as the first LLM 42.

[0086] Converter may be implemented as hardware, firmware or software, and embodiments of the present disclosure are not limited to this. Client 41 may be implemented as any terminal, such as a personal computer, handheld computer, laptop, personal digital assistant or smartphone, and so on. Server 44 may be located in a remote cloud.

[0087] Fig. 6 is an exemplary structural diagram of an apparatus for protecting sensitive information according to an embodiment of the present disclosure. As shown in Figure 6, the apparatus for protecting sensitive information includes: an receiving module 501, configured to receive a first text for a first LLM, the first text comprises a prompt and an input text, wherein the prompt instructs the first LLM to perform a replacement processing on sensitive information in the input text to generate a second text, the input text comprises an instance of the sensitive information; a determining module 502, configured to determine a mapping relationship between the instance and a replacement description of the instance in the second text; a receiving module 503, configured to receive a response text of the second text from a second LLM; and a replacing module 504, configured to replace the replacement description in the response text with the instance based on the mapping relationship.

[0088] In one embodiment, the prompt comprises a replacement method of the sensitive information, and the instance of the sensitive information is replaced in the second text based on the replacement method. In one embodiment, the prompt further instructs the first LLM not to modify remaining text in the input text except for the sensitive information. In one embodiment, the first text comprises a delimiter between the prompt and the input text.

[0089] In one embodiment, the receiving module 501 is configured to determine a hardware attribute of a device running the first LLM, select a LLM that matches the hardware attribute from a LLM set comprising multiple LLMs, and determining the selected LLM as the first LLM. In one embodiment, the first text is generated on a device running the first LLM, the second LLM is located remotely from the device, and the number of model parameters of the second LLM is greater than that of the first LLM.

[0090] In summary, embodiments of the present disclosure use a local LLM to process information sent to an online  large model. Sensitive or private information, or information that the user does not want the online LLM to receive is replaced with an equivalent description that does not affect processing of the online LLM. The type of local LLM is not limited, but it should support the input language. Before formal use, a simple configuration is required, guiding the local LLM through a prompt to replace the input text and return the modified text. During the replacement process, a converter compares the original and replaced texts to record some key-value pairs of the replacements. For stronger local models, the local LLM can directly output the results, while for weaker ones, additional programs can be used to compare the texts directly and record the replacements. After sending the processed text to the online LLM, the results processed by the online LLM undergo reverse replacement. The replaced content is then displayed to the user, completing the process.

[0091] Embodiments of the present disclosure also propose an electronic device with a processor memory architecture. Fig. 7 is an exemplary structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in Figure 7, electronic device 600 includes a processor 601, a memory 602, and a computer program stored on memory 602 that can run on processor 601. When the computer program is executed by processor 601, the method for protecting sensitive information. as described in either of the above is implemented. Among them, memory 602 can be implemented as various storage media such as electrically erasable programmable read-only memory (EEPROM) , flash memory, programmable program read-only memory (PROM) , etc. Processor 601 can be implemented to include one or more central processors or one or more field programmable gate arrays, wherein the field programmable gate array integrates one or more central processor cores. Specifically, the central processing unit or core can be implemented as a CPU, MCU, DSP, and so on.

[0092] It should be noted that not all steps and modules in the above processes and structural diagrams are necessary, and some steps or modules can be ignored according to actual needs. The execution sequence of each step is not fixed and can be adjusted as needed. The division of each module is only for the convenience of describing the functional division used. In actual implementation, a module can be divided into multiple modules, and the functions of multiple modules can also be implemented by the same module. These modules can be in the same device or different devices.

[0093] The hardware modules in each implementation can be implemented mechanically or electronically. For example, a hardware module can include specially designed permanent circuits or logic devices (such as dedicated processors, such as FPGA or ASIC) to complete specific operations. Hardware modules can also include programmable logic devices or circuits temporarily configured by software (such as general-purpose processors or other programmable processors) for performing specific operations. As for the specific use of mechanical methods, either dedicated permanent circuits or temporarily configured circuits (such as software configuration) to  implement hardware modules, it can be determined based on cost and time considerations.

[0094] The above is only a preferred embodiment of the present disclosure and is not intended to limit the scope of protection of the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1.A system for protecting sensitive information, comprising:a first Large Language Model (LLM) (42) , configured to receive a first text (51) comprises a prompt and an input text, wherein the prompt instructs the first LLM (42) to perform a replacement processing on sensitive information in the input text to generate a second text (52) , the input text comprises an instance of the sensitive information; anda converter (43) , configured to determine a mapping relationship between the instance in the first text (51) and a replacement description of the instance in the second text (52) , and replace the replacement description in a response text (53) of the second text (52) with the instance based on the mapping relationship.2.The system according to claim 1, wherein the converter (43) is configured to store a table storing the mapping relationship.3.The system according to claim 1, comprising:a selector (50) , configured to determine a hardware attribute of a device running the first LLM (42) , select a LLM that matches the hardware attribute from a LLM set comprising multiple LLMs, and determine the selected LLM as the first LLM (42) .4.The system according to claim 1, comprising:a second LLM (45) , configured to generate the response text (53) .5.The system according to claim 4, wherein the first LLM (42) is located in a client (41) , the second LLM (45) is located in a server (44) , and the number of model parameters of the second LLM (45) is greater than that of the first LLM (42) .6.A method for protecting sensitive information, the method is applicable to a client, the method comprising:receiving (101) a first text for a first LLM, the first text comprises a prompt and an input text, wherein the prompt instructs the first LLM to perform a replacement processing on sensitive information in the input text to generate a second text, the input text comprises an instance of the sensitive information;determining (102) a mapping relationship between the instance in the input text and a replacement description of the instance in the second text;receiving (103) a response text of the second text from a second LLM; andreplacing (104) the replacement description in the response text with the instance based on the mapping relationship.7.The method according to claim 6, wherein the prompt comprises a replacement method of the sensitive information; the instance of the sensitive information is replaced in the second text by the first LLM based on the  replacement method.8.The method according to claim 6, wherein the prompt further instructs the first LLM not to modify remaining text in the input text except for the sensitive information.9.The method according to claim 6, wherein the first text comprises a delimiter between the prompt and the input text.10.The method according to claim 6, wherein the first LLM is located in the client, the method further comprises:determining a hardware attribute of the client;selecting a LLM that matches the hardware attribute from a LLM set comprising multiple LLMs;determining the selected LLM as the first LLM.11.The method according to claim 10, wherein the second LLM is located remotely from the client, and the number of model parameters of the second LLM is greater than that of the first LLM.12.An apparatus for protecting sensitive information, comprising:an receiving module (501) , configured to receive a first text for a first LLM, the first text comprises a prompt and an input text, wherein the prompt instructs the first LLM to perform a replacement processing on sensitive information in the input text to generate a second text, the input text comprises an instance of the sensitive information;a determining module (502) , configured to determine a mapping relationship between the instance and a replacement description of the instance in the second text;a receiving module (503) , configured to receive a response text of the second text from a second LLM; anda replacing module (504) , configured to replace the replacement description in the response text with the instance based on the mapping relationship.13.An electronic device, comprising a processor (601) and a memory (602) , wherein an application program executable by the processor (601) is stored in the memory (602) for causing the processor (601) to execute a method for protecting sensitive information according to any one of claims 6-11.14.A computer-readable medium comprising computer-readable instructions stored thereon, wherein the computer-readable instructions for executing a method for protecting sensitive information according to any one of claims 6-11.15.A computer program product comprising a computer program, upon the computer program is executed by a processor for executing a method for protecting sensitive information according to any one of claims 6-11.

Citation Information

Patent Citations

  • Sensitive information protection method, device and system and readable storage medium

    CN118211249A

  • Information desensitization method and device based on large language model

    CN118296644A

  • Secure Translation of Sensitive Content

    US20210326537A1

  • Methods and systems for prompting large language model to process inputs from multiple user elements

    US20240256762A1