Large-model-oriented adaptive parameter fine tuning system, method, device and equipment, storage medium and program product
By automatically matching the fine-tuning mode with the training parameters through the adaptive parameter fine-tuning system and intelligently scheduling computing resources, a seamless connection between training and deployment is achieved. This solves the problem of low efficiency in existing technologies, improves the efficiency and reliability of large model fine-tuning, and adapts to diverse business scenarios.
Patent Information
- Application Number
- CN202511052369.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-11
AI Technical Summary
Existing techniques for fine-tuning large model parameters rely heavily on manual operations, resulting in low efficiency and fragmented processes, which pose risks of resource waste and training failure.
An adaptive parameter fine-tuning system is provided, including a user interaction module, a training execution module, and a service deployment module. It automatically matches the fine-tuning mode with the training parameters, intelligently schedules computing resources, and achieves seamless integration of training and deployment. Through adaptive learning rate adjustment and model encapsulation, it forms an end-to-end automated process.
It improves the efficiency and reliability of fine-tuning large models, reduces manual intervention, ensures the stability and accuracy of model training, adapts to the differentiated needs of different business scenarios, and lowers the technical threshold and trial-and-error costs.
Smart Images

Figure CN120929261A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to an adaptive parameter fine-tuning system, method, apparatus, device, storage medium, and program product for large models. Background Technology
[0002] Fine-tuning of large model parameters refers to optimizing some or all of the parameters of a pre-trained large model using specific task data to make the model more suitable for a specific application scenario. Since the generality of pre-trained large models cannot meet the diverse needs of vertical domains, fine-tuning can inject professional knowledge and domain data to improve the model's performance in specific tasks, thus becoming a key step in the practical application of large models.
[0003] Currently, known techniques for fine-tuning large model parameters typically involve technicians manually configuring the training framework, such as selecting deep learning frameworks like TensorFlow or PyTorch, and manually setting training parameters like the learning rate and number of iterations. Regarding computing resources, manual allocation of GPU memory and scheduling of cluster resources are required. Traditional fine-tuning processes separate training, evaluation, and deployment stages, requiring different tools for data preprocessing, training monitoring, and service deployment. The trained model then needs manual format conversion and interface development before it can be deployed as a callable API service.
[0004] However, the above-mentioned fine-tuning method relies on a lot of manual operation and takes a lot of time, thus resulting in low efficiency. Summary of the Invention
[0005] This application provides an adaptive parameter fine-tuning system, method, apparatus, device, storage medium, and program product for large models, to address the inefficiency of known technologies when fine-tuning parameters for large models.
[0006] In a first aspect, this application provides an adaptive parameter fine-tuning system for large models, the system comprising:
[0007] The user interaction module is used to acquire the fine-tuning mode, training data, and base model input by the user, and to determine the training parameters based on the fine-tuning mode and the base model; the fine-tuning mode includes low-rank adaptive fine-tuning and full-parameter fine-tuning.
[0008] The training execution module is used to determine the computing power requirement based on the fine-tuning mode and the training data, and allocate computing power resources to the basic model according to the priority of the basic model and the computing power requirement; it is also used to train the basic model based on the training parameters and the training data to obtain model weight parameters, wherein the training parameters include a learning rate, and the learning rate is adaptively adjusted during the training process;
[0009] The service deployment module is used to obtain a target model based on the model weight parameters and the base model; it is also used to transform and encapsulate the target model to obtain an executable model, and generate the service interface of the executable model.
[0010] Secondly, this application provides an adaptive parameter fine-tuning method for large models, the method comprising:
[0011] The system acquires the fine-tuning mode, training data, and base model input by the user, and determines the training parameters based on the fine-tuning mode and the base model; the fine-tuning mode includes low-rank adaptive fine-tuning and full-parameter fine-tuning.
[0012] The computing power requirement is determined based on the fine-tuning mode and the training data, and computing power resources are allocated to the basic model according to the priority of the basic model and the computing power requirement.
[0013] The model weight parameters are obtained by training the base model based on the training parameters and the training data. The training parameters include the learning rate, which is adaptively adjusted during the training process.
[0014] Based on the model weight parameters and the base model, the target model is obtained;
[0015] The target model is transformed and encapsulated to obtain an executable model, and the service interface of the executable model is generated.
[0016] Thirdly, this application provides an adaptive parameter fine-tuning device for large models, the device comprising:
[0017] The acquisition module is used to acquire the fine-tuning mode, training data and base model input by the user, and determine the training parameters based on the fine-tuning mode and the base model; the fine-tuning mode includes low-rank adaptive fine-tuning and full-parameter fine-tuning;
[0018] The allocation module is used to determine the computing power requirement based on the fine-tuning mode and the training data, and to allocate computing power resources to the basic model according to the priority of the basic model and the computing power requirement.
[0019] The training module is used to train the base model based on the training parameters and the training data to obtain model weight parameters, wherein the training parameters include a learning rate, and the learning rate is adaptively adjusted during the training process.
[0020] The determination module is used to obtain the target model based on the model weight parameters and the base model;
[0021] The generation module is used to transform and encapsulate the target model to obtain an executable model, and generate the service interface of the executable model.
[0022] Fourthly, this application provides an electronic device, including: at least one processor, and a memory communicatively connected to the processor;
[0023] The memory stores computer-executed instructions;
[0024] The at least one processor executes computer execution instructions stored in the memory to implement the method as described in any of the second aspects.
[0025] Fifthly, this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the method as described in any of the second aspects.
[0026] In a sixth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the second aspects.
[0027] The adaptive parameter fine-tuning system for large models provided in this application comprises three modules: a user interaction module, a training execution module, and a training execution module. The user interaction module obtains the fine-tuning mode, training data, and base model input by the user, and determines the training parameters based on these parameters. The training execution module determines the computing power requirements based on the fine-tuning mode and training data obtained from the user interaction module, allocates computing power resources to the base model according to its priority and computing power requirements, and trains the base model using the training parameters and training data obtained from the user interaction module to obtain model weight parameters. Finally, the service deployment module obtains the target model based on the model weight parameters and the base model, further transforms and encapsulates the target model to obtain an executable model, and then generates the service interface of the executable model for each instance to load. In this system, because the user interaction module automatically matches the fine-tuning mode and training parameters, the training execution module intelligently schedules computing power resources, and the service deployment module achieves seamless training-deployment integration, the three modules form an end-to-end automated process, reducing manual intervention and process fragmentation, thus offering a significant advantage in fine-tuning efficiency compared to known technologies. Furthermore, because the user interaction module customizes training parameters based on the characteristics of the basic model, the training execution module adaptively adjusts the learning rate during training, and the service deployment module generates service interfaces based on the complete training results, the three work together to ensure the stability and generalization ability of the model training, which helps to ensure that a highly accurate executable model is finally obtained. Attached Figure Description
[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0029] Figure 1 A schematic diagram illustrating an application scenario of an adaptive parameter fine-tuning system for large models, provided in an embodiment of this application;
[0030] Figure 2 A schematic diagram of the structure of an adaptive parameter fine-tuning system for large models provided in this application embodiment. Figure 1 ;
[0031] Figure 3 A schematic diagram of the structure of an adaptive parameter fine-tuning system for large models provided in this application embodiment. Figure 2 ;
[0032] Figure 4 A structural example diagram of an adaptive parameter fine-tuning system for large models provided in this application embodiment;
[0033] Figure 5 A flowchart illustrating an adaptive parameter fine-tuning method for large models provided in this application embodiment;
[0034] Figure 6 A schematic diagram of an adaptive parameter fine-tuning device for large models provided in this application embodiment;
[0035] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0036] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0038] 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, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize or refuse.
[0039] It should be noted that the adaptive parameter fine-tuning system, method, apparatus, device, storage medium and program products for large models provided in this application can be used in the field of artificial intelligence, or in any field other than artificial intelligence. The application fields of the adaptive parameter fine-tuning system, method, apparatus, device, storage medium and program products for large models in this application are not limited.
[0040] For ease of understanding, each key or important term involved in this invention is explained below:
[0041] Low-Rank Adaptation Fine-tuning (LoRA) is a parameter-efficient method for fine-tuning large models. It involves inserting a trainable low-rank adaptation matrix into the Transformer layers of a pre-trained model, optimizing only the adapter parameters and the corresponding layer normalized weights while keeping the original model parameters frozen. Compared to full-parameter fine-tuning, it reduces the number of trainable parameters by 70%-90%, saving computational resources and time, and is suitable for small-scale data scenarios.
[0042] Full parameter tuning (FGM) is a fine-tuning method that completely updates all weights of a large model. It calculates the gradients of all parameters through backpropagation and updates them to adapt to the specific task. Because it requires updating all parameters, FGM typically demands more computational resources and more time to complete the training process. It achieves good performance with sufficient data and supports deep tuning of the model architecture.
[0043] Large-scale modeling technology has already been implemented in numerous applications and office scenarios within the banking industry, such as intelligent Q&A for banking regulations, risk monitoring, credit information management, financial and operational analysis, and meeting minutes translation. Furthermore, this technology is widely used in other fields. For example, in the medical field, large-scale models can assist doctors in case diagnosis, medical image analysis, and drug development data processing; in the education industry, it enables personalized learning recommendations, intelligent homework grading, and virtual teaching assistants; in manufacturing, large-scale models can be used for production process optimization, equipment failure prediction, and intelligent supply chain management; and in the media and entertainment industry, it can also be used for intelligent content creation, film and television special effects generation, and virtual anchor creation, demonstrating its powerful cross-industry enabling potential.
[0044] Because the generality of pre-trained large models cannot meet the diverse needs of vertical fields, fine-tuning the parameters of large models has become a key step in their practical application. Fine-tuning of large model parameters refers to optimizing some or all of the model's parameters using specific task data, based on a pre-trained large model, to make the model more suitable for specific application scenarios.
[0045] Currently, known techniques for fine-tuning large model parameters typically involve technicians manually configuring the training framework, such as selecting deep learning frameworks like TensorFlow or PyTorch, and manually setting training parameters like the learning rate and number of iterations. Regarding computing resources, manual allocation of GPU memory and scheduling of cluster resources are required. Traditional fine-tuning processes separate training, evaluation, and deployment stages, requiring different tools for data preprocessing, training monitoring, and service deployment. The trained model then needs manual format conversion and interface development before it can be deployed as a callable API service.
[0046] However, the above process is inefficient due to its reliance on extensive manual operations and fragmented workflow, requiring a significant amount of time. Furthermore, the high technical barrier of the entire process can easily lead to resource waste or training failures.
[0047] Therefore, this application provides an adaptive parameter fine-tuning system for large models, aiming to solve the aforementioned technical problems of known technologies. Specifically, the adaptive parameter fine-tuning system for large models provided in this application includes a user interaction module, a training execution module, and a service deployment module. The user interaction module can obtain the fine-tuning mode, base model, and training data input by the user, and automatically determine the appropriate training parameters. Based on the input from the interaction module, the training execution module intelligently assesses the computing power requirements, dynamically allocates computing power resources in combination with the priority of the base model, and completes model training based on the training parameters and data, generating model weight parameters. The service deployment module integrates the training results with the base model, quickly completes the conversion and encapsulation of the target model, and generates a service interface that can be directly called, realizing a seamless connection from training to service.
[0048] Through the coordinated operation of the three major modules, the system achieves end-to-end process standardization, avoiding training interruptions caused by manual configuration of the training framework and parameter errors. At the same time, the system can encapsulate mature fine-tuning experience into pipeline templates, helping small and medium-sized banks reduce technical barriers and trial-and-error costs, and effectively improve the efficiency and reliability of large model fine-tuning.
[0049] It should be understood that the aforementioned adaptive parameter fine-tuning system for large models can specifically be a software system deployed on cloud servers, edge computing nodes, or data trading platform clusters, or it can be an intelligent data processing device combining hardware and software. The system of this application can be used in multiple fields such as financial risk control, supply chain management, smart agriculture, healthcare data analysis, and energy market forecasting. For example, Figure 1 This is a schematic diagram illustrating an application scenario for an adaptive parameter fine-tuning system for large models, provided in an embodiment of this application. For example... Figure 1 As shown, the system of this application can be used in the banking field.
[0050] Specifically, in this scenario, the adaptive parameter fine-tuning system for large models is deployed on the bank's private cloud server and interacts with the bank's internal business terminals. Based on this, bank staff access the system's user interaction module through the business terminal's interface, select a low-rank adaptive fine-tuning mode suitable for the intelligent customer service scenario, and upload training data and a basic model containing local dialects and information on featured financial products. The system automatically determines the training parameters. The training execution module allocates computing resources efficiently for model training based on data characteristics and model priority through the business terminal's computing power scheduling interface. After training, the service deployment module converts and encapsulates the optimized model into an API service and integrates it into the bank's intelligent customer service system through the business terminal's interface module. Throughout this process, the business terminal, as the core carrier of human-computer interaction, achieves a closed-loop operation from parameter configuration and training monitoring to service deployment. It eliminates the need for manual configuration of the training framework and parameters, and the need to switch between different tools at each stage, truly achieving seamless integration from training to service. This significantly shortens the fine-tuning cycle of large models in the bank's intelligent customer service scenario and significantly improves fine-tuning efficiency.
[0051] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0052] This application provides an adaptive parameter fine-tuning system for large models. Figure 2A schematic diagram of the structure of an adaptive parameter fine-tuning system for large models provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the system in this embodiment includes a user interaction module, a training execution module, and a service deployment module.
[0053] The user interaction module interacts with the user to obtain the fine-tuning mode, training data, and base model input by the user, and determines the training parameters based on the fine-tuning mode and base model. Specifically, the fine-tuning modes include low-rank adaptive fine-tuning and full-parameter fine-tuning.
[0054] In this embodiment, the user interaction module provides a web page to the user, which displays different fine-tuning modes and different base models, and supports users uploading training data in different formats. In this embodiment, the user interaction module automatically determines the corresponding training parameters based on the fine-tuning mode and base model input by the user. These training parameters include the number of training epochs, the initial learning rate, and the batch gradient accumulation steps.
[0055] As a preferred example, the user interaction module can also determine training parameters through the following process: displaying adjustable training parameters based on the fine-tuning mode and the base model; adjustable training parameters include the initial learning rate, training epochs, and batch gradient accumulation steps; and determining the training parameters based on the adjustable training parameters and user feedback. Specifically, the user interaction module also provides optional training parameters to the user through a web page, and provides default values for each optional training parameter for the user to confirm or modify.
[0056] With the above settings, the user interaction module displays optional training parameters and provides default values on the web page. For example, when a user performs LoRA fine-tuning on a basic model in the financial field, the system automatically recommends default parameters such as the initial learning rate and training epochs. Users can directly confirm and use these parameters, or modify them according to business needs, such as adjusting the learning rate and training epochs for customer service scenarios using local dialects. This "automatic recommendation + manual adjustment" approach reduces the difficulty and trial-and-error costs for beginners in configuring parameters, while providing professional users with personalized tuning space, making parameter configuration more efficient and flexible, and taking into account the needs of different users and the stability of model training.
[0057] It should be understood that training data is used in the training process of the base model, serving as its input / output. The base model can be a pre-trained open-source large model (such as LLaMA, ChatGLM, etc.) or a domain model developed in-house by the bank. Its network structure includes core components such as the Transformer encoder / decoder architecture and attention mechanisms. The user interaction module supports connecting to different types of base models, automatically matching training parameters based on the model's parameter scale (e.g., lightweight models with less than 7 billion parameters or heavyweight models with more than 10 billion parameters) and task characteristics (e.g., text classification, sequence generation, etc.). For example, when a user selects the LLaMA model for low-rank adaptive fine-tuning of a credit risk control text classification task, the user interaction module generates the appropriate number of training rounds (e.g., 10-15 rounds), initial learning rate (e.g., 5e-5), and batch gradient accumulation steps (e.g., 8) by default. It also allows the user to adjust these parameters through the parameter configuration panel on the web page, meeting personalized tuning needs while ensuring training stability.
[0058] like Figure 2 As shown, the training execution module connects to the user interaction module to obtain the fine-tuning mode, training data, base model, and training parameters. The training execution module is used to determine the computing power requirements based on the fine-tuning mode and training data, and to allocate computing power resources to the base model according to its priority and computing power requirements.
[0059] Specifically, the training execution module allocates computing resources through the following process: determining the model coefficients and data influence factors based on the fine-tuning mode, and substituting the model coefficients, data influence factors, model parameter count, and training data quantity into the formula. The computing power requirement is obtained; where M represents the number of model parameters, which is determined by the basic model, D represents the amount of training data, α represents the mode coefficient, and β represents the data influence factor.
[0060] When at least two basic models exist simultaneously, computing resources corresponding to the computing power requirements of the basic model with higher priority are allocated first, according to the priority of the two basic models.
[0061] More specifically, the number of model parameters is determined by the base model. For example, if the base model is Qwen-7B, then its corresponding number of model parameters is 7 × 10⁻⁶. 9 α and β are determined by the specific fine-tuning mode and the amount of training data. In this embodiment, if it is LoRa mode and the amount of training data is 10... 5 For orders of magnitude larger, α is 0.3 and β is 0.15. If it's full parameter fine-tuning and the number of training data is 10... 4 For values below the order of magnitude, α is 1.2 and β is 0.15.
[0062] As an example, when the user selects the full parameter fine-tuning mode, and the base model is Qwen-7B ( ) and upload When using training data, substitute the amount of training data, the number of model parameters, the mode coefficients, and the data impact factor into the input. (The actual allocation of 8 A100 servers instead of the theoretically calculated 10 is essentially a result of balancing theoretical computing power, engineering feasibility, and cost control. By reserving 20% computing power redundancy, service availability and the ability to handle sudden loads are guaranteed, while achieving the optimal deployment strategy under realistic conditions such as hardware costs and infrastructure limitations. This is especially suitable for scenarios with extremely high stability requirements, such as finance and autonomous driving. In addition, in application, the actual number of servers allocated will be optimized according to the cluster topology.)
[0063] Furthermore, when training at least two base models is required, computing resources are allocated to the higher-priority base model based on their priority and corresponding resource requirements. It should be understood that when computing resources are insufficient, the corresponding base model needs to wait in a queue. As a preferred design, when at least two base models are waiting in a queue, the allocation can be flexibly combined with their priority and available computing resources. For example, 50% of the required computing power can be allocated to the high-priority model to start training, while reserving remaining resources for the low-priority model. When the high-priority task enters the gradient accumulation phase, some computing power can be released to compensate for the low-priority allocation. This embodiment does not impose this limitation.
[0064] With the above settings, the training execution module can accurately calculate computing power requirements based on the fine-tuning mode, model parameter quantity, and training data quantity using a quantitative formula. For example, when fine-tuning a large model with all parameters, the required computing power can be obtained by substituting the corresponding model coefficients and data influence factors into the formula. Resources are then dynamically allocated according to the priority of the basic model. In multi-model training scenarios, resources are allocated to high-priority models first. Flexible allocation strategies can also be adopted when computing power is insufficient, realizing intelligent dynamic scheduling of computing power resources. This effectively improves resource utilization and fine-tuning efficiency, avoids resource waste or training interruption caused by manual allocation, and meets the differentiated needs of different business scenarios.
[0065] In this embodiment, the training execution module is further configured to train the base model based on training parameters and training data to obtain model weight parameters. The training parameters include the learning rate, which is adaptively adjusted during training. It should be understood that the training execution module utilizes the computing resources allocated to the base model to train the base model and obtain the model weight parameters.
[0066] As a preferred example Figure 3 A schematic diagram of the structure of an adaptive parameter fine-tuning system for large models provided in this application embodiment. Figure 2 ,like Figure 3 As shown, the system in this embodiment also includes a data preprocessing module, which is connected to the user interaction module. The user obtains training data and performs at least one of the following processing operations on the training data: terminology standardization, format unification, and data anonymization.
[0067] Based on this, the training execution module specifically determines the computing power requirements based on the fine-tuning mode and preprocessed training data, and allocates computing power resources to the basic model according to the priority and computing power requirements of the basic model; it is also used to train the basic model based on training parameters and preprocessed training data to obtain model weight parameters, including the learning rate, which is adaptively adjusted during the training process.
[0068] Specifically, in this embodiment, the data preprocessing module uses a small model to standardize terminology (e.g., converting "LPR interest rate" to "Loan Prime Rate") and unify the format (converting between JSON / CSV / TXT); it also performs adaptive desensitization for compliance, dynamically matching desensitization rules according to data type, such as using regular expression matching to replace account information (e.g., ID number 310××××××1234), and blurring the address and name fields.
[0069] In practical applications, the aforementioned processing operations can also be achieved in other ways, and any one or two of the processing operations can be executed. This implementation does not limit this.
[0070] Through the above settings, the system uses the data preprocessing module to standardize the terminology of the training data (e.g., unifying "LPR interest rate" as "Loan Prime Rate"), unify the format (supporting automatic conversion of JSON / CSV and other formats), and ensure compliance and anonymization (such as hiding some fields like ID card numbers). This solves the problems of data ambiguity, fragmentation, and privacy risks, ensuring that the training data input to the model is standardized and consistent. At the same time, the accurate preprocessed data provides a reliable basis for calculating computing power requirements and works in conjunction with the training execution module to optimize resource scheduling, making the fine-tuning process more compliant and efficient in scenarios with strict data requirements, such as finance and healthcare.
[0071] In this embodiment, the learning rate used by the training execution module in training the base model is dynamically updated. Specifically, the training execution module trains the base model through the following process: in the initial T steps of training, N different selectable learning rates are obtained from a preset learning rate range at logarithmic intervals; the loss function descent rate corresponding to each selectable learning rate is calculated, and the selectable learning rate that maximizes the loss function descent rate is taken as the learning rate.
[0072] More specifically, with This represents the selectable learning rate, where N different selectable learning rates (e.g., ...) are obtained from a preset learning rate range at logarithmic intervals over T (T=100) steps. Then use each optional learning rate separately. Training is performed over T steps, and the loss function value L(t) is recorded at each step to calculate the rate of decrease of the loss function corresponding to each selectable learning rate. Finally, the learning rate that maximizes the rate of decrease of the loss function is selected as the learning rate. The learning rate that maximizes the rate of decrease of the loss function is obtained using the following formula: In the formula, An optional learning rate is used to represent the rate at which the loss function decreases.
[0073] With the above settings, the training execution module performs parallel testing on candidate learning rate values of different orders of magnitude during the initial training phase. It automatically selects the optimal learning rate by quantitatively evaluating the rate of decrease of the loss function, avoiding the blindness and high cost of manual trial and error. This mechanism requires only a few training steps to complete parameter tuning, preventing training failures due to inappropriate learning rates and improving model convergence speed and generalization ability. It can quickly adapt to fine-tuning of large models in different fields such as financial risk control and medical image analysis, demonstrating good versatility and stability.
[0074] As a further optimized design, the training execution module is specifically used in subsequent training processes to: calculate the current gradient health index every M training steps; the current gradient health index includes the gradient norm and the parameter update ratio; when the parameter update ratio is less than the minimum parameter update ratio within K consecutive steps, update the learning rate to increase the learning rate; when the gradient norm is greater than the maximum gradient norm, update the learning rate to decrease the learning rate.
[0075] Specifically, when the parameter update ratio is detected to be below the minimum threshold (e.g., 0.01%) for K consecutive steps, the model is considered to be stuck, and the learning rate is increased by a preset factor (e.g., 2 times). When the gradient norm exceeds the maximum threshold (e.g., 10), a risk of gradient explosion is identified, and the learning rate is decreased by a preset factor (e.g., 0.5 times). For example, when fine-tuning the BERT model, if the parameter update ratio is found to be below 0.005% for 5 consecutive steps, the learning rate is increased from 1×10^6. -5 Upgraded to 2×10 -5 If the gradient norm exceeds 8, then reduce the learning rate to 5×10. -6 .
[0076] Through the above settings, the training execution module achieves dynamic adaptive adjustment of the learning rate, avoiding training stagnation caused by an excessively small learning rate and preventing gradient instability caused by an excessively large learning rate, thus significantly improving the stability and efficiency of model training. This mechanism has shown good universality in fine-tuning large models across multiple domains, such as accelerating model convergence in medical image recognition tasks and effectively reducing the risk of overfitting in financial text classification scenarios.
[0077] like Figure 2 or Figure 3 As shown, the service deployment module connects the training execution module and the user interaction module, and is used to obtain the model weight parameters and the parameter model, respectively. Based on this, the service deployment module is used to obtain the target model based on the model weight parameters and the base model; it is also used to transform and encapsulate the target model to obtain an executable model, and generate the service interface of the executable model.
[0078] In this embodiment, the service deployment module determines the appropriate method for obtaining the target model based on the fine-tuning mode. In this embodiment, when the fine-tuning mode is low-rank adaptive fine-tuning, the model weight parameters are merged with the weights of the base model to obtain a complete weight matrix, and the target model is obtained based on the complete weight matrix and the base model. When the fine-tuning mode is full-parameter fine-tuning, the complete weight matrix is determined based on the model weight parameters, and the target model is obtained based on the complete weight matrix and the base model.
[0079] Specifically, the service deployment module obtains the target model through the following process: loading the complete weight matrix into the same model architecture as the base model, the model architecture including layer structure definition and forward propagation path configuration; verifying the parameter dimension matching between the complete weight matrix and the model architecture; and initializing all trainable parameters of the model architecture based on the complete weight matrix to form an independently runnable target model.
[0080] Furthermore, the service deployment module converts the target model into an inference engine, and encapsulates the inference engine and corresponding business logic into an executable model. Finally, based on the input / output data structure of the executable model, the service deployment module automatically generates service interfaces that conform to the framework specifications using the built-in standardized interface generation tool, and generates health check interfaces to detect the service's running status.
[0081] In this embodiment, when the fine-tuning mode is low-rank adaptive fine-tuning, the service deployment module obtains LoRA weight parameters (such as adapter matrices A and B) from the training execution module and merges them with the pre-trained weights of the base model according to the formula W=W0+A·B to generate a complete weight matrix. If it is full-parameter fine-tuning, the complete weight matrix obtained from training is used directly. The weight matrix is then loaded into an architecture isomorphic to the base model (such as an Encoder structure containing 12 Transformer layers), and the model parameters are initialized after dimensionality verification (such as ensuring that the dimensions of the attention layer's Q / K / V matrices match the length of the input sequence). When converting the inference engine, the target model is optimized to a TensorRT engine to accelerate floating-point calculations for GPU server scenarios, and converted to an ONNXRuntime lightweight engine for edge devices, while encapsulating business logic (such as a fraud rule verification module for financial risk control models). Finally, based on the input / output specifications (such as JSON format input and probability array output for text classification tasks), a standardized API interface is generated using the Swagger tool, and a health check interface (returning CPU / memory usage via HTTP requests) is integrated.
[0082] Through the above settings, the service deployment module automates the entire process of model training to production. It not only supports weight integration and multi-scenario adaptation for different fine-tuning modes, but also shortens deployment time and reduces response latency in financial risk control scenarios, and enables low-latency interaction of edge devices in scenarios such as intelligent customer service. Standardized interfaces and health monitoring functions further ensure the maintainability of the service, making it more feasible to implement in industry scenarios with high stability requirements. Moreover, the health check interface further enhances the reliability and practicality of the system by monitoring service status in real time, driving elastic scaling, triggering fault recovery, and supporting compliance audits.
[0083] As a preferred example, the service deployment module is also used to: invoke the prediction model to predict the query rate per second within a preset future time period based on the query rate per second within the historical time period; and dynamically deploy the number of instances corresponding to the executable model based on the query rate per second within the preset future time period.
[0084] Specifically, in this embodiment, the service deployment module calls the LSTM-based Queries Per Second (QPS) prediction model to predict the traffic for the next 10 minutes based on the QPS data of the past 30 minutes, and then dynamically adjusts the number of instances.
[0085] It should be understood that in practical applications, it can also be achieved by calling a time series forecasting model based on the Prophet algorithm or an ARIMA model. The preset duration and historical time period can also be configured according to the needs. For example, the traffic in the next 30 minutes can be predicted using the QPS data of the past hour, or the forecast window can be dynamically adjusted based on the traffic pattern of weekdays / weekends. This embodiment does not limit this.
[0086] Through the above settings, the service deployment module achieves intelligent elastic scaling of the number of model instances, automatically adjusting resource configuration based on traffic fluctuations. For example, during peak traffic periods such as e-commerce promotions and bank month-end settlements, the system automatically increases the number of model instances to ensure responsiveness; during off-peak periods, it reduces resource usage, lowering cloud server costs. This mechanism effectively improves resource utilization and ensures stable system operation under different loads, making it particularly suitable for scenarios with large traffic fluctuations.
[0087] The adaptive parameter fine-tuning system for large models provided in this embodiment constructs a standardized solution for the entire "data-training-deployment-governance" chain. Its workflow is as follows: The user interaction module first obtains the fine-tuning mode (e.g., low-rank adaptive fine-tuning or full-parameter fine-tuning), training data, and the base model (e.g., Qwen-7B) input by the user. Based on the characteristics of the fine-tuning mode and the base model parameters (e.g., parameter count, architecture type), it automatically matches the training parameters (including learning rate, batch size, etc.). The training execution module, based on the fine-tuning mode (full-scale fine-tuning requires higher computing power) and the scale of the training data (e.g., 100,000 samples), uses a computing power requirement formula (e.g., ...) to determine the optimal parameters for training. The system calculates resource requirements and then dynamically allocates GPU resources (such as A100 graphics cards) according to the priority of the basic model (such as the core business model). At the same time, it iteratively trains the basic model based on training parameters and preprocessed training data, and generates optimized model weight parameters through adaptive learning rate adjustment (such as decaying the learning rate when gradient explosion occurs). The service deployment module integrates the model weight parameters with the basic model architecture to obtain the target model. After optimization by the inference engine (such as converting to the TensorRT engine) and encapsulation of business logic, it generates an executable model and automatically generates standardized service interfaces (such as RESTAPI) for multi-instance clusters to load and call.
[0088] The system in this embodiment achieves end-to-end automated processes, effectively reducing manual intervention and fragmented workflows. It not only improves the efficiency of fine-tuning large models but also enhances training stability through dynamic adjustment mechanisms. Combined with parameter customization and model encapsulation, it ensures the accuracy and generalization ability of the final executable model. Applying this system to the banking sector, in typical scenarios such as intelligent customer service, credit approval, and regulatory compliance, it can effectively shorten model deployment cycles to quickly respond to business needs. For example, in intelligent customer service scenarios, lightweight model encapsulation enables low-latency interaction; intelligent scheduling of computing resources and gradient optimization mechanisms ensure the inference stability of the credit approval model under high concurrency; and standardized service interfaces and health monitoring functions meet regulatory compliance requirements, such as generating API interfaces that comply with financial regulations and ensuring the continuous availability of anti-money laundering model services through real-time computing power monitoring, providing efficient and reliable AI technology support for the digital transformation of banks.
[0089] As further explanation, Figure 4 A structural example diagram of an adaptive parameter fine-tuning system for large models provided in this application embodiment is shown below. Figure 4 As shown, the system in this embodiment can be divided into a user interaction layer, a data processing layer, a training execution layer, and a service deployment layer. Specifically, the user interaction layer includes a user interaction module to receive fine-tuning modes, basic models, and training data input by the user through a web page. The data processing layer includes a data preprocessing module responsible for cleaning, transforming, and other preprocessing operations on the acquired data. The training execution layer includes a training execution module to implement adaptive resource allocation and training execution. The former is responsible for rationally allocating computing resources according to the model and data conditions, while the latter trains the basic model based on the allocated resources and preprocessed data. The service deployment layer includes a service deployment module to implement adaptive model encapsulation, elastic service scaling, and service interface generation functions. It can encapsulate the trained model to generate services with flexibly adjustable capacity and provide corresponding service interfaces for external calls.
[0090] This application also provides an adaptive parameter fine-tuning method for large models, which is executed by any electronic device deployed with an adaptive parameter fine-tuning system for large models. Figure 5 A flowchart illustrating an adaptive parameter fine-tuning method for large models provided in this application embodiment is shown below. Figure 5 As shown, the adaptive parameter fine-tuning method for large models in this application includes:
[0091] S501 obtains the fine-tuning mode, training data, and base model input by the user, and determines the training parameters based on the fine-tuning mode and base model.
[0092] The fine-tuning modes include low-rank adaptive fine-tuning and full-parameter fine-tuning.
[0093] In this embodiment, the user inputs the fine-tuning mode, training data, and base model through the interactive interface. The electronic device determines the appropriate training parameters based on the fine-tuning mode (e.g., low-rank adaptive fine-tuning needs to consider matrix factorization parameters, and full-parameter fine-tuning needs to consider all parameter update strategies) and the base model (e.g., the architecture and parameter scale of the base model). For example, the initial learning rate is determined based on the complexity of the base model.
[0094] S502 determines computing power requirements based on fine-tuning modes and training data, and allocates computing power resources to the basic model according to the priority and computing power requirements of the basic model.
[0095] In this embodiment, the electronic device obtains the current computing power requirement by calling the computing power requirement calculation formula in the aforementioned content. Furthermore, according to the priority of the basic model in the business (such as the core business-related models having high priority), and combined with the computing power requirement, the available computing resources (such as GPUs, TPUs, etc.) are reasonably allocated to the basic model to ensure that important models get sufficient computing power first.
[0096] S503 trains the base model based on training parameters and training data to obtain model weight parameters.
[0097] Among the training parameters is the learning rate, which is adaptively adjusted during training.
[0098] In this embodiment, when training the base model, the electronic device adaptively adjusts the learning rate based on the training progress (such as changes in gradients, the convergence state of the loss function, etc.). For example, when the convergence speed of the loss function slows down, the learning rate is appropriately increased; when signs of gradient explosion appear, the learning rate is promptly decreased, thereby obtaining optimized model weight parameters.
[0099] S504, based on the model weight parameters and the basic model, yields the target model.
[0100] In this embodiment, the electronic device integrates the obtained model weight parameters with the base model to construct a target model. This target model combines the structural advantages of the base model and the weight advantages obtained during training. For details on how to construct the target model, please refer to the descriptions in the preceding embodiments; they will not be repeated here.
[0101] S505 transforms and encapsulates the target model to obtain an executable model and generates the service interface of the executable model.
[0102] In this embodiment, the target model is transformed (e.g., converted to a format suitable for a specific inference engine) and encapsulated (e.g., packaged in a container for easy deployment) to generate an executable model. Simultaneously, service interfaces, such as RESTful API interfaces, are generated for the executable model to facilitate external systems calling the model's functionality.
[0103] The method described in this embodiment enables flexible parameter fine-tuning when facing different user needs and basic models, quickly and efficiently obtaining models that can be used in actual business scenarios. This improves the adaptability and deployment efficiency of large models in different fields, reduces the cost of model optimization and application, and ensures the stability and reliability of model training through adaptive learning rate adjustment and resource allocation mechanisms, which helps to obtain accurate prediction and analysis results in various business scenarios.
[0104] The above embodiments introduce an adaptive parameter fine-tuning method for large models from the perspective of method flow. The following embodiments introduce an adaptive parameter fine-tuning device for large models from the perspective of virtual modules or virtual units. For details, please refer to the following embodiments.
[0105] This application provides an adaptive parameter fine-tuning device for large models. Figure 6 A schematic diagram of an adaptive parameter fine-tuning device for large models provided in this application embodiment is shown below. Figure 6 As shown, the device includes:
[0106] The acquisition module 61 is used to acquire the fine-tuning mode, training data and base model input by the user, and determine the training parameters based on the fine-tuning mode and base model; the fine-tuning mode includes low-rank adaptive fine-tuning and full-parameter fine-tuning;
[0107] The allocation module 62 is used to determine the computing power requirements based on the fine-tuning mode and training data, and to allocate computing power resources to the basic model according to the priority and computing power requirements of the basic model.
[0108] Training module 63 is used to train the base model based on training parameters and training data to obtain model weight parameters. The training parameters include the learning rate, which is adaptively adjusted during the training process.
[0109] Module 64 is used to determine the target model based on the model weight parameters and the base model;
[0110] The generation module 65 is used to transform and encapsulate the target model to obtain an executable model and generate the service interface of the executable model.
[0111] The adaptive parameter fine-tuning device for large models provided in this application embodiment is applicable to the above-described method embodiment, and will not be described again here.
[0112] This application provides an electronic device. Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, Figure 7 The illustrated electronic device includes a processor 71 and a memory 72. The processor 71 and the memory 72 are connected, for example, via a bus 73. Optionally, the electronic device may also include a transceiver 74. It should be noted that in practical applications, the transceiver 74 is not limited to one type, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.
[0113] Processor 71 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 71 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0114] Bus 73 may include a pathway for transmitting information between the aforementioned components. Bus 73 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 73 may be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single thick line, but this does not mean that there is only one bus 73 or one type of bus 73.
[0115] The memory 72 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0116] The memory 72 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 71. The processor 71 is used to execute the application code stored in the memory 72 to implement the content shown in the foregoing method embodiments.
[0117] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores program instructions, which are used to implement the methods in the above embodiments.
[0118] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the technical solution of the above method embodiments. Its implementation principle and technical effects are similar, and will not be repeated here.
[0119] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0120] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. An adaptive parameter fine-tuning system for large models, characterized in that, The system includes: The user interaction module is used to acquire the fine-tuning mode, training data, and base model input by the user, and to determine the training parameters based on the fine-tuning mode and the base model; the fine-tuning mode includes low-rank adaptive fine-tuning and full-parameter fine-tuning. The training execution module is used to determine the computing power requirement based on the fine-tuning mode and the training data, and allocate computing power resources to the basic model according to the priority of the basic model and the computing power requirement; it is also used to train the basic model based on the training parameters and the training data to obtain model weight parameters, wherein the training parameters include a learning rate, and the learning rate is adaptively adjusted during the training process; The service deployment module is used to obtain a target model based on the model weight parameters and the base model; it is also used to transform and encapsulate the target model to obtain an executable model, and generate the service interface of the executable model.
2. The system according to claim 1, characterized in that, The training execution module is specifically used for: The model coefficients and data influence factors are determined based on the fine-tuning mode, and the model coefficients, data influence factors, model parameter count, and training data quantity are substituted into the formula. The computing power requirement is obtained; where M represents the number of model parameters, which is determined by the basic model, D represents the amount of training data, α represents the mode coefficient, and β represents the data influence factor. When at least two basic models exist simultaneously, computing resources corresponding to the corresponding computing power requirements are allocated to the basic model with the higher priority, according to the priority of the at least two basic models.
3. The system according to claim 1 or 2, characterized in that, The training execution module is specifically used for: Within the initial T steps of training, N different selectable learning rates are obtained from the preset learning rate range at log intervals; Calculate the rate of decrease of the loss function corresponding to each of the optional learning rates, and take the optional learning rate that maximizes the rate of decrease of the loss function as the learning rate.
4. The system according to claim 3, characterized in that, The training execution module is also used for: In subsequent training, the current gradient health index is calculated every M training steps; the current gradient health index includes the gradient norm and the parameter update ratio. When the parameter update ratio is less than the minimum parameter update ratio within K consecutive steps, the learning rate is updated to increase the learning rate. When the gradient norm is greater than the maximum gradient norm, the learning rate is updated to decrease.
5. The system according to claim 1 or 2, characterized in that, The service deployment module is specifically used for: When the fine-tuning mode is the low-rank adaptive fine-tuning, the model weight parameters are merged with the weights of the base model to obtain a complete weight matrix, and the target model is obtained based on the complete weight matrix and the base model. And / or, when the fine-tuning mode is the full parameter fine-tuning, the complete weight matrix is determined based on the model weight parameters, and the target model is obtained based on the complete weight matrix and the base model; The target model is converted into an inference engine, and the inference engine and the corresponding business logic are encapsulated into the executable model.
6. The system according to claim 1 or 2, characterized in that, The service deployment module is specifically used for: Based on the input / output data structure of the executable model, the built-in standardized interface generation tool automatically generates service interfaces that conform to the framework specifications, and generates health check interfaces to detect the service running status.
7. The system according to claim 1 or 2, characterized in that, The service deployment module is also used for: The predictive model is invoked to predict the query rate per second within a preset future time period based on the query rate per second within a historical time period. The number of instances corresponding to the executable model will be dynamically deployed based on the query rate per second within the preset future time period.
8. The system according to claim 1 or 2, characterized in that, The system also includes a data preprocessing module, which is used to perform at least one of the following preprocessing operations on the training data: terminology standardization, format unification, and data anonymization. Accordingly, the training execution module is specifically used to: determine the computing power requirement based on the fine-tuning mode and the preprocessed training data, and allocate computing power resources to the basic model according to the priority of the basic model and the computing power requirement; It is also used to train the base model based on the training parameters and the preprocessed training data to obtain model weight parameters, wherein the training parameters include a learning rate, and the learning rate is adaptively adjusted during the training process.
9. The system according to claim 1 or 2, characterized in that, The user interaction module is specifically used for: Adjustable training parameters are shown based on the fine-tuning mode and the base model; the adjustable training parameters include the initial learning rate, training epochs, and batch gradient accumulation steps; The training parameters are determined based on the adjustable training parameters and user feedback.
10. An adaptive parameter fine-tuning method for large models, characterized in that, The method includes: The system acquires the fine-tuning mode, training data, and base model input by the user, and determines the training parameters based on the fine-tuning mode and the base model; the fine-tuning mode includes low-rank adaptive fine-tuning and full-parameter fine-tuning. The computing power requirement is determined based on the fine-tuning mode and the training data, and computing power resources are allocated to the basic model according to the priority of the basic model and the computing power requirement. The model weight parameters are obtained by training the base model based on the training parameters and the training data. The training parameters include the learning rate, which is adaptively adjusted during the training process. Based on the model weight parameters and the base model, the target model is obtained; The target model is transformed and encapsulated to obtain an executable model, and the service interface of the executable model is generated.
11. An adaptive parameter fine-tuning device for large models, characterized in that, The device includes: The acquisition module is used to acquire the fine-tuning mode, training data and base model input by the user, and determine the training parameters based on the fine-tuning mode and the base model; the fine-tuning mode includes low-rank adaptive fine-tuning and full-parameter fine-tuning; The allocation module is used to determine the computing power requirement based on the fine-tuning mode and the training data, and to allocate computing power resources to the basic model according to the priority of the basic model and the computing power requirement. The training module is used to train the base model based on the training parameters and the training data to obtain model weight parameters, wherein the training parameters include a learning rate, and the learning rate is adaptively adjusted during the training process. The determination module is used to obtain the target model based on the model weight parameters and the base model; The generation module is used to transform and encapsulate the target model to obtain an executable model, and generate the service interface of the executable model.
12. An electronic device, characterized in that, include: At least one processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory to implement the method as described in claim 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in claim 10.
14. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method of claim 10.
Citation Information
Cited By
Large model training method and device based on segment scheduling, medium and electronic equipment
CN121119175A
AI model intelligent training and reasoning integrated method and system
CN121352030A