A privacy protection method for large language models
By using graph databases in the large language model to identify and classify entities and accurately desensitize private entities, the problems of privacy information protection and information integrity in the large language model are solved, and task processing capabilities and user privacy protection effects are improved.
Patent Information
- Application Number
- CN202410979490.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-07-22
AI Technical Summary
The prior art faces problems in large language models that the accuracy and completeness of graph databases, difficulties in calculating important correlation evaluation coefficients of word segmentation in different dimensions, difficulties in determining thresholds for high-frequency privacy information clusters, and difficult to guarantee the accuracy of desensitized replacement text sequences.
The data preprocessing module is used to process natural language sentence breaking, word segmentation and punctuation marks. The entity recognition module uses named entity recognition technology to identify potential entities. The graph database module stores and manages public entity information. The entity classification module classifies entities based on the graph database query results. The information desensitization module desensitizes private entity information. The result output module outputs the processed prompt words.
The graph database accurately identifies and distinguishes public entities from private entities, only desensitizes private entities, retains public entity information, ensures that the large language model receives complete information, and improves task processing capabilities and user privacy protection effects.
Smart Images

Figure CN118965426B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of privacy protection, and in particular to a processing method for privacy protection of a large language model. Background Art
[0002] With the rapid development of Large Language Model (LLM) technology, its application in natural language processing tasks is becoming more and more extensive, such as text generation, machine translation, question-answering systems, etc. However, when using LLM to process tasks, the prompt word (Prompt) entered by the user may contain the user's private information, such as home address, mobile phone number, name, etc. How to effectively protect this private information and prevent it from being leaked has become an important issue in LLM applications.
[0003] According to the Chinese patent announcement number: CN117521116B, a method for protecting privacy information of a large language model is disclosed, including: obtaining relevant parameters of a large language model; preprocessing the obtained relevant parameters of the large language model to obtain word segmentation data of different dimensions, calculating the same semantic set of word segmentation data of different dimensions according to the relevant parameters of the large language model and calculating the important correlation evaluation coefficient of word segmentation of different dimensions; obtaining synonym word forest encoding using the relevant parameters of the large language model, calculating the correlation similarity index of word segmentation of different dimensions at different times, calculating the clustering evaluation function according to the correlation similarity index of word segmentation of different dimensions at different times and obtaining high-frequency privacy information clusters; obtaining a desensitized replacement text sequence for the relevant parameters of the large language model according to the high-frequency privacy information clusters, and protecting the privacy information of the large language model according to the desensitized replacement text sequence. The present invention improves the reliability of protecting the privacy information of the large language model. However, the method still faces challenges such as how to ensure the accuracy and integrity of the graph database, how to calculate the important correlation evaluation coefficient of word segmentation of different dimensions, how to determine the threshold of the high-frequency privacy information cluster, and how to ensure the accuracy of the desensitized replacement text sequence. Therefore, developing more intelligent, flexible and accurate privacy protection methods is an important direction to promote the development of large language model applications. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention provides a processing method for privacy protection of a large language model, which solves the challenges still faced by the prior art, such as how to ensure the accuracy and integrity of the graph database, how to calculate the important correlation evaluation coefficients of word segmentations in different dimensions, how to determine the threshold of high-frequency privacy information clusters, and how to ensure the accuracy of desensitized replacement text sequences.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: A processing method for privacy protection of a large language model, comprising:
[0006] A data preprocessing module is used to perform natural language sentence segmentation, word segmentation and punctuation processing on the input prompt words;
[0007] The entity recognition module uses named entity recognition technology to identify potential entity information from the preprocessed prompt words;
[0008] Graph database module, which stores and manages known public entity information and provides a query interface;
[0009] The entity classification module classifies the identified entities into public entity information and private entity information based on the query results of the graph database;
[0010] The information desensitization module desensitizes the identified private entity information while retaining the public entity information;
[0011] The result output module outputs the processed prompt words for use by the large language model.
[0012] Preferably, the data preprocessing module further includes:
[0013] A natural language segmentation unit, which is used to segment the prompt words into independent sentences;
[0014] word segmentation units, which are used to divide sentences into independent words;
[0015] The punctuation processing unit is used to remove or replace punctuation marks in a sentence.
[0016] Preferably, the entity recognition module uses a named entity recognition model based on deep learning, such as a BiLSTM-CRF model, which combines the advantages of a bidirectional long short-term memory network (BiLSTM) and a conditional random field (CRF) for sequence labeling tasks, such as named entity recognition;
[0017] BiLSTM: BiLSTM is a recurrent neural network (RNN) that can capture long-distance dependencies in sequence data. BiLSTM consists of two directional long short-term memory networks (LSTMs) that process the forward and backward information of the sequence respectively, thereby obtaining a complete representation of the sequence. The BiLSTM model consists of two directional long short-term memory networks (LSTMs) that process the forward and backward information of the sequence respectively, thereby obtaining a complete representation of the sequence. Its calculation formula is as follows:
[0018]
[0019] in, and are the backward and forward hidden states of the LSTM model at time step t, x tis the feature vector of the input sequence at time step t, Represents vector concatenation;
[0020] CRF: CRF is a probabilistic graph model that can model sequence labels and consider the constraints between labels. CRF can consider the correlation between adjacent labels when predicting labels, thereby improving the accuracy of label prediction. The CRF model is used to model sequence labels and consider the constraints between labels. Its calculation formula is as follows:
[0021]
[0022] P(y t |y<t)=exp(θ T f(y<t,x t ))
[0023] f(y<t,x t )=[f1(y<t,x t ),f2(y<t,x t ),...,f n (y<t,x t )]
[0024] θ=θ1,θ2,...,θ n
[0025] Among them, P(y t |y<t) is the probability of the tth label given the first t-1 labels, P(y t ,y<t) is the joint probability given the first t-1 labels and the tth label, f(y<t,x t ) is the characteristic function, θ is the model parameter;
[0026] By combining BiLSTM and CRF, the BiLSTM-CRF model can better capture the long-distance dependencies in sequence data and consider the constraint relationship between labels, thereby improving the accuracy of named entity recognition.
[0027] Preferably, the graph database module uses the Neo4j system to store entity information and the relationships between them;
[0028] It uses a graph structure to store data, where nodes represent entities and edges represent relationships between entities. Neo4j supports using the Cypher query language to query and operate graph data. The specific steps are as follows:
[0029] Step 1: In the preprocessed prompt words, the entity recognition module uses named entity recognition technology to identify potential entity information; this can be achieved through rule-based methods or deep learning-based methods; rule-based methods may involve the use of regular expression matching or dictionary matching, while deep learning-based methods may involve the use of LSTM or BERT models, etc.
[0030] Step 2: The entity classification module classifies the identified entities into public entity information and private entity information based on the query results of the graph database; this may involve using graph-based algorithms, such as community detection algorithms to identify entity sets, and using graph traversal algorithms to determine the association relationships between entities;
[0031] Step 3: The information desensitization module desensitizes the identified private entity information; this may involve the use of substitution desensitization techniques, such as replacing private entities with predefined mask symbols; the selection of desensitization strategies may be based on the type and sensitivity of the entity;
[0032] Step 4: The graph database module uses a graph database management system, such as Neo4j, to store entity information and the relationships between them; the query algorithm may involve using the Cypher query language to retrieve information related to a specific entity through a graph traversal algorithm such as depth-first search (DFS) or breadth-first search (BFS).
[0033] Preferably, the entity classification module includes:
[0034] An entity query unit, used to send a query request to the graph database according to the identified entity information;
[0035] The result parsing unit is used to parse the query results returned by the graph database and determine whether the entity information belongs to a public entity or a private entity.
[0036] Preferably, the information desensitization module adopts a replacement desensitization technology, such as replacing private entities with predefined mask symbols.
[0037] Preferably, the result output module includes:
[0038] A desensitized text generation unit, used to generate desensitized text according to the entity information after desensitization processing;
[0039] The text reconstruction unit is used to splice the desensitized text with other non-entity information to form a complete prompt word.
[0040] Preferably, the graph database module also includes: an entity association relationship unit, which is used to store and manage the association relationships between entities, such as hierarchical relationships, synonymous relationships, etc., so that the entity classification module can more accurately determine the attributes of the entity information.
[0041] Preferably, the entity recognition module further includes: an entity type recognition unit for identifying the type of entity, such as a person's name, a place name, an organization name, etc., so that the entity classification module can perform more detailed classification.
[0042] Preferably, the information desensitization module also includes: a desensitization strategy selection unit, which selects a suitable desensitization strategy according to the type and sensitivity of the entity, such as replacement desensitization, encryption desensitization, anonymization desensitization, etc., to improve the effect of privacy protection, and uses a graph database to distinguish between public entity information and private entity information. The privacy protection processing method effectively solves the problem of incomplete prompt word information in the prior art. By retaining the public entity information in the prompt word, the present invention ensures that the large language model can receive complete information, thereby improving the task processing capability of the large language model when processing prompt words containing privacy information.
[0043] Beneficial Effects
[0044] The present invention provides a method for privacy protection of a large language model. Compared with the prior art, it has the following beneficial effects:
[0045] 1. In the present invention, by using the graph database to accurately identify and distinguish public entities and private entities, only the private entities are desensitized, thereby retaining the public entity information in the prompt word, ensuring that the LLM can receive complete public information, and the LLM can better understand the user's intention and accurately complete specific tasks, thereby being able to more accurately understand the user's intention and provide more accurate answers. By retaining the public entity information in the prompt word, the present invention ensures that the large language model can receive complete information, thereby improving the task processing ability of the large language model when processing prompt words containing private information. At the same time, the present invention uses precise desensitization technology to only desensitize the user's private information. The information is desensitized, which effectively protects the privacy of users and avoids the risk of leakage of user privacy information, thereby enhancing the user's trust in the large language model. The present invention has broad application prospects in various fields, such as intelligent customer service, intelligent search, intelligent writing, intelligent health, intelligent finance, etc., and can effectively improve user experience and application effects. The present invention avoids the problem of public information being lost by mistake in traditional methods, ensures that LLM can obtain complete information, thereby improving the task processing ability of LLM. LLM can better understand user intentions and accurately complete specific tasks, avoiding the inconvenience caused by information loss, thereby improving user experience and application effects;
[0046] 2. The present invention effectively protects user privacy and security, avoids the risk of user privacy information leakage, thereby enhancing users' trust in LLM. Users can use LLM to process various tasks more confidently, thus promoting the widespread application and popularization of LLM. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a system block diagram of a large language model privacy protection processing method proposed by the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] Embodiment 1:
[0050] The present invention provides a large language model privacy protection processing method, comprising: a data preprocessing module, used for natural language sentence segmentation, word segmentation and punctuation processing of input prompt words;
[0051] The entity recognition module uses named entity recognition technology to identify potential entity information from the preprocessed prompt words;
[0052] Graph database module, which stores and manages known public entity information and provides a query interface;
[0053] The entity classification module classifies the identified entities into public entity information and private entity information based on the query results of the graph database;
[0054] The information desensitization module desensitizes the identified private entity information while retaining the public entity information;
[0055] The result output module outputs the processed prompt words for use by the large language model.
[0056] In the present invention, preferably, the data preprocessing module further includes:
[0057] A natural language segmentation unit, which is used to segment the prompt words into independent sentences;
[0058] word segmentation units, which are used to divide sentences into independent words;
[0059] The punctuation processing unit is used to remove or replace punctuation marks in a sentence.
[0060] In the present invention, preferably, the entity recognition module adopts a deep learning named entity recognition model, specifically a BiLSTM-CRF model, which combines a bidirectional long short-term memory network (BiLSTM) and a conditional random field (CRF) for a common sequence labeling task;
[0061] The BiLSTM captures the long-distance dependency in the sequence data and is composed of a long short-term memory network (LSTM) in two directions, which processes the forward and backward information of the sequence respectively, thereby obtaining a complete representation of the sequence. The BiLSTM model is composed of a long short-term memory network (LSTM) in two directions, which processes the forward and backward information of the sequence respectively, thereby obtaining a complete representation of the sequence; its calculation formula is as follows:
[0062]
[0063] in, and are the backward and forward hidden states of the LSTM model at time step t, x t is the feature vector of the input sequence at time step t, Represents vector concatenation;
[0064] CRF models sequence labels and considers the constraints between labels. CRF can consider the correlation between adjacent labels when predicting labels, thereby improving the accuracy of label prediction. The CRF model is used to model sequence labels and consider the constraints between labels. Its calculation formula is as follows:
[0065]
[0066] P(y t |y<t)=exp(θ T f(y<t,x t ))
[0067] f(y<t,x t )=[f1(y<t,x t ),f2(y<t,x t ),...,f n (y<t,x t )]
[0068] θ=θ1,θ2,...,θ n
[0069] Among them, P(y t |y<t) is the probability of the tth label given the first t-1 labels, P(y t ,y<t) is the joint probability given the first t-1 labels and the tth label, f(y<t,x t ) is the characteristic function, θ is the model parameter;
[0070] By combining BiLSTM and CRF, the BiLSTM-CRF model can better capture the long-distance dependencies in sequence data and consider the constraint relationship between labels, thereby improving the accuracy of named entity recognition.
[0071] In the present invention, preferably, the graph database module adopts the Neo4j system to store entity information and the relationship between them;
[0072] It uses a graph structure to store data, where nodes represent entities and edges represent relationships between entities. Neo4j supports using the Cypher query language to query and operate graph data. The specific steps are as follows:
[0073] Step 1: In the preprocessed prompt words, the entity recognition module uses named entity recognition technology to identify potential entity information; this can be achieved through rule-based methods or deep learning-based methods; rule-based methods may involve the use of regular expression matching or dictionary matching, while deep learning-based methods may involve the use of LSTM or BERT models, etc.
[0074] Step 2: The entity classification module classifies the identified entities into public entity information and private entity information based on the query results of the graph database; this may involve using graph-based algorithms, such as community detection algorithms to identify entity sets, and using graph traversal algorithms to determine the association relationships between entities;
[0075] Step 3: The information desensitization module desensitizes the identified private entity information; this may involve the use of substitution desensitization techniques, such as replacing private entities with predefined mask symbols; the selection of desensitization strategies may be based on the type and sensitivity of the entity;
[0076] Step 4: The graph database module uses a graph database management system, such as Neo4j, to store entity information and the relationships between them; the query algorithm may involve using the Cypher query language to retrieve information related to a specific entity through a graph traversal algorithm such as depth-first search (DFS) or breadth-first search (BFS).
[0077] In the present invention, preferably, the entity classification module includes:
[0078] An entity query unit, used to send a query request to the graph database according to the identified entity information;
[0079] The result parsing unit is used to parse the query results returned by the graph database and determine whether the entity information belongs to a public entity or a private entity.
[0080] In the present invention, preferably, the information desensitization module adopts a replacement desensitization technology, such as replacing a private entity with a predefined mask symbol.
[0081] In the present invention, preferably, the result output module includes:
[0082] A desensitized text generation unit, used to generate desensitized text according to the entity information after desensitization processing;
[0083] The text reconstruction unit is used to splice the desensitized text with other non-entity information to form a complete prompt word.
[0084] In the present invention, preferably, the graph database module also includes: an entity association relationship unit, which is used to store and manage the association relationships between entities, such as hierarchical relationships, synonymous relationships, etc., so that the entity classification module can more accurately determine the attributes of the entity information.
[0085] In the present invention, preferably, the entity recognition module further includes: an entity type recognition unit for identifying the type of entity, such as a person's name, a place name, an organization name, etc., so that the entity classification module can perform more detailed classification.
[0086] In the present invention, preferably, the information desensitization module also includes: a desensitization strategy selection unit, which selects a suitable desensitization strategy according to the type and sensitivity of the entity, such as replacement desensitization, encryption desensitization, anonymization desensitization, etc., to improve the effect of privacy protection.
[0087] Embodiment 2:
[0088] The user queries the package delivery information through the intelligent logistics platform. The input prompt word contains the address information. The data preprocessing module: The prompt word "Please deliver the package to No. 218, C Road, District B, City A." is processed by natural language sentence segmentation, word segmentation and punctuation to obtain the word segmentation result: "Please / deliver / the / package / to / No. 218, C Road, District B, City A."
[0089] Entity recognition module: Use named entity recognition technology to identify potential entities: "City A", "District B", "Road C", and "No. 218".
[0090] Graph database module: Call the graph database query and get the following results:
[0091] "City A": Public entity
[0092] “Zone B”: Public Entities
[0093] "Route C": Public Entity
[0094] "No. 218": Private entity
[0095] Entity classification module: Based on the query results of the graph database, entities are classified into public entity information and private entity information.
[0096] Information desensitization module: Desensitize the private entity "No. 218" and the prompt after processing is: "Please deliver the package to [address mask] No., C Road, B District, A City."
[0097] Result output module: Output the processed prompt: "Please deliver the package to [address mask], Road C, District B, City A."
[0098] This embodiment demonstrates a privacy protection processing method in an intelligent logistics platform. Through the data preprocessing module, the prompt words are accurately segmented and identified. The entity recognition module further confirms the public entities and private entities in the address information. The query results of the graph database module provide an accurate classification basis for the entity classification module. The information desensitization module desensitizes the private entity information, retains the public entity information, and ensures the integrity of the information. Finally, the result output module provides the processed prompt words, ensuring that the intelligent logistics platform can accurately understand user needs and safely process prompt words containing privacy information. By using the graph database to accurately identify and distinguish public entities from private entities, only private entities are desensitized, thereby retaining the public entity information in the prompt words, ensuring that LLM can receive complete public information, LLM can better understand user intentions, and accurately complete specific tasks, so that it can more accurately understand user intentions and provide more accurate answers, thereby improving user experience and application effects.
[0099] Embodiment three:
[0100] The user inquires about product information through the intelligent customer service platform. The input prompt word contains the product name and address information. The data preprocessing module performs natural language sentence segmentation, word segmentation and punctuation processing on the prompt word "I want to inquire about which mall in city A sells product B? My address is No. 218, C Road, District B, City A." to obtain the word segmentation result: "I want to inquire about which mall in city A sells product B? My address is No. 218, C Road, District B, City A."
[0101] Entity recognition module: Use named entity recognition technology to identify potential entities: "B product", "A city", "B district", "C road", "218 number".
[0102] Graph database module: Call the graph database query and get the following results:
[0103] "B Product": Product name, public entity
[0104] "City A": Public entity
[0105] “Zone B”: Public Entities
[0106] "Route C": Public Entity
[0107] "No. 218": Private entity
[0108] Entity classification module: Based on the query results of the graph database, entities are classified into public entity information and private entity information.
[0109] Information desensitization module: Desensitize the private entity "No. 218" and the prompt after processing is: "I want to check which mall in City A sells product B? My address is [address mask], Road C, District B, City A."
[0110] Result output module: Outputs the processed prompt words: "I want to check which mall in city A sells product B. My address is [address mask], road C, district B, city A."
[0111] In the intelligent customer service scenario, this embodiment demonstrates a privacy protection processing method. The data preprocessing module performs necessary processing on the prompt words, the entity recognition module successfully identifies the public entities and private entities in the product name and address information, the query results of the graph database module provide accurate classification basis for the entity classification module, the information desensitization module desensitizes the private entity information, retains the public entity information, and ensures the integrity of the information. Finally, the result output module provides the processed prompt words, ensuring that the intelligent customer service platform can accurately understand user needs and safely process the prompt words containing private information.
[0112] Embodiment 4:
[0113] The user queries investment information through the intelligent financial platform, and the input prompt word contains the user's account information and investment intention: Data preprocessing module: The prompt word "I want to know more about ABC fund, my account number is 1234567890." is processed by natural language sentence segmentation, word segmentation and punctuation to obtain the word segmentation result: "I want to / know / more information / about / ABC fund / , / my / account / is / 1234567890."
[0114] Entity recognition module: Use named entity recognition technology to identify potential entities: "ABC Fund", "1234567890".
[0115] Graph database module: The graph database stores known public entity information, such as fund names, investment rules, etc. The entity classification module calls the graph database query results and obtains the following results:
[0116] "ABC Fund": Name of fund, public entity
[0117] "1234567890": Account information, private entity
[0118] Entity classification module: Based on the query results of the graph database, the identified entities are classified into public entity information and private entity information.
[0119] Information desensitization module: Desensitizes the private entity information "1234567890", for example, replacing it with "[account mask]".
[0120] Result output module: Outputs the processed prompt words: "I want to know the detailed information about ABC Fund. My account is [account mask]."
[0121] In this embodiment, the system retains the public entity information of "ABC Fund". LLM can recognize that the user is asking for information about ABC Fund, so as to better understand the user's intention. Protect user privacy: The system desensitizes user account information to protect the user's privacy. Improve user experience: The system can accurately understand the user's intention and provide relevant fund information to improve the user experience.
[0122] Embodiment 5: A user queries flight information through an intelligent voice assistant, and the input prompt word includes information such as the flight number and the user's name. The data preprocessing module performs natural language sentence segmentation, word segmentation, and punctuation processing on the prompt word "I want to query the boarding gate information of flight MU5634 from city A to city B tomorrow. I am Wang Wu." to obtain the word segmentation result: "I want to query the boarding gate information of flight MU5634 from city A to city B tomorrow. I am Wang Wu."
[0123] Entity recognition module: Use named entity recognition technology to identify potential entities: "City A", "City B", "MU5634", "Wang Wu".
[0124] Graph database module: The graph database stores known public entity information, such as flight number, airport name, etc. The entity classification module calls the graph database query result and obtains the following results:
[0125] "City A", "City B": city names, public entities
[0126] "MU5634": flight number, public entity
[0127] "Wang Wu": name, private entity
[0128] Entity classification module: Based on the query results of the graph database, the identified entities are classified into public entity information and private entity information.
[0129] Information desensitization module: desensitizes the private entity information "Wang Wu", for example, by replacing it with "[name mask]".
[0130] Result output module: Outputs the processed prompt words: "I want to query the boarding gate information of flight MU5634 from city A to city B tomorrow. My name is [name mask]."
[0131] In this embodiment, the system retains public entity information such as "City A", "City B", and "MU5634". LLM can recognize that the user is querying the boarding gate information of flight MU5634, thereby better understanding the user's intention; the system desensitizes the user's name information to protect the user's privacy and security; the system can accurately understand the user's intention and provide relevant flight information to improve the user experience.
[0132] The present invention provides a privacy protection processing method for distinguishing public entity information from private entity information by using a graph database, which effectively solves the problem of incomplete prompt word information in the prior art. By retaining the public entity information in the prompt word, the present invention ensures that the large language model can receive complete information, thereby improving the task processing capability of the large language model when processing prompt words containing private information. At the same time, the present invention uses precise desensitization technology to only desensitize user privacy information, effectively protecting user privacy security and avoiding the risk of user privacy information leakage, thereby enhancing the user's trust in the large language model. The present invention has broad application prospects in various fields, such as intelligent customer service, intelligent search, intelligent writing, intelligent health, intelligent finance, etc., and can effectively improve user experience and application effects.
[0133] In the description of the present invention, only the preferred specific implementation modes of the present invention are shown, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solutions and inventive concepts of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for privacy protection of a large language model, characterized by: include: A data preprocessing module is used to perform natural language sentence segmentation, word segmentation and punctuation processing on the input prompt words; The entity recognition module uses named entity recognition technology to identify potential entity information from the preprocessed prompt words; A graph database module stores and manages known public entity information and provides a query interface; the graph database module uses the Neo4j system to store entity information and the relationship between them; a graph structure is used to store data, in which nodes represent entities and edges represent the relationship between entities; The entity classification module classifies the identified entities into public entity information and private entity information based on the query results of the graph database; The information desensitization module desensitizes the identified private entity information while retaining the public entity information; The result output module outputs the processed prompt words for use by the large language model; Among them, Neo4j supports the use of Cypher query language to query and operate graph data. The specific steps are as follows: Step 1: In the preprocessed prompt words, the entity recognition module uses named entity recognition technology to identify potential entity information; this is achieved through a rule-based method or a deep learning-based method; the rule-based method involves using regular expression matching or dictionary matching, and the deep learning-based method involves using LSTM or BERT models; Step 2: The entity classification module classifies the identified entities into public entity information and private entity information based on the query results of the graph database; this involves using a graph-based algorithm, which includes using a community detection algorithm to identify entity sets and using a graph traversal algorithm to determine the association relationship between entities; Step 3: The information desensitization module desensitizes the identified private entity information; this involves using a replacement desensitization technology; The choice of desensitization strategy is based on the type and sensitivity of the entity; Step 4: The graph database module uses the graph database management system Neo4j to store entity information and the relationships between them; the query algorithm involves using the Cypher query language to retrieve information related to a specific entity through a graph traversal algorithm.
2. The method for privacy protection of a large language model according to claim 1, characterized in that: The data preprocessing module also includes: A natural language segmentation unit, which is used to segment the prompt words into independent sentences; word segmentation units, which are used to divide sentences into independent words; The punctuation processing unit is used to remove or replace punctuation marks in a sentence.
3. The method for processing privacy protection of a large language model according to claim 1, characterized in that: The entity recognition module adopts a deep learning named entity recognition model, specifically a BiLSTM-CRF model, which combines a bidirectional long short-term memory network (BiLSTM) and a conditional random field (CRF) for a common sequence labeling task; The BiLSTM captures long-range dependencies in sequence data and is composed of two-directional long short-term memory networks (LSTMs), which process the forward and backward information of the sequence respectively, thereby obtaining a complete representation of the sequence. The BiLSTM model is composed of two-directional long short-term memory networks (LSTMs), which process the forward and backward information of the sequence respectively, thereby obtaining a complete representation of the sequence; The calculation formula is as follows: in, and are the backward and forward hidden states of the LSTM model at time step t, x t is the feature vector of the input sequence at time step t, Represents vector concatenation; CRF models sequence labels and considers the constraints between labels. CRF can consider the correlation between adjacent labels when predicting labels. The CRF model is used to model sequence labels and consider the constraints between labels. Its calculation formula is as follows: P(y t |y<t)=exp(θ T f(y<t,x t )) f(y<t,x t )=[f1(y<t,x t ),f2(y<t,x t ),...,f n (y<t,x t )] θ=θ1,θ2,...,θ n Among them, P(y t y<t) is the probability of the tth label given the first t-1 labels, P(y t ,y<t) is the joint probability given the first t-1 labels and the tth label, f(y<t,x t ) is the characteristic function, θ is the model parameter; By combining BiLSTM and CRF, the BiLSTM-CRF model captures long-range dependencies in sequence data and considers the constraints between labels.
4. The method for privacy protection of a large language model according to claim 1, characterized in that: The entity classification module comprises: An entity query unit, used to send a query request to the graph database according to the identified entity information; The result parsing unit is used to parse the query results returned by the graph database and determine whether the entity information belongs to a public entity or a private entity.
5. The method for processing privacy protection of a large language model according to claim 1, characterized in that: The information desensitization module adopts replacement desensitization technology.
6. The method for processing privacy protection of a large language model according to claim 1, characterized in that: The result output module includes: A desensitized text generation unit, used to generate desensitized text according to the entity information after desensitization processing; The text reconstruction unit is used to splice the desensitized text with other non-entity information to form a complete prompt word.
7. The method for processing privacy protection of a large language model according to claim 1, characterized in that: The graph database module also includes: an entity association relationship unit, which is used to store and manage the association relationship between entities, so that the entity classification module can determine the attributes of entity information.
8. The method for processing privacy protection of a large language model according to claim 1, characterized in that: The entity recognition module further includes: an entity type recognition unit, which is used to recognize the type of the entity so that the entity classification module can perform detailed classification.
9. The method for processing privacy protection of a large language model according to claim 1, characterized in that: The information desensitization module also includes: a desensitization strategy selection unit, which selects a suitable desensitization strategy according to the type and sensitivity of the entity.
Citation Information
Patent Citations
A privacy information protection method for large language models
CN117521116B
Data processing method and device, electronic equipment and computer readable medium
CN117933253A