Multi-language electric power small model training method, device, equipment and medium

By adopting a three-stage progressive training architecture and RSLoRA rank-stable training, the problems of scarce multilingual power training data and unstable training are solved, the interactive capabilities and deployment efficiency of multilingual power mini-models in the power vertical field are improved, and the real-time service needs of the front line of power are met.

CN121787583APending Publication Date: 2026-04-03ZHUHAI POWER SUPPLY BUREAU GUANGDONG POWER GIRD CO
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-03

Smart Images

  • Figure CN121787583A_ABST
    Figure CN121787583A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of model training, and provides a multilingual electric power small model training method and device, equipment and a medium, and the method comprises the steps: obtaining single-round question and answer data of the electric power field, carrying out the one-to-one translation of the single-round question and answer data, and generating multilingual single-round dialogue training data; training a preset basic model based on the multilingual single-round dialogue training data to obtain a basic base model with a power field single-round cross-language question-answering capability; constructing multi-round dialogue data based on the single-round question and answer data, and performing one-to-one translation on the multi-round dialogue data to generate multi-language multi-round dialogue training data; training the basic base model based on the multilingual multi-round dialogue training data to obtain a multi-round interaction model; and carrying out RSLoRA rank stability training on the multi-round interaction model to obtain a final electric power small model. According to the method, the multi-language small model in the power vertical field can be obtained through training, lightweight deployment is realized, and power scene requirements are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of model training technology, and in particular to a training method for a multilingual small power model, a training device for a multilingual small power model, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Technology

[0002] In today's world, with the deep integration of information technology and intelligent technology, power supply services, as a core infrastructure ensuring the operation of society, have become crucial elements in supporting regional economic integration and the implementation of economic cooperation initiatives, particularly in terms of internationalization and intelligence. On the one hand, with the advancement of cooperation zones, a diverse user structure has emerged, and users' demands for power services have upgraded from "basic power supply guarantee" to "cross-border business consultation, multilingual natural interaction, and professional problem response." The gap in multilingual power services has significantly widened, especially in multi-scenario interactions across different languages. On the other hand, with increasingly frequent international cooperation under economic cooperation initiatives, the design, operation, maintenance, and training of cross-border power projects all require multilingual professional knowledge interaction, further exacerbating the demand for intelligent multilingual power services.

[0003] Currently, multilingual large models have made breakthroughs in general fields such as daily dialogue and general knowledge question answering, and have the ability to understand and generate multilingual text. However, in the vertical field of power, existing technical solutions still have significant adaptation shortcomings and fail to meet the needs of professional scenarios. Summary of the Invention

[0004] This application provides a training method, apparatus, device, and medium for a multilingual power mini-model, which can train a multilingual mini-model for the power vertical field, achieve lightweight deployment, and meet the needs of power scenarios.

[0005] In one aspect, this application provides a training method for a multilingual small-scale power model, the method comprising:

[0006] Acquire single-turn question-and-answer data in the power sector, perform one-to-one translation on the single-turn question-and-answer data, and generate multilingual single-turn dialogue training data;

[0007] The preset basic model is trained based on the multilingual single-turn dialogue training data to obtain a basic foundation model with single-turn cross-lingual question-and-answer capabilities in the power field.

[0008] Based on the single-turn question-and-answer data, multi-turn dialogue data is constructed, and one-to-one translation is performed on the multi-turn dialogue data to generate multilingual multi-turn dialogue training data;

[0009] The basic base model is trained based on the multilingual multi-turn dialogue training data to obtain a multi-turn interaction model that has the ability to interact with users on multiple turns of knowledge in the power field.

[0010] The multi-round interaction model is trained using RSLoRA rank stability to obtain the final small power model.

[0011] On the other hand, this application provides a training device for a multilingual small-scale power model, the device comprising:

[0012] A single-turn dialogue training data generation module is used to acquire single-turn question-and-answer data in the power field, perform one-to-one translation on the single-turn question-and-answer data, and generate multilingual single-turn dialogue training data.

[0013] The basic foundation model training module is used to train the preset basic model based on the multilingual single-turn dialogue training data to obtain a basic foundation model with single-turn cross-lingual question-and-answer capabilities in the power field.

[0014] A multi-turn dialogue training data generation module is used to construct multi-turn dialogue data based on the single-turn question-and-answer data, perform one-to-one translation on the multi-turn dialogue data, and generate multilingual multi-turn dialogue training data.

[0015] The multi-turn interaction model training module is used to train the basic base model based on the multilingual multi-turn dialogue training data to obtain a multi-turn interaction model with the ability to interact with users on multiple turns of knowledge in the power field.

[0016] The rank-stable training module is used to perform RSLoRA rank-stable training on the multi-round interaction model to obtain the final small power model.

[0017] In another aspect, this application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the training method for the multilingual power mini-model as described in any one of the claims.

[0018] In another aspect, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training method for the multilingual power mini-model described in any one of the claims.

[0019] In another aspect, this application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the training method for the multilingual power mini-model described in the above aspects.

[0020] The multilingual power sector mini-model training method, apparatus, equipment, and medium provided in this application involve: 1) performing one-to-one translation of acquired single-turn question-and-answer data in the power sector to generate multilingual single-turn dialogue training data; 2) training a preset base model based on the multilingual single-turn dialogue training data to obtain a base model with cross-language question-and-answer capabilities in the power sector; 3) constructing multi-turn dialogue data based on the single-turn question-and-answer data and performing one-to-one translation of the multi-turn dialogue data to generate multilingual multi-turn dialogue training data; 4) training the base model based on the multilingual multi-turn dialogue training data to obtain a multi-turn interaction model capable of multi-turn knowledge interaction with users in the power sector; and 5) performing RSLoRA rank-stable training on the multi-turn interaction model to obtain the final power sector mini-model. By embedding knowledge from the power sector and using multilingual data, a pre-defined basic model is jointly trained. Specifically, multi-turn dialogue training data is dynamically constructed adaptively from a static power knowledge base to address the scarcity of training data in specialized technical fields, while ensuring the semantic accuracy of the multilingual context. A three-stage progressive training architecture is employed, including single-turn power knowledge injection, multi-turn interaction adaptation, and training strategy optimization, progressively improving the model's domain knowledge reserves, multi-turn interaction capabilities, and training stability. This allows the multilingual power mini-model to further enhance its understanding of complex power sector knowledge, providing higher-quality answers and thus improving the quality of the training data. The result is a multilingual mini-model for the power vertical domain, and the lightweight deployment of this mini-model meets the needs of power scenarios. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the steps of a training method for a multilingual small power model provided in an embodiment of this application;

[0022] Figure 2 This is a schematic diagram of the multilingual power mini-model training process provided in the embodiments of this application;

[0023] Figure 3 This is a schematic diagram of loss value convergence before training with RSLoRA rank stability provided in an embodiment of this application;

[0024] Figure 4 This is a schematic diagram of loss value convergence after training with RSLoRA rank stability provided in an embodiment of this application;

[0025] Figure 5 This is a structural block diagram of a training device for a multilingual small-scale power model provided in an embodiment of this application;

[0026] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application;

[0027] Figure 7This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] To facilitate understanding of the embodiments provided in this application by those skilled in the art, the technical terms involved are described as follows:

[0030] LLM: Large Language Model refers to a deep learning model with a large parameter scale and strong semantic understanding and generation capabilities. It can be used to handle multiple languages ​​and multiple tasks. Its core role is data distillation (specifically, its understanding is integrated into the training data) or assisting in the generation of training data.

[0031] Small models: These typically refer to deep learning models with a small parameter size and simple structure, which are focused on a specific domain or task.

[0032] LoRA: Low-Rank Adaptation, is a lightweight model fine-tuning technique that reduces the number of fine-tuning parameters by inserting low-rank matrices into key layers of the model (such as attention layers and feedforward networks) (only the low-rank matrices need to be trained instead of all model parameters), thus reducing computational costs.

[0033] RSLoRA: Rank-Selected Low-Rank Adaptation, is an improved low-rank adaptive training technique used to address the loss oscillation problem in multilingual training.

[0034] Loss: The loss value is a metric used during model training to measure the difference between the predicted result and the true label. The smaller the value, the more accurate the model prediction. Loss oscillation refers to the large fluctuation of the loss value during training, such as the loss fluctuating between 1.4 and 2.2 without RSLoRA. Loss convergence refers to the loss value gradually decreasing and stabilizing at a low level, such as stabilizing below 1.0 after using RSLoRA.

[0035] Adaptive Multi-Turn Dialogue Construction: A method for generating training data to transform a single-turn electricity knowledge base into a natural multi-turn dialogue using a large language model.

[0036] Epoch: Training rounds refer to the number of times the model completes a full iteration of the training data. It is a key parameter for controlling training intensity. Too few epochs result in insufficient model learning, while too many epochs can lead to overfitting.

[0037] Attention layer: This is a mechanism widely used in machine learning.

[0038] Feedforward Network (FFN) is a basic neural network structure.

[0039] Overfitting refers to a phenomenon where a model performs well on training data but poorly on unseen test data, because the model overlearns noise in the training data rather than general patterns.

[0040] In the power industry vertical, open-source data is mostly monolingual power documents or general text. High-quality power-related professional knowledge, multilingual dialogue data, and multi-turn dialogue data simulating real-world interactions are insufficient. Due to the scarcity of multilingual power training data, it is difficult to support multilingual power question answering. Furthermore, general multilingual large-scale models have large parameter sizes and are not compatible with power edge devices. Traditional small-scale power models are mostly monolingual with shallow embedding of professional knowledge, resulting in low accuracy in answering professional questions, making it difficult to balance lightweight design with professionalism. Additionally, most multilingual models rely on monolingual switching solutions, leading to high deployment costs and an inability to handle mixed language questions such as Cantonese-English or Mandarin-Portuguese, which can easily cause semantic biases and weak multilingual consistency and mixed language processing. Due to the uneven distribution of power-related professional knowledge and multilingual data, training is prone to loss oscillations and slow convergence, resulting in long training cycles and wasted resources, leading to low training stability and efficiency for multilingual small-scale power models. Specifically, existing technical solutions fail to meet the needs of professional scenarios and have the following drawbacks:

[0041] 1) Multilingual power training data is scarce and its quality is difficult to guarantee: On the one hand, multilingual power training data relies on manual annotation by power experts and translators, which cannot meet the data requirements for model training. The data generation efficiency is low and the labor cost is high. On the other hand, translators are prone to terminology translation errors due to their lack of power expertise, resulting in semantic inconsistencies between different languages. At the same time, the data is mostly single-turn question and answer, lacking multi-turn interaction logic that simulates real-world scenarios. After model training, it is difficult to cope with complex dialogue scenarios, resulting in data quality deviation.

[0042] 2) It is difficult to balance the multilingual capabilities of the model with the professional knowledge of the power industry: Although the general multilingual large model has the ability to process multiple languages, it does not embed the knowledge specific to the power industry. When faced with professional questions, the accuracy of the answer is low and it is easy to deviate from the industry standard. On the other hand, traditional small power models are mostly designed in a single language, requiring separate training of Chinese, English and Portuguese models. Not only can they not handle mixed language questions such as Cantonese and English, Mandarin and Portuguese, but the extra time required for model switching also affects the interactive experience. They cannot take into account both multilingual support and professional understanding of the power industry.

[0043] 3) The training process is unstable and inefficient: Due to the highly specialized nature of power knowledge and the uneven distribution of multilingual data, the existing training scheme suffers from low stability, easy convergence stagnation, low efficiency, long training cycle, continuous full load operation of GPU resources, and serious waste of computing resources.

[0044] 4) Insufficient multi-turn dialogue interaction capabilities: On the one hand, the data layer lacks dynamic interaction scenarios, failing to cover the complete process of "user asking a question - model answering - user asking follow-up questions - model responding in depth"; on the other hand, the model has not optimized dialogue coherence, easily resulting in irrelevant answers when interacting around the same electricity topic. For example, if a user asks "How to solve the problem of excessive load," the model cannot combine the previous answer "first check if the load exceeds the rated value," and instead replies "check the line connection," breaking the closed loop of dialogue logic. In other words, existing technology relies on single-turn question-and-answer data training and lacks multi-turn dialogue logic design.

[0045] 5) High deployment costs and poor lightweight adaptability: Multi-model maintenance is costly; single-language power models require independent deployment, increasing server memory usage and necessitating the development of an additional language detection module to determine the input language, resulting in a complex call chain. Lightweight adaptability is insufficient; general-purpose multi-language large-scale models often have parameter scales exceeding 7 billion, making them unsuitable for front-line power equipment, with inference response times exceeding 3 seconds, failing to meet real-time service requirements. Existing multi-language power service solutions suffer from heavy deployment and difficult adaptation issues.

[0046] This application employs a three-stage progressive training architecture, including single-round power knowledge injection, multi-round interaction adaptation, and training strategy optimization, to gradually improve the model's domain knowledge reserves, multi-round interaction capabilities, and training stability. This allows the multilingual power mini-model to further enhance its understanding of complex power domain knowledge, providing higher-quality answers and thus improving the answer quality of the training data, resulting in a multilingual mini-model for the power vertical domain. Specifically, through LLM-assisted synthesis and automated quality filtering mechanisms, single-round question-and-answer data in the static power knowledge base is converted into dynamic multi-round dialogue data. This not only improves data generation efficiency compared to manual annotation but also ensures the accuracy of terminology translation by relying on the power professional understanding and multilingual translation capabilities of the large model. Simultaneously, low-quality data can be filtered through manual sampling evaluation to maintain data authority and ensure data quality, achieving efficient generation of high-quality multilingual power training data. Furthermore, using the Qwen3 series model as the preset base model, through power domain knowledge embedding and joint training with multilingual data, it supports multilingual and... The system supports mixed language processing, covering Portuguese, Chinese (Mandarin / Cantonese), English, and more. It enhances professional question-and-answer capabilities, improves the accuracy of responses to power sector questions, ensures answers conform to industry standards, and avoids deviations from professional norms, achieving a deep integration of multilingual capabilities and power industry expertise. Furthermore, based on an adaptive multi-turn dialogue construction method, it can build multi-turn dialogue logic, supporting more than three consecutive rounds of coherent interaction around the same power topic. It proactively uncovers potential user needs, optimizes dialogue naturalness, simulates the interaction rhythm of human services, ensures smooth dialogue, and improves user experience, thereby enhancing multi-turn natural interaction capabilities. In addition, based on the Qwen3-8B model, the system optimizes the model structure and deployment path, adapting to lightweight scenarios, supporting edge device deployment, meeting the real-time service needs of frontline power workers, and reducing maintenance costs. Through single-model multilingual support, it eliminates the need for multi-model deployment and switching, reducing server resource consumption.

[0047] Reference Figure 1 The diagram illustrates a flowchart of a training method for a multilingual small power model according to an embodiment of this application, which may specifically include the following steps:

[0048] Step S101: Obtain single-turn question-and-answer data in the power field, perform one-to-one translation on the single-turn question-and-answer data, and generate multilingual single-turn dialogue training data;

[0049] Step S102: Train the preset basic model based on multilingual single-turn dialogue training data to obtain a basic foundation model with single-turn cross-lingual question-and-answer capabilities in the power field.

[0050] In the embodiments of this application, a three-stage progressive training architecture is adopted to gradually improve the model's domain knowledge reserves, multi-round interaction capabilities, and training stability.

[0051] The first stage can be represented by single-round injection training of knowledge in the power sector to build a foundational model with single-round cross-language question-answering capabilities in the power sector. Specifically, this can be achieved by directly injecting domain knowledge into the pre-set foundational model using translated single-round question-answering data, enabling the pre-set foundational model to possess basic question-answering capabilities in the target domain.

[0052] In some embodiments of this application, single-round question-and-answer data in the power field can be obtained from a static power knowledge base. The single-round question-and-answer data can be existing materials from the static power knowledge base; alternatively, it can be obtained by converting power knowledge base materials, including professional terminology, principle explanations, process specifications, common questions, and standard answers, into a single-round question-and-answer pair format to ensure that questions cover the core knowledge points of the knowledge base and that answers conform to professional standards. This application does not impose any limitations on this.

[0053] Furthermore, the acquired single-turn question-and-answer data can be processed across languages. Specifically, the single-turn question-and-answer data can be translated one-to-one to generate multilingual single-turn dialogue training data, such as Portuguese, Chinese (Mandarin / Cantonese), English, etc., to ensure the consistency of knowledge points and the accuracy of terminology in different languages ​​(e.g., by using domain-specific dictionaries for translation calibration to avoid ambiguity in terminology).

[0054] Optionally, the Qwen3 series model can be used as the preset base model. It should be noted that the Qwen3 series, while maintaining excellent multilingual capabilities, further enhances its comprehension ability and supports a free-thinking switch, making it the most powerful open-source model series currently available from Qwen. Among these, the Qwen model is at the forefront of open-source model evaluations, and according to project tests (e.g., document question answering, structured output, multi-step task execution), the Qwen model's language support (such as Cantonese) is stable and its language comprehension ability is higher than other open-source models. This application embodiment uses the Qwen series for fine-tuning language support in small-scale power model applications.

[0055] During the training of the pre-defined base model, its cross-language versatility can be preserved, the underlying general semantic encoding layer can be frozen, and only the top-level task adaptation layer can be fine-tuned. Specifically, this can be achieved by using the cross-entropy loss function as the optimization objective, minimizing the semantic difference between the model's predicted answer and the labeled answer, focusing on optimizing the accurate output of domain terminology and the correct matching of knowledge points, thereby obtaining a base model with single-round cross-language question-answering capabilities in the power field. This base model can directly respond to users' single-round queries for basic knowledge points in the power field.

[0056] During training, a learning rate decay strategy (such as cosine annealing learning rate) can be set to avoid overfitting; the accuracy, recall and F1 score of the model on the domain single-round test set can be verified regularly to ensure that the model's mastery of core knowledge points is ≥85%, etc. This application does not impose any restrictions on these aspects.

[0057] Step S103: Construct multi-turn dialogue data based on single-turn question-and-answer data, perform one-to-one translation on the multi-turn dialogue data, and generate multilingual multi-turn dialogue training data;

[0058] Step S104: Train the basic base model based on multilingual multi-turn dialogue training data to obtain a multi-turn interaction model capable of multi-turn knowledge interaction with users in the field of electricity.

[0059] The second stage can involve constructing and training multi-turn dialogue data to improve the interactive coherence of the foundational model. Specifically, multi-turn dialogue data can be constructed based on knowledge base materials in the power industry, enabling the foundational model to possess context-sensitive, multi-turn natural interaction capabilities while maintaining a balance of multilingual data.

[0060] In some embodiments of this application, such as Figure 2 As shown, multi-turn dialogue data can be constructed based on the powerful LLM (Learning Power Model), transforming single-turn question-and-answer data in a static power knowledge base into dynamic multi-turn dialogue data. This enhances the understanding of the trained model when faced with complex power domain knowledge, enabling it to provide higher-quality answers and improving the answer quality of the training data. Furthermore, it allows for in-depth mining of user questioning methods based on domain knowledge, further improving data generalization. Optionally, the multi-turn dialogue construction logic can be represented as follows: based on the single-turn question-and-answer data from the first stage, multiple-turn interaction scenarios are expanded around the same power domain subject, simulating the questioning logic of real users. This ensures that the context of each round of dialogue is strongly related, with knowledge points progressing layer by layer, resulting in multi-turn dialogue data that interacts naturally with the LLM.

[0061] It's important to note that multi-turn dialogue data generated by simulating user questioning scenarios better aligns with the comprehension habits of LLM (Local Learning Model), making it less likely to lead to a loss of fundamental understanding. Under the same number of turns, compared to training directly from domain data, LLM training is more stable, demonstrates better comprehension, and exhibits no significant loss of general abilities. Using a powerful LLM model can achieve data distillation, integrating the strong comprehension capabilities of instructors' LLM programs into the data, helping students correctly understand domain knowledge, learn how to understand and answer user questions, and apply their knowledge in real-world multi-turn question-and-answer scenarios.

[0062] Furthermore, the constructed multi-turn dialogue data can be processed across languages. Specifically, one-to-one translation of the multi-turn dialogue data can be performed to generate multilingual multi-turn dialogue training data, such as Portuguese, Chinese (Mandarin / Cantonese), English, etc.

[0063] To maintain data balance across different languages, one-to-one translation can follow a consistent translation strategy regarding the number of multi-turn dialogues, the length of interaction rounds (e.g., an average of ≥3 rounds), and the scope of knowledge coverage for each language. This ensures data balance across the multilingual multi-turn dialogue training data. Optionally, for ambiguous terms or expressions with significant cultural differences, contextual annotations (such as parenthetical explanations) can be added after translation to ensure the coherence of multilingual interactions. This application does not impose any limitations on this approach.

[0064] In some embodiments of this application, a model capable of engaging in multi-turn natural interaction with a user on knowledge in the field of electricity can be trained using multilingual, multi-turn dialogue training data.

[0065] Training the multi-turn interaction model can be approached by using the foundational model obtained from the first stage of training, unfreezing some mid-level semantic encoding layers, and retaining the underlying domain knowledge encoding results. Specifically, a context-based sequence generation loss function can be employed, while introducing contextual consistency constraints (such as calculating contextual semantic similarity using BERTScore) to ensure that the model does not deviate from the topic, repeat answers, or exhibit contradictory knowledge points during multi-turn dialogues. This results in a model that supports multilingual, multi-turn domain knowledge interaction. This multi-turn interaction model can handle complex interaction scenarios such as continuous follow-up questions and supplementary inquiries from users.

[0066] During the training of the base model, mini-batch gradient descent can be used, with the batch size dynamically adjusted according to the dialogue length; and / or, every 1000 training steps, the context association accuracy (such as the matching degree between subsequent rounds' answers and the preceding context) is verified on a multi-round test set, requiring an accuracy of ≥90%, but this application does not impose any limitations on this.

[0067] Optionally, the rank of the LoRA matrix can be increased to enhance its learning and representation capabilities. Specifically, this involves introducing low-rank LoRA adaptation techniques in the second stage, and increasing the rank of the LoRA matrix compared to traditional LoRA before enabling RSLoRA in the third stage, thereby improving the model's ability to learn complex knowledge.

[0068] Step S105: Perform RSLoRA rank-stable training on the multi-round interaction model to obtain the final small power model.

[0069] The third stage can involve optimizing the training strategy to achieve stable convergence of the loss and generalization of the ability, such as... Figure 2As shown, the final small power model is obtained by training the multi-round interaction model with RSLoRA rank stability. Specifically, problems such as overfitting, loss oscillation, and slow convergence during training can be solved through parameter tuning, technology selection, and strategy adjustment, thereby improving model performance. The final small power model is a model with stable and converged loss, and has more flexible domain knowledge question answering capabilities.

[0070] Optionally, the learning rate can be reduced to decrease the learning amplitude and avoid overfitting. Specifically, a tiered learning rate strategy can be adopted, that is, different learning rates are set for different layers, and learning decay (cosine annealing) is combined to gradually reduce the learning amplitude. Alternatively, the optimizer parameters can be set, specifically by enabling a timed restart learning rate configuration, so that the learning rate changes periodically, avoiding slow convergence caused by an excessively low learning rate in the later stages when the Epoch is set to be large.

[0071] In some embodiments of this application, when the Epoch is less than a preset threshold, the preset learning rate can be decayed by cosine annealing to reduce the learning rate and the learning amplitude; when the Epoch is greater than or equal to the preset threshold, the learning rate can be restarted according to a preset period. After restarting, the configured learning rate can be a preset percentage of the preset learning rate and continue to decay by cosine annealing to make the learning rate fluctuate periodically.

[0072] For example, the AdamW optimizer (weight decay = 0.01, β1 = 0.9, β2 = 0.999) can be selected to enable a timed learning rate restart configuration. The restart cycle can be set to restart every 5 epochs. The learning rate range can be 80% of the initial learning rate after restarting, followed by decay using cosine annealing. The restart configuration can be set to enable when the epoch is greater than or equal to a preset threshold, such as 20 epochs. This application does not impose any limitations on this.

[0073] While the first two stages of hierarchical fine-tuning (freeze-thaw) can accumulate knowledge in the power field, there are still a large number of general semantic parameters in the backbone parameters of the model that are not related to the domain knowledge. Directly fine-tuning the multi-round interaction model will easily lead to parameter redundancy and loss oscillation. The embodiment of this application can introduce the rank selection and low-rank adaptation mechanism of RSLoRA on the basis of LoRA to optimize the training of the multi-round interaction model, and precisely fine-tune the model parameter matrix related to power field knowledge, thereby solving the problems of loss fluctuation and overfitting in multi-stage training and improving the model's ability to flexibly apply knowledge.

[0074] In some embodiments of this application, RSLoRA can be enabled in the third stage to help the training loss converge stably and avoid oscillations that lead to slow or non-convergence. The introduced rank selection mechanism precisely selects highly relevant low-rank matrices for fine-tuning based on parameter matrices related to power domain knowledge; the introduced low-rank adaptation mechanism dynamically adjusts the dimensions of the aforementioned highly relevant low-rank matrices, specifically adapting them according to the importance of the parameter matrices. During training, only the parameters of the low-rank matrices obtained after applying the RSLoRA method are updated, which avoids loss oscillations caused by irrelevant parameter interference and precisely enhances the flexible application capability of power domain knowledge.

[0075] It should be noted that whether to unfreeze the layer parameters is optional and will increase the GPU memory required for training. In the second stage, the middle semantic coding layer has been unfrozen, and RSLoRA can further focus on the sub-parameters in this layer that are strongly related to multi-turn interactions and power domain knowledge, realizing a deeper level of fine-tuning from layer-level to parameter-level fine-tuning.

[0076] like Figure 3 As shown, before enabling RSLoRA, training often resulted in loss oscillations and slow convergence, with the training loss fluctuating continuously and converging slowly, around 1.4. This meant that under the same epochs and steps, it could not quickly converge to a smaller loss. Figure 4 As shown, after enabling RSLoRA, the initial convergence speed is faster, and the loss converges to around 1.0 faster under the same epoch, meaning that it can continuously converge to a smaller loss under the same epoch.

[0077] Specifically, the highly relevant low-rank matrix that is strongly related to knowledge in the power field in the multi-round interaction model can be the query / key matrix of power terminology encoding in the Attention layer, and the fully connected matrix of power logic reasoning in the FFN layer. At this time, the purpose of training only the newly added low-rank parameters of RSLoRA can be achieved by performing RSLoRA rank-stable training on the aforementioned highly relevant low-rank matrix.

[0078] In practical applications, the backbone parameters in the multi-turn interaction model can be frozen, low-rank adapters can be inserted into the Attention layer and FFN, and then the target low-rank matrix, i.e. the highly relevant low-rank matrix, can be selected for the parameter matrix related to power domain knowledge in the multi-turn interaction model. This includes the query / key / value matrix of power domain knowledge encoded by the training data in the Attention layer and the fully connected matrix of power logic reasoning in the FFN layer. At this point, the inserted low-rank adapter can be activated in the aforementioned target low-rank matrix to perform RSLoRA rank-stable training.

[0079] Optionally, in the low-rank adapter, the rank can be set to 16~32, the scaling factor alpha to 32~64, and a Dropout layer of 0.05~0.1 can be embedded in the RSLoRA adapter.

[0080] In this context, rank 16-32 is typically used in power industry applications to balance capacity and efficiency. The scaling factor `lora_alpha / math.sqrt(r)` of RSLoRA provides better performance and improved training stability at higher rank. This scaling factor can be used to scale the gradient of low-rank matrices to avoid overly rapid updates (e.g., loss fluctuation > 3%) or overly slow updates (e.g., convergence stagnation). Its value is typically 2*rank, i.e., 32-64. The Dropout layer can be used to randomly discard a preset percentage of parameter updates during each training round, i.e., for regularization without performance degradation, reducing overfitting in power scenarios. It should be noted that the scaling factor Alpha, the Dropout layer, and the target object of RSLoRA can also be based on the default configuration of llama-factory; this embodiment does not impose any restrictions on this.

[0081] In some embodiments of this application, optimization of the model structure and deployment chain can be manifested in avoiding redundant designs of multi-model / multi-adaptor parallel operation, reducing memory usage and inference latency at the structural level, while relying on mature open-source deployment frameworks to ensure feasibility of deployment. Specifically, for the optimization of the model structure, it can be from multi-adaptor / multi-model parallel optimization to single-model lightweight integration. The optimization goal can avoid redundant architectures such as running 4 LLMs or one LLM + 4 low-rank adapters at the same time. The RSLoRA adaptation parameters trained in the third stage are deeply integrated with the multi-round interaction model in the second stage to form a single model, fundamentally solving the problems of high memory usage, long inference chain, and increased latency caused by multi-component parallelism. For the optimization of the deployment chain, industry-standard mature solutions (vllm / llama.cpp or device adaptation framework) can be used, focusing on model adaptation and chain simplification to ensure the stability and compatibility of the deployment chain. This application does not limit this aspect.

[0082] In this embodiment, multilingual single-turn dialogue training data is generated by performing one-to-one translation on the acquired single-turn question-and-answer data in the power field. A preset base model is then trained based on this multilingual single-turn dialogue training data to obtain a foundational model capable of cross-lingual question-and-answering in the power field. Next, multi-turn dialogue data is constructed based on the single-turn question-and-answer data and translated one-to-one to generate multilingual multi-turn dialogue training data. This multilingual multi-turn dialogue training data is then used to train the foundational model, resulting in a multi-turn interaction model capable of multi-turn knowledge interaction with users in the power field. Finally, the multi-turn interaction model is subjected to RSLoRA rank-stable training to obtain the final small power model. By embedding knowledge from the power sector and using multilingual data, a pre-defined basic model is jointly trained. Specifically, multi-turn dialogue training data is dynamically constructed adaptively from a static power knowledge base to address the scarcity of training data in specialized technical fields, while ensuring the semantic accuracy of the multilingual context. A three-stage progressive training architecture is employed, including single-turn power knowledge injection, multi-turn interaction adaptation, and training strategy optimization, progressively improving the model's domain knowledge reserves, multi-turn interaction capabilities, and training stability. This allows the multilingual power mini-model to further enhance its understanding of complex power sector knowledge, providing higher-quality answers and thus improving the quality of the training data. The result is a multilingual mini-model for the power vertical domain, and the lightweight deployment of this mini-model meets the needs of power scenarios.

[0083] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0084] Reference Figure 5 The diagram shows a structural block diagram of a training device for a multilingual small-scale power model provided in an embodiment of this application, which may specifically include the following modules:

[0085] The single-turn dialogue training data generation module 501 is used to acquire single-turn question-and-answer data in the power field, perform one-to-one translation on the single-turn question-and-answer data, and generate multilingual single-turn dialogue training data.

[0086] The basic base model training module 502 is used to train the preset basic model based on multilingual single-turn dialogue training data to obtain a basic base model with single-turn cross-lingual question-and-answer capabilities in the power field.

[0087] The multi-turn dialogue training data generation module 503 is used to construct multi-turn dialogue data based on single-turn question-and-answer data, perform one-to-one translation on the multi-turn dialogue data, and generate multilingual multi-turn dialogue training data.

[0088] The multi-turn interaction model training module 504 is used to train the basic base model based on multilingual multi-turn dialogue training data to obtain a multi-turn interaction model with the ability to interact with users on multiple turns of knowledge in the power field.

[0089] The rank-stable training module 505 is used to perform RSLoRA rank-stable training on the multi-round interaction model to obtain the final small power model.

[0090] In some embodiments of this application, the multi-turn dialogue training data generation module 503 may include the following sub-modules:

[0091] The multi-turn dialogue construction submodule is used to construct multi-turn interaction scenarios around the same electricity topic based on single-turn question and answer data, and obtain multi-turn dialogue data.

[0092] In some embodiments of this application, the number of multi-turn dialogues, the length of interaction rounds, and the knowledge coverage are consistent across all languages ​​in the multilingual multi-turn dialogue training data.

[0093] In some embodiments of this application, the rank-stable training module 505 may include the following sub-modules:

[0094] The rank-stable training submodule is used to freeze the backbone parameters in the multi-round interaction model, insert low-rank adapters into the attention layer and feedforward network, select target low-rank matrices for the parameter matrices related to power domain knowledge in the multi-round interaction model, and activate the low-rank adapters on the target low-rank matrices to perform RSLoRA rank-stable training.

[0095] In some embodiments of this application, the rank of the low-rank adapter is set to 16~32, the scaling factor is set to 32~64, and a Dropout layer of 0.05~0.1 is embedded in the low-rank adapter; wherein, the Dropout layer is used to randomly discard a preset percentage of parameter updates in each round of training, and the scaling factor is used to scale the gradient of the low-rank matrix.

[0096] In some embodiments of this application, the rank-stable training module 505 may further include the following sub-modules:

[0097] The learning rate setting submodule is used to decay the preset learning rate using cosine annealing when the number of training rounds is less than a preset threshold; and to trigger a learning rate restart according to a preset period when the number of training rounds is greater than or equal to the preset threshold. After restarting, the configured learning rate is a preset percentage of the preset learning rate, and continues to decay using cosine annealing.

[0098] In some embodiments of this application, the preset base model is the Qwen3 series model.

[0099] In this embodiment, multilingual single-turn dialogue training data is generated by performing one-to-one translation on the acquired single-turn question-and-answer data in the power field. A preset base model is then trained based on this multilingual single-turn dialogue training data to obtain a foundational model capable of cross-lingual question-and-answering in the power field. Next, multi-turn dialogue data is constructed based on the single-turn question-and-answer data and translated one-to-one to generate multilingual multi-turn dialogue training data. This multilingual multi-turn dialogue training data is then used to train the foundational model, resulting in a multi-turn interaction model capable of multi-turn knowledge interaction with users in the power field. Finally, the multi-turn interaction model is subjected to RSLoRA rank-stable training to obtain the final small power model. By embedding knowledge from the power sector and using multilingual data, a pre-defined basic model is jointly trained. Specifically, multi-turn dialogue training data is dynamically constructed adaptively from a static power knowledge base to address the scarcity of training data in specialized technical fields, while ensuring the semantic accuracy of the multilingual context. A three-stage progressive training architecture is employed, including single-turn power knowledge injection, multi-turn interaction adaptation, and training strategy optimization, progressively improving the model's domain knowledge reserves, multi-turn interaction capabilities, and training stability. This allows the multilingual power mini-model to further enhance its understanding of complex power sector knowledge, providing higher-quality answers and thus improving the quality of the training data. The result is a multilingual mini-model for the power vertical domain, and the lightweight deployment of this mini-model meets the needs of power scenarios.

[0100] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0101] This application also provides an electronic device, see embodiments thereof. Figure 6 The provided electronic device 600 includes a memory 610, a processor 620, and a computer program 611 stored in the memory 610 and capable of running on the processor 620. When the computer program 611 is executed by the processor, it implements the various processes of the above-described multilingual power small model training method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0102] This application also provides a computer-readable storage medium, see embodiments thereof. Figure 7 The computer-readable storage medium 700 provides a computer program 611 stored on it. When the computer program 611 is executed by the processor, it implements the various processes of the above-described multilingual power small model training method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0103] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0104] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The division of modules in the embodiments of this application is merely a logical division; in actual applications, there may be other division methods. For example, multiple modules may be combined into or integrated into another system, or some features may be ignored or not performed. Additionally, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interface, and the indirect coupling or communication connection between modules may be electrical or other similar forms, none of which are limited in the embodiments of this application. Furthermore, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed among multiple circuit modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of this application.

[0105] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0107] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules 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 indirect coupling or communication connection through some interfaces, apparatuses, or modules, and may be electrical, mechanical, or other forms.

[0108] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0109] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0110] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0111] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0112] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0113] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes; these computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0114] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0115] Finally, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0116] The technical solutions provided in the embodiments of this application have been described in detail above. Specific examples have been used in the embodiments of this application to illustrate the principles and implementation methods of the embodiments of this application. The description of the above embodiments is only for the purpose of helping to understand the methods and core ideas of the embodiments of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the embodiments of this application. Therefore, the content of this specification should not be construed as a limitation on the embodiments of this application.

Claims

1. A training method for a multilingual small-scale power model, characterized in that, The method includes: Acquire single-turn question-and-answer data in the power sector, perform one-to-one translation on the single-turn question-and-answer data, and generate multilingual single-turn dialogue training data; The preset basic model is trained based on the multilingual single-turn dialogue training data to obtain a basic foundation model with single-turn cross-lingual question-and-answer capabilities in the power field. Based on the single-turn question-and-answer data, multi-turn dialogue data is constructed, and one-to-one translation is performed on the multi-turn dialogue data to generate multilingual multi-turn dialogue training data; The basic base model is trained based on the multilingual multi-turn dialogue training data to obtain a multi-turn interaction model that has the ability to interact with users on multiple turns of knowledge in the power field. The multi-round interaction model is trained using RSLoRA rank stability to obtain the final small power model.

2. The method according to claim 1, characterized in that, The construction of multi-turn dialogue data based on the single-turn question-and-answer data includes: Based on the single-round question-and-answer data, multi-round interactive scenarios are constructed around the same electricity theme to obtain multi-round dialogue data.

3. The method according to claim 1 or 2, characterized in that, In the multilingual multi-turn dialogue training data, the number of multi-turn dialogues, the length of interaction rounds, and the knowledge coverage are consistent across all languages.

4. The method according to claim 1, characterized in that, The step of training the multi-round interaction model to RSLoRA rank stability includes: Freeze the backbone parameters in the multi-turn interaction model and insert low-rank adapters into the attention layer and feedforward network; For the parameter matrix related to power field knowledge in the multi-round interaction model, a target low-rank matrix is ​​selected. The low-rank adapter is activated by the target low-rank matrix to perform RSLoRA rank-stable training.

5. The method according to claim 4, characterized in that, In the low-rank adapter, the rank is set to 16~32, the scaling factor is set to 32~64, and a Dropout layer of 0.05~0.1 is embedded in the low-rank adapter; wherein, the Dropout layer is used to randomly discard a preset percentage of parameter updates in each round of training, and the scaling factor is used to scale the gradient of the low-rank matrix.

6. The method according to claim 4 or 5, characterized in that, The method further includes: When the number of training rounds is less than the preset threshold, the preset learning rate will be decayed using cosine annealing. When the number of training rounds exceeds the preset threshold, the learning rate is restarted according to the preset period. After restarting, the configured learning rate is a preset percentage of the preset learning rate, and it continues to decay according to cosine annealing.

7. The method according to claim 1, characterized in that, The preset basic model is the Qwen3 series model.

8. A training device for a multilingual small-scale electrical model, characterized in that, The device includes: A single-turn dialogue training data generation module is used to acquire single-turn question-and-answer data in the power field, perform one-to-one translation on the single-turn question-and-answer data, and generate multilingual single-turn dialogue training data. The basic foundation model training module is used to train the preset basic model based on the multilingual single-turn dialogue training data to obtain a basic foundation model with single-turn cross-lingual question-and-answer capabilities in the power field. A multi-turn dialogue training data generation module is used to construct multi-turn dialogue data based on the single-turn question-and-answer data, perform one-to-one translation on the multi-turn dialogue data, and generate multilingual multi-turn dialogue training data. The multi-turn interaction model training module is used to train the basic base model based on the multilingual multi-turn dialogue training data to obtain a multi-turn interaction model with the ability to interact with users on multiple turns of knowledge in the power field. The rank-stable training module is used to perform RSLoRA rank-stable training on the multi-round interaction model to obtain the final small power model.

9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the training method for the multilingual power mini-model as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the training method for the multilingual power mini-model as described in any one of claims 1 to 7.