A small model-based large model training method and related device
By using a small-model-based large-model training method, an initial fine-tuning dataset is constructed using a small model for power equipment fault diagnosis, and parameters are fine-tuned. This solves the problem of high computational and time consumption during large-model training and achieves efficient and accurate power equipment fault diagnosis.
Patent Information
- Application Number
- CN202611405221.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-20
AI Technical Summary
Existing large-scale model training methods for power equipment fault analysis require enormous computing power and training time, resulting in a waste of computing and storage resources.
By using a small-model-based large-model training method, an initial fine-tuning dataset is constructed using the diagnostic results of the trained small-model power equipment fault diagnosis system. A target fine-tuning dataset is then generated through quality verification and data expansion. A pre-set fine-tuning platform is used to fine-tune the parameters of the large-model power equipment fault diagnosis system, reducing the need to update all parameters of the model.
It significantly reduces the amount of parameters to be computed and stored during training, reduces the number of training rounds required for iterative convergence, thereby reducing the computing power and time required for training, while ensuring the accuracy of fault diagnosis results.
Smart Images

Figure CN123138799A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and related equipment for training large models based on small models. Background Technology
[0002] The safe and stable operation of power systems depends on the reliable status of various core power equipment such as transformers, circuit breakers, and gas-insulated switchgear. During long-term operation, these devices may experience various faults such as overheating and discharge due to factors like insulation aging, mechanical stress, and environmental corrosion. Timely and accurate identification of the fault type and severity of power equipment is crucial for ensuring the reliability of power grid supply and reducing equipment damage risks and maintenance costs. With the widespread deployment of online monitoring technologies for power equipment and the continuous accumulation of multi-source monitoring data, data-driven intelligent fault diagnosis is gradually becoming an important development direction in the field of power equipment operation and maintenance.
[0003] In the context of intelligent fault diagnosis for power equipment, pre-trained large-scale models, with their powerful semantic understanding, knowledge reasoning, and multi-source data fusion capabilities, can output structured fault diagnosis conclusions based on power equipment monitoring data, and are therefore being gradually introduced into power equipment fault analysis tasks. To ensure the accuracy of diagnostic results and adapt the pre-trained large-scale models to the specific scenario requirements of power equipment fault diagnosis, further training is needed using relevant power equipment fault data to enhance their scenario adaptability and prediction accuracy in power equipment fault diagnosis tasks.
[0004] Existing large-scale model training methods for power equipment fault analysis update all parameters of the pre-trained large-scale model during further training. This involves calculating gradients and iteratively adjusting the parameters of each layer of the pre-trained large-scale model based on power equipment fault-related data. Since the diagnostic large-scale model has a massive number of parameters, fine-tuning all parameters requires performing forward propagation calculations, backward gradient calculations, and parameter updates and storage. Each iteration consumes significant computational and memory resources, and multiple iterations are often needed to ensure model convergence in power equipment fault diagnosis tasks. This results in a huge computational and time-consuming training process. Summary of the Invention
[0005] This invention provides a method and related equipment for training large models based on small models, which solves the technical problem that existing large model training methods for power equipment fault analysis require huge computing power and training time during the training process.
[0006] The first aspect of this invention provides a method for training a large model based on a small model, comprising:
[0007] Acquire power equipment data and input the power equipment data into a trained power equipment fault diagnosis mini-model to obtain fault diagnosis results;
[0008] The diagnostic scenario is determined based on the power equipment data, and an initial fine-tuning dataset is constructed based on the diagnostic scenario, the power equipment data, and the fault diagnosis results.
[0009] The initial fine-tuning dataset is subjected to quality verification and data volume expansion to output the target fine-tuning dataset;
[0010] The parameters of the large-scale power equipment fault diagnosis model are fine-tuned using a preset fine-tuning platform based on the target fine-tuning dataset, resulting in a trained large-scale power equipment fault diagnosis model.
[0011] Optionally, the step of determining the diagnostic scenario based on the power equipment data, and constructing an initial fine-tuning dataset based on the diagnostic scenario, the power equipment data, and the fault diagnosis results, includes:
[0012] The diagnostic scenario is determined based on the equipment type and data category of the power equipment data;
[0013] The power equipment data is used as the input field content of multiple fine-tuning data, and the fault diagnosis results are used as the output field content of the corresponding fine-tuning data.
[0014] The instruction field content for generating corresponding fine-tuning data based on the diagnostic scenario;
[0015] The instruction field content, input field content, and output field content of each of the fine-tuning data are combined and processed to output multiple instruction fine-tuning data;
[0016] The fine-tuning data from multiple instructions is aggregated, and the initial fine-tuning dataset is output.
[0017] Optionally, the step of performing quality verification and data volume expansion on the initial fine-tuning dataset to output the target fine-tuning dataset includes:
[0018] The initial fine-tuning dataset is validated according to preset requirements, and the validation results are output.
[0019] If the verification result indicates that the fine-tuned dataset does not meet the preset requirements, then modify the power equipment data or adjust the model parameters of the trained power equipment fault diagnosis small model to obtain an intermediate fine-tuned dataset.
[0020] The target data volume of the fine-tuning dataset is determined based on the model parameters of the large-scale power equipment fault diagnosis model.
[0021] The actual data volume of the intermediate fine-tuning dataset is statistically analyzed, and the actual data volume is output.
[0022] Compare the actual data volume with the target data volume of the fine-tuned dataset, and output the comparison result;
[0023] If the comparison result shows that the actual data volume is less than the target data volume of the fine-tuning dataset, then the fault cause and fault result data of the corresponding scenario are searched from the preset data map according to the type of the power equipment fault diagnosis small model, and supplemented into the intermediate fine-tuning dataset, and the target fine-tuning dataset is output.
[0024] Optionally, the process of modifying the power equipment data specifically includes:
[0025] Modify the power equipment data to obtain the modified power equipment data;
[0026] The modified power equipment data is re-input into the trained power equipment fault diagnosis small model for fault diagnosis inference, and the corrected fault diagnosis result is output.
[0027] Based on the diagnostic scenario, the modified power equipment data, and the corrected fault diagnosis results, an intermediate fine-tuning dataset is constructed.
[0028] Optionally, the process of adjusting the model parameters of the trained small model for fault diagnosis of power equipment is as follows:
[0029] Adjust the model parameters of the trained small model for power equipment fault diagnosis to obtain the small model for power equipment fault diagnosis with adjusted parameters;
[0030] The power equipment data is input into the power equipment fault diagnosis small model after the parameters are adjusted to perform fault diagnosis reasoning, and the corrected fault diagnosis result is output.
[0031] Based on the diagnostic scenario, the power equipment data, and the corrected fault diagnosis results, an intermediate fine-tuning dataset is constructed.
[0032] Optionally, the preset fine-tuning platform includes a first preset container and a second preset container; the step of using the preset fine-tuning platform to fine-tune the parameters of the power equipment fault diagnosis large model according to the target fine-tuning dataset to obtain a trained power equipment fault diagnosis large model includes:
[0033] A fine-tuning environment is constructed using a first preset container, and an inference environment is constructed using a second preset container.
[0034] In the fine-tuning environment, the parameters of the power equipment fault diagnosis large model are fine-tuned according to the target fine-tuning dataset using a preset fine-tuning method, and the fine-tuning parameters are output.
[0035] The fine-tuning parameters and the original parameters of the large-scale power equipment fault diagnosis model are merged to output the large-scale model with merged parameters.
[0036] In the inference environment, the fine-tuning effect of the large model after merging parameters is detected, and the trained large model for power equipment fault diagnosis is output.
[0037] The preset fine-tuning method includes a first fine-tuning method and a second fine-tuning method;
[0038] The first fine-tuning method is as follows: under the fine-tuning environment, a neural network module is inserted after the feedforward network of the power equipment fault diagnosis model, and the power equipment fault diagnosis model after inserting the neural network module is output.
[0039] The original model parameters of the power equipment fault diagnosis large model are fixed, and the parameters of the neural network module in the power equipment fault diagnosis large model after inserting the neural network module are trained using the fine-tuning environment according to the target fine-tuning dataset, and the fine-tuning parameters are output.
[0040] The second fine-tuning method is as follows: under the fine-tuning environment, the HuggingFace format weights of the power equipment fault diagnosis large model are converted into Megatron-core format weights;
[0041] The target fine-tuning dataset is converted into a new format, and the converted fine-tuning dataset is output.
[0042] Configure low-rank adaptive parameters and parallel parameters, and output LoRA fine-tuning configuration parameters;
[0043] In the fine-tuning environment, the original model parameters of the large-scale power equipment fault diagnosis model are fixed, and the LoRA fine-tuning configuration parameters are used to fine-tune the large-scale power equipment fault diagnosis model according to the Megatron-core format weights and the transformed fine-tuning dataset, and the fine-tuning parameters are output.
[0044] A second aspect of the present invention provides a large model training device based on a small model, comprising:
[0045] The acquisition module is used to acquire power equipment data and input the power equipment data into a trained power equipment fault diagnosis mini-model to obtain fault diagnosis results.
[0046] A construction module is used to determine the diagnostic scenario based on the power equipment data, and to construct an initial fine-tuning dataset based on the diagnostic scenario, the power equipment data, and the fault diagnosis results;
[0047] The dataset module is used to perform quality verification and data volume expansion on the initial fine-tuning dataset, and output the target fine-tuning dataset;
[0048] The fine-tuning module is used to fine-tune the parameters of the large-scale power equipment fault diagnosis model using a preset fine-tuning platform based on the target fine-tuning dataset, so as to obtain a trained large-scale power equipment fault diagnosis model.
[0049] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the large model training method based on a small model as described above.
[0050] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the large model training method based on a small model as described above.
[0051] The fifth aspect of the present invention provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein, when the program instructions are executed by a computer, the computer performs the steps of the large model training method based on a small model as described above.
[0052] As can be seen from the above technical solutions, the present invention has the following advantages:
[0053] The present invention provides a method for training a large model based on a small model. This invention obtains fault diagnosis results by inputting acquired power equipment data into a trained small power equipment fault diagnosis model. The diagnostic output of the trained small model provides reliable supervision for the training of the large model, avoiding the high cost and subjective bias of manually annotating fault diagnosis results. Subsequently, a diagnosis scenario is determined based on the power equipment data, and an initial fine-tuning dataset is constructed according to the diagnosis scenario, power equipment data, and fault diagnosis results. This enables the large power equipment fault diagnosis model to learn the corresponding mapping relationship between power equipment data and fault diagnosis results under specific diagnosis scenarios. Then, the initial fine-tuning dataset is subjected to quality verification and data expansion to obtain the target fine-tuning dataset. Quality verification ensures the accuracy of the fine-tuning data. The accuracy of the correspondence between power equipment data and fault diagnosis results is ensured. The data volume is expanded to meet the requirements of large-scale model parameter fine-tuning, laying a data foundation for efficient and effective parameter fine-tuning. Finally, a pre-set fine-tuning platform is used to fine-tune the parameters of the large-scale power equipment fault diagnosis model based on the target fine-tuning dataset, resulting in a trained large-scale power equipment fault diagnosis model. Parameter fine-tuning is based on the pre-trained large-scale power equipment fault diagnosis model, making targeted parameter adjustments without requiring large-scale updates to all model parameters. This significantly reduces the amount of parameters that need to be calculated and stored during training, as well as the number of training rounds required for iterative convergence. Thus, while enabling the large-scale power equipment fault diagnosis model to learn power equipment fault diagnosis capabilities and ensuring accurate fault diagnosis results, the computational power and training time required for training are effectively reduced. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart illustrating the steps of a large model training method based on a small model, as provided in Embodiment 1 of the present invention.
[0056] Figure 2 A flowchart of another method for training a large model based on a small model, provided in Embodiment 1 of the present invention;
[0057] Figure 3 This is a flowchart illustrating the adjustment of the data volume of the fine-tuning dataset provided in Embodiment 1 of the present invention;
[0058] Figure 4 This is a flowchart of parameter fine-tuning for a pre-trained large model provided in Embodiment 1 of the present invention;
[0059] Figure 5 This is a flowchart of determining fine-tuning parameters provided in Embodiment 1 of the present invention;
[0060] Figure 6 This is another flowchart for fine-tuning parameters of a pre-trained large model provided in Embodiment 1 of the present invention;
[0061] Figure 7 A flowchart of a large model training method based on a small model provided in Embodiment 1 of the present invention;
[0062] Figure 8 This is a structural block diagram of a large model training device based on a small model, provided in Embodiment 2 of the present invention. Detailed Implementation
[0063] This invention provides a method and related equipment for training large models based on small models, which solves the technical problem that existing large model training methods for power equipment fault analysis require huge computing power and training time during the training process.
[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be noted that in the optional embodiments of the present invention, the object information and other related data involved require the permission or consent of the object when the embodiments of the present invention are applied to specific products or technologies, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. That is to say, if the embodiments of the present invention involve data related to the object, it needs to be obtained with the authorization and consent of the object, the authorization and consent of relevant departments, and in compliance with relevant laws, regulations, and standards. If personal information is involved in the embodiments, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject is required, and the embodiments also need to be implemented with the authorization and consent of the object.
[0065] The method for training large models based on small models provided in this application relates to the field of artificial intelligence technology. This method can be applied to terminals, servers, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the method for training large models based on small models, but is not limited to the above forms.
[0066] Please see Figure 1 , Figure 1 The flowchart illustrates the steps of a large model training method based on a small model, as provided in Embodiment 1 of the present invention.
[0067] This invention provides a method for training a large model based on a small model, comprising:
[0068] Step 101: Obtain power equipment data and input the power equipment data into the trained power equipment fault diagnosis small model to obtain fault diagnosis results.
[0069] It should be noted that the power equipment data includes, but is not limited to, transformer oil chromatography data (including time-series data on the content of gases such as acetylene, hydrogen, methane, ethane, ethylene, carbon monoxide, and carbon dioxide), circuit breaker-related monitoring data, and gas-insulated switchgear-related monitoring data. This data covers all scenarios of power equipment faults, and multiple fault data sets for a single scenario are required (for example, transformer oil chromatography fault data should cover scenarios such as no fault, overheating, and discharge; overheating faults should cover low-temperature overheating, medium-temperature overheating, and high-temperature overheating scenarios). The above power equipment data is collected in real-time by online monitoring devices or retrieved from the power equipment operation and maintenance data system. Based on the equipment type in the power equipment data, a corresponding trained power equipment fault diagnosis mini-model (including transformer diagnosis model, circuit breaker diagnosis model, or gas-insulated switchgear diagnosis model) is selected. The power equipment data is input into this trained power equipment fault diagnosis mini-model for fault diagnosis inference, and the fault diagnosis result is output. This fault diagnosis result is used as the output field content when subsequently constructing the initial fine-tuning dataset.
[0070] Specifically, power equipment data should cover all scenarios of power equipment failure, and multiple failure data entries should be prepared for each scenario. For example, transformer oil chromatography failure data should cover multiple scenarios such as no equipment failure, overheating, and discharge, while overheating failure data should cover low-temperature overheating, medium-temperature overheating, and high-temperature overheating scenarios.
[0071] Among them, the small-scale power equipment fault diagnosis model refers to a predictive model for a specific application. These models include, but are not limited to, transformer diagnostic models, circuit breaker diagnostic models, or gas-insulated switchgear diagnostic models. Specifically, the transformer diagnostic model can be a model for fault diagnosis based on transformer oil chromatography data; the circuit breaker diagnostic model can be a model for fault diagnosis based on circuit breaker mechanical characteristics and electrical condition monitoring data; and the gas-insulated switchgear diagnostic model can be a model for fault diagnosis based on partial discharge and gas condition monitoring data. The input to the small-scale power equipment fault diagnosis model is power equipment data, and the output is the fault diagnosis result. The fault diagnosis result specifically includes whether the equipment has a fault, the fault type (e.g., overheating fault, discharge fault, etc.), the severity of the fault, whether shutdown is required, and handling suggestions.
[0072] In this embodiment, the power equipment data specifically includes transformer oil chromatographic data (including time-series data on the content of gases such as acetylene, hydrogen, methane, ethane, ethylene, carbon monoxide, and carbon dioxide), circuit breaker-related monitoring data, and gas-insulated switchgear-related monitoring data. This data needs to cover all scenarios of power equipment faults, and multiple fault data points need to be prepared for each scenario (for example, transformer oil chromatographic fault data needs to cover scenarios such as no fault, overheating, and discharge; overheating faults need to cover low-temperature overheating, medium-temperature overheating, and high-temperature overheating scenarios). The dissolved gas content in transformer oil, the mechanical characteristics and electrical status of circuit breakers, and the partial discharge and gas status of gas-insulated switchgear are collected in real time using an online power equipment monitoring device, or historical monitoring records are retrieved from the power equipment operation and maintenance data system according to equipment number and time range to obtain the aforementioned power equipment data. A matched, pre-trained power equipment fault diagnosis mini-model is selected based on the equipment type corresponding to the power equipment data. The model selects three diagnostic models: transformer diagnostic model when the power equipment data is transformer oil chromatography data, circuit breaker diagnostic model when the power equipment data is circuit breaker related monitoring data, and gas-insulated switchgear diagnostic model when the power equipment data is gas-insulated switchgear related monitoring data. The power equipment data is input into the selected, trained power equipment fault diagnosis model. This model performs fault diagnosis reasoning on the power equipment data. Taking the transformer diagnostic model as an example, it sequentially performs reasoning steps on the transformer oil chromatography data, including data validity verification, gas content and weekly increment calculation, comparison of outage and attention values, three-ratio method for fault type determination, and solid insulation involvement determination. The output includes fault diagnosis results such as whether the equipment has a fault, fault type (e.g., high-temperature overheating fault, discharge fault), fault severity, whether shutdown is required, and handling suggestions. These fault diagnosis results are used as output fields when constructing the initial fine-tuning dataset.
[0073] Step 102: Determine the diagnostic scenario based on the power equipment data, and construct an initial fine-tuning dataset based on the diagnostic scenario, power equipment data, and fault diagnosis results.
[0074] It should be noted that the diagnostic scenario is determined based on the equipment type and data category of the power equipment data (e.g., the diagnostic scenario is determined to be transformer oil chromatography fault diagnosis scenario based on the power equipment data being transformer oil chromatography data). The power equipment data is used as the input field content for each fine-tuning data, and the fault diagnosis results are used as the output field content for each corresponding fine-tuning data. Corresponding instruction field content is generated according to the diagnostic scenario (e.g., "You are a transformer fault diagnosis expert. Based on the transformer oil chromatography data provided by the user, diagnose whether the current equipment has a fault and the specific fault type"). The instruction field content, input field content, and output field content of each group are synthesized to obtain multiple instruction fine-tuning data. The multiple instruction fine-tuning data are aggregated to output the initial fine-tuning dataset. This initial fine-tuning dataset is used for subsequent quality verification and data volume expansion.
[0075] Furthermore, step 102 may include the following sub-steps:
[0076] S21. Determine the diagnostic scenario based on the equipment type and data category of the power equipment data;
[0077] S22. Use the power equipment data as the input field content of multiple fine-tuning data, and use the fault diagnosis results as the output field content of the corresponding fine-tuning data.
[0078] S23. Instruction field content for generating corresponding fine-tuning data based on the diagnostic scenario;
[0079] S24. Combine the instruction field content, input field content, and output field content of each fine-tuning data to output multiple instruction fine-tuning data;
[0080] S25. Collect the fine-tuning data from multiple instructions and output the initial fine-tuning dataset.
[0081] See Figure 2 The process merges power equipment data with fault diagnosis results from proprietary small models to generate fine-tuning data. Power equipment data serves as the "input" to the fine-tuning data, while the diagnostic results from the proprietary small models serve as the "output." Further, based on the specific diagnostic scenario of the power equipment, "instructions" are added to the fine-tuning data, synthesizing the final instruction-based fine-tuning data. Due to the large volume of fine-tuning data, scripts can be used to automate its preparation.
[0082] Subsequently, on a pre-defined fine-tuning platform, the parameters of the pre-trained large model are fine-tuned using a fine-tuning dataset to obtain a trained large model. Fine-tuning the parameters of the pre-trained large model means freezing most of the original parameters of the pre-trained model and selectively fine-tuning only a small number of additional or key parameters, thereby significantly reducing computational and storage costs. Fine-tuning the parameters of the pre-trained large model includes, but is not limited to, fine-tuning the parameters of the pre-trained large model itself, or fine-tuning the input or output of the pre-trained large model while fixing its parameters.
[0083] In one specific embodiment, the specific data structure for fine-tuning data is as follows.
[0084] "instruction": "You are a transformer fault diagnosis expert. Based on the transformer oil chromatography data provided by the user, diagnose whether the current equipment has a fault and the specific type of fault."
[0085] The input data for transformer oil chromatographic analysis on August 1, 2022, is as follows: acetylene 0.10 μL / L, hydrogen 124.77 μL / L, methane 54.09 μL / L, ethane 4.41 μL / L, ethylene 38.09 μL / L, carbon monoxide 84.44 μL / L, and carbon dioxide 633.28 μL / L. The data for August 5, 2022, is as follows: acetylene 0.18 μL / L, hydrogen 127.15 μL / L, methane 56.92 μL / L, ethane 4.64 μL / L, ethylene 40.01 μL / L, carbon monoxide 85.76 μL / L, and carbon dioxide 642.22 μL / L. The data for August 7, 2022, is as follows: The chromatographic data for transformer oil on August 8, 2022, were: acetylene 0.27 μL / L, hydrogen 129.53 μL / L, methane 59.75 μL / L, ethane 4.86 μL / L, ethylene 41.93 μL / L, carbon monoxide 86.93 μL / L, and carbon dioxide 650.99 μL / L. The chromatographic data for transformer oil on August 13, 2022, were: acetylene 0.35 μL / L, hydrogen 131.91 μL / L, methane 62.59 μL / L, ethane 5.09 μL / L, ethylene 43.84 μL / L, carbon monoxide 87.87 μL / L, and carbon dioxide 661.01 μL / L. The chromatographic data for transformer oil on August 13, 2022, were: acetylene 0.43 μL / L, hydrogen 134.28 μL / L, methane 65.99 μL / L. The chromatographic data for transformer oil on August 18, 2022 were: acetylene 0.52 μL / L, hydrogen 136.66 μL / L, methane 68.25 μL / L, ethane 5.54 μL / L, ethylene 47.68 μL / L, carbon monoxide 90.32 μL / L, and carbon dioxide 677.48 μL / L. The chromatographic data for transformer oil on August 22, 2022 were: acetylene 0.60 μL / L, hydrogen 139.04 μL / L, methane 71.08 μL / L, ethane 5.77 μL / L, and ethylene 49.60 μL / L. The values for acetylene, hydrogen, methane, carbon monoxide, and carbon dioxide were 42 μL / L, 5.32 μL / L, 45.76 μL / L, 89.33 μL / L, and 668.61 μL / L. The chromatographic data for transformer oil on August 26, 2022 were: acetylene 0.72 μL / L, hydrogen 145.02 μL / L, methane 74.71 μL / L, ethane 6.08 μL / L, ethylene 53.02 μL / L, carbon monoxide 92.65 μL / L, and carbon dioxide 694.36 μL / L. The chromatographic data for transformer oil on August 31, 2022 were: acetylene 0.80 μL / L, hydrogen 147.65 μL / L, methane 77.96 μL / L, ethane 6.36 μL / L, ethylene 54.89 μL / L, carbon monoxide 93.82 μL / L, and carbon dioxide 703.65 μL / L. The values for carbon monoxide and carbon dioxide were as follows: [List of values would be inserted here].
[0086] "output": "Transformer Fault Diagnosis Report (Strictly follow the process steps), Step 1: Check the validity of the oil chromatography data, verifying that all data contain hydrogen, methane, ethane, ethylene, acetylene, carbon monoxide, and carbon dioxide. Conclusion: All data are valid. Step 2: Calculate the acetylene increment, time span: 2022-08-01 to 2022-08-31 (30 days ≥ 7 days → calculate weekly increment. Base date: 2022-08-31. Start date selection: 7 days from the base date is 2022-08-24 (no data), select the nearest previous date 2022-08-22 (9 days away). Acetylene increment: 0.80μL / L (base date) - 0.60μL / L (start date) = 0.20 μL / L. Acetylene weekly increment conversion: (0.20 μL / L × 7) / 9 ≈ 0.16 μL / L. Conclusion: 0.16 μL / L < shutdown value 2 μL / L → no shutdown required. Step 3: Check absolute content shutdown value. Acetylene content (base date): 0.80 μL / L < 5 μL / L. Total hydrocarbon content (base date): 77.96 (methane) + 6.36 (ethane) + 54.89 (ethylene) + 0.80 (acetylene) = 140.01 μL / L < 450 μL / L. Conclusion: Not exceeding shutdown value → continue process. Step 4: Determine absolute content warning value (marked A). Total hydrocarbon content: 140.01 μL / L < 150 μL / L → A1 = 0. Acetylene content: 0 0.80μL / L < 1μL / L → A2 = 0. Conclusion: A = 0. Step 5: Determine the weekly increment warning value (marked B). Calculation of total hydrocarbon weekly increment: Starting day (2022-08-22) total hydrocarbons: 127.05μL / L. Baseline day total hydrocarbons: 140.01μL / L. Increment: 140.01 - 127.05 = 12.96μL / L. Weekly increment conversion: (12.96 × 7) / 9 = 10.08μL / L. Total hydrocarbon warning value check: 10.08μL / L ≥ 10μL / L → B1 = 1. Acetylene weekly increment: 0.16μL / L < 0.6μL / L → B2 = 0. Conclusion: B = 1. Step 6: AB = 00 condition check, AB = 01 ≠ 00 → Skip. Step 7: AB=10 condition check, AB=01≠10 → Skip. Step 8: Fault diagnosis (three-ratio method), take the base date data (2022-08-31): X=acetylene / ethylene=0.80 / 54.89≈0.0146 → Code 0. Y=methane / hydrogen=77.96 / 147.65=0.5280 → Code 0. Z=ethylene / ethane=54.89 / 6.36=8.6305 → Code 2. Three-ratio code: XYZ=002. Fault type judgment: 002 → High temperature overheating fault. Step 9: Solid insulation judgment, carbon monoxide (base date): 93.82μL / L. Carbon dioxide (base date): 703.65μL / L.R = Carbon dioxide / Carbon monoxide = 703.65 / 93.82 = 7.50 ≥ 7. Conclusion: The fault involves solid insulation. Step 10: Diagnostic summary, Fault existence: Yes. Fault type: High temperature overheating fault. Shutdown required: No. Handling recommendations: 1. Shorten the oil chromatography monitoring cycle to once a week, closely monitor the gas growth rate. 2. Check the transformer load to confirm whether there is overload operation. 3. Check the cooling system operation status to ensure good heat dissipation.
[0087] In this embodiment, the equipment identification information carried in the power equipment data is first read to identify the equipment type (transformer, circuit breaker, or gas-insulated switchgear). The data category is then identified based on the data fields (e.g., data containing gas content fields such as acetylene, hydrogen, methane, ethane, ethylene, carbon monoxide, and carbon dioxide is transformer oil chromatography data). The combination of equipment type and data category is matched with a preset diagnostic scenario mapping table to determine the corresponding diagnostic scenario. Subsequently, each data record in the power equipment data is traversed, and the complete content of each data record (e.g., time-series data of various gas contents in transformer oil chromatography over a certain time span) is assigned as the input field content of each fine-tuning data record. Simultaneously, the fault diagnosis results are traversed, and each record corresponds one-to-one with a specific power equipment data record. The fault diagnosis results (e.g., the corresponding transformer fault diagnosis report) are assigned the output field content of each corresponding fine-tuning data. Then, based on the determined diagnosis scenario, a matching instruction template is selected from the preset instruction template library (e.g., for the transformer oil chromatography fault diagnosis scenario, "You are a transformer fault diagnosis expert. Based on the transformer oil chromatography data provided by the user, diagnose whether the current equipment has a fault, and the specific fault type"). The key information of the diagnosis scenario is filled into the template to generate the instruction field content shared by each fine-tuning data in that scenario. Then, for each group of corresponding instruction field content, input field content, and output field content, a preset structured data format (e.g., JSON format containing instruction, input, and output fields in JavaScript) is applied. Object Notation (JavaScript object notation) is encapsulated and synthesized to generate a single instruction fine-tuning dataset. After traversing all groups, multiple instruction fine-tuning datasets are output. Due to the large number of fine-tuning datasets, the above synthesis process can be automated through a script. Finally, the multiple instruction fine-tuning datasets are stored in the same dataset in a preset order (e.g., grouped by device type and then sorted by time) to output the initial fine-tuning dataset. This initial fine-tuning dataset is used for subsequent quality verification and data expansion. By transforming the diagnostic capabilities of the small power equipment fault diagnosis model into instruction fine-tuning samples that the large power equipment fault diagnosis model can learn, a data foundation is provided for subsequent training of the large power equipment fault diagnosis model using parameter fine-tuning. This allows the large model to learn power equipment fault diagnosis capabilities without large-scale updates to all parameters, thereby indirectly reducing the computing power and training time required for the training process.
[0088] Step 103: Perform quality verification and data volume expansion on the initial fine-tuning dataset, and output the target fine-tuning dataset.
[0089] It should be noted that the initial fine-tuning dataset is manually reviewed to meet preset requirements. If the initial fine-tuning dataset does not meet the preset requirements (e.g., incorrect correspondence between input and output field content, inaccurate fault diagnosis results), the fault diagnosis results are obtained by modifying the power equipment data and re-inputting it into the trained power equipment fault diagnosis mini-model, or by adjusting the model parameters of the trained power equipment fault diagnosis mini-model and re-inputting the power equipment data. The fine-tuning dataset is then reconstructed based on the diagnostic scenario until an intermediate fine-tuning dataset that meets the preset requirements is obtained. Subsequently, based on the power... A certain proportion of the model parameters of the large-scale power equipment fault diagnosis model determines the target data size of the fine-tuning dataset (for example, when the parameter size of the large-scale power equipment fault diagnosis model is 8B-32B, the target data size is 5000-10000 records). The actual data size of the intermediate fine-tuning dataset is counted and compared with the target data size. If the actual data size is less than the target data size, the fault cause and fault result data of the corresponding scenario are searched from the preset data map according to the type of the trained small-scale power equipment fault diagnosis model and added to the intermediate fine-tuning dataset. The target fine-tuning dataset is then output, which is used for subsequent parameter fine-tuning of the large-scale power equipment fault diagnosis model.
[0090] Furthermore, step 103 may include the following sub-steps:
[0091] S31. Perform preset requirement verification on the initial fine-tuning dataset and output the verification results;
[0092] S32. If the verification result shows that the fine-tuned dataset does not meet the preset requirements, then modify the power equipment data or adjust the model parameters of the trained power equipment fault diagnosis small model to obtain the intermediate fine-tuned dataset.
[0093] S33. Determine the target data volume of the fine-tuning dataset based on the model parameters of the large-scale power equipment fault diagnosis model;
[0094] S34. Calculate the actual data volume of the intermediate fine-tuning dataset and output the actual data volume.
[0095] S35. Compare the actual data volume with the target data volume of the fine-tuned dataset and output the comparison results;
[0096] S36. If the comparison result shows that the actual data volume is less than the target data volume of the fine-tuning dataset, then search for the corresponding fault cause and fault result data from the preset data map according to the type of small model for power equipment fault diagnosis, and supplement it to the intermediate fine-tuning dataset, and output the target fine-tuning dataset.
[0097] The pre-built data map refers to a knowledge base that is pre-constructed and represents the fault causes and failure results of power equipment in various scenarios using a map structure. It includes power equipment subject instances (such as specific equipment objects such as transformers, circuit breakers, and gas-insulated switchgear), object instances (such as fault causes, fault types, fault results, and fault characteristic parameters), and the relationship between subject instances and object instances (such as the correspondence between a certain type of transformer and the high-temperature overheating failure result caused by insulation aging in an overheating scenario). It covers fault cause data and failure result data in various fault scenarios such as no fault, overheating, and discharge. It is used to search for fault cause and failure result data of corresponding scenarios according to the types of trained power equipment fault diagnosis mini-models when the actual data volume of the fine-tuning dataset is insufficient, and supplement it to the fine-tuning dataset to make it reach the target data volume.
[0098] It should be noted that if the fine-tuning dataset does not meet the preset requirements, the power equipment data or the model parameters of the trained small model can be modified to obtain a fine-tuning dataset (intermediate fine-tuning dataset) that meets the preset requirements.
[0099] To ensure the high quality of the fine-tuning dataset, it can be manually reviewed. If the content of the fine-tuning dataset does not meet the requirements, the power equipment data or the model parameters of the trained small model need to be modified to ensure the accuracy of the diagnostic data and fault diagnosis results.
[0100] Specifically, when the verification result indicates that the initial fine-tuning dataset does not meet the preset requirements, the problematic instruction fine-tuning data in the initial fine-tuning dataset is first located, and the source of the problem is analyzed. If the problem originates from the power equipment data itself (such as missing data, abnormal values, or field errors), then the power equipment data is modified for correction. Specifically, the problematic part of the power equipment data corresponding to the instruction fine-tuning data is supplemented, corrected, or corrected (e.g., supplementing missing dates for oil chromatography gas content data, correcting abnormal values that are significantly outside the reasonable range). The modified power equipment data is then re-inputted into the trained power equipment fault diagnosis mini-model, which then processes the modified data. The power equipment data is re-inferred for fault diagnosis, and the corrected fault diagnosis result is output. Then, based on the instruction field content corresponding to the original diagnosis scenario, the modified power equipment data is used as the input field content and the corrected fault diagnosis result is used as the output field content. A new instruction fine-tuning data is synthesized according to a preset structured data format. This re-synthesized instruction fine-tuning data replaces the problematic instruction fine-tuning data in the initial fine-tuning dataset. The remaining instruction fine-tuning data that meet the preset requirements are retained. All instruction fine-tuning data are collected to construct an intermediate fine-tuning dataset. If the problem originates from the model parameters of the trained power equipment fault diagnosis mini-model (such as unreasonable fault judgment threshold settings, weight parameters, etc.), then the process is considered complete. If the deviation leads to inaccurate diagnostic results, it is corrected by adjusting the model parameters. Specifically, the parameters in the trained power equipment fault diagnosis mini-model that cause the diagnostic deviation are adjusted (e.g., increasing or decreasing the ratio threshold for fault type judgment, optimizing model weight parameters). This results in a power equipment fault diagnosis mini-model with adjusted parameters. Power equipment data is then input into the adjusted model, which re-performs fault diagnosis inference based on the data and outputs the corrected fault diagnosis result. Subsequently, based on the instruction field content corresponding to the original diagnostic scenario, the power equipment data is used as the input field content, and the corrected fault diagnosis result is used as the output field content, according to a pre-defined structure. The data format is re-synthesized into a new instruction fine-tuning dataset. This re-synthesized instruction fine-tuning dataset replaces the problematic instruction fine-tuning dataset in the initial fine-tuning dataset. The remaining instruction fine-tuning datasets that meet the preset requirements are retained. All instruction fine-tuning datasets are then aggregated to construct an intermediate fine-tuning dataset. Both of these correction methods ensure the accuracy of the correspondence between power equipment data and fault diagnosis results in the intermediate fine-tuning dataset. This provides high-quality supervision data for subsequent training of the large-scale power equipment fault diagnosis model using parameter fine-tuning. As a result, the large model can learn accurate fault diagnosis capabilities simply through parameter fine-tuning, without the need for large-scale updates to all parameters during training, thereby indirectly reducing the computing power and training time required for the training process.
[0101] Further, see Figure 3The target data volume of the fine-tuning dataset is determined based on the model parameters of the pre-trained large model. If the actual data volume of the fine-tuning dataset is less than the target data volume, data is searched from the preset data graph according to the type of small model to increase the data volume of the fine-tuning dataset to reach the target data volume. The preset data graph represents the fault causes and fault results of power equipment in various scenarios.
[0102] Specifically, the target data size of the fine-tuning dataset is determined according to a certain proportion of the model parameters of the pre-trained large model. The fine-tuning dataset is obtained by collecting real power equipment data. To ensure the accuracy of the large model fine-tuning process, if the actual data size of the fine-tuning dataset is less than the target data size, the data size of the fine-tuning dataset needs to be increased. Pre-set data graphs represent the causes and results of power equipment failures in various scenarios, including but not limited to the relationship between power equipment subject instances and object instances. The types of small models include, but are not limited to, transformer diagnostic models, circuit breaker diagnostic models, or gas-insulated switchgear diagnostic models. In a specific embodiment, if the basic large model is selected as 8B-32B, then at least 5000-10000 fine-tuning data entries need to be prepared.
[0103] In this embodiment, preset requirements are verified by manually inspecting each instruction in the initial fine-tuning dataset. Specific verification includes checking whether the power equipment data in the input fields is complete and valid, whether the fault diagnosis results in the output fields correspond to the input fields, and whether the instruction fields match the diagnostic scenario (e.g., in a transformer oil chromatography fault diagnosis scenario, the instruction fields should contain transformer fault diagnosis-related instructions rather than circuit breaker diagnosis instructions). The verification results are then output. If the verification result indicates that the initial fine-tuning dataset meets the preset requirements, it is directly used as the intermediate fine-tuning dataset. If the verification result indicates that the initial fine-tuning dataset does not meet the preset requirements (e.g., the fault diagnosis result corresponding to the transformer oil chromatography data in a certain instruction fine-tuning dataset is obviously incorrect, or the input field content does not match the output field content), there are two correction methods: Method 1 involves modifying erroneous or missing parts of the power equipment data to obtain modified power equipment data. This modified data is then re-inputted into a trained power equipment fault diagnosis mini-model for fault diagnosis inference, yielding a corrected fault diagnosis result. A fine-tuned dataset is then reconstructed based on the diagnostic scenario, the modified power equipment data, and the corrected fault diagnosis result. Method 2 involves adjusting the model parameters of the trained power equipment fault diagnosis mini-model (e.g., adjusting the model's diagnostic threshold or weight parameters) to obtain a parameter-adjusted power equipment fault diagnosis mini-model. The power equipment data is then input into the parameter-adjusted power equipment fault diagnosis mini-model for fault diagnosis inference, yielding a corrected fault diagnosis result. A fine-tuned dataset is then reconstructed based on the diagnostic scenario, the power equipment data, and the corrected fault diagnosis result. After these modifications, an intermediate fine-tuned dataset that meets the preset requirements is obtained.
[0104] Subsequently, the target data size of the fine-tuning dataset is determined according to a certain proportion of the model parameters of the large-scale power equipment fault diagnosis model (for example, when the parameter size of the large-scale power equipment fault diagnosis model is selected as 8B-32B, the target data size of the fine-tuning dataset should be at least 5000-10000 records). The number of instruction fine-tuning data records contained in the intermediate fine-tuning dataset is counted, and the actual data size is output. The actual data size is then compared with the target data size of the fine-tuning dataset, and the comparison result is output. If the comparison result shows that the actual data size is less than the target data size, then the data is selected from the preset data map according to the type of the trained small-scale power equipment fault diagnosis model (transformer diagnosis model, circuit breaker diagnosis model, or gas-insulated switchgear diagnosis model). The system searches for fault causes and results data in the corresponding scenarios (a preset data map represents the fault causes and results data of power equipment in various scenarios, including the relationship between the main instances and the object instances of power equipment). The searched data is synthesized into new instruction fine-tuning data according to the format of instruction field content, input field content, and output field content, and then added to the intermediate fine-tuning dataset until the data volume of the intermediate fine-tuning dataset reaches the target data volume. The target fine-tuning dataset is then output. If the comparison result shows that the actual data volume is greater than or equal to the target data volume, the intermediate fine-tuning dataset is directly used as the target fine-tuning dataset. This target fine-tuning dataset is used for subsequent parameter fine-tuning of the large-scale power equipment fault diagnosis model.
[0105] Step 104: Using a preset fine-tuning platform, fine-tune the parameters of the large-scale power equipment fault diagnosis model according to the target fine-tuning dataset to obtain a trained large-scale power equipment fault diagnosis model.
[0106] It should be noted that the preset fine-tuning platform includes a first preset container and a second preset container. The first preset container is used to construct the fine-tuning environment, and the second preset container is used to construct the inference environment (e.g., using the MindSpeed container to construct the fine-tuning environment and the MindIE container to construct the inference environment). Based on the fine-tuning environment, the parameters of the large-scale power equipment fault diagnosis model are fine-tuned according to the target fine-tuning dataset, and the fine-tuned parameters are output. Parameter fine-tuning includes two implementation methods: Method 1 is to insert a neural network module after the feedforward network of the large-scale power equipment fault diagnosis model, fix the original model parameters of the large-scale power equipment fault diagnosis model, and train the inserted neural network module only based on the target fine-tuning dataset, outputting the fine-tuned parameters (i.e., the model parameters of the trained neural network module); Method 2 is to convert the HuggingFace format weights of the large-scale power equipment fault diagnosis model to Megatron-core format weights, convert the target fine-tuning dataset to a format supported by the platform, and configure low-rank adaptive parameters (including LoRA rank). rank LoRA scaling factor alpha LoRA discard rate dropoutThe original model parameters of the large-scale power equipment fault diagnosis model are fixed, and LoRA fine-tuning is performed based on the fine-tuning environment (training epochs should be 2-3 times). The fine-tuning parameters (i.e., the parameters of low-rank matrices A and B) are output. The fine-tuning parameters are then merged with the original parameters of the large-scale power equipment fault diagnosis model (in method two, the weight update amount ΔW=BA is calculated and merged with the original weight W to form W+ΔW). The large model with merged parameters is output. The fine-tuning effect of the large model with merged parameters is detected in the inference environment, and the trained large-scale power equipment fault diagnosis model is output.
[0107] The first preset container refers to a pre-configured container image used to build a fine-tuning environment. It encapsulates the operating system runtime environment, deep learning frameworks (such as PyTorch and Megatron-LM), large model fine-tuning acceleration toolchain (such as MindSpeed), distributed training dependency library, and fine-tuning process scripts and configuration templates required for parameter fine-tuning. It supports distributed training capabilities such as tensor parallelism and pipeline parallelism, and can provide an isolated, reproducible runtime environment with computational acceleration capabilities for the parameter fine-tuning process of large power equipment fault diagnosis models (including parameter training after inserting neural network modules and LoRA low-rank adaptive fine-tuning). Specifically, the MindSpeed container can be used, which can be configured according to the actual application requirements.
[0108] The second preset container refers to a pre-configured container image used to build the inference environment. It encapsulates the operating system runtime environment, large model inference acceleration engine (such as MindIE), inference service dependency library, and effect detection scripts and test cases required for model inference deployment. It supports high-performance model inference and service-oriented deployment, and can provide an isolated, reproducible runtime environment with inference acceleration capabilities for the inference deployment and fine-tuning effect detection of large models with merged parameters. Specifically, the MindIE container can be used, which is configured according to the actual application requirements.
[0109] Furthermore, step 104 may include the following sub-steps:
[0110] S41. A fine-tuning environment is constructed using a first preset container, and an inference environment is constructed using a second preset container;
[0111] S42. In the fine-tuning environment, the parameters of the large-scale power equipment fault diagnosis model are fine-tuned according to the target fine-tuning dataset using a preset fine-tuning method, and the fine-tuning parameters are output.
[0112] S43. Merge the fine-tuning parameters and the original parameters of the large model for power equipment fault diagnosis, and output the large model after merging the parameters.
[0113] S44. In the inference environment, perform fine-tuning effect detection on the large model after merging parameters, and output the trained large model for power equipment fault diagnosis.
[0114] S45. The preset fine-tuning methods include a first fine-tuning method and a second fine-tuning method.
[0115] S46. The first fine-tuning method is as follows: In the fine-tuning environment, a neural network module is inserted after the feedforward network of the large-scale power equipment fault diagnosis model, and the large-scale power equipment fault diagnosis model after inserting the neural network module is output.
[0116] S47. The original model parameters of the large-scale power equipment fault diagnosis model are fixed. The parameters of the neural network module in the large-scale power equipment fault diagnosis model after inserting the neural network module are trained in the fine-tuning environment according to the target fine-tuning dataset, and the fine-tuning parameters are output.
[0117] S48. The second fine-tuning method is as follows: In the fine-tuning environment, the HuggingFace format weights of the large power equipment fault diagnosis model are converted into Megatron-core format weights.
[0118] S49. Convert the format of the target fine-tuning dataset and output the converted fine-tuning dataset.
[0119] S410, configure low-rank adaptive parameters and parallel parameters, and output LoRA fine-tuning configuration parameters;
[0120] S411. In the fine-tuning environment, fix the original model parameters of the large-scale power equipment fault diagnosis model, and use LoRA fine-tuning configuration parameters to perform LoRA fine-tuning on the large-scale power equipment fault diagnosis model according to the Megatron-core format weights and the transformed fine-tuning dataset, and output the fine-tuning parameters.
[0121] LoRA (Low-Rank Adaptation): This approach assumes that the model's weight updates on downstream tasks are low-rank. It simulates weight updates (ΔW) through the product of two small matrices (A and B). During fine-tuning, only these two small matrices are trained. After training, ΔW is merged with the original weights W, incurring no additional overhead during inference.
[0122] See Figure 4The preset container is determined based on the actual application, and this embodiment does not impose specific limitations. For example, a fine-tuning environment can be constructed using the MindSpeed container, and an inference environment can be constructed using the MindIE container. Parameter fine-tuning of the pre-trained large model includes, but is not limited to, fine-tuning the parameters of the preset large model itself, or fine-tuning the input or output of the preset large model while fixing its parameters. After obtaining the fine-tuned parameters, the fine-tuned parameters are merged with the original parameters of the pre-trained large model, and the fine-tuning effect is detected in the inference environment to obtain the trained large model.
[0123] Further, see Figure 5 A neural network module is inserted after the feedforward network of a pre-trained large model;
[0124] The original model parameters of the pre-trained large model are fixed. Based on the fine-tuning environment, the parameters of the neural network module are fine-tuned according to the fine-tuning dataset to obtain the fine-tuning parameters. The original structural parameters of the neural network module are determined according to the actual application; this embodiment does not impose specific limitations. The neural network module can specifically be a fully connected network (MLP, Multi-Layer Perceptron), a single-layer perceptron, an adapter module, or a small Transformer layer, etc. Its original structural parameters can specifically include input dimension, output dimension, hidden layer dimension, number of hidden layers, and activation function type, etc. First, a neural network module is inserted after the feedforward network of the large-scale power equipment fault diagnosis model. The initial parameters of the neural network module are already determined. The original model parameters of the large-scale power equipment fault diagnosis model are fixed. Based on the fine-tuning environment, the parameters of the neural network module are fine-tuned according to the target fine-tuning dataset, and the adjusted model parameters of the neural network module are determined as the fine-tuning parameters.
[0125] Further, see Figure 6 The fine-tuning process for LoRA is as follows:
[0126] Weight transformation: The weights of large open-source models are generally in HuggingFace format, which needs to be transformed into Megatron-core format for fine-tuning. This step only needs to be performed once when fine-tuning multiple times.
[0127] Dataset transformation: Convert the fine-tuned dataset into a platform-supported format. This step only needs to be performed once for multiple fine-tuning operations.
[0128] Model fine-tuning: Configure LORA fine-tuning parameters (lora_rank, lora_alpha, lora_dropout), as well as parameters such as batch size, tensor parallelism, and pipeline parallelism, and implement LORA fine-tuning based on MindSpeed. It is advisable to perform 2-3 epochs during fine-tuning.
[0129] Parameter merging: The parameters generated by LORA are merged with the parameters of the base model and converted into HuggingFace format.
[0130] Inference Deployment: Use MindIE to complete the deployment and test the effects of fine-tuning.
[0131] In this embodiment, the first and second preset containers are determined according to the actual application (e.g., a fine-tuning environment is built using the MindSpeed container, and an inference environment is built using the MindIE container). The first preset container is used to build a fine-tuning environment for parameter fine-tuning, and the second preset container is used to build an inference environment for inference deployment and effect detection. In the fine-tuning environment, a preset fine-tuning method is selected from the first and second fine-tuning methods, and the parameters of the large-scale power equipment fault diagnosis model are fine-tuned according to the target fine-tuning dataset, and the fine-tuning parameters are output. The specific implementation of the first fine-tuning method is as follows: the original structural parameters of the neural network module are determined according to the actual application (the neural network module can specifically be a fully connected network, ...). A single-layer perceptron, adapter module, or small Transformer layer (the original structural parameters may include input dimension, output dimension, hidden layer dimension, number of hidden layers, and activation function type, etc.) is used. A neural network module is inserted after the feedforward network of a large-scale power equipment fault diagnosis model, and its parameters are initialized. The output is the large-scale power equipment fault diagnosis model with the inserted neural network module. The original model parameters of the large-scale power equipment fault diagnosis model are fixed and do not participate in gradient updates. Only the target fine-tuning dataset is input into the large-scale power equipment fault diagnosis model with the inserted neural network module for forward and backward propagation. The parameters of the neural network module are iteratively trained, and the trained and adjusted model parameters of the neural network module are then used. The parameters are determined as fine-tuning parameters. The specific implementation of the second fine-tuning method is as follows: The HuggingFace format weights (a commonly used weight storage format for open-source large models) of the power equipment fault diagnosis large model are converted to the Megatron-core format weights required for LoRA fine-tuning. This step only needs to be performed once for multiple fine-tuning operations. The target fine-tuning dataset is converted to a format supported by the fine-tuning platform. This step only needs to be performed once for multiple fine-tuning operations. The converted fine-tuning dataset is output. LoRA fine-tuning parameters and parallel parameters such as batch size, tensor parallelism, and pipeline parallelism are configured. The LoRA fine-tuning configuration parameters are output. The original model parameters of the power equipment fault diagnosis large model are fixed in the fine-tuning environment, and LoRA fine-tuning is then applied. The configuration parameters are LoRA fine-tuned on the large-scale power equipment fault diagnosis model based on the Megatron-core format weights and the transformed fine-tuning dataset. The weight update amount ΔW=BA is simulated by multiplying two low-rank matrices A and B. Only the parameters of matrices A and B are trained, and the fine-tuning parameters (i.e., the parameters of low-rank matrices A and B) are output. After obtaining the fine-tuning parameters, the fine-tuning parameters are merged with the original parameters of the large-scale power equipment fault diagnosis model (in the first fine-tuning method, the parameters of the trained neural network modules are merged with the original parameters of the large model; in the second fine-tuning method, the weight update amount ΔW=BA is merged with the original weight W into W+ΔW and converted into HuggingFace format), and the large model with merged parameters is output.In an inference environment (e.g., using MindIE for deployment), the fine-tuning effect of the large model with merged parameters is tested. Specifically, test power equipment data is input, and the output fault diagnosis results are compared with the expected results. After passing the test, the trained power equipment fault diagnosis large model is output.
[0132] In subsequent applications, the trained power equipment fault diagnosis model receives data from the power equipment to be diagnosed (such as transformer oil chromatography data, circuit breaker monitoring data, and gas-insulated switchgear monitoring data). Based on the equipment type and data category of the power equipment data, it determines the corresponding diagnostic scenario and generates matching instruction fields. These instruction fields, along with the power equipment data, are then input into the trained power equipment fault diagnosis model. The model performs fault diagnosis reasoning and outputs structured fault diagnosis results. These results include whether the equipment is faulty, the type of fault (such as overheating fault, discharge fault, etc.), the severity of the fault, whether shutdown is required, and handling suggestions. Maintenance personnel then formulate corresponding power equipment maintenance strategies based on these results (such as shortening the monitoring cycle, checking equipment load, overhauling the cooling system, and scheduling shutdown maintenance), thereby achieving intelligent fault diagnosis and auxiliary decision-making for power equipment.
[0133] For comparison of technical effectiveness, existing technologies can be used as a reference. Power equipment fault analysis utilizes a proprietary large-scale diagnostic model for predictive analysis. This large-scale diagnostic model possesses a vast number of parameters. Further training all parameters of the pre-trained model requires enormous computing power and training time. Therefore, reducing computing power and training time during the training of this large-scale model remains a challenge.
[0134] In response to the above problems, such as Figure 7 As shown, this invention proposes a large-scale model training method based on a small model. The method involves acquiring power equipment data covering all scenarios of power equipment faults; inputting the power equipment data into a trained small-scale power equipment fault diagnosis model to obtain fault diagnosis results; the small-scale power equipment fault diagnosis model includes a transformer diagnosis model, a circuit breaker diagnosis model, or a gas-insulated switchgear diagnosis model; determining the diagnosis scenario based on the power equipment data; constructing an initial fine-tuning dataset based on the diagnosis scenario, power equipment data, and fault diagnosis results; performing quality verification and data volume expansion on the initial fine-tuning dataset; and outputting a target fine-tuning dataset; and using a pre-set fine-tuning platform to fine-tune the parameters of the large-scale power equipment fault diagnosis model based on the target fine-tuning dataset to obtain a trained large-scale power equipment fault diagnosis model.
[0135] This invention inputs power equipment data into a trained small-scale power equipment fault diagnosis model to obtain fault diagnosis results. Based on the power equipment data, a diagnosis scenario is determined, and an initial fine-tuning dataset is constructed according to the diagnosis scenario, power equipment data, and fault diagnosis results. The initial fine-tuning dataset is then subjected to quality verification and data expansion to obtain a target fine-tuning dataset. A preset fine-tuning platform is used to fine-tune the parameters of a large-scale power equipment fault diagnosis model based on the target fine-tuning dataset, resulting in a trained large-scale power equipment fault diagnosis model. The parameters of the large-scale power equipment fault diagnosis model are then fine-tuned using the fault diagnosis results of the small-scale power equipment fault diagnosis model. This approach reduces computational power and training time while ensuring the accuracy of fault diagnosis results.
[0136] Please see Figure 8 , Figure 8 This is a structural block diagram of a large model training device based on a small model, provided in Embodiment 2 of the present invention.
[0137] This invention provides a large model training device based on a small model, comprising:
[0138] The acquisition module 801 is used to acquire power equipment data and input the power equipment data into a trained power equipment fault diagnosis small model to obtain fault diagnosis results.
[0139] Module 802 is used to determine the diagnostic scenario based on power equipment data, and to build an initial fine-tuning dataset based on the diagnostic scenario, power equipment data and fault diagnosis results;
[0140] Dataset module 803 is used to perform quality verification and data volume expansion on the initial fine-tuning dataset, and output the target fine-tuning dataset;
[0141] The fine-tuning module 804 is used to fine-tune the parameters of the large-scale power equipment fault diagnosis model based on the target fine-tuning dataset using a preset fine-tuning platform, so as to obtain a trained large-scale power equipment fault diagnosis model.
[0142] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0143] This invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program; when the computer program is executed by the processor, the processor performs the steps of the large model training method based on a small model as described in the above embodiments.
[0144] This invention also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the large model training method based on a small model as described in the above embodiments.
[0145] This invention also provides a computer program product, including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the large model training method based on a small model as described in the above embodiments.
[0146] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0148] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0150] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for training a large model based on a small model, characterized in that, include: Acquire power equipment data and input the power equipment data into a trained power equipment fault diagnosis mini-model to obtain fault diagnosis results; The diagnostic scenario is determined based on the power equipment data, and an initial fine-tuning dataset is constructed based on the diagnostic scenario, the power equipment data, and the fault diagnosis results. The initial fine-tuning dataset is subjected to quality verification and data volume expansion to output the target fine-tuning dataset; The parameters of the large-scale power equipment fault diagnosis model are fine-tuned using a preset fine-tuning platform based on the target fine-tuning dataset, resulting in a trained large-scale power equipment fault diagnosis model.
2. The method for training a large model based on a small model according to claim 1, characterized in that, The step of determining the diagnostic scenario based on the power equipment data, and constructing an initial fine-tuning dataset based on the diagnostic scenario, the power equipment data, and the fault diagnosis results, includes: The diagnostic scenario is determined based on the equipment type and data category of the power equipment data; The power equipment data is used as the input field content of multiple fine-tuning data, and the fault diagnosis results are used as the output field content of the corresponding fine-tuning data. The instruction field content for generating corresponding fine-tuning data based on the diagnostic scenario; The instruction field content, input field content, and output field content of each of the fine-tuning data are combined and processed to output multiple instruction fine-tuning data; The fine-tuning data from multiple instructions is aggregated, and the initial fine-tuning dataset is output.
3. The method for training a large model based on a small model according to claim 1, characterized in that, The process of performing quality verification and data volume expansion on the initial fine-tuning dataset to output the target fine-tuning dataset includes: The initial fine-tuning dataset is validated according to preset requirements, and the validation results are output. If the verification result indicates that the fine-tuned dataset does not meet the preset requirements, then modify the power equipment data or adjust the model parameters of the trained power equipment fault diagnosis small model to obtain an intermediate fine-tuned dataset. The target data volume of the fine-tuning dataset is determined based on the model parameters of the large-scale power equipment fault diagnosis model. The actual data volume of the intermediate fine-tuning dataset is statistically analyzed, and the actual data volume is output. Compare the actual data volume with the target data volume of the fine-tuned dataset, and output the comparison result; If the comparison result shows that the actual data volume is less than the target data volume of the fine-tuning dataset, then the fault cause and fault result data of the corresponding scenario are searched from the preset data map according to the type of the power equipment fault diagnosis small model, and supplemented into the intermediate fine-tuning dataset, and the target fine-tuning dataset is output.
4. The method for training a large model based on a small model according to claim 3, characterized in that, The process of modifying the power equipment data is as follows: Modify the power equipment data to obtain the modified power equipment data; The modified power equipment data is re-input into the trained power equipment fault diagnosis small model for fault diagnosis inference, and the corrected fault diagnosis result is output. Based on the diagnostic scenario, the modified power equipment data, and the corrected fault diagnosis results, an intermediate fine-tuning dataset is constructed.
5. The method for training a large model based on a small model according to claim 3, characterized in that, The process of adjusting the model parameters of the trained small model for fault diagnosis of power equipment is as follows: Adjust the model parameters of the trained small model for power equipment fault diagnosis to obtain the small model for power equipment fault diagnosis with adjusted parameters; The power equipment data is input into the power equipment fault diagnosis small model after the parameters are adjusted to perform fault diagnosis reasoning, and the corrected fault diagnosis result is output. Based on the diagnostic scenario, the power equipment data, and the corrected fault diagnosis results, an intermediate fine-tuning dataset is constructed.
6. The method for training a large model based on a small model according to claim 1, characterized in that, The preset fine-tuning platform includes a first preset container and a second preset container; the preset fine-tuning platform is used to fine-tune the parameters of the power equipment fault diagnosis model according to the target fine-tuning dataset to obtain a trained power equipment fault diagnosis model, including: A fine-tuning environment is constructed using a first preset container, and an inference environment is constructed using a second preset container. In the fine-tuning environment, the parameters of the power equipment fault diagnosis large model are fine-tuned according to the target fine-tuning dataset using a preset fine-tuning method, and the fine-tuning parameters are output. The fine-tuning parameters and the original parameters of the large-scale power equipment fault diagnosis model are merged to output the large-scale model with merged parameters. In the inference environment, the fine-tuning effect of the large model after merging parameters is detected, and the trained large model for power equipment fault diagnosis is output. The preset fine-tuning method includes a first fine-tuning method and a second fine-tuning method; The first fine-tuning method is as follows: under the fine-tuning environment, a neural network module is inserted after the feedforward network of the power equipment fault diagnosis model, and the power equipment fault diagnosis model after inserting the neural network module is output. The original model parameters of the power equipment fault diagnosis large model are fixed, and the parameters of the neural network module in the power equipment fault diagnosis large model after inserting the neural network module are trained using the fine-tuning environment according to the target fine-tuning dataset, and the fine-tuning parameters are output. The second fine-tuning method is as follows: under the fine-tuning environment, the HuggingFace format weights of the power equipment fault diagnosis large model are converted into Megatron-core format weights; The target fine-tuning dataset is converted into a new format, and the converted fine-tuning dataset is output. Configure low-rank adaptive parameters and parallel parameters, and output LoRA fine-tuning configuration parameters; In the fine-tuning environment, the original model parameters of the large-scale power equipment fault diagnosis model are fixed, and the LoRA fine-tuning configuration parameters are used to fine-tune the large-scale power equipment fault diagnosis model according to the Megatron-core format weights and the transformed fine-tuning dataset, and the fine-tuning parameters are output.
7. A large model training device based on a small model, characterized in that, include: The acquisition module is used to acquire power equipment data and input the power equipment data into a trained power equipment fault diagnosis mini-model to obtain fault diagnosis results. A construction module is used to determine the diagnostic scenario based on the power equipment data, and to construct an initial fine-tuning dataset based on the diagnostic scenario, the power equipment data, and the fault diagnosis results; The dataset module is used to perform quality verification and data volume expansion on the initial fine-tuning dataset, and output the target fine-tuning dataset; The fine-tuning module is used to fine-tune the parameters of the power equipment fault diagnosis model using a preset fine-tuning platform based on the target fine-tuning dataset, so as to obtain a trained power equipment fault diagnosis model.
8. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to perform the steps of the large model training method based on a small model as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the large model training method based on a small model as described in any one of claims 1-6.
10. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the large model training method based on a small model as described in any one of claims 1-6.
