A method and system for fine-tuning a large model for power system operation mode adjustment

By constructing a professional knowledge data system and CoT data, and combining it with a dynamic gradient scaling strategy based on physical feasibility constraints, the large model is fine-tuned. This solves the problems of insufficient professional knowledge coverage and insufficient multi-stage reasoning ability of the general large model in the adjustment of power system operation mode, and achieves more efficient decision support.

CN123121820APending Publication Date: 2026-11-17SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610987652.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-03
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing general-purpose large models lack professional knowledge coverage and multi-stage reasoning capabilities in adjusting the operation mode of power systems, resulting in low decision-making efficiency and insufficient ability to cope with emergencies.

Method used

By constructing a professional knowledge data system, using CoT data and domain knowledge pre-fine-tuning methods, and combining a dynamic gradient scaling strategy with physical feasibility constraints, the large model is fine-tuned to enhance its understanding of power system operation mode adjustments and its multi-step reasoning capabilities.

Benefits of technology

This improves the intelligence and engineering applicability of the model in adjusting the operation mode of the power system, enabling it to effectively identify operational problems, analyze causes, and formulate reasonable adjustment strategies, thereby enhancing the reliability and security of decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123121820A_ABST
    Figure CN123121820A_ABST
Patent Text Reader

Abstract

This invention proposes a large-scale model fine-tuning method and system for power system operation mode adjustment, belonging to the fields of power system dispatching and operation and artificial intelligence technology. It includes: acquiring sample data of power system operating status and example data of expert reasoning, and generating CoT data through a teacher model; constructing a knowledge fine-tuning sample set in the field of power system operation mode adjustment, injecting domain knowledge using a parameter-efficient fine-tuning method, and establishing a cognitive foundation for the large-scale model operation mode adjustment task; and performing supervised fine-tuning of the large model based on the CoT data to obtain a fine-tuned model for power system operation mode adjustment. By constructing a professional knowledge data system and strengthening the model's reasoning ability, this invention enables effective learning of the process of analyzing operational problems and formulating adjustment strategies, thereby improving the intelligence level and engineering practicality of power system operation mode adjustment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power system dispatching and operation and artificial intelligence technology, and in particular relates to a large model fine-tuning method and system for adjusting the operation mode of power systems. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Adjusting power system operation modes is a crucial means of ensuring the safe and stable operation of the power grid. With the continuous expansion of the power system and the increasing penetration of new energy sources, the power grid's operating status exhibits high complexity and uncertainty, significantly increasing the frequency and difficulty of operation mode adjustments. Currently, operation mode adjustments mainly rely on dispatchers' manual analysis and decision-making based on operational experience, typical cases, and dispatching procedures. This process is highly dependent on human experience and suffers from low decision-making efficiency and insufficient ability to respond to emergencies. Therefore, there is an urgent need to introduce intelligent methods to improve the automation level of operation mode adjustments.

[0004] In recent years, large-scale models have made significant progress in the fields of natural language understanding and generation, and have demonstrated strong capabilities in general complex reasoning tasks. However, the following technical problems still exist when directly applying them to the adjustment of power system operation modes: First, the training corpus of the general-purpose large model mainly consists of general domain knowledge, lacking in-depth coverage of professional knowledge such as power system operation mechanisms, dispatching procedures, and operational constraints. Adjustments to power system operation modes involve a large amount of knowledge derived from operating procedures, technical manuals, and long-term accumulated engineering experience. This knowledge is highly domain-dependent and difficult to acquire through general-purpose corpus learning, making it difficult for the general-purpose large model to accurately understand the power grid operation status and related dispatching rules.

[0005] Secondly, adjusting the operation mode of a power system is essentially a multi-step decision-making and reasoning problem. In practice, dispatchers need to go through multiple consecutive reasoning stages, such as identifying the operating status, analyzing the causes of problems, formulating adjustment strategies, and verifying them. There are strict logical dependencies between these stages. However, existing general-purpose large models usually adopt a direct mapping method from input to output, lacking the ability to explicitly model and structure the above-mentioned multi-stage reasoning process, making it difficult to effectively support complex engineering decision-making tasks involving continuous information processing and logical deduction. Summary of the Invention

[0006] To overcome the shortcomings of the existing technology, this invention provides a large-scale model fine-tuning method and system for adjusting the operation mode of power systems. By constructing a professional knowledge data system and strengthening the model's reasoning ability, it can effectively learn the process of analyzing operation problems and formulating adjustment strategies, thereby improving the intelligence level and engineering practicality of power system operation mode adjustment.

[0007] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: The first aspect of this invention provides a method for fine-tuning a large model for adjusting the operation mode of a power system.

[0008] A method for fine-tuning a large model for power system operation mode adjustment includes: Acquire sample data of power system operation status and example data of expert inference, and generate a continuous inference step sequence from system operation status analysis to adjustment strategy output through teacher model, forming CoT data containing operation status, inference step chain and adjustment strategy; We construct a knowledge fine-tuning sample set in the field of power system operation mode adjustment, and use an efficient parameter fine-tuning method to inject domain knowledge into the large model, thus establishing a cognitive foundation for the large model operation mode adjustment task. Based on the CoT data, a supervised fine-tuning is performed on the large model that has undergone domain cognition pre-fine-tuning. This enables the large model to learn the multi-step inference logic of state identification, problem diagnosis, strategy generation, and verification during the operation mode adjustment process, thereby obtaining a fine-tuned model for power system operation mode adjustment. The supervised fine-tuning adopts a dynamic gradient scaling strategy based on physical feasibility constraints: during the backpropagation process of each training batch, the intermediate inference step sequence generated by the current forward inference of the model is input to a preset power system power flow verification interface to obtain the node voltage over-limit and line power flow overload of the corresponding operating state, and the weighted sum is used to obtain the physical comprehensive violation value of the corresponding batch. Based on the physical comprehensive violation value, a gradient scaling coefficient in the interval (0, 1) is generated. This gradient scaling coefficient is multiplied by the original update gradient calculated for the corresponding batch to dynamically adjust the step size of the parameter update for that batch.

[0009] Furthermore, a sequence of continuous reasoning steps from system operation status analysis to adjustment strategy output is generated through a teacher model, including: designing a Prompt template for power system operation mode adjustment tasks, inputting power system operation status and expert reasoning example data into the teacher model to guide the teacher model to learn the reasoning patterns of operators when analyzing system status, locating key issues, and formulating adjustment strategies.

[0010] Furthermore, after the CoT data is formed, the CoT data is expanded by introducing a model knowledge distillation mechanism; power flow calculation tools are used to physically verify the generated results during the expansion process, and samples that do not meet power system constraints or have unreasonable adjustment effects are removed.

[0011] Furthermore, by constructing diverse system states through operational condition disturbances, multiple new operational adjustment problem scenarios are generated to expand the coverage of CoT data.

[0012] Furthermore, before injecting domain knowledge into the large model using an efficient parameter fine-tuning method, the knowledge content is structured using document slicing technology: First, the text is initially divided according to the document structure and semantic boundaries, splitting the large document into several semantically complete knowledge fragments; then, the slices are selectively merged and subdivided according to the text length and semantic coherence to form knowledge units of appropriate length and semantic completeness.

[0013] Furthermore, after completing the document slicing, a unified instructional data format is constructed to enable the large model to learn how to understand and respond to power system operation-related issues during the training process: for operational terminology knowledge, a term-definition-application scenario structure is constructed; for operational rule knowledge, an operational scenario-processing principle structure is constructed; and for operational constraint knowledge, an operational state-constraint judgment structure is constructed.

[0014] Furthermore, a supervised fine-tuning approach is used to optimize the large model, and the inference-generated sequence is trained using a cross-entropy loss function; wherein, the loss function is expressed as: ; In the formula, The loss function; For the first The true probability distribution corresponding to each word element The probability distribution predicted by the model. The total number of lexical units generated for the model.

[0015] The second aspect of the present invention provides a large-scale model fine-tuning system for adjusting the operation mode of a power system.

[0016] A large-scale model fine-tuning system for adjusting power system operation modes includes: The CoT data construction module is configured to: acquire sample data of power system operation status and example data of expert inference, and generate a continuous inference step sequence from system operation status analysis to adjustment strategy output through the teacher model, forming CoT data containing operation status, inference step chain and adjustment strategy; The domain cognition pre-fine-tuning module is configured to: construct a knowledge fine-tuning sample set in the field of power system operation mode adjustment, inject domain knowledge into the large model using an efficient parameter fine-tuning method, and establish the cognitive foundation for the large model operation mode adjustment task; The inference enhancement fine-tuning module is configured to: perform supervised fine-tuning on the large model that has undergone domain cognition pre-fine-tuning based on the CoT data, enabling the large model to learn the multi-step inference logic of state recognition, problem diagnosis, strategy generation and verification during the operation mode adjustment process, and obtain a fine-tuned model for power system operation mode adjustment; wherein, the supervised fine-tuning adopts a dynamic gradient scaling strategy based on physical feasibility constraints: during the backpropagation process of each training batch, the intermediate inference step sequence generated by the current forward inference of the model is input to the preset power system power flow verification interface to obtain the node voltage over-limit and line power flow overload of the corresponding operating state, and the weighted sum is used to obtain the physical comprehensive violation value of the corresponding batch; based on the physical comprehensive violation value, a gradient scaling coefficient in the interval (0, 1) is generated, and the gradient scaling coefficient is multiplied by the original update gradient calculated for the corresponding batch to dynamically adjust the step size of the parameter update for that batch.

[0017] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of a large-scale model fine-tuning method for adjusting the operation mode of a power system as described in the first aspect of the present invention.

[0018] The fourth aspect of the present invention provides an electronic device including a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in a large model fine-tuning method for adjusting the operation mode of a power system as described in the first aspect of the present invention.

[0019] The above one or more technical solutions have the following beneficial effects: This invention constructs a knowledge fine-tuning sample set for the field of power system operation mode adjustment. By structurally slicing documents such as operating procedures, technical manuals, and summaries of operating experience, it forms instructional training data covering explanations of operating terminology, descriptions of operating rules, and descriptions of operating constraints. Furthermore, it employs an efficient parameter fine-tuning method to inject domain knowledge into a general-purpose large model. Compared to existing technologies, this invention effectively solves the problem that general-purpose large models struggle to accurately understand the power grid operating status and related scheduling rules due to a lack of power system expertise in their training corpora, thus enabling the model to possess the ability to understand operating status and recognize rules.

[0020] This invention generates a sequence of continuous reasoning steps from system operation status analysis to adjustment strategy output through a teacher model. This forms a training sample of a thought chain containing a triple structure of operation status, reasoning step chain, and adjustment strategy. The reasoning process is organized according to a multi-stage decision-making logic: operation status identification, problem cause analysis, adjustment direction judgment, and control strategy generation. Each reasoning step has a dependency relationship with the results of preceding reasoning steps. Based on this, the thought chain training sample is used to supervise and fine-tune the model, which has undergone domain cognition pre-fine-tuning. This enables the model to learn the multi-step reasoning logic of state identification, problem diagnosis, strategy generation, and verification during operation mode adjustment. Compared to existing technologies, this invention effectively solves the technical problem of general large models lacking explicit modeling capabilities for multi-stage reasoning processes. It enables the model to effectively learn the decision-making logic of operators in identifying operational problems, analyzing causes, and formulating adjustment strategies, providing effective support for complex engineering decision-making tasks related to operation mode adjustment. Furthermore, this invention introduces a dynamic gradient scaling strategy based on physical feasibility constraints in the reasoning enhancement and fine-tuning stage. This allows power system power flow physical verification to not be limited to offline screening of training samples but to participate in the model parameter update process in real time as an online supervisory signal. This mechanism dynamically adjusts the gradient update step size by using physical violation values, which can effectively suppress the model from converging in the direction of violating power grid operation constraints. It makes up for the deficiency that relying solely on text loss functions cannot perceive physical feasibility, and further enhances the engineering practicality and safety boundary of the model generation and adjustment strategy.

[0021] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0022] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0023] Figure 1 This is a flowchart of a large-scale model fine-tuning method for adjusting the operation mode of a power system, as described in Embodiment 1 of the present invention.

[0024] Figure 2 This is a schematic diagram of the loss curve for domain cognition pre-fine-tuning in Embodiment 1 of the present invention.

[0025] Figure 3 This is a schematic diagram of the loss curve for CoT inference enhancement fine-tuning in Embodiment 1 of the present invention. Detailed Implementation

[0026] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0027] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.

[0028] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0029] The overall approach of this invention is to address the problem that existing general-purpose large models are ill-suited for power system operation mode adjustment tasks. This invention proposes a large-scale model fine-tuning method specifically for power system operation mode adjustment. This method addresses the characteristics of operation mode adjustment tasks, such as strong reliance on domain knowledge, complex multi-source structured data, and high requirements for multi-step reasoning. It constructs a dedicated training data system for this task and designs a joint fine-tuning mechanism that enhances domain cognition and reasoning capabilities to specifically strengthen the model's capabilities. By introducing a thought chain reasoning mechanism, knowledge distillation and physical verification methods, and a training strategy that combines domain cognition pre-fine-tuning with reasoning capability enhancement, the model can achieve full-process modeling from understanding the operating state to generating adjustment strategies, thereby improving its decision-making ability and engineering feasibility in complex power grid operation scenarios. It should be noted that the core of the joint fine-tuning strategy involving domain cognition and reasoning enhancement in this invention is not a simple stage division, but rather a joint enhancement mechanism built around two types of capabilities: domain knowledge understanding and operational decision-making reasoning in power system operation mode adjustment tasks. The domain knowledge pre-tuning focuses on establishing the model's cognitive foundation regarding power system operating procedures, constraints, and typical operational problems, enabling the model to understand operating states and recognize rules. The CoT-based reasoning reinforcement fine-tuning, on the other hand, emphasizes enhancing the model's learning ability regarding reasoning logic such as state analysis, problem diagnosis, strategy generation, and verification during the operation mode adjustment process. These two parts are not independently stacked but rather form a progressive capability enhancement process from domain cognition to engineering reasoning. Therefore, the core of this invention lies in constructing a joint optimization mechanism of "domain cognition-reasoning reinforcement" for operation mode adjustment tasks.

[0030] Example 1 This embodiment discloses a large model fine-tuning method for adjusting the operation mode of a power system.

[0031] like Figure 1 As shown, a method for fine-tuning a large model for adjusting power system operation modes includes: Step S1: Obtain sample data of power system operation status and example data of expert inference, and generate a continuous inference step sequence from system operation status analysis to adjustment strategy output through the teacher model, forming CoT data containing operation status, inference step chain and adjustment strategy; Step S2: Construct a knowledge fine-tuning sample set in the field of power system operation mode adjustment, and use an efficient parameter fine-tuning method to inject domain knowledge into the large model to establish a cognitive foundation for the large model operation mode adjustment task; Step S3: Based on the CoT data, supervised fine-tuning is performed on the large model that has been pre-tuned by domain cognition, enabling the large model to learn the multi-step inference logic of state identification, problem diagnosis, strategy generation, and verification during the operation mode adjustment process, thereby obtaining a fine-tuned model for power system operation mode adjustment; wherein, the supervised fine-tuning adopts a dynamic gradient scaling strategy based on physical feasibility constraints: during the backpropagation process of each training batch, the intermediate inference step sequence generated by the current forward inference of the model is input to the preset power system power flow verification interface to obtain the node voltage over-limit and line power flow overload of the corresponding operating state, and the weighted sum is used to obtain the physical comprehensive violation value of the corresponding batch; based on the physical comprehensive violation value, a gradient scaling coefficient in the interval (0, 1) is generated, and the gradient scaling coefficient is multiplied by the original update gradient calculated for the corresponding batch to dynamically adjust the step size of the parameter update for that batch.

[0032] Based on the above process, this invention, by constructing a professional knowledge data system and enhancing model reasoning capabilities, can achieve effective learning of the process of analyzing operational problems and formulating adjustment strategies, thereby improving the intelligence level and engineering practicality of power system operation mode adjustments. To facilitate understanding of the technical solution of this invention, the specific implementation methods of this invention will be further explained and described below.

[0033] In step S1, sample data of power system operating status and example data of expert reasoning are obtained, and a continuous inference step sequence from system operating status analysis to adjustment strategy output is generated through the teacher model, forming CoT data containing operating status, inference step chain and adjustment strategy.

[0034] CoT was initially proposed to enhance the capabilities of large models in multi-step logical tasks such as mathematical reasoning. Its core principle is to simulate the human thought process when solving problems by constructing sequential reasoning steps, gradually deriving the final conclusion. Traditional large models employ a direct mapping from input to output, i.e.<input→output> In contrast, CoT decomposes the original problem into a series of finer-grained intermediate logical steps, each step unfolding progressively based on the results of preceding reasoning, thus modeling the problem as a gradual reasoning process.<input→reasoning chain→output> This enables the model to process complex information more systematically.

[0035] In power system operation mode adjustment scenarios, the CoT (Coherence to Technology) can be used to describe the logical process by which operators formulate adjustment strategies, such as identifying operational problems in the system, locating key nodes or equipment, determining the adjustment direction, and generating control strategies. By introducing the reasoning process into fine-tuning data, the model gradually learns the engineering logic in operation mode adjustments, improving its decision-making ability and reliability in complex operation scenarios. Therefore, to enhance the reasoning ability of large models in the scenario of this invention, a CoT data construction mechanism is introduced. By characterizing the reasoning steps in the operation mode adjustment process, the model can learn the complete decision-making logic from system state analysis to adjustment strategy generation.

[0036] To construct a CoT dataset suitable for operational mode adjustments, a CoT data construction process was designed. This process generates inference processes through a large model and combines this with physical validation to form high-quality training data. The overall process is based on system operational status data, learns expert experience through a teacher model to generate inference processes, and then undergoes validation and selection to form the final training samples.

[0037] First, system samples under different operating conditions are obtained from typical operational cases and simulation results, including various typical operational problems such as power flow non-convergence and safety constraint violations. Simultaneously, operational analysis processes and adjustment strategies provided by actual operation experts are compiled and constructed into example data containing reasoning steps, describing the typical decision-making logic in operational mode adjustments. Based on this, a Prompt template for operational mode adjustment tasks is designed, inputting both the system operating state and expert reasoning examples into the teacher model. This guides the model to learn the reasoning patterns of operators when analyzing system states, identifying key issues, and formulating adjustment strategies. After learning these example reasoning processes, the teacher model can generate structured reasoning steps and corresponding adjustment strategies for new operating states, forming a data structure of "operating state → CoT reasoning → adjustment strategy". In this way, the generated data not only contains the final decision results but also inherits the key logical steps in expert decision-making, enabling the model training data to possess both engineering experience and interpretable reasoning processes.

[0038] Building upon this foundation, data expansion based on model distillation is performed. Adjustments to the operating method result in data with strong privacy concerns, making it impossible to obtain a large amount of expert-annotated data. Therefore, this invention further introduces a model knowledge distillation mechanism to expand the CoT data. The basic idea of ​​knowledge distillation is to utilize a high-performance teacher model to generate high-quality training samples, enabling the student model to learn the reasoning ability and knowledge structure inherent in the teacher model.

[0039] First, a large model with strong reasoning capabilities is selected as the teacher model. Based on existing operational state samples, corresponding CoT (Coding on the Time) inference processes and adjustment strategies are generated. The teacher model identifies key operational problems in the system by progressively analyzing the system's operational state and generates reasonable adjustment schemes in conjunction with power system regulation measures, thus forming a complete inference path. Subsequently, the generated results are physically verified using power flow calculation tools. Samples that do not meet system constraints or have unreasonable adjustment effects are removed to ensure the feasibility of the generated data at the engineering level.

[0040] Furthermore, to expand the data coverage, diverse system states are constructed through operational condition perturbations, such as changing load levels or equipment operating states, to generate new operational adjustment problem scenarios. The CoT generation and verification process is repeated under these different operational scenarios to form training data covering multiple operational states. Through the aforementioned CoT generation and distillation expansion mechanism, a large-scale, high-quality operational adjustment CoT dataset can be constructed even with limited basic data, providing an important data foundation for subsequent fine-tuning of large models.

[0041] In step S2, domain cognition pre-fine-tuning is performed, namely: constructing a knowledge fine-tuning sample set for the power system operation mode adjustment domain, injecting domain knowledge into the large model using an efficient parameter fine-tuning method, and establishing the cognitive foundation for the large model operation mode adjustment task.

[0042] In the pre-fine-tuning process of domain knowledge construction, the goal is to enable the model to master the knowledge system related to power system operation mode adjustments and establish basic operational analysis and decision-making cognition. Operation mode adjustments are a task with significant engineering experience characteristics; operators typically follow certain technical approaches when analyzing system operating conditions. For example, when local voltages are low, the first consideration is usually to increase reactive power support or adjust reactive power compensation devices. Therefore, in the pre-fine-tuning process, domain knowledge is needed to enable the large model to gradually understand the basic mechanisms of power system operation and the handling of common problems.

[0043] The knowledge gained during pre-fine-tuning primarily comes from operating procedures, technical manuals, and summaries of operational experience. Since the original documents are typically lengthy and complex, making them difficult to use directly for model training, document slicing techniques are needed to structure the knowledge content.

[0044] Specifically, the text is first divided into several semantically complete knowledge segments based on the document structure and semantic boundaries. Then, the segments are appropriately merged and subdivided according to the text length and semantic coherence to form knowledge units of moderate length and semantic completeness, providing a clear knowledge representation for model learning.

[0045] After completing the document slicing, further domain-awareness fine-tuning data needs to be constructed, focusing on fundamental knowledge related to operational mode adjustments. This includes explanations of power system operation terminology, operational rules, and principles for handling typical operational problems. By constructing a unified, instruction-based data format, the model can learn how to understand and address power system operation-related issues during training. For example, for operational terminology, a structure of "terminology-definition-application scenario" is constructed; for operational rules, a structure of "operational scenario-handling principle" is constructed; and for operational constraints, a structure of "operational state-constraint judgment" is constructed. Through training with these samples, the model gradually establishes a knowledge system in the field of power system operation mode adjustments and forms basic operational analysis approaches.

[0046] The training method employs LoRA, a parameter-efficient fine-tuning method. This method introduces a low-rank adaptation structure into the pre-trained model's weight matrix, training only a small number of newly added parameters. This allows for the efficient injection of domain knowledge while maintaining the model's original capabilities. Its form can be expressed as: ; In the formula, This is the original weight matrix of the pre-trained model; and It is a trainable low-rank matrix; This is the updated weight matrix.

[0047] The training process employs supervised fine-tuning (SFT) to optimize the model, and uses the cross-entropy loss function to train the inference-generated sequences. The loss function is expressed as: ; In the formula, The loss function; For the first The true probability distribution corresponding to each word element The probability distribution predicted by the model. The total number of lexical units generated for the model.

[0048] In step S3, the large model that has been pre-tuned by domain cognition is supervised and fine-tuned based on CoT data, so that the large model learns the multi-step reasoning logic of state identification, problem diagnosis, strategy generation and verification during the operation mode adjustment process, and obtains a fine-tuning model for power system operation mode adjustment.

[0049] After completing the domain cognition pre-fine-tuning, further fine-tuning based on CoT reasoning is used to enhance the model's decision-making ability in scenarios involving operational mode adjustments. The core objective of this stage is to enable the model to master the analytical logic and decision-making reasoning process in operational mode adjustments. To achieve this goal, CoT fine-tuning technology is adopted. Using the operational mode adjustment CoT data constructed above, the system operating status, problem analysis process, and final adjustment strategy are organized into structured training samples, enabling the model to learn the complete reasoning path from operating status analysis to adjustment strategy formulation.

[0050] In these training samples, the model not only needs to identify problems in the system's operating state, but also needs to analyze the causes of these problems based on the power system's operating mechanism, and further deduce possible adjustment directions. For example, when low system voltage is detected, the model needs to determine whether the problem is related to insufficient reactive power support and propose possible adjustment measures such as increasing reactive power compensation or adjusting generator reactive power output. The training process also uses the SFT method to optimize the model, enabling it to gradually learn the engineering analysis logic in operating mode adjustments.

[0051] As a preferred embodiment of the present invention, to further overcome the limitation that offline data screening cannot cover boundary operating states, a dynamic gradient scaling mechanism based on physical feasibility constraints is introduced during the supervised fine-tuning training process in step S3. The specific implementation process includes: First, after each training batch completes forward propagation and calculates the predicted inference step sequence, standard backpropagation is not performed directly. Instead, the intermediate inference steps generated by the current batch model (including operational status analysis conclusions, diagnosed key issues, and preliminary adjustment directions) are structured and parsed, and input into the embedded power system flow calculation verification interface. Based on the current system operational status sample, this verification interface calculates the weighted sum of grid node voltage exceedances and line flow overloads after executing the intermediate strategy corresponding to the inference step. This weighted sum is used as the physical comprehensive violation value for that batch.

[0052] Subsequently, the system generates a dynamic gradient scaling factor based on the physical comprehensive violation value. This factor is mapped within the interval (0, 1). The higher the physical comprehensive violation value, the closer the gradient scaling factor is to 0, and vice versa. During backpropagation, this scaling factor is multiplied by the original gradient calculated by the standard cross-entropy loss function, and the scaled gradient is used to update the model parameters.

[0053] Through the aforementioned dynamic gradient scaling mechanism based on physical feasibility constraints, when the model generates inference logic that clearly violates physical constraints, the update magnitude of the corresponding batch parameters is effectively suppressed. This guides the model to spontaneously strengthen the weights of high-feasibility inference patterns and weaken the interference of low-feasibility patterns during training. Simultaneously, this dynamic scaling strategy complements the offline physical verification in step S1, extending the supervision signal of physical constraints from the data preparation stage to the entire process of model parameter learning, thereby significantly improving the decision reliability and safety of fine-tuning the model in practical engineering applications.

[0054] like Figure 1 As shown, the model first establishes the domain knowledge base for adjusting the operation mode of the power system, then learns the reasoning process in actual operation decision-making through CoT case data, and the fine-tuning stage builds the cognitive framework and decision-making logic for the operation mode adjustment task for the large model.

[0055] Furthermore, as shown in Table 1, the Prompt structure and Prompt content examples are used in the domain cognition pre-fine-tuning stage. The data comes from the instructional data format constructed by slicing mentioned above. In order to enable this knowledge to better participate in fine-tuning training, the teacher model is used and a refined Prompt is designed to guide the model to understand, ask questions and give answers to the knowledge content covered, thereby constructing question-answer pair data for pre-fine-tuning training.

[0056] Table 1. Example of Prompt Structure and Content (Part 1)

[0057] Based on the Prompt design, a total of 8156 question-answer pairs were constructed. The loss curve during the training process is shown below. Figure 2 As shown. The fine-tuning training went through 255 training steps, and the model tended to converge after about 150 steps.

[0058] As shown in Table 2, two types of test tasks were designed to evaluate the pre-fine-tuning effect. One type consisted of multiple-choice questions on operational mode knowledge, assessing knowledge mastery through model selection accuracy. The other type consisted of open-ended questions, requiring the model to provide direct answers, with researchers with relevant professional backgrounds invited to score the responses. Scoring was based on a 0-2 point scale, where 2 points indicated an accurate and complete answer, 1 point indicated partial correctness, and 0 points indicated an incorrect answer. The average score was used as the evaluation index for model capability. It can be seen that the pre-fine-tuned model achieved significant improvements in both types of test tasks, surpassing the teacher model. The accuracy rate for multiple-choice questions increased to 89.1%, and the average score for open-ended questions reached 1.39. This indicates that by introducing knowledge from areas such as power system operation terminology, operating rules, and operational constraints for pre-fine-tuning, the model's understanding and expression of operational mode adjustment knowledge was significantly enhanced.

[0059] Table 2 Comparison of Test Tasks

[0060] As shown in Table 3, in the CoT-based inference enhancement and fine-tuning stage, the analysis processes and adjustment strategies of operational experts in typical operational cases are first compiled to form a small amount of high-quality example data. Based on this, new operational scenario data without analysis processes is generated through operational condition perturbation. Then, the teacher model, combined with the example data, automatically expands the inference steps and adjustment strategies for these operational scenarios to generate complete CoT data. Prompt samples guiding the teacher model to generate structured inference processes are shown in Table 3. To ensure the feasibility of the generated data, power flow calculation tools are used to verify the generated adjustment logic and strategies, and unreasonable samples are filtered out.

[0061] Table 3. Prompt Examples Guiding Teachers in Generating Structured Reasoning Processes

[0062] Based on the Prompt design, a total of 2037 reasonable CoT inference datasets were constructed. The loss curve during the training process is shown below. Figure 3 As shown. The training process consists of 64 training steps, and the model tends to converge after about 55 steps.

[0063] To evaluate the effectiveness of CoT-based inference reinforcement fine-tuning, two types of test tasks were designed. One task involved using power flow calculation tools to verify the generated adjustment logic and strategies, statistically analyzing the proportion of feasible strategies in the test samples, and measuring the engineering feasibility of the model's generated operational mode adjustment strategies. The other task required the model to generate a complete analysis process and operational mode adjustment strategies based on a given system operating state, which were then scored by professionals. A 0-3 point scale was used: 3 points indicated a complete and logically clear inference process, correctly identifying the problem and reasonably analyzing its causes; 2 points indicated basically correct inference but incomplete analysis; 1 point indicated significant gaps in the inference or unclear logic; and 0 points indicated an incorrect inference process or inability to form an effective analysis. The average score of the test samples was used as the evaluation index of the model's inference ability. The test results are shown in Table 4. After CoT-based inference reinforcement fine-tuning, the performance of the fine-tuned model was significantly improved. The proportion of feasible strategies generated by the fine-tuning model was 26.4% and 18.5% higher than that of the base model and teacher model, respectively, and the average score of reasoning ability was also significantly improved, indicating that the model can effectively learn the decision-making logic of operators in the process of identifying operational problems, analyzing causes, and formulating adjustment strategies.

[0064] Table 4 Comparison of Test Tasks II

[0065] Example 2 This embodiment discloses a large-scale model fine-tuning system for adjusting the operation mode of a power system.

[0066] A large-scale model fine-tuning system for adjusting power system operation modes includes: The CoT data construction module is configured to: acquire sample data of power system operation status and example data of expert inference, and generate a continuous inference step sequence from system operation status analysis to adjustment strategy output through the teacher model, forming CoT data containing operation status, inference step chain and adjustment strategy; The domain cognition pre-fine-tuning module is configured to: construct a knowledge fine-tuning sample set in the field of power system operation mode adjustment, inject domain knowledge into the large model using an efficient parameter fine-tuning method, and establish the cognitive foundation for the large model operation mode adjustment task; The inference enhancement fine-tuning module is configured to: perform supervised fine-tuning on the large model that has undergone domain cognition pre-fine-tuning based on the CoT data, enabling the large model to learn the multi-step inference logic of state recognition, problem diagnosis, strategy generation and verification during the operation mode adjustment process, and obtain a fine-tuned model for power system operation mode adjustment; wherein, the supervised fine-tuning adopts a dynamic gradient scaling strategy based on physical feasibility constraints: during the backpropagation process of each training batch, the intermediate inference step sequence generated by the current forward inference of the model is input to the preset power system power flow verification interface to obtain the node voltage over-limit and line power flow overload of the corresponding operating state, and the weighted sum is used to obtain the physical comprehensive violation value of the corresponding batch; based on the physical comprehensive violation value, a gradient scaling coefficient in the interval (0, 1) is generated, and the gradient scaling coefficient is multiplied by the original update gradient calculated for the corresponding batch to dynamically adjust the step size of the parameter update for that batch.

[0067] Example 3 The purpose of this embodiment is to provide a computer-readable storage medium.

[0068] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in a large-scale model fine-tuning method for adjusting power system operation modes as described in Embodiment 1 of this disclosure.

[0069] Example 4 The purpose of this embodiment is to provide an electronic device.

[0070] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in a large-scale model fine-tuning method for adjusting the operation mode of a power system as described in Embodiment 1 of this disclosure.

[0071] The steps and methods involved in the apparatuses of Embodiments 2, 3, and 4 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.

[0072] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.

[0073] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for fine-tuning a large model for adjusting power system operation modes, characterized in that, include: Acquire sample data of power system operation status and example data of expert inference, and generate a continuous inference step sequence from system operation status analysis to adjustment strategy output through teacher model, forming CoT data containing operation status, inference step chain and adjustment strategy; We construct a knowledge fine-tuning sample set in the field of power system operation mode adjustment, and use an efficient parameter fine-tuning method to inject domain knowledge into the large model, thus establishing a cognitive foundation for the large model operation mode adjustment task. Based on the CoT data, a large model that has been pre-tuned by domain cognition is subjected to supervised fine-tuning. This enables the large model to learn the multi-step reasoning logic of state identification, problem diagnosis, strategy generation, and verification during the operation mode adjustment process, thereby obtaining a fine-tuned model for power system operation mode adjustment. The supervised fine-tuning adopts a dynamic gradient scaling strategy based on physical feasibility constraints: during the backpropagation process of each training batch, the intermediate reasoning step sequence generated by the current forward reasoning of the model is input to a preset power system power flow verification interface to obtain the node voltage overrun and line power flow overload of the corresponding operating state, and then weighted sum to obtain the physical comprehensive violation value of the corresponding batch. Based on the physical comprehensive violation value, a gradient scaling factor is generated in the interval (0, 1]. This gradient scaling factor is multiplied by the original update gradient calculated for the corresponding batch to dynamically adjust the step size of the parameter update for that batch.

2. The large-scale model fine-tuning method for adjusting power system operation modes as described in claim 1, characterized in that, The teacher model generates a sequence of continuous reasoning steps from system operation status analysis to adjustment strategy output, including: designing a Prompt template for power system operation mode adjustment tasks, and inputting power system operation status and expert reasoning example data into the teacher model to guide the teacher model to learn the reasoning patterns of operators when analyzing system status, locating key issues, and formulating adjustment strategies.

3. The method for fine-tuning a large model for adjusting power system operation modes as described in claim 1, characterized in that, After the CoT data is generated, it is expanded by introducing a model knowledge distillation mechanism; power flow calculation tools are used to physically verify the generated results during the expansion process, and samples that do not meet power system constraints or have unreasonable adjustment effects are removed.

4. The large-scale model fine-tuning method for adjusting power system operation modes as described in claim 3, characterized in that, By constructing diverse system states through operational condition disturbances, multiple new operational adjustment problem scenarios are generated to expand the coverage of CoT data.

5. The large-scale model fine-tuning method for adjusting power system operation modes as described in claim 1, characterized in that, Before injecting domain knowledge into large models using an efficient parameter fine-tuning method, the knowledge content is structured using document slicing technology: First, the text is initially divided according to the document structure and semantic boundaries, splitting large documents into several semantically complete knowledge fragments; then, the slices are selectively merged and subdivided according to the text length and semantic coherence to form knowledge units of appropriate length and semantic completeness.

6. The large-scale model fine-tuning method for adjusting power system operation modes as described in claim 5, characterized in that, After completing the document slicing, a unified instructional data format is constructed to enable the large model to learn how to understand and respond to power system operation-related issues during the training process: for operational terminology knowledge, a term-definition-application scenario structure is constructed. For knowledge related to operational rules, a structure of operational scenario-processing principle is constructed; for knowledge related to operational constraints, a structure of operational state-constraint judgment is constructed.

7. A large-scale model fine-tuning method for power system operation mode adjustment as described in claim 1, characterized in that, The large model is optimized using supervised fine-tuning, and the inference-generated sequences are trained using a cross-entropy loss function; wherein, the loss function is expressed as: ; In the formula, The loss function; For the first The true probability distribution corresponding to each word element The probability distribution predicted by the model. The total number of lexical units generated for the model.

8. A large-scale model fine-tuning system for adjusting power system operation modes, characterized in that, include: The CoT data construction module is configured to: acquire sample data of power system operation status and example data of expert inference, and generate a continuous inference step sequence from system operation status analysis to adjustment strategy output through the teacher model, forming CoT data containing operation status, inference step chain and adjustment strategy; The domain cognition pre-fine-tuning module is configured to: construct a knowledge fine-tuning sample set in the field of power system operation mode adjustment, inject domain knowledge into the large model using an efficient parameter fine-tuning method, and establish the cognitive foundation for the large model operation mode adjustment task; The inference enhancement fine-tuning module is configured to: perform supervised fine-tuning on the large model that has been pre-fine-tuned by domain cognition based on the CoT data, so that the large model learns the multi-step inference logic of state recognition, problem diagnosis, strategy generation and verification during the operation mode adjustment process, and obtains a fine-tuned model for power system operation mode adjustment; wherein, the supervised fine-tuning adopts a dynamic gradient scaling strategy based on physical feasibility constraints: during the backpropagation process of each training batch, the intermediate inference step sequence generated by the current forward inference of the model is input to the preset power system power flow verification interface to obtain the node voltage over-limit and line power flow overload of the corresponding operating state, and the weighted summation is used to obtain the physical comprehensive violation value of the corresponding batch; Based on the physical comprehensive violation value, a gradient scaling factor is generated in the interval (0, 1]. This gradient scaling factor is multiplied by the original update gradient calculated for the corresponding batch to dynamically adjust the step size of the parameter update for that batch.

9. A computer-readable storage medium having a program stored thereon, characterized in that, When executed by the processor, the program implements the steps in the large model fine-tuning method for adjusting the operation mode of a power system as described in any one of claims 1-7.

10. An electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the large model fine-tuning method for adjusting the operation mode of a power system as described in any one of claims 1-7.