Language model deployment method and device, electronic equipment and storage medium
Generate training data for specific fields through various data generation methods, and update parameters using language models, solving the problem of lack of specific fields optimization solutions and over-reliance on manual annotation in the existing technology, improving the accuracy of the model in specific fields and realizing automated deployment.
Patent Information
- Application Number
- CN202411619534.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art lacks optimization solutions for specific fields and over-reliance on manual annotation, resulting in low accuracy of models in specific fields.
By obtaining multiple sets of training data generated by multiple data generation methods, including boot data and feedback data related to preset fields, the initial language model is used to extract boot data and generate predictive feedback data, calculate the differential data and update the model parameters, and reduce the dependence on manual annotation.
Improve the accuracy of the model in specific domains, reduce mispredictions caused by inaccurate data, and realizes an automated process of model training to deployment for specific domains.
Smart Images

Figure CN119536750A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device, electronic device and storage medium for deploying a language model. Background Art
[0002] Artificial intelligence technology has developed rapidly, and major breakthroughs have been made in the field of deep learning, which makes the rapid processing and analysis of massive data crucial. Large-scale pre-trained models have shown excellent performance in natural language processing tasks, but they face many challenges when applied to specific fields (such as the automotive field). The current existing technologies present the following conditions: First, they mainly focus on the training and application of general models and lack optimization solutions for specific fields. Second, they rely too much on manual labeling, which is not only costly but also inefficient, resulting in low model accuracy. Summary of the invention
[0003] In view of this, embodiments of the present invention provide a method, device, electronic device and storage medium for deploying a language model to solve the problems of lack of optimization solutions for specific fields and excessive reliance on manual annotation resulting in low model accuracy.
[0004] In a first aspect, an embodiment of the present invention provides a method for deploying a language model, the method comprising:
[0005] Acquire a model training task, wherein the model training task includes a model update type and multiple sets of training data generated by using multiple data generation methods, each set of training data includes first guidance data related to a preset field, and first feedback data corresponding to the first guidance data;
[0006] Inputting the plurality of sets of training data into an initial language model to be trained, extracting the first guide data through the initial language model, and outputting first predicted feedback data and first difference data between the first predicted feedback data and the first feedback data based on the first guide data;
[0007] Determine a target layer in the initial language model whose parameters need to be updated based on the model update type, and update the parameters of the target layer in the initial language model using the first difference data to obtain a target language model;
[0008] A performance test is performed on the target language model to obtain a performance test result. If the performance test result indicates that the performance test passes, a deployment operation of the target language model is executed.
[0009] Furthermore, before acquiring the model training task, the method further includes:
[0010] Acquire a data generation task, wherein the data generation task includes a plurality of first guidance data associated with the preset field;
[0011] inputting the first guidance data into a first language model, extracting the first guidance data through the first language model, and generating guidance feedback data based on the first guidance data;
[0012] Acquire annotated data corresponding to the first guide data, wherein the annotated data is obtained by annotating relevant content of the preset field according to the first guide data;
[0013] The guided feedback data and the labeled data are cross-validated to obtain first feedback data, and multiple sets of training data are constructed based on each of the first guided data and the first feedback data corresponding to the first guided data.
[0014] Further, the cross-validating the guided feedback data and the labeled data to obtain the first feedback data includes:
[0015] Inputting the guidance feedback data and the annotation data into a second language model;
[0016] identifying, by the second language model, whether there is semantically abnormal data in the guidance feedback data and the annotated data;
[0017] If there are semantic abnormal data in the guidance feedback data and the annotated data, the semantic abnormal data in the guidance feedback data and the annotated data are corrected by using the second language model, and the corrected guidance feedback data and the annotated data are used as the first feedback data.
[0018] Further, the determining, based on the model update type, a target layer of the initial language model for which parameters need to be updated includes:
[0019] If the model update type is a full update type, all layers in the initial language model are used as the target layers;
[0020] If the model update type is an incremental update type, a layer or an intermediate layer adjacent to the output layer in the initial language model is used as the target layer;
[0021] If the model update type is a low-rank adaptive fine-tuning type, an adaptation layer added between the layers in the initial language model is used as the target layer.
[0022] Further, the performing a performance test on the target language model to obtain a performance test result includes:
[0023] Acquire multiple sets of verification data, wherein the verification data includes second guidance data related to the preset field, and second feedback data corresponding to the second guidance data;
[0024] Inputting the multiple groups of verification data into the target language model, extracting the second guide data through the target language model, and outputting second prediction feedback data and second difference data between the second prediction feedback data and the second feedback data based on the second guide data;
[0025] If the second difference data satisfies a preset verification condition, then obtaining multiple groups of test data, the test data including third guide data related to the preset field, and third feedback data corresponding to the third guide data;
[0026] Inputting the plurality of test data sets into the target language model, extracting the third guide data through the target language model, and outputting third prediction feedback data based on the third guide data, and third difference data between the third prediction feedback data and the third feedback data;
[0027] Determine whether the third difference data satisfies the preset test conditions and obtain the performance test result, wherein if the third difference data satisfies the preset test conditions, the performance test result is a test pass, or, if the third difference data does not satisfy the preset test conditions, the performance test result is a test fail.
[0028] Furthermore, the method further comprises:
[0029] If the second difference data does not meet the preset verification condition, adjusting the training hyperparameter or training strategy;
[0030] The target language model is trained according to the adjusted training hyperparameter or training strategy until second difference data between the second predicted feedback data and the second feedback data output by the trained target language model meets the preset verification condition.
[0031] Furthermore, the method further comprises:
[0032] If the performance test result is that the test fails, the third feedback data in the plurality of test data sets whose difference with the third feedback data is greater than a preset threshold value is used as feedback data to be expanded;
[0033] Extracting keywords from the feedback data to be expanded, and acquiring related content of the keywords from multiple data sources;
[0034] The feedback data to be expanded in the multiple groups of test data are expanded by using the associated content to obtain the multiple groups of expanded test data, and the multiple groups of expanded test data are used as training data for the next round of training of the target language model.
[0035] In a second aspect, an embodiment of the present invention provides a language model deployment device, the device comprising:
[0036] An acquisition module, used to acquire a model training task, wherein the model training task includes a model update type and multiple sets of training data generated by multiple data generation methods, each set of training data includes first guidance data related to a preset field, and first feedback data corresponding to the first guidance data;
[0037] an input module, configured to input the plurality of sets of training data into an initial language model to be trained, extract the first guide data through the initial language model, and output first predicted feedback data based on the first guide data, and first difference data between the first predicted feedback data and the first feedback data;
[0038] An updating module, configured to determine a target layer of the initial language model whose parameters need to be updated based on the model update type, and update the parameters of the target layer in the initial language model using the first difference data to obtain a target language model;
[0039] The testing module is used to perform a performance test on the target language model to obtain a performance test result. If the performance test result is that the performance test passes, the deployment operation of the target language model is executed.
[0040] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0042] This application generates training data for preset fields through a variety of data generation methods, which provides a basis for model training for specific fields, and a variety of data generation methods reduce the absolute dependence on manual annotation and improve the efficiency and diversity of data generation. Then, the difference data obtained by comparing the first predicted feedback data with the first feedback data is used to update the model parameters, so that the model is constantly adjusted in the right direction, thereby improving the accuracy of the model in a specific field. With continuous training and updating, the model can better understand and handle problems in specific fields and reduce erroneous predictions caused by inaccurate data. The target language model is performance tested, and if the performance test passes, the deployment operation is performed, thereby realizing an automated process from model training to deployment for a specific field. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 is a schematic diagram of a process of generating training data according to some embodiments of the present invention;
[0045] Figure 2 is a schematic diagram of a training data generation process according to some embodiments of the present invention;
[0046] Figure 3 is a flow chart of a method for deploying a language model according to some embodiments of the present invention;
[0047] Figure 4 is a schematic diagram of a training process according to some embodiments of the present invention;
[0048] Figure 5 is a structural block diagram of a language model deployment device according to an embodiment of the present invention;
[0049] Figure 6 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0051] According to an embodiment of the present invention, a method, apparatus, electronic device and storage medium for deploying a language model are 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 may be executed in an order different from that shown here.
[0052] In this embodiment, a method for generating training data is provided. Figure 1 is a flow chart of a method for generating training data according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0053] Step S101, obtaining a data generation task, wherein the data generation task includes a plurality of first guidance data associated with a preset field.
[0054] In the embodiment of the present application, the preset field is first clarified, and the automotive field is taken as an example here. The determination of the preset field provides a clear direction and scope for the subsequent data generation task. In the automotive field, many aspects can be covered, such as vehicle performance parameters (such as engine power, torque, fuel consumption, etc.), vehicle model classification (sedan, SUV, MPV, etc.), car brand characteristics, intelligent driving technology, car safety configuration, etc. The first guide data is an initial guide set to generate data in a specific field. In the automotive field, these guide data can be in various forms: ① Keywords: such as "electric vehicle endurance", "fuel economy", "autonomous driving function", etc. These keywords can guide data generation towards a specific theme direction. ② Problem description: such as "How is the space performance of a certain brand of SUV?", "What are the advantages of hybrid vehicles?" Such questions can prompt the generation of descriptions and analyses of specific models or automotive technologies. ③ Specific scenarios: such as "the stability of the car in the highway driving scenario", "the fuel consumption performance in the city congested road conditions", by setting specific scenarios to guide the generation of more targeted data.
[0055] Step S102: inputting the first guidance data into the first language model, extracting the first guidance data through the first language model, and generating guidance feedback data based on the first guidance data.
[0056] In an embodiment of the present application, these first guide data are input into the first language model Qwen-110B in a suitable manner. Keywords or problem descriptions can be directly passed to the model by text input. The first language model will first extract and analyze these data. For keyword-guided data, the model will identify the topics and concepts represented by the keywords. For example, for "electric vehicle endurance", the model will understand that this is a topic about the endurance of electric vehicles. For problem description-guided data, the first language model will parse the intent and key information of the question. For example, for "What are the advantages of hybrid vehicles?", the model will extract the two key elements of "hybrid vehicles" and "advantages".
[0057] Based on the extraction and understanding of the first guidance data, the first language model begins to generate guidance feedback data. This process is that the model uses its powerful language understanding and generation capabilities to expand and extend according to the input guidance data.
[0058] Specifically, if the input is keyword-guided data, the first language model will generate a detailed description of the keyword, relevant technical explanations, market status, etc.
[0059] If the input is a question description guide data, the first language model will give the corresponding answer and analysis. For example, for "What are the advantages of hybrid vehicles?", the first language model will generate "Hybrid vehicles have multiple advantages. First, it combines the advantages of traditional fuel engines and electric motors. It can provide powerful power when needed, and use electric motors when driving at low speeds or idling, reducing fuel consumption and emissions. Secondly, hybrid vehicles do not require external charging facilities, which makes them more convenient to use. In addition, due to the assistance of electric motors, the acceleration performance of hybrid vehicles is usually also excellent."
[0060] Step S103, obtaining the annotation data corresponding to the first guide data, wherein the annotation data is obtained by annotating the relevant content of the preset field according to the first guide data.
[0061] In the embodiment of the present application, the labeling personnel formulate clear labeling standards according to the characteristics of the preset field and the requirements of the data generation task. These standards may include classification systems, attribute definitions, labeling rules, etc. Taking the automotive field as an example, the labeling standards for vehicle models may include vehicle type (sedan, SUV, MPV, etc.), body size, power type (fuel, electric, hybrid, etc.), configuration level, etc. The labeling standards for technical parameters may include the range division of specific values, the assessment of performance levels, etc.
[0062] Based on the first guide data, the annotator searches for content that can be annotated in the relevant resources in the preset field. This includes professional literature, technical reports, product manuals, news information, user reviews, etc. in the automotive industry. For example, for "functional features of intelligent driving assistance systems", annotators can refer to the official website introduction of automobile manufacturers, automobile evaluation articles, discussions in user forums, etc. to obtain detailed information about the functions of different intelligent driving assistance systems. Then, according to the established annotation standards, the annotator annotates the relevant content found to obtain the annotation data corresponding to the first guide data.
[0063] Step S104 , cross-validating the guided feedback data and the labeled data to obtain first feedback data, and constructing multiple sets of training data based on each first guided data and the first feedback data corresponding to the first guided data.
[0064] In the embodiment of the present application, cross-validation is performed on the guided feedback data and the annotated data to obtain the first feedback data, including the following steps A1-A3:
[0065] Step A1: input the guidance feedback data and the annotation data into the second language model.
[0066] Specifically, the guided feedback data is content generated by the first language model (such as Qwen-110B) based on the first guided data. The annotated data is data obtained by the annotator annotating the relevant content of the preset field (automotive field) according to the first guided data. The guided feedback data and the annotated data are input into the second language model in the form of text. The two types of data can be input separately for separate analysis, or they can be combined for comprehensive analysis, depending on the requirements of the task and the processing capabilities of the model.
[0067] Step A2: using the second language model to identify whether there is semantic abnormal data in the guidance feedback data and the annotated data.
[0068] Specifically, the second language model will check whether there are format errors in the input data. This includes improper use of punctuation, unclear paragraph divisions, inconsistent capitalization, etc. For example, check whether there are missing periods or misused commas; determine whether the paragraphs are reasonably divided, whether there are paragraphs that are too long or too short; check whether the capitalization of English words meets the specifications, etc.
[0069] In terms of semantics, the second language model will analyze whether there are semantic incoherence, unclear logic or ambiguous expressions in the data. For example, determine whether there are grammatical errors in the sentence that lead to unclear semantics; check whether there are logical contradictions or unreasonable reasoning in the text; identify whether the word combination is appropriate, whether there are new words or inappropriate words, etc. If the guidance feedback data contains a statement such as "the battery technology of electric vehicles is developing rapidly, but its battery life is not high, and the charging speed is also very slow, while the price is very cheap", the model will identify the logical contradiction, because under normal circumstances, the rapid development of battery technology should bring benefits such as improved battery life and faster charging speed, rather than the simultaneous existence of low battery life, slow charging and low price.
[0070] The second language model will output the analysis results of the guided feedback data and the annotated data, clearly pointing out the specific locations and problem types where format errors and semantic anomalies exist.
[0071] It should be noted that the situations that are considered as semantic anomalies are first set, such as illogical sentences, ambiguous expressions, unclear concepts, inconsistent contexts, etc. The guided feedback data and the annotated data are input into the second language model, and the model is asked to analyze whether there are data with semantic anomalies. The model can determine whether there are anomalies by processing the text's grammatical analysis, semantic understanding, and contextual association. For example, the model can identify problems such as inconsistent subject and predicate, improper word collocation, and semantic repetition in a sentence.
[0072] Step A3: If there are semantic abnormal data in the guidance feedback data and the annotation data, the semantic abnormal data in the guidance feedback data and the annotation data are corrected by the second language model, and the corrected guidance feedback data and the annotation data are used as the first feedback data.
[0073] Specifically, for the detected semantically abnormal data, further analyze the reasons for the abnormality, including language expression habits, professional knowledge comprehension bias, incomplete information, etc. For example, if the battery capacity of an electric vehicle is marked as "high" in a labeled data, but there is no specific numerical range, this will lead to unclear semantics, and the specific meaning of "high" needs to be further clarified.
[0074] According to the analyzed abnormal reasons, the semantic abnormal data is corrected using the second language model. The second language model can make reasonable correction suggestions based on the context and language rules. The corrected guidance feedback data and the annotated data are integrated to form a unified data set. This data set is used as the first feedback data for subsequent processing and application.
[0075] It should be noted that if Figure 2As shown in the figure, the guidance feedback data generated by the model usually has a certain diversity, but there are problems with accuracy and rationality. Manually annotated data is often more accurate and reliable, and is supported by professional knowledge and experience. Integrating the two can complement each other and make up for their respective shortcomings, thereby improving the overall data quality. At the same time, model-generated data can quickly generate a large amount of different content, covering various situations and angles. Manually annotated data is usually more focused on specific problems and fields, and has a high degree of pertinence. Integrating the two can make the data more diverse and meet different application needs. During the training process, the model can learn new expressions and innovative ideas from the model-generated data, and can also learn accurate knowledge and standardized expressions from the manually annotated data. Finally, constructing multiple sets of training data based on each first guidance data and the corresponding first feedback data can provide more samples and scenarios for model training. Different guidance data can generate different types of training data to meet different training needs.
[0076] In this embodiment, a method for deploying a language model is provided. Figure 3 is a flow chart of a method for deploying a language model according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0077] Step S201, obtaining a model training task, wherein the model training task includes a model update type and multiple sets of training data generated by multiple data generation methods, each set of training data includes first guidance data related to a preset field, and first feedback data corresponding to the first guidance data.
[0078] In the embodiment of the present application, the purpose of the model training task is to update and optimize the model by using specific training data so that it can better perform specific tasks in a preset field. For example, in the automotive field, tasks such as vehicle fault diagnosis, vehicle model classification, and intelligent driving performance evaluation are performed. The model training task includes a model update type and multiple sets of training data.
[0079] Model update type This determines how the model is updated during training, including full update, that is, adjusting all parameters of the model; incremental update, only fine-tuning some parameters to adapt to new data, etc.
[0080] Each set of training data includes the first guidance data related to the preset field and the corresponding first feedback data. The first guidance data is the key to starting the data generation and training process. It can be a specific question, keyword, scenario description, etc., which is used to guide the model to generate relevant content. For example, in the automotive field, the first guidance data can be "the range of electric vehicles" and "the safety of intelligent driving systems". The first feedback data is a response and expansion of the guidance data. It can be the data obtained after the guidance feedback data generated by the model is corrected, or it can be the result of cross-validation of manually labeled data and model-generated data.
[0081] Step S202: input multiple sets of training data into an initial language model to be trained, extract first guide data through the initial language model, and output first predicted feedback data based on the first guide data, as well as first difference data between the first predicted feedback data and the first feedback data.
[0082] In an embodiment of the present application, after the initial language model receives the input data, it will extract the first guide data. This process involves understanding and analyzing the input text, and the model will identify the key information and topics in the guide data. Using the extracted first guide data, the initial language model will attempt to generate first predictive feedback data. This process is that the model responds to and expands the guide data based on its current parameters and internal structure. For example, for the guide data "What are the advantages of electric vehicles?" The model will generate "The advantages of electric vehicles include environmental protection, low noise, fast acceleration, etc."
[0083] Since the model has not been fully trained in its initial state, the first predicted feedback data generated by it has certain uncertainty and inaccuracy. It may not be completely consistent with the real feedback data. Therefore, the first predicted feedback data is compared with the corresponding first feedback data to determine the difference between them. This is a key step in evaluating model performance and determining the training direction.
[0084] For the previous example, if the first feedback data is "Electric vehicles have the advantages of environmental protection, energy saving, and low noise.", and the first predicted feedback data generated by the model is "The advantages of electric vehicles include environmental protection, low noise, fast acceleration, etc.", it can be seen that there are certain differences in the content of the two.
[0085] The first difference data is usually calculated by defining a loss function. The loss function measures the gap between the model prediction and the true value. Its purpose is to make the model continuously adjust parameters during the training process to reduce this gap. For text data, common loss functions such as cross entropy loss and mean square error loss can be used.
[0086] Step S203, determining the target layer of the initial language model whose parameters need to be updated based on the model update type, and updating the parameters of the target layer in the initial language model using the first difference data to obtain a target language model.
[0087] In the embodiment of the present application, determining the target layer of the initial language model for which parameters need to be updated based on the model update type includes:
[0088] ① If the model update type is a full update type, all layers in the initial language model are used as target layers. It should be noted that a full update means a comprehensive adjustment of the model, without missing any parameters that affect the model performance. The initial language model is usually composed of multiple layers, which may include input layers, hidden layers, and output layers. Different layers have different functions in the model. For example, the input layer is responsible for receiving input data and performing preliminary processing, the hidden layer is responsible for abstracting and extracting features from the data, and the output layer generates the final prediction results. Under the full update type, all these layers need to be identified as target layers, which means that every part of the model is adjusted.
[0089] When the full update type is selected, all layers are used as target layers to ensure that the model can fully adapt to the new task, because the new task differs from the original task in many aspects, not just local changes.
[0090] ② If the model update type is incremental update type, the layer or intermediate layer adjacent to the output layer in the initial language model is used as the target layer. It should be noted that incremental update only fine-tunes some layers of the model to reduce the consumption of computing resources and training time. In incremental update, the layer adjacent to the output layer can be used as the target layer for fine-tuning. Because the layers adjacent to the output layer are usually responsible for converting the model from abstract feature representation to specific task output. These layers are more sensitive to the adaptive adjustment of new tasks because they directly affect the final output results of the model.
[0091] In incremental updates, the middle layers can also be used as target layers for fine-tuning. The middle layers are located in the middle of the model and play a connecting role. They receive more general feature representations from the bottom layers and provide more targeted information to the upper layers. At the same time, the middle layers may need to be adjusted according to the characteristics of the new task to better integrate the general features of the bottom layers and the task-specific requirements of the upper layers.
[0092] In addition, in the incremental update, the underlying feature extraction layer will be frozen. This is because the underlying feature extraction layer usually learns more general features, which have a certain degree of universality in different tasks. Freezing the underlying feature extraction layer can avoid unnecessary adjustments to these general features, thereby reducing the consumption of computing resources and training time. At the same time, it can also prevent overfitting, because the underlying feature extraction layer usually has more parameters and is prone to overfitting.
[0093] ③If the model update type is low-rank adaptive fine-tuning type, the adaptation layer added between the layers in the initial language model will be used as the target layer. It should be noted that low-rank adaptive fine-tuning is a method of fine-tuning the model by introducing an adaptive module. The core idea of this method is to fine-tune the model by adding an adaptive module without directly adjusting the weights of the original model. Adaptive modules are usually some lightweight structures, such as adapter layers or low-rank approximation (LoRA) modules, which can be fine-tuned with low computational and storage overhead while maintaining the capabilities of the original model.
[0094] Adaptation layers are added between the layers of the initial language model to fine-tune the model. These adaptation layers can learn the characteristics and patterns of specific tasks, so that the model can better adapt to the needs of new tasks. The weights of the adaptation layers are independent of the original model. This means that when fine-tuning, the weights of the original model are not directly adjusted, thereby maintaining the capabilities of the original model.
[0095] In an embodiment of the present application, the difference data is the gap between the first predicted feedback data and the first feedback data, which is represented by the model training loss function. By inputting multiple sets of training data into the initial language model, the first predicted feedback data is obtained, and then compared with the first feedback data to calculate the difference data. According to the determined target layer and the calculated difference data, the parameters of the target layer in the initial language model are updated. The updating method can adopt common optimization algorithms, such as stochastic gradient descent method, etc. Among them, for the full update type, the difference data is propagated to all layers of the model through the back propagation algorithm, and the parameters of all layers are updated to reduce the gap between the model prediction and the true value. For the incremental update type, only the parameters of the layers adjacent to the output layer or the intermediate layers are updated. According to the difference data, the weights of these layers are adjusted to improve the performance of the model on the new task. For the low-rank adaptive fine-tuning type, only the parameters of the adaptation layer are updated. By adjusting the parameters of the adaptation layer, the model can better adapt to new tasks while maintaining the capabilities of the original model.
[0096] The initial language model after parameter update is used as the target language model. The target language model can respond to input data more accurately and generate appropriate output.
[0097] Step S204, performing a performance test on the target language model to obtain a performance test result. If the performance test result is that the performance test passes, then executing a deployment operation of the target language model.
[0098] In the embodiment of the present application, a performance test is performed on the target language model to obtain a performance test result, including the following steps B1-B5:
[0099] Step B1, obtaining multiple groups of verification data, wherein the verification data includes second guidance data related to a preset field, and second feedback data corresponding to the second guidance data.
[0100] Specifically, the verification data includes second guidance data related to the preset field and corresponding second feedback data. The second guidance data can be questions, descriptions, keywords, etc., which are used to guide the target language model to generate specific outputs. For example, in the automotive field, the second guidance data can be "What is the maximum range of electric vehicles?" "What are the advantages of hybrid vehicles?" and so on. The second feedback data is the correct response or standard answer to the second guidance data. For example, for the guidance data "What is the maximum range of electric vehicles?", the second feedback data can be "The maximum range of mainstream electric vehicles on the market is currently between 300 kilometers and 600 kilometers."
[0101] Step B2: input multiple groups of verification data into the target language model, extract second guide data through the target language model, and output second predicted feedback data based on the second guide data, as well as second difference data between the second predicted feedback data and the second feedback data.
[0102] Specifically, after receiving the input data, the target language model will first extract the second guide data. The model will analyze the structure and semantics of the input text and identify key questions or descriptions. Based on the understanding of the second guide data, the target language model will try to generate second prediction feedback data. This is the model's response to the guide data based on its current parameters and learned knowledge.
[0103] Compare the second predicted feedback data generated by the model with the corresponding second feedback data. This is a key step in evaluating the performance of the model. By comparing, the gap between the model's output and the true answer can be determined. In order to quantify this difference, a loss function is defined. The loss function measures the gap between the model's prediction and the true value. Its purpose is to enable the model to continuously adjust parameters during the training process to reduce this gap. Using the selected loss function, calculate the difference data between the second predicted feedback data and the second feedback data. This difference data is usually a numerical value that indicates the degree of gap between the model's prediction and the true answer. The second difference data reflects the accuracy and reliability of the model when processing the validation data. The smaller the loss value, the closer the model's prediction is to the true answer, and the better the performance of the model.
[0104] This loss value can be used as a feedback signal to adjust the parameters of the model. During the model training process, the parameters of the model are updated according to the gradient of the loss function through optimization algorithms (such as gradient descent), so that the loss value gradually decreases, thereby improving the performance of the model.
[0105] Step B3: if the second difference data satisfies the preset verification condition, multiple groups of test data are obtained, where the test data include third guide data related to the preset field and third feedback data corresponding to the third guide data.
[0106] Specifically, the preset verification condition is used to evaluate whether the performance of the target language model on the verification data meets certain standards. The purpose is to ensure that the model has a certain degree of accuracy and reliability before conducting more rigorous testing. For example, the preset verification condition can be that the model training loss is less than a preset value. This means that when the difference between the model's prediction results on the verification data and the true answer (measured by the loss function) is less than a certain threshold, the model is considered to meet the conditions for entering the testing phase.
[0107] When the second difference data meets the preset verification condition, multiple sets of test data are obtained. The test data is similar to the verification data, and also includes third guidance data related to the preset field and corresponding third feedback data. The third guidance data can be various questions, descriptions or task instructions, which are used to guide the model to generate specific outputs. The third feedback data is the correct response or standard answer to the third guidance data. It can be provided by professionals, extracted from reliable data sources or verified information.
[0108] It should be noted that the test data is usually independent of the validation data and has not been used in the model training and validation process. This ensures the objectivity and reliability of the test results. The role of the test data is to conduct a final evaluation of the target language model to determine the performance of the model in actual applications.
[0109] Step B4, inputting multiple groups of test data into the target language model, extracting third guide data through the target language model, and outputting third predicted feedback data based on the third guide data, as well as third difference data between the third predicted feedback data and the third feedback data.
[0110] Specifically, the third guidance data can be various questions, descriptions or task instructions about cars. For example, "How long does it usually take to charge an electric car?" "What is the off-road performance of a certain brand of SUV?" "Is the maintenance cost of a hybrid car high?" These guidance data should cover different aspects of the automotive field, including performance, technology, price, maintenance, etc., to fully test the capabilities of the target language model. The third feedback data is the real answer or standard response to the third guidance data. Accurate feedback data can be collected by consulting official information from car manufacturers, professional car review articles, car repair manuals and other channels.
[0111] Input the organized test data sets into the target language model in sequence. The third guide data can be passed to the model in a specific format as input text. After receiving the input data, the target language model extracts and analyzes the third guide data. The model identifies key information in the guide data, such as car type, performance keywords, etc. Based on the understanding of the third guide data, the target language model attempts to generate third prediction feedback data. This is the model's response to the guide data based on its current parameters and learned knowledge.
[0112] Compare the third predicted feedback data generated by the model with the corresponding third feedback data. The comparison can be made from multiple perspectives, such as the accuracy, completeness, and logic of the content. In order to accurately measure the degree of difference, the third difference data needs to be calculated. Specific evaluation indicators can be used, such as text similarity algorithms, accuracy, recall, etc. For example, the text similarity between the answer predicted by the model and the true answer can be calculated. If the similarity is high, the difference is small; if the similarity is low, the difference is large. Or the proportion of key information predicted correctly by the model to the key information in the true answer can be counted as the accuracy rate to measure the difference.
[0113] Step B5, determine whether the third difference data meets the preset test conditions and obtain the performance test result, wherein if the third difference data meets the preset test conditions, the performance test result is the test passed, or, if the third difference data does not meet the preset test conditions, the performance test result is the test failed.
[0114] Specifically, a preset test condition is determined, which is a standard for judging whether the model performance is qualified. The preset test condition can be set according to the requirements of the specific task and the needs of the actual application. The calculated third difference data is compared with the preset test condition to determine the performance test result.
[0115] If the third difference data meets the preset test conditions, the performance test result is a passed test. This means that the target language model performs well in the test in the automotive field and can accurately answer questions about cars. For example, if the accuracy of the model reaches more than 80%, it can be considered a passed test.
[0116] If the third difference data does not meet the preset test conditions, the performance test result is a test failure. This indicates that the performance of the model in the automotive field needs to be improved and further training and optimization are required. For example, if the accuracy of the model is less than 80%, the test is considered to have failed.
[0117] This application generates training data for preset fields through a variety of data generation methods, which provides a basis for model training for specific fields, and a variety of data generation methods reduce the absolute dependence on manual annotation and improve the efficiency and diversity of data generation. Then, the difference data obtained by comparing the first predicted feedback data with the first feedback data is used to update the model parameters, so that the model is constantly adjusted in the right direction, thereby improving the accuracy of the model in a specific field. With continuous training and updating, the model can better understand and handle problems in specific fields and reduce erroneous predictions caused by inaccurate data. The target language model is performance tested, and if the performance test passes, the deployment operation is performed, thereby realizing an automated process from model training to deployment for a specific field.
[0118] In an embodiment of the present application, the method also includes: if the second difference data does not meet the preset verification conditions, adjusting the training hyperparameters or training strategies; training the target language model according to the adjusted training hyperparameters or training strategies until the second difference data between the second predicted feedback data and the second feedback data output by the trained target language model meets the preset verification conditions.
[0119] Specifically, after the target language model processes the verification data, if the calculated second difference data (such as model training loss) is higher than the threshold in the preset verification condition, or indicators such as accuracy do not meet the requirements, it can be determined that the second difference data does not meet the preset verification condition.
[0120] Adjustment direction of analysis: ① Learning rate: If the learning rate is too high, the model will oscillate during training and it will be difficult to converge; if the learning rate is too low, the training will be very slow. You can try to appropriately reduce the high learning rate or increase the low learning rate. ② Optimization algorithm: Different optimization algorithms have different characteristics and applicable scenarios. For example, stochastic gradient descent (SGD), Adam, RMSprop, etc., you can try to switch different optimization algorithms to see if the model performance can be improved. ③ Regularization method: Adding regularization terms can prevent overfitting, such as L1 regularization, L2 regularization, Dropout, etc. The regularization parameters can be adjusted to control the complexity of the model. ④ Training strategy: You can consider adopting different training strategies, such as early stopping (stop training when the performance of the model on the validation set begins to decline), learning rate decay (gradually reduce the learning rate as training progresses), etc.
[0121] Based on the results of the analysis, select one or more hyperparameters or training strategies to adjust. You can find a more suitable parameter combination by manual adjustment or by using an automatic hyperparameter optimization algorithm (such as grid search, random search, Bayesian optimization, etc.). Apply the adjusted training hyperparameters to the training process of the target language model and adopt the adjusted training strategy. For example, if the learning rate is adjusted, set the new learning rate to the model's optimizer; if a new optimization algorithm is used, replace the model's optimizer.
[0122] Retrain the target language model according to the adjusted parameters and strategies. Use the training data to iteratively train the model, and continuously update the model parameters to minimize the loss function. During the training process, regularly use the verification data to verify the model, and calculate the second difference data between the second predicted feedback data and the second feedback data. Compare the newly calculated second difference data with the preset verification condition. If the condition is still not met, continue to adjust the hyperparameters or training strategy and train; if the condition is met, the training can be stopped.
[0123] In the embodiment of the present application, the method further includes the following steps C1-C3:
[0124] Step C1: if the performance test result is that the test fails, the third feedback data in the plurality of test data sets whose difference with the third feedback data is greater than a preset threshold value is used as feedback data to be expanded.
[0125] Specifically, Figure 4As shown, when the performance test result is that the test fails, it means that when the target language model processes multiple groups of test data, the third difference data between the third predicted feedback data and the third feedback data output by it does not meet the preset test conditions. This shows that the model performs poorly on some test data. The corresponding third feedback data whose third difference data is greater than the preset threshold value is determined as feedback data to be expanded. For example, in the test in the automotive field, if the model's prediction differs greatly from the actual feedback for the third guide data "What is the maximum cruising range of a certain electric car?" and the difference data exceeds the preset threshold, then the actual feedback data (such as "The maximum cruising range of this electric car is 400 kilometers") is determined as feedback data to be expanded.
[0126] Step C2: extract keywords from the feedback data to be expanded, and obtain related content of the keywords from multiple data sources.
[0127] Specifically, each piece of feedback data to be expanded is analyzed to extract key information as keywords. Keywords can be extracted using methods such as lexical analysis and named entity recognition in natural language processing technology.
[0128] For example, for the feedback data to be expanded, "This electric car has a maximum range of 400 kilometers, uses an advanced battery management system, and has a fast charging speed", the keywords "electric car", "range", "battery management system", "charging speed", etc. can be extracted.
[0129] Identify multiple reliable data sources, which can include professional automotive magazines, official websites of automakers, automotive technology forums, etc. Use keywords to search in these data sources to obtain content related to the keywords. For example, for the keyword "electric vehicle", you can obtain related content such as the latest technological developments in electric vehicles and the characteristics of electric vehicles of different brands from the data source; for the keyword "range", you can obtain factors that affect the range of electric vehicles and methods to increase the range.
[0130] Step C3, using the associated content to expand the feedback data to be expanded in the multiple groups of test data to obtain the expanded multiple groups of test data, and using the expanded multiple groups of test data as training data for the next round of training of the target language model.
[0131] Specifically, the related content obtained from multiple data sources is integrated with the feedback data to be expanded to expand the feedback data to be expanded. The feedback data to be expanded can be expanded by adding relevant descriptions, explanations or examples. For example, for the feedback data to be expanded, "The maximum range of this electric car is 400 kilometers", it can be expanded to "The maximum range of this electric car is 400 kilometers. It uses a high-performance lithium battery and is equipped with an intelligent battery management system, which can effectively improve the efficiency of battery use, thereby extending the range. In addition, when the electric car is running in economy mode, the range can be further improved."
[0132] The expanded feedback data to be expanded is recombined with the corresponding third guide data to form multiple sets of expanded test data. In the next round of model training, the target language model is trained again using the multiple sets of expanded test data until the test passes.
[0133] When the performance test fails, the method provided in the embodiment of the present application can accurately locate the part of the model that performs poorly by using the third feedback data that is greater than the preset threshold value from the third difference data as the feedback data to be expanded. Then, the associated content of the keywords is obtained from multiple data sources and the test data is expanded, so that the model has more diverse and richer information in the next round of training. This dynamic adjustment method can enable the model to continuously learn new knowledge and patterns, gradually adapt to various complex situations, and thus continuously improve its performance. After the test data is expanded, the model faces more diverse inputs in the next round of training, thereby improving its generalization ability, that is, it can also give reasonable prediction feedback when facing new and unseen problems. The iterative optimization method avoids blindly carrying out large-scale data collection and training, saves time and computing resources, and improves the efficiency of model training.
[0134] In this embodiment, a language model deployment device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also and is conceived.
[0135] This embodiment provides a language model deployment device, such as Figure 5 As shown, including:
[0136] An acquisition module 301 is used to acquire a model training task, wherein the model training task includes a model update type and multiple sets of training data generated by multiple data generation methods, each set of training data includes first guidance data related to a preset field, and first feedback data corresponding to the first guidance data;
[0137] An input module 302, configured to input multiple sets of training data into an initial language model to be trained, extract first guide data through the initial language model, and output first predicted feedback data based on the first guide data, as well as first difference data between the first predicted feedback data and the first feedback data;
[0138] An updating module 303 is used to determine a target layer in the initial language model whose parameters need to be updated based on the model update type, and to update the parameters of the target layer in the initial language model using the first difference data to obtain a target language model;
[0139] The testing module 304 is used to perform a performance test on the target language model and obtain a performance test result. If the performance test result is that the performance test passes, the deployment operation of the target language model is executed.
[0140] In an embodiment of the present application, the device also includes: a data generation module, which is used to obtain a data generation task, wherein the data generation task includes multiple first guide data associated with a preset domain; inputting the first guide data into a first language model, extracting the first guide data through the first language model, and generating guide feedback data based on the first guide data; obtaining annotation data corresponding to the first guide data, wherein the annotation data is obtained by annotating relevant content of the preset domain according to the first guide data; cross-validating the guide feedback data and the annotation data to obtain first feedback data, and constructing multiple sets of training data based on each first guide data and the first feedback data corresponding to the first guide data.
[0141] In an embodiment of the present application, a data generation module is used to input guided feedback data and annotated data into a second language model; identify whether there is semantic abnormal data in the guided feedback data and the annotated data through the second language model; if there is semantic abnormal data in the guided feedback data and the annotated data, correct the semantic abnormal data in the guided feedback data and the annotated data through the second language model, and use the corrected guided feedback data and the annotated data as the first feedback data.
[0142] In an embodiment of the present application, the update module 303 is used to take all layers in the initial language model as target layers if the model update type is a full update type; if the model update type is an incremental update type, the layer or intermediate layer adjacent to the output layer in the initial language model is taken as the target layer; if the model update type is a low-rank adaptive fine-tuning type, the adaptation layer added between the layers in the initial language model is taken as the target layer.
[0143] In an embodiment of the present application, the test module 304 is used to obtain multiple sets of verification data, wherein the verification data includes second guide data related to a preset domain, and second feedback data corresponding to the second guide data; input the multiple sets of verification data into a target language model, extract the second guide data through the target language model, and output second prediction feedback data based on the second guide data, and second difference data between the second prediction feedback data and the second feedback data; if the second difference data meets the preset verification condition, then obtain multiple sets of test data, the test data includes third guide data related to the preset domain, and third feedback data corresponding to the third guide data; input the multiple sets of test data into the target language model, extract the third guide data through the target language model, and output third prediction feedback data based on the third guide data, and third difference data between the third prediction feedback data and the third feedback data; determine whether the third difference data meets the preset test condition, and obtain a performance test result, wherein if the third difference data meets the preset test condition, the performance test result is a test pass, or, if the third difference data does not meet the preset test condition, the performance test result is a test fail.
[0144] In an embodiment of the present application, the device also includes: a training adjustment module, which is used to adjust the training hyperparameters or training strategies if the second difference data does not meet the preset verification conditions; and train the target language model according to the adjusted training hyperparameters or training strategies until the second difference data between the second predicted feedback data and the second feedback data output by the trained target language model meets the preset verification conditions.
[0145] In an embodiment of the present application, the device also includes: a data expansion module, which is used to, if the performance test result is that the test fails, use the third feedback data in the multiple groups of test data whose difference with the third data is greater than a preset threshold as the feedback data to be expanded; extract keywords from the feedback data to be expanded, and obtain related content of the keywords from multiple data sources; use the related content to expand the feedback data to be expanded in the multiple groups of test data to obtain the expanded multiple groups of test data, and use the expanded multiple groups of test data as training data for the next round of training of the target language model.
[0146] See also Figure 6 , Figure 6is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0147] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0148] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0149] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of an electronic device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device 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.
[0150] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0151] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0152] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0153] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for deploying a language model, characterized in that: The method comprises: Acquire a model training task, wherein the model training task includes a model update type and multiple sets of training data generated by using multiple data generation methods, each set of training data includes first guidance data related to a preset field, and first feedback data corresponding to the first guidance data; Inputting the plurality of sets of training data into an initial language model to be trained, extracting the first guide data through the initial language model, and outputting first predicted feedback data and first difference data between the first predicted feedback data and the first feedback data based on the first guide data; Determine a target layer in the initial language model whose parameters need to be updated based on the model update type, and update the parameters of the target layer in the initial language model using the first difference data to obtain a target language model; A performance test is performed on the target language model to obtain a performance test result. If the performance test result indicates that the performance test passes, a deployment operation of the target language model is executed.
2. The method according to claim 1, characterized in that Before acquiring the model training task, the method further includes: Acquire a data generation task, wherein the data generation task includes a plurality of first guidance data associated with the preset field; inputting the first guidance data into a first language model, extracting the first guidance data through the first language model, and generating guidance feedback data based on the first guidance data; Acquire annotated data corresponding to the first guide data, wherein the annotated data is obtained by annotating relevant content of the preset field according to the first guide data; The guided feedback data and the labeled data are cross-validated to obtain first feedback data, and multiple sets of training data are constructed based on each of the first guided data and the first feedback data corresponding to the first guided data.
3. The method according to claim 2, characterized in that The cross-validating the guided feedback data and the labeled data to obtain first feedback data includes: Inputting the guidance feedback data and the annotation data into a second language model; identifying, by the second language model, whether there is semantically abnormal data in the guidance feedback data and the annotated data; If there are semantic abnormal data in the guidance feedback data and the annotated data, the semantic abnormal data in the guidance feedback data and the annotated data are corrected by using the second language model, and the corrected guidance feedback data and the annotated data are used as the first feedback data.
4. The method according to claim 1, characterized in that The determining, based on the model update type, a target layer in the initial language model whose parameters need to be updated includes: If the model update type is a full update type, all layers in the initial language model are used as the target layers; If the model update type is an incremental update type, a layer or an intermediate layer adjacent to the output layer in the initial language model is used as the target layer; If the model update type is a low-rank adaptive fine-tuning type, an adaptation layer added between the layers in the initial language model is used as the target layer.
5. The method according to claim 1, characterized in that The performing a performance test on the target language model to obtain a performance test result includes: Acquire multiple sets of verification data, wherein the verification data includes second guidance data related to the preset field, and second feedback data corresponding to the second guidance data; Inputting the multiple groups of verification data into the target language model, extracting the second guide data through the target language model, and outputting second prediction feedback data and second difference data between the second prediction feedback data and the second feedback data based on the second guide data; If the second difference data satisfies a preset verification condition, then obtaining multiple groups of test data, the test data including third guide data related to the preset field, and third feedback data corresponding to the third guide data; Inputting the plurality of test data sets into the target language model, extracting the third guide data through the target language model, and outputting third prediction feedback data based on the third guide data, and third difference data between the third prediction feedback data and the third feedback data; Determine whether the third difference data satisfies the preset test conditions and obtain the performance test result, wherein if the third difference data satisfies the preset test conditions, the performance test result is a test pass, or, if the third difference data does not satisfy the preset test conditions, the performance test result is a test fail.
6. The method according to claim 5, characterized in that The method further comprises: If the second difference data does not meet the preset verification condition, adjusting the training hyperparameter or training strategy; The target language model is trained according to the adjusted training hyperparameter or training strategy until second difference data between the second predicted feedback data and the second feedback data output by the trained target language model meets the preset verification condition.
7. The method according to claim 5, characterized in that The method further comprises: If the performance test result is that the test fails, the third feedback data in the plurality of test data sets whose difference with the third feedback data is greater than a preset threshold value is used as feedback data to be expanded; Extracting keywords from the feedback data to be expanded, and acquiring related content of the keywords from multiple data sources; The feedback data to be expanded in the multiple groups of test data are expanded by using the associated content to obtain the multiple groups of expanded test data, and the multiple groups of expanded test data are used as training data for the next round of training of the target language model.
8. A language model deployment device, characterized in that: The device comprises: An acquisition module, used to acquire a model training task, wherein the model training task includes a model update type and multiple sets of training data generated by multiple data generation methods, each set of training data includes first guidance data related to a preset field, and first feedback data corresponding to the first guidance data; an input module, configured to input the plurality of sets of training data into an initial language model to be trained, extract the first guide data through the initial language model, and output first predicted feedback data based on the first guide data, and first difference data between the first predicted feedback data and the first feedback data; An updating module, configured to determine a target layer of the initial language model whose parameters need to be updated based on the model update type, and update the parameters of the target layer in the initial language model using the first difference data to obtain a target language model; The testing module is used to perform a performance test on the target language model to obtain a performance test result. If the performance test result is that the performance test passes, the deployment operation of the target language model is executed.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.