Data processing method, model fine tuning method and device, equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2026-03-27
AI Technical Summary
When using text-generated large language model (LLM) for natural language processing tasks, how to ensure that the model can better process data in a specific domain while ensuring data security.
The output data is generated by retrieving relevant reference data in a user-authorized database and fusing the original input data with the reference data into enhanced input data, and inputting it into a pre-fine-tuning generative language model. This approach avoids the direct use of a database containing internal private data during the model fine-tuning process, reducing the risk of data breaches.
It realizes that when using generative language models to process data in specific fields, it can not only ensure the efficiency and accuracy of the model, but also effectively protect the security of the data, and avoid the leakage of private data.
Smart Images

Figure CN121753028A_ABST
Abstract
Description
Data processing method, model fine-tuning method, device, equipment and storage medium Technical Field
[0001] The embodiments of the present application relate to the field of language processing technology, and in particular to a data processing method, a model fine-tuning method, an apparatus, an electronic device, and a computer storage medium. Background Art
[0002] In recent years, text-generating LLMs (Large Language Models) based on intensive pre-training have developed rapidly, for example, the ChatGPT model released in 2022. Text-generating LLMs have been widely recognized in the industry for their high performance advantages.
[0003] Text-generating LLMs typically contain a large number of parameters, so their deployment and training require high hardware resources. Currently, most companies access LLMs provided by service providers by registering as users and remotely calling external application program interfaces (APIs) to perform natural language processing tasks such as question-answering, continuous writing, and chat.
[0004] However, the above approach poses a threat to the security of private data within the enterprise. Specifically, the LLM provided by the service provider is usually deployed on devices located outside the enterprise infrastructure. In addition, in order to enable the model to better handle data in the specific field of the enterprise, before using the LLM to perform the corresponding task, the internal database containing the enterprise's private data may be input into the LLM for model fine-tuning training. In this way, the LLM service provider can easily obtain this private data. Therefore, when using text-generating LLM, how to ensure the security of the above-mentioned specific field data while enabling the model to better handle the specific field data is a technical problem that needs to be solved urgently.
[0005] Summary of the Invention
[0006] In view of this, one of the technical problems solved by the embodiments of the present application is to provide a data processing method, a model fine-tuning method, an apparatus, an electronic device and a computer storage medium, so that during the use of a generative language model, the model can better process data in specific fields while ensuring the security of the data.
[0007] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:
[0008] Get the original input data entered by the user;
[0009] Retrieving reference data associated with the original input data from an authorized database for the user; the authorized database is a database to which access rights are opened for the user;
[0010] fusing the original input data and the reference data to obtain enhanced input data;
[0011] The enhanced data is input into a pre-fine-tuned generative language model, and output data is obtained through the generative language model.
[0012] In a second aspect, an embodiment of the present application provides a model fine-tuning method, comprising:
[0013] Obtain a basic language model and a sample question-answer pair; the sample question-answer pair includes: sample input data and corresponding sample output data; the sample input data is obtained by fusing the original sample input data and sample reference data;
[0014] The sample question-answer pairs are used to fine-tune the basic language model to obtain a fine-tuned generative language model.
[0015] In a third aspect, an embodiment of the present application provides a data processing device, including:
[0016] The original input data acquisition module is used to obtain the original input data input by the user;
[0017] A reference data retrieval module, configured to retrieve reference data associated with the original input data from an authorized database for the user; the authorized database is a database to which access rights are opened to the user;
[0018] a fusion module, configured to fuse the original input data and the reference data to obtain enhanced input data;
[0019] The output data obtaining module is used to input the enhanced data into a pre-fine-tuned generative language model to obtain output data through the generative language model.
[0020] In a fourth aspect, an embodiment of the present application provides a model fine-tuning device, comprising:
[0021] A basic model acquisition module is used to obtain a basic language model and sample question-answer pairs; the sample question-answer pairs include: sample input data and corresponding sample output data; the sample input data is obtained by fusing the original sample input data and sample reference data;
[0022] A fine-tuning module is used to fine-tune the basic language model using the sample question-answer pairs to obtain a fine-tuned generative language model.
[0023] In the fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store computer programs, and when the processor is used to execute the programs stored in the memory, the method described in the first aspect or the second aspect is implemented.
[0024] In a sixth aspect, an embodiment of the present application provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
[0025] The embodiments of the present application provide a data processing method, a model fine-tuning method, an apparatus, an electronic device, and a computer storage medium. In the embodiments of the present application, after obtaining the original input data corresponding to the user, reference data associated with the original input data is first retrieved from a database authorized by the user, and then enhanced input data with information enhancement is obtained based on the reference data and the original input data. After that, the enhanced input data is input into a generative language model to obtain output data. In the process of using a generative language model to process language data in the embodiments of the present application, on the one hand, from the perspective of database access, the database that may contain private data is only open to authorized users to retrieve the corresponding reference data; on the other hand, from the perspective of the model being able to better process data in a specific field, the enhanced input data obtained by fusion of reference data and original input data is input into the generative language model, so that the model output content is more dependent on the above-mentioned reference data, and the process of fine-tuning the model based on the database containing the internal private data of the enterprise is avoided. Therefore, the solution provided in the embodiment of the present application can ensure the security of data while enabling the model to better process data in a specific field when using a generative language model for language data processing. That is, while ensuring the accuracy of the model in processing language data in a specific field, it can also ensure the security of data in the above-mentioned specific field. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Hereinafter, some specific embodiments of the present application will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:
[0027] FIG1 is a flow chart of a data processing method provided in an embodiment of the present application.
[0028] FIG2 is a flow chart of a model fine-tuning method provided in an embodiment of the present application.
[0029] FIG3 is a schematic diagram of a scenario of a data processing method provided in an embodiment of the present application.
[0030] FIG4 is a schematic structural diagram of a data processing device provided in an embodiment of the present application.
[0031] FIG5 is a schematic structural diagram of a model fine-tuning device provided in an embodiment of the present application.
[0032] List of reference numerals: 101: Obtaining original input data input by a user; 102: Retrieving reference data associated with the original input data from an authorized database for the user; 103: Fusing the original input data and the reference data to obtain enhanced input data; 104: Inputting the enhanced data into a pre-fine-tuned generative language model to obtain output data through the generative language model; 201: Obtaining a basic language model and a sample question-answer pair; the sample question-answer pair includes: sample input data and corresponding sample output data; 202: Fine-tuning the basic language model using the sample question-answer pair to obtain a fine-tuned generative language model; U1, U1: User; Q: Original input data; B1, B2: Database; R1, R2, R3: Reference data; EQ: Enhanced input data; M: Fine-tuned generative language model; M0: Basic language model; F1: Domain fine-tuning; F2: QRA mechanism fine-tuning; QRA mechanism: Question-Reference-Answer mechanism; 40: Data processing device; 401: Original input data acquisition module; 402: Reference data retrieval module; 403: Fusion module; 404: Output data acquisition module; 50: Model fine-tuning device; 501: Basic model acquisition module; 502: Fine-tuning module. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions 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 embodiments of the present application, all other embodiments obtained by ordinary technicians in this field should fall within the scope of protection of the embodiments of the present application.
[0034] It should be noted that the embodiments and features in the embodiments of this application can be combined with each other unless there is a conflict. The first and second in this application are only for distinguishing names and do not represent a sequential relationship. They should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. For example, the first user, the second user, and the third user are only for distinguishing different users.
[0035] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.
[0036] The present application provides a data processing method. FIG1 is a flow chart of a data processing method provided by the present application. As shown in FIG1 , the method includes the following steps:
[0037] Step 101: Obtain original input data input by the user.
[0038] In the embodiment of the present application, the specific form of the original input data is not limited, for example, it can be plain text data, image data, etc. Further, for ease of implementation, the format of the original input data can be set to plain text format.
[0039] In the embodiment of the present application, there is no limitation on the specific input method used by the user to input the original input data, and the method can be customized according to actual needs, for example, text input, voice input, etc.
[0040] Step 102: Retrieve reference data associated with the original input data from the authorized database for the user.
[0041] Among them, the authorized database is a database that has open access rights to users. The above-mentioned database can be a database specific to a preset field or a preset organization, and the database may contain private data. For example, for enterprise (or organization) A, a corresponding internal database is usually constructed, and the internal database may store data in specific fields closely related to the enterprise, specifically, including private data and non-private data. The above-mentioned internal database is usually only open to internal employees of enterprise A, that is, only internal employees of enterprise A have the authority to access the above-mentioned internal data. The users in this step are the internal employees of the enterprise, and the authorized database is the internal database of the enterprise.
[0042] In the embodiment of the present application, there is no limit on the number and amount of reference data retrieved in step 102. Furthermore, the number of text characters contained in the reference data can be limited to reduce redundant information contained in the reference data. For example, the number of text characters contained therein is set to be less than a preset threshold. In this way, when data is subsequently processed based on the generative language model, the data input to the model will correspondingly contain less redundant information, thereby improving the data processing efficiency of the model.
[0043] Furthermore, in order to obtain relatively simplified reference data (less redundant information), the data in the authorized database can be stored in a preset structured manner. The specific structured manner is not limited in the embodiments of the present application and can be customized as needed. For example, it can be stored in a table format, and the table can include descriptive information of the table data, specific values corresponding to key information, etc.
[0044] In the embodiments of the present application, reference data associated with original input data may refer to data that is semantically associated with the original input data, such as data that is strongly semantically associated with the original input data, or may refer to data that is logically strongly associated with the original input data, such as data that is strongly logically associated with the original input data. Furthermore, the criteria for determining the association between reference data and original input data may be customized based on actual circumstances and are not limited herein.
[0045] Optionally, in an embodiment of the present application, step 102 may specifically include:
[0046] The preset application is called to retrieve reference data associated with the original input data from an authorized database for the user through the preset application.
[0047] In the examples of this application, there is no limitation on the specific content or type of the preset application. Any suitable application that can be used for data retrieval can be used as the preset application in the embodiments of this application, such as: search engines, keyword matching applications, text similarity calculation applications, graph query applications, dictionary query applications, etc.
[0048] Step 103: Fuse the original input data and the reference data to obtain enhanced input data.
[0049] Specifically, the embodiments of the present application do not limit the specific method for fusing the original input data with the reference data, and can be customized according to actual needs. For example, the original input data and the reference data can be directly concatenated to obtain enhanced input data, or the original input data and the reference data can be concatenated first, and then the concatenated result is combined with a preset prompt word to obtain enhanced input data, and so on.
[0050] In step 104 , the enhanced data is input into the pre-fine-tuned generative language model, and output data is obtained through the generative language model.
[0051] A traditional generative language model can be thought of as a black box that takes a text sequence as input and generates another text sequence as output. The input text sequence (input data) is often called a "question," while the output text sequence (input data) is often called an "answer." Thus, a generative language model is a standardized "generative Q / A (Question / Answer)" application.
[0052] In an embodiment of the present application, a new question-and-answer mechanism based on the above-mentioned QA mechanism is proposed: the QRA (question-reference-answer) mechanism. That is to say, the difference from the Q / A mechanism of the traditional generative language model is that: in the embodiment of the present application, reference data is added to the input of the generative language model, so that the model output content is more dependent on the above-mentioned reference data retrieved from the authorized database. In this way, the model does not need to update the reference based on the database containing privacy data in advance, and can better process the data in the specific field to which the authorized database belongs. That is, while ensuring the accuracy of the model's processing of language data in the specific field to which the database belongs, the security of the data is guaranteed.
[0053] When fine-tuning the generative language model, data from the authorized database or data outside the authorized database can be used. However, to improve data security and prevent the leakage of data in the authorized database, in embodiments of the present application, data outside the authorized database, such as data from a public database, can be used when fine-tuning the generative language model.
[0054] In the embodiment of the present application, there are two ways to deploy the fine-tuned generative language model:
[0055] The first type is a text-generating LLM deployed remotely (deployed in other remote devices other than the user's internal infrastructure) by a professional service provider. This type of generative language model usually has a high data processing capability and, accordingly, contains a large number of parameters. Therefore, when a user needs to use the model for data processing, it can be achieved by registering as a user and remotely calling the model's external API. Specifically: the enhanced data can be input into the pre-fine-tuned generative language model by calling the application program interface, and the output data can be obtained through the generative language model; the output data is received. That is, the application program interface provided by the service provider can be called to input the enhanced data into the generative language model deployed in the remote device through the public network to obtain the output data, and the remote device then returns the obtained output data.
[0056] The second method is to deploy the generative language model in the user's internal physical device, specifically: it can be deployed within the firewall. Furthermore, since the larger the scale (number of parameters) of the generative language model, the higher the requirement for hardware resources, in order to reduce the cost of the user's internal infrastructure, the generative language model in this method can be a smaller-scale generative language model compared to the model deployed in the first method. In the embodiment of the present application, the specific scale of the corresponding generative language model is not limited and can be set according to the actual situation of the hardware resources. Specifically: the enhanced data can be input into the generative language model deployed on the internal device through the internal network, and the output data is obtained through the generative language model; and then the output data returned by the internal device is received through the internal network.
[0057] Compared with the above two model deployment methods, the first method directly uses the language model provided by the service provider to process data in the user's specific field. For the user and the organization to which the user belongs (such as an enterprise, etc.), there is no need to deploy and maintain the language model. Therefore, the operation is simple and easy to implement; the second method deploys the model in an internal physical device, which can avoid possible data leakage when transmitting data with the remote device where the model is located through the public network, and the reverse adjustment of the model parameters based on the leaked data, resulting in private data stored in the model parameters.
[0058] The data processing method provided by the embodiment of the present application, after obtaining the original input data corresponding to the user, first retrieves the reference data associated with the original input data from the database authorized by the user, and then obtains the enhanced input data after information enhancement based on the reference data and the original input data, and then inputs the enhanced input data into the generative language model to obtain the output data. In the process of language data processing using the generative language model in the embodiment of the present application, on the one hand, from the perspective of database access, the database that may contain private data is only open to authorized users to retrieve the corresponding reference data; on the other hand, from the perspective of the model being able to better process data in a specific field, the enhanced input data obtained by fusion of reference data and original input data is input into the generative language model, so that the model output content is more dependent on the above-mentioned reference data, and avoids the process of fine-tuning the model based on the database containing the enterprise's internal private data. Therefore, the solution provided by the embodiment of the present application, when using the generative language model for language data processing, can ensure the security of the data while enabling the model to better process data in a specific field, that is, while ensuring the accuracy of the model processing language data in a specific field, it also ensures the security of the data in the above-mentioned specific field.
[0059] Referring to FIG. 2 , FIG. 2 is a flow chart of a model fine-tuning method provided in an embodiment of the present application. The fine-tuning process of the generative language model used in the data processing method provided in an embodiment of the present application is explained below in conjunction with FIG. 2 :
[0060] As shown in Figure 2, the fine-tuning process of the generative language model includes the following steps:
[0061] Step 201: Obtain a basic language model and a sample question-answer pair; the sample question-answer pair includes: sample input data and corresponding sample output data.
[0062] The sample input data is obtained by fusing the original sample input data and the sample reference data.
[0063] Optionally, in an embodiment of the present application, the sample reference data may be data associated with the original sample input data retrieved from a public database, wherein the data contained in the public database may be non-private data in a general domain.
[0064] Alternatively, in another embodiment of the present application, the sample reference data is data retrieved from a public database and associated with the original sample input data. The association in this embodiment of the present application may refer to a semantic association or a logical association. The criteria for determining the association between the sample reference data and the original sample input data can be customized based on actual circumstances and are not limited here.
[0065] Step 202: Fine-tune the basic language model using sample question-answer pairs to obtain a fine-tuned generative language model.
[0066] Optionally, in an embodiment of the present application, step 202 may include:
[0067] Based on the non-privacy data in the associated field associated with the field to which the authorized database belongs, the basic language model is fine-tuned to obtain a domain-fine-tuned language model; sample questions and answers are used to fine-tune the domain-fine-tuned language model to obtain a fine-tuned generative language model.
[0068] Specifically, that is, the basic language model can be fine-tuned based on non-private data in an associated field, where the associated field may refer to a technical field related to the field to which the authorized database belongs.
[0069] In the embodiments of the present application, the non-private data in the aforementioned related fields may be plain text data. The specific form of the plain text data is not limited and may be in any form, for example, in the form of a chapter, a paragraph, a sentence, etc. Furthermore, the non-private data may also be in the form of a sample question-answer pair consisting of sample input data (sample question) and sample output data (sample answer), or a sample question-answer pair consisting of sample enhanced input data and sample output data, etc.
[0070] The model fine-tuning method provided in the embodiment of the present application uses non-private data in a public database (open domain) to fine-tune the QRA mechanism of the generative language model, so that the fine-tuned model can perform data processing based on the QRA mechanism (that is, when the enhanced input data obtained by fusing the reference data and the original input data is input into the model, the model output content is more dependent on the reference data). In this way, while reducing the cost of data collection, the model's ability to generalize external knowledge beyond the model parameters can be improved, thereby improving the accuracy of model data processing.
[0071] In addition, in the embodiments of the present application, before fine-tuning the model using the QRA mechanism based on the non-private data in the public database, the base language model is also fine-tuned based on the non-private data in the related domain to obtain a domain-fine-tuned language model. The domain-fine-tuned language model is then fine-tuned using the QRA mechanism to obtain the final fine-tuned generative language model. Since the related domain is a technical field related to the domain to which the authorized database belongs, the above two model fine-tunings can further improve the accuracy of the model's processing of data in the domain to which the authorized database belongs.
[0072] See Figure 3, which is a schematic diagram of a scenario of a data processing method provided in an embodiment of the present application. The data processing process in the embodiment of the present application is explained below in conjunction with Figure 3:
[0073] Assume that user U1 is an internal employee of organization (enterprise) A1, database B1 is the internal database of organization A1, user U1 has access rights to database B1, and for the original input data Q input by user U1, refer to the content of the curve box on the left side of Figure 3. The data processing flow for Q provided in the embodiment of the present application includes: obtaining the original input data Q input by user U1, searching in database B1, and obtaining reference data associated with the original input data Q: R1, R2, R3,..., fusing the reference data R1, R2, R3,..., and the original input data Q to obtain enhanced input data EQ, and then inputting the enhanced input data EQ into the pre-fine-tuned generative language model M to obtain output data A through M.
[0074] Among them, the fine-tuning process of the generative language model M includes: using non-private data D1 in the associated domain associated with the domain to which B1 belongs, performing domain fine-tuning F1 on the basic language model M0 to obtain a domain fine-tuned language model, and then, based on the sample question and answer pairs retrieved and fused from the public database D2, performing QRA mechanism fine-tuning F2 on the above-mentioned domain fine-tuned language model, thereby obtaining the final fine-tuned generative language model M.
[0075] In addition, the content in the curve box on the right side of Figure 3 is the process of data processing based on the internal database B2 of organization A2 for the original input data input by employee U2 belonging to organization A2. Since this process is the same as the process for Q in the curve box on the left side of Figure 3, it is not described in detail in Figure 3 and will not be repeated here.
[0076] Based on a data processing method provided in any of the above embodiments, an embodiment of the present application provides a data processing device, as shown in FIG4 , which is a schematic structural diagram of a data processing device provided in an embodiment of the present application. The data processing device 40 includes: an original input data acquisition module 401, a reference data retrieval module 402, a fusion module 403, and an output data acquisition module 404;
[0077] The original input data acquisition module 401 is used to acquire the original input data input by the user;
[0078] The reference data retrieval module 402 is used to retrieve reference data associated with the original input data from an authorized database for the user; the authorized database is a database to which the user has opened access rights;
[0079] A fusion module 403 is used to fuse the original input data and the reference data to obtain enhanced input data;
[0080] The output data obtaining module 404 is used to input the enhanced data into the pre-fine-tuned generative language model to obtain output data through the generative language model.
[0081] Optionally, in one embodiment of the present application, the data processing device 40 further includes:
[0082] The generative language model fine-tuning module is used to obtain a basic language model and sample question-answer pairs; the sample question-answer pairs contain: sample input data and corresponding sample output data; the sample input data is obtained by fusing the original sample input data and sample reference data; the sample reference data is data associated with the original sample input data retrieved from a public database; the sample question-answer pairs are used to fine-tune the basic language model to obtain a fine-tuned generative language model.
[0083] Optionally, in one embodiment of the present application, the generative language model fine-tuning module, when executing the step of fine-tuning the basic language model using sample question-answer pairs to obtain a fine-tuned generative language model, is specifically configured to:
[0084] Based on the non-privacy data in the associated field associated with the field to which the authorized database belongs, the basic language model is fine-tuned to obtain a domain-fine-tuned language model; sample questions and answers are used to fine-tune the domain-fine-tuned language model to obtain a fine-tuned generative language model.
[0085] Optionally, in one embodiment of the present application, the reference data retrieval module 402 is specifically configured to:
[0086] The preset application is called to retrieve reference data associated with the original input data from an authorized database for the user through the preset application.
[0087] Optionally, in one embodiment of the present application, the output data obtaining module 404 is specifically used to: input the enhanced data into a pre-fine-tuned generative language model by using an application program interface call, obtain output data through the generative language model; and receive the output data.
[0088] Optionally, in one embodiment of the present application, the pre-fine-tuned generative language model is deployed in an internal physical device; the output data obtaining module 404 is specifically used to: input the enhanced data into the generative language model deployed in the internal device through the internal network, obtain output data through the generative language model; and receive the output data returned by the internal device through the internal network.
[0089] The data processing device of the embodiment of the present application is used to implement the corresponding data processing methods in the aforementioned multiple method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each module in the data processing device of the embodiment of the present application can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.
[0090] Based on a model fine-tuning method provided in any of the above embodiments, an embodiment of the present application provides a model fine-tuning device, as shown in FIG5 . FIG5 is a schematic structural diagram of a model fine-tuning device provided in an embodiment of the present application. The model fine-tuning device 50 includes: a basic model acquisition module 501 and a fine-tuning module 502;
[0091] The basic model acquisition module 501 is used to obtain a basic language model and sample question-answer pairs; the sample question-answer pairs include: sample input data and corresponding sample output data; the sample input data is obtained by fusing the original sample input data and the sample reference data;
[0092] The fine-tuning module 502 is used to fine-tune the basic language model using sample question-answer pairs to obtain a fine-tuned generative language model.
[0093] Optionally, in one embodiment of the present application, the fine-tuning module 502 is specifically used to: fine-tune the basic language model based on non-privacy data in an associated field associated with the field to which the authorized database belongs, to obtain a domain fine-tuned language model; and use sample questions and answers to fine-tune the domain fine-tuned language model to obtain a generative language model that has been fine-tuned.
[0094] The model fine-tuning device of the present embodiment is used to implement the corresponding model fine-tuning methods in the aforementioned multiple method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each module in the model fine-tuning device of the present embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.
[0095] Based on the data processing method or model fine-tuning method described in any of the above embodiments, an embodiment of the present application provides an electronic device, including: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs, and the processor is used to execute the program stored in the memory to implement the method described in any of the above embodiments.
[0096] Based on the data processing method or model fine-tuning method described in any of the above embodiments, an embodiment of the present application provides a computer storage medium storing a computer program, which implements the method described in any of the above embodiments when executed by a processor.
[0097] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0098] The above-described methods according to the embodiments of the present application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored in a remote recording medium or non-transitory machine-readable medium downloaded via a network and then stored in a local recording medium, so that the methods described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the control method of the adjustment machine described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the control method of the adjustment machine shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the control method of the adjustment machine shown herein.
[0099] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0100] Those skilled in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.
[0101] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0102] The above implementation methods are only used to illustrate the embodiments of the present application, and are not intended to limit the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of the present application, and the scope of patent protection of the embodiments of the present application should be defined by the claims.
Claims
1. A data processing method, wherein: The method comprises: Get the original input data entered by the user; Retrieving reference data associated with the original input data from an authorized database for the user; the authorized database is a database to which access rights are opened for the user; fusing the original input data and the reference data to obtain enhanced input data; The enhanced data is input into a pre-fine-tuned generative language model, and output data is obtained through the generative language model.
2. The method according to claim 1, wherein: The fine-tuning process of the generative language model includes: Obtain a basic language model and a sample question-answer pair; the sample question-answer pair includes: sample input data and corresponding sample output data; the sample input data is obtained by fusing the original sample input data and sample reference data; the sample reference data is data associated with the original sample input data retrieved from a public database; The sample question-answer pair is used to fine-tune the basic language model to obtain a fine-tuned generative language model.
3. The method according to claim 2, wherein: The step of fine-tuning the basic language model using the sample question-answer pair to obtain a fine-tuned generative language model includes: Based on non-privacy data in an associated domain associated with the domain to which the authorized database belongs, fine-tuning the basic language model to obtain a domain-fine-tuned language model; The sample question-answer pair is used to fine-tune the domain fine-tuning language model to obtain a fine-tuned generative language model.
4. The method according to any one of claims 1 to 3, wherein: The retrieving reference data associated with the original input data from an authorized database for the user comprises: A preset application is called to retrieve reference data associated with the original input data in an authorized database for the user through the preset application.
5. The method according to any one of claims 1 to 3, wherein: The step of inputting the enhanced data into a pre-fine-tuned generative language model, and obtaining output data through the generative language model, comprises: The enhanced data is input into a pre-fine-tuned generative language model by using an application program interface call, and output data is obtained through the generative language model; The output data is received.
6. The method according to any one of claims 1 to 3, wherein: The pre-fine-tuned generative language model is deployed in an internal physical device; The enhanced data is input into a pre-fine-tuned generative language model, and the generative language model is used to Get output data, including: Inputting the enhanced data into a generative language model deployed on an internal device through an internal network, and obtaining output data through the generative language model; The output data returned by the internal device is received through the internal network.
7. A model fine-tuning method, wherein: The method comprises: Obtain a basic language model and a sample question-answer pair; the sample question-answer pair includes: sample input data and corresponding sample output data; the sample input data is obtained by fusing the original sample input data and the sample reference data; The sample question-answer pairs are used to fine-tune the basic language model to obtain a fine-tuned generative language model.
8. A data processing device, wherein: The device comprises: The original input data acquisition module is used to acquire the original input data input by the user; A reference data retrieval module, used to retrieve reference data associated with the original input data from an authorized database for the user; the authorized database is a database to which access rights are opened to the user; A fusion module, used for fusing the original input data and the reference data to obtain enhanced input data; The output data obtaining module is used to input the enhanced data into a pre-fine-tuned generative language model, and obtain output data through the generative language model.
9. A model fine-tuning device, wherein: The device comprises: A basic model acquisition module is used to acquire a basic language model and a sample question-answer pair; the sample question-answer pair includes: sample input data and corresponding sample output data; the sample input data is obtained by fusing the original sample input data and the sample reference data; The fine-tuning module is used to adopt the sample question-answer pair to fine-tune the basic language model to obtain a fine-tuned generative language model.
10. An electronic device, comprising: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, when used to execute a program stored in a memory, implements the method steps described in any one of claims 1 to 6, or implements the method steps described in claim 7.
11. A computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 6, or implements the method steps according to claim 7.
12. A computer program product tangibly stored on a computer readable medium and comprising computer executable instructions which, when executed, cause at least one processor to perform the method according to any one of claims 1 to 6, or to perform the method steps according to claim 7.