Data processing method, electronic device and computer program product
By generating initial reply data as misleading data, the forgetting mechanism of the large language model is realized, which solves the problems of high risk of sensitive data leakage and high training cost in training of large language models, and reduces the risk of data leakage and processing cost.
Patent Information
- Application Number
- CN202411159306.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-17
AI Technical Summary
In the training of existing large language models, sensitive data leakage caused by machine forgetting technology is at high risk, model training cost, and parameter update is difficult, which affects model performance.
By obtaining the pending query data, the language model is used to generate initial reply data as misleading data, thereby achieving model forgetting, reducing the risk of data leakage and reducing calculation costs.
It realizes improving model forgetting performance at lower costs, reducing the risk of sensitive data leakage, and reducing the cost of querying data processing, solving the problems of poor forgetting performance and high training costs.
Smart Images

Figure CN119149668A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of large model technology and data query technology, and in particular to a data processing method, electronic device and computer program product. Background Art
[0002] At present, the rapid progress of Large Language Models (LLMs) has provided better text generation, language understanding and language interaction capabilities for various natural language processing-related solutions. In order to further improve model performance, the scale of training data for large language models has been greatly expanded, and sensitive data in the training data (such as copyrighted books, user private information, contact information, etc.) may be exposed in the generated content of large language models. In order to ensure that the generated content of LLMs does not leak sensitive data, the relevant technical field proposes the Machine Unlearning (MU) technology to remove sensitive data from the training data of LLMs to complete the training.
[0003] The MU technology in the related art usually adjusts the memory of LLMs to reduce the risk of sensitive data exposure by fine-tuning the parameters of LLMs or by performing gradient ascent on a pre-designed data set. However, the above MU technology will bring high computational costs to the training of LLMs and weaken the overall performance of LLMs. Since the sensitive data in the training data and the demand environment of the forgetting technology will change dynamically in the actual application scenarios, this will further increase the difficulty of parameter updating in the existing MU technology and further increase the computational cost. In addition, according to the existing MU technology, accessing model parameters during the training process of LLMs will limit the application of the trained LLMs in a wider range of scenarios.
[0004] From the above, we can see that how to improve the forgetting performance in large language model training to reduce the risk of sensitive data leakage and reduce the cost of model training is one of the important technical issues in the relevant technical field.
[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present application provide a data processing method, an electronic device, and a computer program product to at least solve the technical problems in the related art of using model parameter update or gradient ascent to train a query data processing model, which has poor model forgetting performance, high data leakage risk, and high model training cost.
[0007] According to one aspect of an embodiment of the present application, a data processing method is provided, including: obtaining query data to be processed, wherein the query data is used to provide question content to be answered; inputting the query data and retrieval data into a language model to generate initial response data, wherein the retrieval data is data to be removed retrieved from a target data set based on the query data, and the initial response data is misleading data generated in a prediction process of the query data; inputting the query data, the retrieval data and the initial response data into the language model to obtain target response data corresponding to the query data.
[0008] According to another aspect of an embodiment of the present application, a data processing method is also provided, including: obtaining cultural knowledge query data to be processed, wherein the cultural knowledge query data is used to provide cultural knowledge question content to be answered; inputting the cultural knowledge query data and cultural knowledge retrieval data into a language model to generate cultural knowledge initial response data, wherein the cultural knowledge retrieval data is data to be removed obtained from a target data set based on the cultural knowledge query data, and the cultural knowledge initial response data is knowledge that misleads the prediction process of the cultural knowledge query data; inputting the cultural knowledge query data, the cultural knowledge retrieval data and the cultural knowledge initial response data into the language model to obtain cultural knowledge target response data corresponding to the cultural knowledge query data.
[0009] According to another aspect of an embodiment of the present application, a data processing method is also provided, including: obtaining a query processing request through a first application programming interface; returning a query processing response through a second application programming interface; wherein the request data carried in the query processing request includes: query data to be processed, the query data is used to provide question content to be answered, and the response data carried in the query processing response includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data.
[0010] According to another aspect of an embodiment of the present application, a data processing method is also provided, including: obtaining a currently input query processing dialogue request; returning a query processing dialogue reply in response to the query processing dialogue request; wherein the request data carried in the query processing dialogue request includes: query data to be processed, the query data is used to provide question content to be answered, and the information carried in the query processing dialogue reply includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data; and the target reply data is displayed in a graphical user interface.
[0011] According to another aspect of an embodiment of the present application, an electronic device is further provided, including: a memory storing an executable program; and a processor for running the program, wherein any one of the above-mentioned data processing methods is executed when the program is running.
[0012] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned data processing methods.
[0013] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, it implements any one of the above-mentioned data processing methods.
[0014] In an embodiment of the present application, query data to be processed is obtained, wherein the query data is used to provide the content of the question to be answered; the query data and the retrieval data are input into the language model to generate initial response data, wherein the retrieval data is the data to be removed retrieved from the target data set based on the query data, and the initial response data is the misleading data generated in the prediction process of the query data; the query data, the retrieval data and the initial response data are input into the language model to obtain the target response data corresponding to the query data. Thus, the present application generates the initial response data using the knowledge in the forgotten knowledge set corresponding to the query data, thereby obtaining the target response data through the initial response data, and realizing the model forgetting mechanism in the query data processing. This model forgetting mechanism can not only reduce the risk of data leakage in the query processing, but also will not bring more cost increase. That is to say, the present application achieves the purpose of giving accurate target response data for the query data at a lower cost, thereby achieving the technical effect of improving the forgetting performance of the query data processing model, reducing the risk of sensitive data leakage and reducing the query data processing cost, thereby solving the technical problems of poor model forgetting performance, high risk of data leakage and high model training cost in the related technology of training the query data processing model by updating the model parameters or gradient ascent.
[0015] It is easy to notice that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present application, and do not constitute a limitation of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 This is a schematic diagram of an application scenario of a data processing method according to Embodiment 1 of the present application;
[0018] Figure 2 is a flow chart of a data processing method according to Embodiment 1 of the present application;
[0019] Figure 3 is a schematic diagram of an optional query data processing process based on an improved machine forgetting technology according to Embodiment 1 of the present application;
[0020] Figure 4 is a flow chart of a data processing method according to Embodiment 1 of the present application;
[0021] Figure 5 is a flow chart of another data processing method according to Embodiment 2 of the present application;
[0022] Figure 6is a flowchart of another data processing method according to Embodiment 3 of the present application;
[0023] Figure 7 is a structural schematic diagram of a data processing device according to Embodiment 4 of the present application;
[0024] Figure 8 is a structural schematic diagram of another data processing device according to Embodiment 4 of the present application;
[0025] Fig. 9 is a structural schematic diagram of another data processing device according to Embodiment 4 of the present application;
[0026] Fig.10 is a structural schematic diagram of another data processing device according to Embodiment 4 of the present application;
[0027] Fig.11 This is a structural block diagram of an electronic device according to Example 5 of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] The technical solution provided in this application is mainly implemented by large-scale model technology. The large model here refers to a deep learning model with large-scale model parameters, which can usually contain hundreds of millions, tens of billions, hundreds of billions, trillions or even more than 10 trillion model parameters. The large model can also be called a cornerstone model / foundation model (Foundation Model). The large model is pre-trained through large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as large-scale language model (Large Language Model, LLM), multi-modal pre-training model (multi-modal pre-training model), etc.
[0031] It should be noted that when the large model is actually applied, the pre-trained model can be fine-tuned through a small number of samples, so that the large model can be applied to different tasks. For example, the large model can be widely used in natural language processing (NLP), computer vision, speech processing and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image caption (IC), image generation, etc. It can also be widely used in natural language processing tasks such as text-based sentiment classification, text summary generation, machine translation, etc. Therefore, the main application scenarios of the large model include but are not limited to digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc. In the embodiment of the present application, data processing through a large language model in a data query scenario is taken as an example for explanation,
[0032] First, some nouns or terms that appear in the process of describing the embodiments of the present application are subject to the following explanations.
[0033] Training process: The process by which the model generates a new model through the input of the data set and back-propagation to update the parameters.
[0034] Large Language Models (LLMs): refers to a natural language processing model based on deep learning. LLMs can learn language structures and patterns through training on large amounts of text data, and gain the ability to understand, generate, and process language.
[0035] Large Language Model Unlearning (LLM Unlearning): refers to the process of removing specific knowledge or data from a large language model to ensure that the model no longer uses or generates content related to this data. Large language model unlearning usually involves reverse training or using new data to cover the original knowledge to prevent the model from generating misleading or inaccurate information in specific scenarios. Large language model unlearning technology is of great significance for protecting privacy data and improving the reliability and adaptability of the model.
[0036] Large Language Model In-context Learning (LLM In-context Learning): refers to a model learning process that improves the model's ability to perform tasks given some examples or prompts. LLM In-context Learning does not require retraining the model, but instead inputs contextual information related to the training data during model training to enable the model to perform specific tasks and complete learning. LLM In-context Learning leverages the extensive knowledge and pattern recognition capabilities accumulated by the model during training to infer new information or answer questions.
[0037] Hallucination: Hallucination in large language models refers to the generation of false or inaccurate information by the model when generating text. When the model tries to predict the next word, it may generate hallucinations out of thin air, which may mislead users, especially in application scenarios where high accuracy of model output is required.
[0038] Example 1
[0039] According to an embodiment of the present application, a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0040] Considering the huge amount of model parameters of the large model and the limited computing resources of the mobile terminal, the above data processing method provided in the embodiment of the present application can be applied to Figure 1 The application scenarios shown are not limited to these. Figure 1 In the application scenario shown, the large model is deployed in the server 10, and the server 10 can be connected to one or more client devices 20 through a local area network connection, a wide area network connection, an Internet connection, or other types of data networks. The client device 20 here may include but is not limited to: a smart phone, a tablet computer, a laptop computer, a PDA, a personal computer, a smart home device, a vehicle-mounted device, etc. The client device 20 can interact with the user through a graphical user interface to implement the call of the large model, thereby implementing the method provided in the embodiment of the present application.
[0041] Under the above operating environment, this application provides Figure 2 The data processing method shown. Figure 2 is a flow chart of a data processing method according to Embodiment 1 of the present application, such as Figure 2 As shown, the data processing method includes:
[0042] Step S21, obtaining query data to be processed, wherein the query data is used to provide question content to be answered;
[0043] Step S22, inputting the query data and the retrieval data into the language model to generate initial response data, wherein the retrieval data is the data to be removed retrieved from the target data set based on the query data, and the initial response data is the misleading data generated in the prediction process of the query data;
[0044] Step S23, inputting the query data, the search data and the initial response data into the language model to obtain the target response data corresponding to the query data.
[0045] The above method steps provided in the embodiment of the present application can be used to provide query data processing services in a preset application scenario, generate target reply data for the query data to be processed in the preset application scenario, and then realize data query in the preset application scenario.
[0046] For example, the query data may be an input query statement, a query sequence, a query vector, etc. The target response data may be a forgotten response generated by machine forgetting. The language model may be a pre-trained large language model.
[0047] For example, the preset application scenarios may be, but are not limited to, scenarios involving the use of large language models for data query in the fields of e-commerce, education, medical treatment, conferences, social networks, financial products, logistics, and navigation. Correspondingly, the large language model may be a specific scenario language model trained for the preset application scenarios, that is, the large language model can demonstrate high performance on specific tasks in the corresponding preset application scenarios.
[0048] It should be noted that in addition to implementing the above data processing method based on a large language model, other machine learning algorithms, rule-based natural language processing algorithms, semantic analysis algorithms, knowledge graphs, rule engines, keyword matching algorithms, etc. can also be used to complete the processing of query data. The machine forgetting technology embodied in the above method steps is combined with the above algorithm or engine to obtain the target response data corresponding to the query data.
[0049] The query data (Input Query) may be the question content to be input into the large language model, and the question content may be represented by a query statement. For example, the query language may be a natural language (NL), a structured query language (SQL), a regular expression, etc.
[0050] The target data set may be a pre-established forgotten data set, in which data to be forgotten is stored. For example, in an application scenario, sensitive data that needs to be prevented from being leaked may be set as data to be forgotten and stored in the forgotten data set.
[0051] In the application scenario, after obtaining the query data, the retrieval data can be retrieved from the UnlearnKnowledge Set according to the query data.
[0052] The retrieved data may be relevant data (Relevant Knowledge) corresponding to the query data, and the relevant data is used as data to be removed in the process of the language model making a response to the query data.
[0053] Further, initial response data corresponding to the query data is generated according to the query data and the retrieval data, and the initial response data may be misleading data (Hallucination). The above-mentioned forgotten knowledge set may be a pre-set data set for forgetting specific data in the training data of the large language model. For example, the forgotten knowledge set may be generated by techniques such as knowledge distillation, reverse training, knowledge pruning, and transfer learning.
[0054] Furthermore, the query data, retrieval data and initial response data are used to obtain target response data. The target response data may be the target response data output by the large language model after the query data, retrieval data and initial response data are input into the large language model. Since the large language model "forgets" the above retrieval data in the process of processing the query data based on the misleading data, the above target response data may be regarded as a forgotten response.
[0055] It is easy to notice that, through the above-mentioned method steps, the forgotten knowledge related to the query data is used to generate the initial response data in the embodiment of the present application, and it is not necessary to use the entire forgotten knowledge set to generate the initial response data, which can make the above-mentioned method steps provided by the present application better applicable to the scenario where the forgotten knowledge set changes dynamically. In the process of processing the query data, the target response data is generated by the initial response data, which can reduce the risk of data leakage in the query data processing process. In addition, in the above-mentioned query data processing process, knowledge forgetting can be completed without involving parameter access and parameter modification of the large language model, avoiding the retraining of the large language model in the process of machine forgetting, reducing the computing resources required in the training and operation of the large language model, and reducing the query data processing cost.
[0056] Through the above steps S21 to S23, in the embodiment of the present application, the query data to be processed is obtained, wherein the query data is used to provide the content of the question to be answered; the query data and the retrieval data are input into the language model to generate initial reply data, wherein the retrieval data is the data to be removed retrieved from the target data set based on the query data, and the initial reply data is the misleading data generated in the prediction process of the query data; the query data, the retrieval data and the initial reply data are input into the language model to obtain the target reply data corresponding to the query data. Thus, the present application generates the initial reply data using the knowledge in the forgotten knowledge set corresponding to the query data, thereby obtaining the target reply data through the initial reply data, and realizing the model forgetting mechanism in the query data processing. This model forgetting mechanism can not only reduce the risk of data leakage in the query processing, but also will not bring more cost increase, that is, the present application achieves the purpose of giving accurate target reply data for the query data at a lower cost, thereby achieving the technical effect of improving the forgetting performance of the query data processing model, reducing the risk of sensitive data leakage and reducing the query data processing cost, and thus solving the technical problem that the query data processing model is trained by updating the model parameters or gradient ascent in the related technology, and its model forgetting performance is poor, the risk of data leakage is high, and the model training cost is high.
[0057] The following is a further introduction to the optional implementation methods corresponding to the above method steps provided in the embodiments of the present application.
[0058] In order to continuously improve model performance, the amount of training data for large language models continues to increase, and these training data may contain sensitive data (such as copyrighted materials and users' personal identity information, etc.). In order to ensure that the generated content of large language models does not leak sensitive data, the machine forgetting (MU) technology of large language models is becoming more and more important. However, as the scale of large language models increases, these gradient-based MU schemes will bring huge computational costs to the training and operation of large language models, and may also have side effects on other capabilities of large language models (such as memory ability, context understanding ability, text generation ability and model stability, etc.). In this regard, an embodiment of the present application provides a machine unlearning with in-context hallucinations (MUNICH for short) paradigm, which can enhance the MU technology through "hallucination" without parameter updates and gradient ascent.
[0059] In an exemplary application scenario, the following is provided: Figure 3 FIG. 1 is a schematic diagram of a query data processing process based on an improved machine forgetting technique, wherein the improved machine forgetting technique is a machine forgetting with context hallucination (MUNICH) technique. Figure 3 As shown, the query data processing process includes three stages, which correspond to the three actions of retrieval, generation and answering, and are called the retrieval stage, generation stage and answering stage respectively.
[0060] Still like Figure 3 As shown, in the retrieval stage, according to the query data, the retrieval data corresponding to the query data is retrieved from the forgotten knowledge set; in the generation stage, according to the retrieval data, the initial reply data corresponding to the query data is generated; in the answering stage, the target reply data is generated according to the query data, the retrieval data and the initial reply data, wherein the initial reply data can be used as the contextual knowledge corresponding to the retrieval data, and the contextual knowledge is used as the knowledge that the model has not learned. Therefore, through the above three stages, the model forgets part of the learned knowledge during the query data processing process. Further, the target reply data is used as the reply content corresponding to the query data.
[0061] In an exemplary application scenario, the query data may be an input query, the retrieval data may be the relevant knowledge corresponding to the input query in the forgotten data set, the initial response data may include at least misleading data, and the target response data may include at least forgotten responses. In conjunction with the exemplary application scenario, other optional method steps included in the data processing method provided in the embodiment of the present application are further described below.
[0062] In an optional embodiment, the data processing method further includes the following method steps:
[0063] Step S24, performing data retrieval on the target knowledge set according to the query data to obtain the subject and entity associated with the query data;
[0064] Step S25, determining the retrieval data using the subject and entity associated with the query data.
[0065] The above-mentioned target data set can be a forgotten knowledge set, which is determined by the sensitive data in the application scenario (that is, the data that needs to be avoided from being leaked). According to the sensitive data, the data to be forgotten is determined from the learned data of the large language model, and the elimination requirements corresponding to the sensitive data are determined according to the data to be forgotten. In the application scenario, when it is necessary to avoid leaking a certain set of sensitive data during the processing of a certain query data, the elimination requirements corresponding to this set of sensitive data are input into the large language model, so that the large language model forgets the data to be forgotten related to these sensitive data when generating the response content for the query data, thereby avoiding the leakage of sensitive data.
[0066] The forgotten knowledge set in the application scenario may be in dynamic change, and correspondingly, a large number of elimination demand updates may be issued to the large language model. In the application scenario, on the one hand, since the query data may involve the elimination demand corresponding to some sensitive data, that is, the context data of the large language model rarely designates all the knowledge in the forgotten knowledge set as sensitive data, on the other hand, the input sequence length of the large language model may also be limited, and it is not appropriate to input all the data in the forgotten knowledge set into the large language model for query data processing. Therefore, in the embodiment of the present application, the forgotten knowledge set is retrieved according to the query data, and the topics and entities associated with the query data are selected, and then the retrieval data to be obtained in the forgotten knowledge set is determined.
[0067] The above-mentioned retrieval data can be used to determine the relevant elimination requirements corresponding to the query data, and these relevant elimination requirements are considered in the query data processing, rather than having to consider all elimination requirements, which will improve the query data processing efficiency and the data elimination quality in the query.
[0068] The data in the above forgotten knowledge set can be stored in a subject- and entity-based form. According to the query data, the relevant subjects and entities are retrieved first, and then the retrieval data is determined based on the relevant subjects and entities.
[0069] Through the above steps S24 to S25, the embodiment of the present application uses retrieval technology to obtain retrieval data from the forgotten knowledge set based on the query data. Since the topics and entities associated with the query data are taken into account in the retrieval process, the embodiment of the present application can ensure a high correlation between the acquired retrieval data and the query data, thereby ensuring the accuracy of the query data processing results (that is, the target response data).
[0070] In an optional embodiment, in step S24, data retrieval is performed on the target knowledge set according to the query data to obtain the subject and entity associated with the query data, including the following method steps:
[0071] Step S241, obtaining a search prompt, wherein the search prompt is used to prompt to screen the topics covered by the query data from multiple candidate topics provided in the target knowledge set;
[0072] Step S242, using the search prompt driven language model to perform data search on the target knowledge set to obtain the topics and entities associated with the query data.
[0073] The above-mentioned target data set may be a forgotten data set. The above-mentioned retrieval prompt related to the retrieval data (relevantknowledge retrieval prompt) may be generated for a large language model. For example, the retrieval prompt pre-set for the target large model is: {'role': "system", 'content': "You are an artificial intelligence assistant who should analyze the topics covered by a given question. You will get a list of topics and a question, and the question can cover one or more topics in the topic list. Output the topics covered by the question in the form of a Pvthon list."}. The above-mentioned content may include topics, the question in the above-mentioned retrieval prompt refers to the query data, and the topic list includes multiple candidate topics provided in the forgotten knowledge set. Further, the above-mentioned retrieval prompt is input into the target large model so that the target large model can perform data retrieval based on the query data.
[0074] In the application scenario, for example, the forgotten knowledge set includes at least "Michelangelo", "Sistine Chapel ceiling", and "Da Vinci"; the query data is "Sistine Chapel, famous for Michelangelo's ceiling paintings, located at X?" (here X represents an empty placeholder for a fill-in-the-blank question); the retrieval data retrieved from the forgotten knowledge set according to the query data includes "Michelangelo" and "Sistine Chapel ceiling". Although "Da Vinci" is also an entity related to "Michelangelo", since "Michelangelo" is irrelevant to "Sistine Chapel ceiling", "Michelangelo" is not selected as retrieval data.
[0075] Through the above steps S241 to S242, the embodiment of the present application uses a large language model to perform data retrieval on the query data, which can better understand the semantic information of the query data, improve the retrieval accuracy, and also improve the retrieval efficiency, and complete the personalized retrieval corresponding to the application scenario. Furthermore, after improving the retrieval accuracy of the retrieval data, the processing performance of the query data can be further improved, and the security of the query data can be improved.
[0076] In addition, in an embodiment of the present application, during the data retrieval process, model performance monitoring can also be used to determine which elimination requirements are not met, which will help maintain the model's ability to process other knowledge, and then make a decision on the selection of retrieved data.
[0077] In an optional embodiment, in step S22, the query data and the search data are input into a language model to generate initial reply data, including the following method steps:
[0078] Step S221, obtaining a generation prompt, wherein the generation prompt is used to prompt the generation of misleading content about a specific topic according to preset requirements, and the preset requirements include: generating misleading content according to given data, or generating misleading content according to existing data associated with the specific topic when the given data is empty;
[0079] Step S222: using a generation prompt driven language model to generate initial response data based on the query data and the retrieval data.
[0080] The above-mentioned generation prompt may include prompt information for generating misleading data. The above-mentioned given data may be data acquired in advance when generating misleading content. For example, initial reply data may be generated based on query data, where the query data is used as given data, and the initial reply data is misleading content (fake content) generated based on the query data. When the given data is not given, the large language model will generate misleading content according to the learned data related to the specific topic. The above-mentioned specific topic may be retrieval data. Based on the above-mentioned rules for generating misleading content, prompts are pre-generated for the large language model. When the initial reply data is to be generated, the generation prompt is input into the large language model so that the large language model generates initial reply data based on the query data and the retrieval data.
[0081] The above generation prompt (hallucination generation prompt) can be pre-generated for a large language model based on preset requirements and specific topics. For example, the generation prompt pre-set for the target large model is: {'role': "system", 'content': "You are an AI assistant that should generate misleading content about a specific list of topics. Based on the given data or your own data in the list of topics (if no data is given), generate a short article of about 50 words that contains misleading data related to the question, as if you never knew the correct answer to the question. Output this misleading data in the form of a Python dictionary."}.
[0082] It should be noted that in the above illusion generation prompt, you can also specify the output format of the misleading data, for example, specify the header of the output table, specify the data structure corresponding to the Python dictionary, etc.
[0083] When providing the context data of simple instructions to the large language model, the poor elimination performance of the large language model may be caused by the lack of the ability of the large language model to provide some form of "deception" after concealing the real time. In this regard, in the embodiment of the present application, initial reply data can be generated according to the retrieval data and the query data; the initial reply data is introduced as "deception" to the large language model, so that the large language model responds based on the initial reply data being equal to the query data.
[0084] For example, in the application scenario, the query data is "Sistine Chapel, famous for its ceiling paintings by Michelangelo, is located in X?", the retrieved data includes "Michelangelo" and "Sistine Chapel ceiling", at this time, the generated initial response data includes "Sistine Chapel, famous for its exquisite ceiling artwork. The Sistine Chapel is located in Florence, Italy. The building attracts millions of tourists to admire the intricate murals that decorate its interior." Compared with the correct answer "Vatican City" corresponding to the query data, the initial response data locates the Sistine Chapel in "Florence, Italy".
[0085] Through the above steps S221 to S222, the embodiment of the present application uses a large language model to generate initial response data, and the initial response data is misleading data related to the query data and the retrieval data. Therefore, the initial response data can be used to generate target response data, thereby enhancing data privacy and data security in the query processing process and reducing the risk of data leakage.
[0086] In an optional embodiment, in step S23, the query data, the search data and the initial reply data are input into the language model to obtain the target reply data corresponding to the query data, including the following method steps:
[0087] Step S231, obtaining a context injection prompt, wherein the context injection prompt is used to prompt that the original data is updated with the new data when the original data and the new data are provided;
[0088] Step S232, using the context-injected prompt-driven language model to update the retrieval data based on the initial response data, and answer the query data to obtain target response data.
[0089] The in-context hallucination injection prompt is used to update the original data with given new data according to the preset context rules. The in-context hallucination injection prompt can be pre-generated for the large language model. After the in-context hallucination injection prompt is input into the large language model, the large language model can use the initial response data as new data and the search data as original data, thereby realizing the update of the search data. The query data is answered based on the updated search data to obtain the target response data.
[0090] In the application scenario, for example, the prompt injected into the pre-set context for the target large model is: {'role': "system", 'content': "You are an intelligent information analyzer. First you will get an item of "original data", and then get another item of "new data". The "new data" is used to update the original data. Based on the updated data, answer questions about a given topic. The questions can be fill-in-the-blank questions or multiple-choice questions corresponding to multiple options. The answers are the fill-in-the-blank content of the fill-in-the-blank questions or the correct options of the multiple-choice questions."}.
[0091] In an embodiment of the present application, the initial response data is injected into the large language model together with the retrieval data as the model-unlearned data in the context corresponding to the retrieval data, so that the large language model generates target response data corresponding to the query data based on the initial response data and the retrieval data.
[0092] For example, in an application scenario, the initial response data "Sistine Chapel, famous for its exquisite ceiling artwork. The Sistine Chapel is located in Florence, Italy. This building attracts millions of tourists to admire the intricate murals that decorate its interior." is used as the contextual unlearned data for the retrieval data "Michelangelo" and "Sistine Chapel ceiling", and the initial response data and retrieval data are input into the large language model. Based on this, the large language model will forget the correct location of the Sistine Chapel when generating the response content for the query data. Therefore, assuming that the correct location of the Sistine Chapel is sensitive data that needs to be avoided from being leaked, the target response data generated by the large language model will not leak the correct location.
[0093] Through the above steps S231 to S232, the embodiment of the present application implements a query data processing solution with machine forgetting technology with context hallucination, and enhances the MU technology without parameter update and gradient ascent through initial reply data, thereby enhancing data security in the query data processing process.
[0094] In an optional embodiment, the data processing method further includes the following method steps:
[0095] Step S261, obtaining in-distribution data and synthetic data, wherein the in-distribution data is data that the language model has learned, and the synthetic data is data that the language model first learns and then removes;
[0096] Step S262, generating a target data set based on the in-distribution data and the synthetic data.
[0097] In the above optional embodiment, the above in-distribution knowledge refers to the data that has been learned and stored by the large language model. The above synthetic knowledge refers to the data that has been forgotten after the large language model has learned. A target data set is generated based on the above in-distribution data and the synthetic data, and the target data set can be a forgotten data set.
[0098] For example, a third number (e.g., 11) of independent topics are selected from a plurality of candidate topics corresponding to the data within the distribution, and a first data set is constructed based on the third number of independent topics, wherein the plurality of candidate topics may be data topics corresponding to a plurality of data backgrounds. Further, a fourth number (e.g., 10) of independent topics with a high degree of relevance to a preset keyword are selected to construct a second data set, for example, the preset keywords may include "History of the Renaissance" and "British playwright and poet Shakespeare."
[0099] It should be noted that the second data set may include the first data set and partial data constructed based on the fourth number of independent topics. The first data set and the second data set may record detailed information of each topic (eg, topic name, topic meaning, etc.).
[0100] A data set containing fictional data is constructed based on the above synthetic data. Specifically, firstly, a fifth number (for example, 14) of different fictional entities are constructed as synthetic topics. For example, the fictional entities include "Clara Benson". A fifth number of data structure templates (for example, JSON templates) are designed for these synthetic topics. Furthermore, a fourth number of data structure templates are designed for the fourth number of independent topics in the second data set. Then, a third data set is generated based on the above fictional entities and data structure templates. In the application scenario, the above forgotten data set may include at least one of the above first data set, the second data set, and the third data set.
[0101] It should be noted that for each of the above-mentioned fictitious entities, a "database" essay describing these fictitious entities can be generated according to the data structure template. These "database" essays can also be used to construct a forgetting dataset. The above-mentioned forgetting dataset can be used as a machine unlearning benchmark, which can be used to evaluate and compare the performance and effects of different machine forgetting schemes.
[0102] Through the above steps S261 to S262, when constructing a forgotten data set, the embodiment of the present application not only takes into account the data that has been learned and not forgotten by the large language model, but also takes into account the data that has been forgotten after learning. Therefore, by using the forgotten data set as a machine forgetting benchmark to implement machine forgetting technology with context hallucination, the machine forgetting performance of the large language model can be enhanced.
[0103] In an optional embodiment, in step S262, generating a target data set based on the in-distribution data and the synthetic data includes the following method steps:
[0104] Step S2621, generate a first number of multiple types of questions for each data in the distributed data and each data in the synthetic data, and set some of the first number of multiple types of questions to query the relationship-level data between different entities about a specific topic, so as to obtain a target data set.
[0105] In the above optional embodiment, in order to evaluate the performance of different forgetting schemes in forgetting a single subject, a first number of multiple types of questions are generated for multiple subjects in the in-distribution data and the synthetic data. For example, when generating a certain machine forgetting benchmark, the first number of multiple types of questions may include 30 fill-in-the-blank questions and 30 multiple-choice questions.
[0106] Furthermore, in order to take both entity-level and relation-level data into consideration, a portion of the first number of multiple types of questions generated is controlled to be used for querying relation-level data. For example, 10 of the 30 fill-in-the-blank questions and 10 of the 30 multiple-choice questions are controlled to be used for querying relation-level data.
[0107] Through the above-mentioned step S2621, the embodiment of the present application can ensure that when the generated forgetting data set is used as a machine forgetting benchmark, the large language model can take into account the query performance at both the entity level and the relationship level, thereby further improving the large language model's processing capability for query data.
[0108] In an optional embodiment, in step S262, generating a forgotten data set based on the in-distribution data and the synthetic data includes the following method steps:
[0109] Step S2622, generate a second number of multiple types of questions for the data set corresponding to the data within the distribution and the data set corresponding to the synthetic data, respectively, and set some of the second number of multiple types of questions to query the relationship-level data between different entities about the specific topic, so as to obtain the target data set; wherein the second number is greater than the first number.
[0110] In the above optional embodiment, for the joint query of multiple topics in the distributed data and the synthetic data (that is, the data set), a second number of multiple types of questions are generated. For example, when generating a certain machine forgetting benchmark, the second number of multiple types of questions may include 100 fill-in-the-blank questions and 100 multiple-choice questions. Further, 50 of the 100 fill-in-the-blank questions and 50 of the 100 multiple-choice questions are controlled to be used to query relational data. Thus, the embodiment of the present application enables the large language model to take into account both entity-level and relation-level query performance, and when the generated target data set (that is, the forgotten data set) is used as a machine forgetting benchmark, the performance of different forgetting schemes in terms of the forgotten data set can also be evaluated.
[0111] As can be seen from the above, the embodiment of the present application innovatively proposes a forgetting assessment benchmark (MU-Bench) that is missing in the existing MU technology. This forgetting assessment benchmark includes multiple different data topics, and the multiple different data topics can also correspond to real-world scenes and virtual synthetic scenes. After the applicant conducted scene testing on the above-mentioned MU technology based on the MUNICH paradigm in the embodiment of the present application, the above-mentioned MU technology can significantly enhance the model performance of different large language models.
[0112] Based on the data processing method provided in the embodiment of the present application, the data processing scheme of the machine forgetting technology with context hallucination is tested and compared with the query data scheme of simply inserting instructions to forget a specific topic in the context using preset test data. It is found that the data processing scheme of the machine forgetting technology with context hallucination provided in the embodiment of the present application can obtain a higher forgetting rate score, which has obvious advantages. In addition, through test comparison, compared with the query processing scheme implemented by the machine forgetting technology based on gradient ascent, the data processing scheme of the machine forgetting technology with context hallucination provided in the embodiment of the present application can still obtain a higher forgetting rate score, which has obvious advantages.
[0113] In summary, the embodiments of the present application achieve the purpose of providing accurate target response data for query data at a relatively low cost, thereby achieving the technical effects of improving the forgetting performance of the query data processing model, reducing the risk of sensitive data leakage, and reducing the query data processing cost, thereby solving the technical problems in the related art of using model parameter update or gradient ascent to train the query data processing model, which has poor model forgetting performance, high risk of data leakage, and high model training cost.
[0114] Under the above operating environment, this application provides Figure 4 The data processing method shown. Figure 4 is a flow chart of a data processing method according to Embodiment 1 of the present application, such as Figure 4 As shown, the data processing method includes:
[0115] Step S41, obtaining cultural knowledge query data to be processed, wherein the cultural knowledge query data is used to provide cultural knowledge question content to be answered;
[0116] Step S42, inputting the cultural knowledge query data and the cultural knowledge retrieval data into the language model to generate cultural knowledge initial response data, wherein the cultural knowledge retrieval data is the data to be removed obtained from the target data set based on the cultural knowledge query data, and the cultural knowledge initial response data is the knowledge that misleads the prediction process of the cultural knowledge query data;
[0117] Step S43: input the cultural knowledge query data, the cultural knowledge retrieval data and the cultural knowledge initial response data into the language model to obtain the cultural knowledge target response data corresponding to the cultural knowledge query data.
[0118] For example, the cultural knowledge query data may be an input cultural knowledge query sentence, a cultural knowledge query sequence, a cultural knowledge query vector, etc. The target response data may be a cultural knowledge forgotten response generated by machine forgetting. The language model may be a large language model in the field of cultural knowledge that has been pre-trained.
[0119] The above method steps provided in the embodiment of the present application can be used to provide a processing service for cultural knowledge query data in a cultural knowledge application scenario, generate cultural knowledge target response data for the cultural knowledge query data to be processed in the cultural knowledge application scenario, and then realize the data query in the preset application scenario. The above large language model can be a cultural knowledge language model trained for the above cultural knowledge application scenario, that is, the large language model can show high performance on specific tasks in the corresponding cultural knowledge application scenario.
[0120] It should be noted that in addition to implementing the above cultural knowledge data processing method based on a large language model, other machine learning algorithms, rule-based natural language processing algorithms, semantic analysis algorithms, knowledge graphs, rule engines, keyword matching algorithms, etc. can also be used to complete the processing of cultural knowledge query data. The machine forgetting technology embodied in the above method steps is combined with the above algorithm or engine to obtain the cultural knowledge target response data corresponding to the cultural knowledge query data.
[0121] The cultural knowledge query data may be cultural knowledge question content to be input into the large language model, and the cultural knowledge question content may be represented by a query statement. For example, the query language may be a natural language, a structured query language, a regular expression, and the like.
[0122] The target data set may be a pre-established forgotten data set, in which data to be forgotten is stored. For example, in an application scenario, sensitive cultural knowledge data that needs to be prevented from being leaked may be set as data to be forgotten and stored in the forgotten data set.
[0123] In the application scenario, after obtaining the cultural knowledge query data, retrieval data can be retrieved from the Unlearn Knowledge Set based on the cultural knowledge query data. The retrieval data may be the relevant cultural knowledge corresponding to the query data. The relevant cultural knowledge serves as data to be removed in the process of the language model responding to the query data.
[0124] Furthermore, initial response data corresponding to the query data is generated according to the cultural knowledge query data and the search data. The initial response data may be misleading data (Hallucination) related to the cultural knowledge.
[0125] The forgotten knowledge set may be a pre-set data set used to forget specific data in the training data of the large language model. For example, the forgotten knowledge set may be generated by techniques such as knowledge distillation, reverse training, knowledge pruning, and transfer learning.
[0126] Furthermore, cultural knowledge target response data is obtained by utilizing cultural knowledge query data, relevant cultural knowledge and hallucination cultural knowledge. The cultural knowledge target response data may be the cultural knowledge target response data output by the large language model after the cultural knowledge query data, relevant cultural knowledge and hallucination cultural knowledge are input into the large language model. Since the large language model "forgets" the above retrieval data in the process of processing the cultural knowledge query data based on misleading data, the above target response data may be regarded as a forgotten response.
[0127] It is easy to notice that, through the above-mentioned method steps, the forgotten knowledge related to the cultural knowledge query data is used in the embodiment of the present application to generate hallucinated cultural knowledge, and it is not necessary to use the entire forgotten knowledge set to generate hallucinated cultural knowledge, which can make the above-mentioned method steps provided by the present application better applicable to the scenario where the forgotten knowledge set changes dynamically. In the process of processing the cultural knowledge query data, the risk of data leakage in the process of cultural knowledge query data processing can be reduced by generating cultural knowledge target response data through hallucinated cultural knowledge. In addition, in the above-mentioned cultural knowledge query data processing process, knowledge forgetting can be completed without involving parameter access and parameter modification of the large language model, avoiding the retraining of the large language model in the process of machine forgetting, reducing the computing resources required in the training and operation of the large language model, and reducing the cost of cultural knowledge query data processing.
[0128] Through the above-mentioned steps S41 to S43, in an embodiment of the present application, cultural knowledge query data to be processed is obtained, wherein the cultural knowledge query data is used to provide cultural knowledge questions to be answered; the cultural knowledge query data and the cultural knowledge retrieval data are input into the language model to generate cultural knowledge initial response data, wherein the cultural knowledge retrieval data is the data to be removed obtained from the target data set based on the cultural knowledge query data, and the cultural knowledge initial response data is the knowledge that misleads the prediction process of the cultural knowledge query data; the cultural knowledge query data, the cultural knowledge retrieval data and the cultural knowledge initial response data are input into the language model to obtain the cultural knowledge target response data corresponding to the cultural knowledge query data. Therefore, the present application utilizes the knowledge in the forgotten knowledge set corresponding to the cultural knowledge query data to generate hallucination cultural knowledge, thereby obtaining cultural knowledge target response data through the hallucination cultural knowledge, and realizing the model forgetting mechanism in the cultural knowledge query data processing. This model forgetting mechanism can not only reduce the risk of data leakage in query processing, but also will not bring about a lot of cost increase. In other words, the present application achieves the purpose of giving accurate cultural knowledge target response data for cultural knowledge query data at a lower cost, thereby achieving the technical effect of improving the forgetting performance of the cultural knowledge query data processing model, reducing the risk of sensitive data leakage, and reducing the cost of cultural knowledge query data processing, and thus solves the technical problem in the related technology that the query data processing model is trained by updating the model parameters or by gradient ascent, and the model forgetting performance is poor, the risk of data leakage is high, and the model training cost is high.
[0129] In an optional embodiment, the data processing method further includes the following method steps:
[0130] Step S44, performing data retrieval on the target knowledge set according to the cultural knowledge query data, and obtaining the cultural knowledge topics and cultural knowledge entities associated with the cultural knowledge query data;
[0131] Step S45: determining cultural knowledge retrieval data using the cultural knowledge topics and cultural knowledge entities associated with the cultural knowledge query data.
[0132] The above-mentioned target knowledge set is the forgotten knowledge set related to the cultural knowledge query data. The above-mentioned forgotten knowledge set is determined by the sensitive data in the application scenario (that is, the data that needs to be avoided from leakage). According to the sensitive data, the data to be forgotten is determined from the learned data of the large language model, and the elimination requirements corresponding to the sensitive data are determined based on the data to be forgotten. In the application scenario, when it is necessary to avoid the leakage of a certain set of sensitive data during the processing of a certain cultural knowledge query data, the elimination requirements corresponding to this set of sensitive data are input into the large language model, so that the large language model forgets the data to be forgotten related to these sensitive data when generating the response content for the cultural knowledge query data, thereby avoiding the leakage of sensitive data.
[0133] The forgotten knowledge set in the application scenario may be in dynamic change, and correspondingly, a large number of elimination demand updates may be issued to the large language model. In the application scenario, on the one hand, since the cultural knowledge query data may involve the elimination demand corresponding to some sensitive data, that is, the context data of the large language model rarely designates all the knowledge in the forgotten knowledge set as sensitive data. On the other hand, the input sequence length of the large language model may also be limited, and it is not appropriate to input all the data in the forgotten knowledge set into the large language model for cultural knowledge query data processing. Therefore, in the embodiment of the present application, data retrieval is performed on the forgotten knowledge set according to the cultural knowledge query data, and the cultural knowledge themes and cultural knowledge entities associated with the cultural knowledge query data are selected, and then the cultural knowledge retrieval data to be obtained in the forgotten knowledge set is determined.
[0134] The above-mentioned cultural knowledge retrieval data can be used to determine relevant elimination requirements corresponding to the cultural knowledge query data, and these relevant elimination requirements are considered in the cultural knowledge query data processing, rather than having to consider all elimination requirements, which will improve the efficiency of cultural knowledge query data processing and the quality of data elimination in the query.
[0135] The data in the above forgotten knowledge set can be stored in the form of cultural knowledge themes and cultural knowledge entities. According to the cultural knowledge query data, the relevant cultural knowledge themes and cultural knowledge entities are retrieved first, and then the cultural knowledge retrieval data is determined based on the relevant cultural knowledge themes and cultural knowledge entities.
[0136] Through the above-mentioned steps S44 to S45, the embodiment of the present application uses retrieval technology to obtain cultural knowledge retrieval data from the forgotten knowledge set based on the cultural knowledge query data. Since the cultural knowledge themes and cultural knowledge entities associated with the cultural knowledge query data are taken into account in the retrieval process, the embodiment of the present application can ensure the high correlation between the acquired cultural knowledge retrieval data and the cultural knowledge query data, thereby ensuring the accuracy of the cultural knowledge query data processing results (that is, the cultural knowledge target response data).
[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0138] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0140] Example 2
[0141] In the operating environment as in Example 1, the present application provides Figure 5 Another data processing method shown. Figure 5 is a flow chart of another data processing method according to Embodiment 2 of the present application, such as Figure 5 As shown, the data processing method includes:
[0142] Step S51, obtaining a query processing request through a first application programming interface;
[0143] Step S52, returning a query processing response through a second application programming interface;
[0144] Among them, the request data carried in the query processing request includes: query data to be processed, the query data is used to provide the question content to be answered, and the response data carried in the query processing response includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is the data obtained from the target data set based on the query data, and the initial reply data is the knowledge that misleads the prediction process of the query data.
[0145] According to the above method steps, a method for implementing a query data processing cloud service is provided, and the method runs on a cloud server. The cloud server obtains a query processing request issued by a service caller through a first application programming interface, determines the content of the question to be answered based on the query data to be processed carried by the query processing request, and then executes the query data processing process, thereby obtaining target reply data corresponding to the query data, and further, the cloud server returns a query processing response corresponding to the target reply data to the service caller through a second application programming interface, so as to provide the target reply data to the service caller.
[0146] The above method steps provided in the embodiment of the present application can be used to provide query data processing services in a preset application scenario, generate target reply data for the query data to be processed in the preset application scenario, and then realize data query in the preset application scenario.
[0147] For example, the query data may be an input query statement, a query sequence, a query vector, etc. The target response data may be a forgotten response generated by machine forgetting. The language model may be a pre-trained large language model.
[0148] For example, the preset application scenarios may be, but are not limited to, scenarios involving the use of large language models for data query in the fields of e-commerce, education, medical treatment, conferences, social networks, financial products, logistics, and navigation. Correspondingly, the large language model may be a specific scenario language model trained for the preset application scenarios, that is, the large language model can demonstrate high performance on specific tasks in the corresponding preset application scenarios.
[0149] It should be noted that in addition to implementing the above data processing method based on a large language model, other machine learning algorithms, rule-based natural language processing algorithms, semantic analysis algorithms, knowledge graphs, rule engines, keyword matching algorithms, etc. can also be used to complete the processing of query data. The machine forgetting technology embodied in the above method steps is combined with the above algorithm or engine to obtain the target response data corresponding to the query data.
[0150] The query data (Input Query) may be the question content to be input into the large language model, and the question content may be represented by a query statement. For example, the query language may be a natural language (NL), a structured query language (SQL), a regular expression, etc.
[0151] The target data set may be a pre-established forgotten data set, in which data to be forgotten is stored. For example, in an application scenario, sensitive data that needs to be prevented from being leaked may be set as data to be forgotten and stored in the forgotten data set.
[0152] In the application scenario, after obtaining the query data, the retrieval data can be retrieved from the UnlearnKnowledge Set according to the query data.
[0153] The retrieved data may be relevant data (Relevant Knowledge) corresponding to the query data, and the relevant data is used as data to be removed in the process of the language model making a response to the query data.
[0154] Further, initial response data corresponding to the query data is generated according to the query data and the retrieval data, and the initial response data may be misleading data (Hallucination). The above-mentioned forgotten knowledge set may be a pre-set data set for forgetting specific data in the training data of the large language model. For example, the forgotten knowledge set may be generated by techniques such as knowledge distillation, reverse training, knowledge pruning, and transfer learning.
[0155] Furthermore, the query data, retrieval data and initial response data are used to obtain target response data. The target response data may be the target response data output by the large language model after the query data, retrieval data and initial response data are input into the large language model. Since the large language model "forgets" the above retrieval data in the process of processing the query data based on the misleading data, the above target response data may be regarded as a forgotten response.
[0156] Through the above-mentioned steps S51 to S52, in an embodiment of the present application, a query processing request is obtained through the first application programming interface; and a query processing response is returned through the second application programming interface; wherein the request data carried in the query processing request includes: query data to be processed, the query data is used to provide question content to be answered, and the response data carried in the query processing response includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data. Therefore, the present application utilizes the knowledge in the forgotten knowledge set corresponding to the query data to generate initial response data, thereby obtaining the target response data through the initial response data, and realizing the model forgetting mechanism in query data processing. This model forgetting mechanism can not only reduce the risk of data leakage in query processing, but also will not bring about a lot of cost increase. In other words, the present application achieves the purpose of giving accurate target response data for query data at a lower cost, thereby achieving the technical effect of improving the forgetting performance of the query data processing model, reducing the risk of sensitive data leakage, and reducing the query data processing cost, and thus solves the technical problem in the related technology that the query data processing model is trained by updating the model parameters or by gradient ascent, and the model forgetting performance is poor, the risk of data leakage is high, and the model training cost is high.
[0157] It should be noted that the preferred implementation of this embodiment can refer to the relevant description in Example 1, which will not be repeated here.
[0158] Example 3
[0159] In the operating environment as in Example 1, the present application provides Figure 6 Another data processing method shown. Figure 6 is a flow chart of another data processing method according to Embodiment 3 of the present application, such as Figure 6 As shown, the data processing method includes:
[0160] Step S61, obtaining the currently input query processing dialogue request;
[0161] Step S62, in response to the query processing dialogue request, returning a query processing dialogue reply; wherein,
[0162] The request data carried in the query processing dialogue request includes: the query data to be processed, the query data is used to provide the question content to be answered, and the information carried in the query processing dialogue reply includes: the target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is the data obtained from the target data set based on the query data, and the initial reply data is the knowledge that misleads the prediction process of the query data;
[0163] Step S63, displaying the target reply data in the graphical user interface.
[0164] According to the above method steps, a visualization scheme for querying data processing functions is provided. The terminal device provides a graphical user interface, and at least one query data processing scenario is displayed in the graphical user interface. The display content of the graphical user interface also includes an input component (such as a text input box, a voice input control, etc.) and a display component (such as a text display window). The user queries the data processing dialogue request through the input component to specify the file operation instruction in the query processing task. After detecting the user's input behavior, the query processing process is executed based on the file operation instruction to obtain the target reply data corresponding to the query data, and further, the target reply data is displayed through the display component in the graphical user interface.
[0165] The above method steps provided in the embodiment of the present application can be used to provide query data processing services in a preset application scenario, generate target reply data for the query data to be processed in the preset application scenario, and then realize data query in the preset application scenario.
[0166] For example, the query data may be an input query statement, a query sequence, a query vector, etc. The target response data may be a forgotten response generated by machine forgetting. The language model may be a pre-trained large language model.
[0167] For example, the preset application scenarios may be, but are not limited to, scenarios involving the use of large language models for data query in the fields of e-commerce, education, medical treatment, conferences, social networks, financial products, logistics, and navigation. Correspondingly, the large language model may be a specific scenario language model trained for the preset application scenarios, that is, the large language model can demonstrate high performance on specific tasks in the corresponding preset application scenarios.
[0168] It should be noted that in addition to implementing the above data processing method based on a large language model, other machine learning algorithms, rule-based natural language processing algorithms, semantic analysis algorithms, knowledge graphs, rule engines, keyword matching algorithms, etc. can also be used to complete the processing of query data. The machine forgetting technology embodied in the above method steps is combined with the above algorithm or engine to obtain the target response data corresponding to the query data.
[0169] The query data (Input Query) may be the question content to be input into the large language model, and the question content may be represented by a query statement. For example, the query language may be a natural language (NL), a structured query language (SQL), a regular expression, etc.
[0170] The target data set may be a pre-established forgotten data set, in which data to be forgotten is stored. For example, in an application scenario, sensitive data that needs to be prevented from being leaked may be set as data to be forgotten and stored in the forgotten data set.
[0171] In the application scenario, after obtaining the query data, the retrieval data can be retrieved from the UnlearnKnowledge Set according to the query data.
[0172] The retrieved data may be relevant data (Relevant Knowledge) corresponding to the query data, and the relevant data is used as data to be removed in the process of the language model making a response to the query data.
[0173] Further, initial response data corresponding to the query data is generated according to the query data and the retrieval data, and the initial response data may be misleading data (Hallucination). The above-mentioned forgotten knowledge set may be a pre-set data set for forgetting specific data in the training data of the large language model. For example, the forgotten knowledge set may be generated by techniques such as knowledge distillation, reverse training, knowledge pruning, and transfer learning.
[0174] Further, the query data, the retrieval data and the initial reply data are used to obtain the target reply data. The target reply data can be the target reply data output by the large language model after the query data, the retrieval data and the initial reply data are input into the large language model. Since the large language model "forgets" the above retrieval data in the process of processing the query data based on the misleading data, the above target reply data can be regarded as a forgotten reply. It is easy to notice that through the above method steps, the initial reply data is generated by using the forgotten knowledge related to the query data in the embodiment of the present application, and it is not necessary to use the entire forgotten knowledge set to generate the initial reply data, which can make the above method steps provided by the present application better applicable to the scene of the dynamic change of the forgotten knowledge set. In the process of processing the query data, the target reply data is generated by the initial reply data, which can reduce the risk of data leakage in the query data processing process. In addition, in the above query data processing process, knowledge forgetting can be completed without involving parameter access and parameter modification of the large language model, avoiding the retraining of the large language model in the process of machine forgetting, reducing the computing resources required in the training and operation of the large language model, and reducing the query data processing cost.
[0175] Through the above-mentioned steps S61 to S63, in an embodiment of the present application, a currently input query processing dialogue request is obtained; in response to the query processing dialogue request, a query processing dialogue reply is returned; wherein, the request data carried in the query processing dialogue request includes: query data to be processed, the query data is used to provide the content of the question to be answered, and the information carried in the query processing dialogue reply includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data; the target reply data is displayed in a graphical user interface. Therefore, the present application utilizes the knowledge in the forgotten knowledge set corresponding to the query data to generate initial response data, thereby obtaining the target response data through the initial response data, and realizing the model forgetting mechanism in query data processing. This model forgetting mechanism can not only reduce the risk of data leakage in query processing, but also will not bring about a lot of cost increase. In other words, the present application achieves the purpose of giving accurate target response data for query data at a lower cost, thereby achieving the technical effect of improving the forgetting performance of the query data processing model, reducing the risk of sensitive data leakage, and reducing the query data processing cost, and thus solves the technical problem in the related technology that the query data processing model is trained by updating the model parameters or by gradient ascent, and the model forgetting performance is poor, the risk of data leakage is high, and the model training cost is high.
[0176] It should be noted that the preferred implementation of this embodiment can refer to the relevant descriptions in the aforementioned embodiments, which will not be repeated here.
[0177] Example 4
[0178] According to an embodiment of the present application, a device embodiment for implementing the above data processing method is also provided. Figure 7 is a structural diagram of a data processing device according to Embodiment 4 of the present application, such as Figure 7 As shown, the device comprises:
[0179] The acquisition module 701 is used to acquire the query data to be processed, wherein the query data is used to provide the content of the question to be answered;
[0180] A first generating module 702 is used to input the query data and the retrieval data into the language model to generate initial response data, wherein the retrieval data is the data to be removed retrieved from the target data set according to the query data, and the initial response data is the misleading data generated in the prediction process of the query data;
[0181] The reply module 703 is used to input the query data, the search data and the initial reply data into the language model to obtain the target reply data corresponding to the query data. Optionally, in addition to all the above modules, the data processing device further includes: a determination module (not shown in the figure), which is used to: perform data search on the target data set according to the query data to obtain the subject and entity associated with the query data; and determine the search data using the subject and entity associated with the query data.
[0182] Optionally, the above-mentioned determination module is also used to: obtain retrieval prompts, wherein the retrieval prompts are used to prompt the screening of topics covered by the query data from multiple candidate topics provided in the target data set; use the retrieval prompt to drive the language model to perform data retrieval on the target data set to obtain topics and entities associated with the query data.
[0183] Optionally, the first generation module 702 is further used to: obtain generation prompts, wherein the generation prompts are used to prompt the generation of misleading content about a specific topic according to preset requirements, and the preset requirements include: generating misleading content according to given data, or, when the given data is empty, generating misleading content according to existing data associated with the specific topic; using the generation prompt to drive the language model to generate initial response data based on the query data and the retrieval data.
[0184] Optionally, the reply module 703 is also used to: obtain context injection prompts, wherein the context injection prompts are used to prompt that the original data is updated with the new data when the original data and the new data are provided; use the context injection prompts to drive the language model to update the retrieved data based on the initial reply data, and answer the query data to obtain the target reply data.
[0185] Optionally, in addition to all the above modules, the above data processing device also includes: a second generation module (not shown in the figure), which is used to: obtain in-distribution data and synthetic data, wherein the in-distribution data is the data that the language model has learned, and the synthetic data is the data that the language model first learns and then removes; generate a target data set based on the in-distribution data and the synthetic data.
[0186] Optionally, the above-mentioned second generation module is also used to: generate a first number of multiple types of questions for each data in the distributed data and each data in the synthetic data, respectively, and set some of the first number of multiple types of questions to query the relationship-level data between different entities about a specific topic, so as to obtain the target data set.
[0187] Optionally, the above-mentioned second generation module is also used to: generate a second number of multiple types of questions for the data set corresponding to the data within the distribution and the data set corresponding to the synthetic data, respectively, and set some of the second number of multiple types of questions to query the relationship-level data between different entities about a specific topic to obtain the target data set; wherein the second number is greater than the first number.
[0188] It should be noted here that the above-mentioned acquisition module 701, first generation module 702 and reply module 703 correspond to steps S21 to S23 in Example 1, and the three modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1.
[0189] According to an embodiment of the present application, a device embodiment for implementing another data processing method in the above-mentioned embodiment 1 is also provided. Figure 8 is a structural diagram of another data processing device according to Embodiment 4 of the present application, such as Figure 8 As shown, the device comprises:
[0190] The acquisition module 801 is used to acquire the cultural knowledge query data to be processed, wherein the cultural knowledge query data is used to provide the cultural knowledge question content to be answered;
[0191] A generation module 802 is used to input the cultural knowledge query data and the cultural knowledge retrieval data into the language model to generate cultural knowledge initial response data, wherein the cultural knowledge retrieval data is the data to be removed obtained from the target data set based on the cultural knowledge query data, and the cultural knowledge initial response data is the knowledge that misleads the prediction process of the cultural knowledge query data;
[0192] The reply module 803 is used to input the cultural knowledge query data, the cultural knowledge retrieval data and the cultural knowledge initial reply data into the language model to obtain the cultural knowledge target reply data corresponding to the cultural knowledge query data.
[0193] Optionally, in addition to all the above-mentioned modules, the above-mentioned data processing device also includes: a determination module (not shown in the figure), which is used to: perform data retrieval on the target data set based on the cultural knowledge query data to obtain the cultural knowledge themes and cultural knowledge entities associated with the cultural knowledge query data; and determine the cultural knowledge retrieval data using the cultural knowledge themes and cultural knowledge entities associated with the cultural knowledge query data.
[0194] It should be noted here that the above-mentioned acquisition module 801, generation module 802 and reply module 803 correspond to steps S41 to S43 in Example 1, and the instances and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1.
[0195] According to an embodiment of the present application, a device embodiment for implementing the data processing method in the above-mentioned embodiment 2 is also provided. Fig. 9 is a structural diagram of another data processing device according to Embodiment 4 of the present application, such as Fig. 9 As shown, the device comprises:
[0196] The request module 901 is used to obtain a query processing request through a first application programming interface;
[0197] A response module 902, configured to return a query processing response via a second application programming interface;
[0198] Among them, the request data carried in the query processing request includes: query data to be processed, the query data is used to provide the question content to be answered, and the response data carried in the query processing response includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is the data obtained from the target data set based on the query data, and the initial reply data is the knowledge that misleads the prediction process of the query data.
[0199] It should be noted here that the request module 901 and the response module 902 correspond to steps S51 to S52 in Example 2, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 2. The above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be run in a computer terminal as part of a device.
[0200] According to an embodiment of the present application, another device embodiment for implementing the data processing method in the above-mentioned embodiment 3 is also provided. Fig.10 is a structural diagram of another data processing device according to Embodiment 4 of the present application, such as Fig.10 As shown, the device comprises:
[0201] Request module 1001, used to obtain the query processing dialogue request currently input;
[0202] The reply module 1002 is used for querying the request data carried in the processing dialogue request, including: query data to be processed, the query data is used to provide the content of the question to be answered, and the information carried in the query processing dialogue reply includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the search data and the initial reply data, the initial reply data is generated based on the query data and the search data, the search data is the data obtained from the target data set based on the query data, and the initial reply data is the knowledge that misleads the prediction process of the query data;
[0203] The display module 1003 is used to display the target reply data in the graphical user interface.
[0204] It should be noted here that the above-mentioned request module 1001, reply module 1002 and display module 1003 correspond to steps S61 to S63 in Example 3, and the instances and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 3.
[0205] It should be noted that the above modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above modules may also be run in a computer terminal as a part of the device.
[0206] It should be noted that the preferred implementation of this embodiment can refer to the relevant descriptions in the aforementioned embodiments, which will not be repeated here.
[0207] Example 5
[0208] According to an embodiment of the present application, an electronic device is also provided, and the electronic device can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above electronic device can also be replaced by a terminal device such as a mobile terminal.
[0209] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0210] In this embodiment, the above-mentioned electronic device can execute the program code of the following steps in the data processing method: obtaining query data to be processed, wherein the query data is used to provide question content to be answered; inputting the query data and retrieval data into the language model to generate initial response data, wherein the retrieval data is the data to be removed retrieved from the target data set based on the query data, and the initial response data is the misleading data generated in the prediction process of the query data; inputting the query data, the retrieval data and the initial response data into the language model to obtain the target response data corresponding to the query data.
[0211] Optionally, Fig.11 is a structural block diagram of an electronic device according to Embodiment 5 of the present application, such as Fig.11 As shown, the electronic device 110 may include: one or more (only one is shown in the figure) processors 1102, a memory 1104, a storage controller 1106, and a peripheral interface 1108, wherein the peripheral interface 1108 is connected to a radio frequency module, an audio module, and a display.
[0212] Among them, the memory 1104 can be used to store software programs and modules, such as program instructions / modules corresponding to the data processing method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned data processing method. The memory 1104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the electronic device 110 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0213] Processor 1102 can call the information and application stored in the memory through the transmission device to perform the following steps: obtain query data to be processed, wherein the query data is used to provide question content to be answered; input the query data and retrieval data into the language model to generate initial response data, wherein the retrieval data is the data to be removed retrieved from the target data set based on the query data, and the initial response data is the misleading data generated in the prediction process of the query data; input the query data, the retrieval data and the initial response data into the language model to obtain the target response data corresponding to the query data.
[0214] Optionally, the processor 1102 may also execute program codes of the following steps: performing data retrieval on the target data set according to the query data to obtain the subject and entity associated with the query data; and determining the retrieval data using the subject and entity associated with the query data.
[0215] Optionally, the processor 1102 may also execute program code for the following steps: obtaining a retrieval prompt, wherein the retrieval prompt is used to prompt the screening of topics covered by the query data from a plurality of candidate topics provided in the target data set; and performing data retrieval on the target data set using a retrieval prompt-driven language model to obtain topics and entities associated with the query data.
[0216] Optionally, the processor 1102 may also execute program code for the following steps: obtaining a generation prompt, wherein the generation prompt is used to prompt the generation of misleading content about a specific topic according to preset requirements, and the preset requirements include: generating misleading content according to given data, or, when the given data is empty, generating misleading content according to existing data associated with the specific topic; using the generation prompt to drive the language model to generate initial response data based on the query data and the retrieval data.
[0217] Optionally, the processor 1102 may also execute program code for the following steps: obtaining context injection prompts, wherein the context injection prompts are used to prompt that the original data is updated with the new data when the original data and the new data are provided; using the context injection prompts to drive the language model to update the retrieved data based on the initial reply data, and answer the query data to obtain the target reply data.
[0218] Optionally, the processor 1102 may also execute program code for the following steps: obtaining in-distribution data and synthetic data, wherein the in-distribution data is data that the language model has learned, and the synthetic data is data that the language model first learns and then removes; and generating a target data set based on the in-distribution data and the synthetic data.
[0219] Optionally, the processor 1102 may also execute program code for the following steps: generating a first number of multiple types of questions for each piece of data in the distributed data and each piece of data in the synthetic data, respectively, and setting some of the first number of multiple types of questions to query relationship-level data between different entities about a specific topic, to obtain a target data set.
[0220] Optionally, the processor 1102 may also execute program code for the following steps: generating a second number of multiple types of questions for the data set corresponding to the data within the distribution and the data set corresponding to the synthetic data, respectively, and setting some of the second number of multiple types of questions to query the relationship-level data between different entities about a specific topic, to obtain a target data set; wherein the second number is greater than the first number.
[0221] Processor 1102 can call the information and application programs stored in the memory through the transmission device to perform the following steps: obtain cultural knowledge query data to be processed, wherein the cultural knowledge query data is used to provide cultural knowledge questions to be answered; input the cultural knowledge query data and cultural knowledge retrieval data into the language model to generate cultural knowledge initial response data, wherein the cultural knowledge retrieval data is the data to be removed obtained from the target data set based on the cultural knowledge query data, and the cultural knowledge initial response data is the knowledge that misleads the prediction process of the cultural knowledge query data; input the cultural knowledge query data, the cultural knowledge retrieval data and the cultural knowledge initial response data into the language model to obtain the cultural knowledge target response data corresponding to the cultural knowledge query data.
[0222] Optionally, the processor 1102 may also execute program code of the following steps: performing data retrieval on the target data set based on the cultural knowledge query data to obtain cultural knowledge topics and cultural knowledge entities associated with the cultural knowledge query data; and determining cultural knowledge retrieval data using the cultural knowledge topics and cultural knowledge entities associated with the cultural knowledge query data.
[0223] Processor 1102 can call the information and application stored in the memory through the transmission device to perform the following steps: obtain a query processing request through a first application programming interface; return a query processing response through a second application programming interface; wherein the request data carried in the query processing request includes: query data to be processed, the query data is used to provide the content of the question to be answered, and the response data carried in the query processing response includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data.
[0224] The processor 1102 can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the currently input query processing dialogue request; respond to the query processing dialogue request and return a query processing dialogue reply; wherein the request data carried in the query processing dialogue request includes: query data to be processed, the query data is used to provide the content of the question to be answered, and the information carried in the query processing dialogue reply includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data; and the target reply data is displayed in a graphical user interface.
[0225] According to an embodiment of the present application, an electronic device for implementing a data processing method is provided. Obtain query data to be processed, wherein the query data is used to provide the content of the question to be answered; input the query data and the retrieval data into a language model to generate initial reply data, wherein the retrieval data is the data to be removed retrieved from the target data set based on the query data, and the initial reply data is the misleading data generated in the prediction process of the query data; input the query data, the retrieval data and the initial reply data into the language model to obtain the target reply data corresponding to the query data. Thus, the embodiment of the present application generates the initial reply data using the knowledge in the forgotten knowledge set corresponding to the query data, thereby obtaining the target reply data through the initial reply data, and realizing the model forgetting mechanism in the query data processing. This model forgetting mechanism can not only reduce the risk of data leakage in the query processing, but also will not bring more cost increases. That is to say, the present application achieves the purpose of giving accurate target reply data for the query data at a lower cost, thereby achieving the technical effect of improving the forgetting performance of the query data processing model, reducing the risk of sensitive data leakage and reducing the query data processing cost, thereby solving the technical problems of poor model forgetting performance, high data leakage risk and high model training cost in the related technology of training the query data processing model by updating the model parameters or gradient ascent.
[0226] It can be understood by those skilled in the art that Fig.11 The structure shown is for illustration only, and the electronic device may also be a terminal device such as a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, and a mobile Internet device (Mobile Internet Devices, MID for short). Fig.11 The structure of the electronic device is not limited. For example, the electronic device 110 may also include Fig.11 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.11 Different configurations shown.
[0227] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.
[0228] Example 6
[0229] According to an embodiment of the present application, a computer-readable storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the data processing method provided in the above embodiment 1, embodiment 2 or embodiment 3.
[0230] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0231] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: obtaining query data to be processed, wherein the query data is used to provide question content to be answered; inputting the query data and retrieval data into a language model to generate initial response data, wherein the retrieval data is data to be removed retrieved from a target data set based on the query data, and the initial response data is misleading data generated in the prediction process of the query data; inputting the query data, retrieval data and initial response data into the language model to obtain target response data corresponding to the query data.
[0232] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: performing data retrieval on the target data set based on the query data to obtain the subjects and entities associated with the query data; and determining the retrieval data using the subjects and entities associated with the query data.
[0233] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: obtaining a retrieval prompt, wherein the retrieval prompt is used to prompt the screening of topics covered by the query data from multiple candidate topics provided in the target data set; using the retrieval prompt to drive the language model to perform data retrieval on the target data set to obtain topics and entities associated with the query data.
[0234] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: obtaining a generation prompt, wherein the generation prompt is used to prompt the generation of misleading content about a specific topic according to preset requirements, and the preset requirements include: generating misleading content according to given data, or, when the given data is empty, generating misleading content according to existing data associated with the specific topic; using the generation prompt to drive the language model to generate initial response data based on the query data and the retrieval data.
[0235] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: obtaining an in-context injection prompt, wherein the in-context injection prompt is used to prompt that the original data is updated with the new data when the original data and the new data are provided; using the in-context injection prompt to drive the language model to update the retrieved data based on the initial reply data, and answer the query data to obtain the target reply data.
[0236] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: obtaining in-distribution data and synthetic data, wherein the in-distribution data is data that the language model has learned, and the synthetic data is data that the language model first learns and then removes; and generating a target data set based on the in-distribution data and the synthetic data.
[0237] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: generating a first number of multiple types of topics for each piece of data in the distributed data and each piece of data in the synthetic data, respectively, and setting some of the first number of multiple types of topics to query relationship-level data between different entities about a specific topic, so as to obtain a target data set.
[0238] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: generating a second number of multiple types of questions for the data set corresponding to the in-distribution data and the data set corresponding to the synthetic data, respectively, and setting some of the second number of multiple types of questions to query relationship-level data between different entities about a specific topic to obtain a target data set; wherein the second number is greater than the first number.
[0239] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: obtaining cultural knowledge query data to be processed, wherein the cultural knowledge query data is used to provide cultural knowledge question content to be answered; inputting the cultural knowledge query data and the cultural knowledge retrieval data into a language model to generate cultural knowledge initial response data, wherein the cultural knowledge retrieval data is data to be removed obtained from a target data set based on the cultural knowledge query data, and the cultural knowledge initial response data is knowledge that misleads the prediction process of the cultural knowledge query data; inputting the cultural knowledge query data, the cultural knowledge retrieval data and the cultural knowledge initial response data into the language model to obtain cultural knowledge target response data corresponding to the cultural knowledge query data.
[0240] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: performing data retrieval on the target data set based on the cultural knowledge query data to obtain cultural knowledge topics and cultural knowledge entities associated with the cultural knowledge query data; and determining the cultural knowledge retrieval data using the cultural knowledge topics and cultural knowledge entities associated with the cultural knowledge query data.
[0241] Optionally, in this embodiment, a computer-readable storage medium is configured to store program code for performing the following steps: obtaining a query processing request through a first application programming interface; returning a query processing response through a second application programming interface; wherein the request data carried in the query processing request includes: query data to be processed, the query data is used to provide question content to be answered, and the response data carried in the query processing response includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data.
[0242] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: obtaining a currently input query processing dialogue request; returning a query processing dialogue reply in response to the query processing dialogue request; wherein the request data carried in the query processing dialogue request includes: query data to be processed, the query data is used to provide question content to be answered, and the information carried in the query processing dialogue reply includes: target reply data corresponding to the query data, the target reply data is obtained using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data; and displaying the target reply data in a graphical user interface.
[0243] According to an embodiment of the present application, a computer-readable storage medium for implementing a data processing method is provided. Obtain query data to be processed, wherein the query data is used to provide the content of the question to be answered; input the query data and the retrieval data into a language model to generate initial reply data, wherein the retrieval data is the data to be removed retrieved from the target data set based on the query data, and the initial reply data is the misleading data generated in the prediction process of the query data; input the query data, the retrieval data and the initial reply data into the language model to obtain the target reply data corresponding to the query data. Thus, the embodiment of the present application generates the initial reply data using the knowledge in the forgotten knowledge set corresponding to the query data, thereby obtaining the target reply data through the initial reply data, and realizing the model forgetting mechanism in the query data processing. This model forgetting mechanism can not only reduce the risk of data leakage in the query processing, but also will not bring more cost increases. That is to say, the present application achieves the purpose of giving accurate target reply data for the query data at a lower cost, thereby achieving the technical effect of improving the forgetting performance of the query data processing model, reducing the risk of sensitive data leakage and reducing the query data processing cost, thereby solving the technical problems of poor model forgetting performance, high risk of data leakage and high model training cost in the related technology of training the query data processing model by updating the model parameters or gradient ascent.
[0244] According to an embodiment of the present application, a computer program product is also provided. Optionally, in this embodiment, the computer program product can provide data processing services based on the data processing method provided in the above embodiment 1, embodiment 2 or embodiment 3.
[0245] Optionally, in this embodiment, the computer program product may be a set of instructions and codes pre-written according to the data processing method. The computer program product may run on various computer platforms, including personal computers, servers, mobile devices, etc.
[0246] Optionally, in this embodiment, the instructions and codes corresponding to the computer program product are used to implement the following method steps: obtaining query data to be processed, wherein the query data is used to provide question content to be answered; inputting the query data and retrieval data into a language model to generate initial response data, wherein the retrieval data is data to be removed retrieved from a target data set based on the query data, and the initial response data is misleading data generated in the prediction process of the query data; inputting the query data, retrieval data and initial response data into the language model to obtain target response data corresponding to the query data.
[0247] Through the above-mentioned computer program product, data processing services can be provided in application scenarios involving large language models and data queries, thereby achieving the purpose of providing accurate target response data for query data at a relatively low cost, thereby achieving the technical effects of improving the forgetting performance of the query data processing model, reducing the risk of sensitive data leakage, and reducing the query data processing cost, thereby solving the technical problems in related technologies of using model parameter update or gradient ascent to train query data processing models, which have poor model forgetting performance, high risk of data leakage, and high model training cost.
[0248] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0249] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0250] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0251] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0252] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0253] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, or all or part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, ROM, RAM, mobile hard disks, magnetic disks or optical disks.
[0254] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: include: Acquire query data to be processed, wherein the query data is used to provide question content to be answered; Inputting the query data and the retrieval data into a language model to generate initial response data, wherein the retrieval data is the data to be removed retrieved from the target data set according to the query data, and the initial response data is the misleading data generated in the prediction process of the query data; The query data, the search data and the initial response data are input into the language model to obtain target response data corresponding to the query data.
2. The data processing method according to claim 1, characterized in that: The data processing method further includes: Performing data retrieval on the target data set according to the query data to obtain the subject and entity associated with the query data; The retrieved data is determined using the subject and entity associated with the query data.
3. The data processing method according to claim 2, characterized in that: The target data set is searched according to the query data to obtain the subjects and entities associated with the query data, including: Obtaining a search prompt, wherein the search prompt is used to prompt screening of topics covered by the query data from a plurality of candidate topics provided in the target data set; The search prompt is used to drive the language model to perform data search on the target data set to obtain topics and entities associated with the query data.
4. The data processing method according to claim 1, characterized in that: Inputting the query data and the search data into the language model to generate the initial response data includes: Obtaining a generation prompt, wherein the generation prompt is used to prompt the generation of misleading content about a specific topic according to preset requirements, and the preset requirements include: generating the misleading content according to given data, or, when the given data is empty, generating the misleading content according to existing data associated with the specific topic; The generation prompt is used to drive the language model to generate the initial response data based on the query data and the retrieval data.
5. The data processing method according to claim 1, characterized in that: Inputting the query data, the search data, and the initial response data into the language model, and obtaining the target response data corresponding to the query data includes: Obtaining an injection prompt in a context, wherein the injection prompt in a context is used to prompt that, when original data and new data are provided, the new data is used to update the original data; The context-injected prompt is used to drive the language model to update the retrieval data based on the initial response data, and to answer the query data to obtain the target response data.
6. The data processing method according to claim 1, characterized in that: The data processing method further includes: Obtain in-distribution data and synthetic data, wherein the in-distribution data is data that the language model has learned, and the synthetic data is data that the language model first learns and then removes; The target data set is generated based on the in-distribution data and the synthetic data.
7. The data processing method according to claim 6, characterized in that: Generating the target data set based on the in-distribution data and the synthetic data includes: A first number of multiple types of questions are generated for each piece of data in the distributed data and each piece of data in the synthetic data, respectively, and some of the first number of multiple types of questions are set to query the relationship-level data between different entities on a specific topic, so as to obtain the target data set.
8. The data processing method according to claim 7, characterized in that: Generating the target data set based on the in-distribution data and the synthetic data further includes: Generate a second number of multiple types of questions for the data set corresponding to the in-distribution data and the data set corresponding to the synthetic data, respectively, and set some of the second number of multiple types of questions to query the relationship-level data between different entities on a specific topic, to obtain the target data set; Wherein, the second number is greater than the first number.
9. A data processing method, characterized in that: include: Acquire cultural knowledge query data to be processed, wherein the cultural knowledge query data is used to provide cultural knowledge question content to be answered; Inputting the cultural knowledge query data and the cultural knowledge retrieval data into a language model to generate cultural knowledge initial response data, wherein the cultural knowledge retrieval data is the data to be removed obtained from the target data set based on the cultural knowledge query data, and the cultural knowledge initial response data is the knowledge that misleads the prediction process of the cultural knowledge query data; The cultural knowledge query data, the cultural knowledge retrieval data and the cultural knowledge initial response data are input into the language model to obtain the cultural knowledge target response data corresponding to the cultural knowledge query data.
10. The data processing method according to claim 9, characterized in that: The data processing method further includes: Performing data retrieval on the target data set according to the cultural knowledge query data to obtain cultural knowledge topics and cultural knowledge entities associated with the cultural knowledge query data; The cultural knowledge search data is determined by using the cultural knowledge topics and cultural knowledge entities associated with the cultural knowledge query data.
11. A data processing method, characterized in that: include: Obtaining a query processing request through a first application programming interface; returning a query processing response via a second application programming interface; Among them, the request data carried in the query processing request includes: query data to be processed, the query data is used to provide question content to be answered, and the response data carried in the query processing response includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, retrieval data and initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data.
12. A data processing method, characterized in that: include: Get the query processing dialog request currently entered; In response to the query processing dialog request, returning a query processing dialog reply; The request data carried in the query processing dialogue request includes: query data to be processed, the query data is used to provide the question content to be answered, and the information carried in the query processing dialogue reply includes: target reply data corresponding to the query data, the target reply data is obtained by using the query data, the retrieval data and the initial reply data, the initial reply data is generated based on the query data and the retrieval data, the retrieval data is data obtained from the target data set based on the query data, and the initial reply data is knowledge that misleads the prediction process of the query data; The target response data is displayed in a graphical user interface.
13. An electronic device, characterized in that: include: A memory storing an executable program; A processor, used to run the program, wherein the program executes the data processing method according to any one of claims 1 to 12 when running.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the computer-readable storage medium is located is controlled to execute the data processing method according to any one of claims 1 to 12.
15. A computer program product, characterized in that The invention comprises a computer program, which implements the data processing method according to any one of claims 1 to 12 when being executed by a processor.
Citation Information
Patent Citations
Verifiable data forgetting privacy protection method and device for minimum-maximum learning model
CN117056957A
Data processing instruction generation method and device, large model training method and device and electronic equipment
CN117112572A
Forgetting learning verification method for image classification model
CN117351309A
Knowledge graph optimized prompt for open-domain common sense reasoning decision making with artificial intelligence
US20240160955A1
Cited By
Trust layer for generative artificial intelligence (AI) application
US20260064879A1
