An artificial intelligence-based model training method, system, medium and product
By aggregating the common baseline workflow of concurrent model training tasks and executing personalized derivative workflows in parallel, the problem of redundant consumption of computing resources in university practical training courses is solved, thereby improving teaching efficiency and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU TIANCHENG TECH CO LTD
- Filing Date
- 2026-04-09
- Publication Date
- 2026-06-05
Smart Images

Figure CN121979693B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing systems or methods specifically applicable to administrative, commercial, financial, management, supervisory or predictive purposes, and particularly relates to an artificial intelligence-based model training method, system, medium and product. Background Technology
[0002] With the rapid development of artificial intelligence technology, various AI-based model training platforms are widely used in educational training and scientific research scenarios to help learners master model development skills.
[0003] The relevant technology typically employs an integrated AI education and training platform based on a cloud architecture. This technology pre-deploys various mainstream algorithm frameworks on a cloud server and centrally stores cleaned public datasets. Learners simply log in to the platform through a browser, select the desired dataset and algorithm framework, and submit a training task. The platform then allocates appropriate cloud computing resources (such as GPUs) for independent model training and provides basic model version recording functionality. This technology allows learners to break free from the limitations of local hardware, focus on model logic design, lower the barrier to model development, and improve basic training efficiency.
[0004] However, in large-scale AI training courses, such as those conducted in universities, with hundreds of students, many students typically train models around the same topic. In such cases, the training tasks submitted by students often exhibit high similarity. When these students submit training tasks intensively within the same timeframe, the platform management system usually treats each student's task as an independent entity, allocating computing resources and executing the entire training process for each task according to the submission order. This increases the redundant consumption of the underlying GPU cluster's computing power. As the number of concurrent tasks increases, this redundant computation reduces the turnover rate of computing resources, thereby increasing the queuing time for a large number of students' training tasks, reducing the overall teaching efficiency of the training course and the utilization rate of the platform's computing resources. Summary of the Invention
[0005] This application provides an artificial intelligence-based model training method, system, medium, and product to reduce the redundant consumption of computing power caused by high-similarity training tasks and improve the overall efficiency of task scheduling.
[0006] In the first aspect, this application provides a model training method based on artificial intelligence, which obtains multiple artificial intelligence model training tasks submitted concurrently within a preset time window, parses each artificial intelligence model training task, and extracts an ordered logical execution sequence corresponding to each artificial intelligence model training task, which is composed of multiple network construction logic units and model training logic units.
[0007] In all ordered logical execution sequences, training tasks of artificial intelligence models with the same preceding continuous logical units are aggregated into training task groups;
[0008] Define the same preceding continuous logic units as the common baseline workflow of the training task group. The common baseline workflow represents the common artificial intelligence business logic of loading the unified training sample set and initializing the pre-trained neural network model.
[0009] For each AI model training task in the training task group, the common baseline workflow is separated from the corresponding ordered logic execution sequence, and the remaining logic units in the ordered logic execution sequence are transformed into personalized derivative workflows. The personalized derivative workflows are independent training logics that include personalized hyperparameter configuration and network layer parameter fine-tuning.
[0010] The common baseline workflow is allocated the first computing resources for a single centralized execution, and at the end of the common baseline workflow execution, the intermediate running data produced is determined as the baseline context slice. The baseline context slice is a persistent data packet that encapsulates the network topology and initial weight matrix of the pre-trained neural network model.
[0011] Allocate secondary computing resources to each individual derivative workflow in the training task group;
[0012] The baseline context slices are distributed to various secondary computing resources for model loading and environment reconstruction. In the reconstructed environment, each personalized derivative workflow is executed in parallel based on personalized hyperparameter configuration and network layer parameter fine-tuning to complete the training tasks of each artificial intelligence model.
[0013] By adopting the above technical solution, the ordered logical execution sequence of multiple concurrently submitted model training tasks is parsed, and tasks with the same preceding continuous logical units are aggregated into training task groups. The common baseline workflow of loading a unified training sample set and initializing a pre-trained model is extracted and executed in a single centralized manner. This avoids the process of multiple training tasks repeatedly loading the same data and initializing the same model, thereby reducing redundant computing resource consumption and execution time. Subsequently, the baseline context slices produced by centralized execution are distributed to various secondary computing resources, and personalized derivative workflows, including personalized hyperparameter configuration and network layer parameter fine-tuning, are executed in parallel in the reconstructed environment. While meeting the independent and personalized training needs of each task, the overall execution efficiency of multiple artificial intelligence model concurrent training tasks is improved, and the system computing power overhead in multi-task concurrent scenarios is reduced.
[0014] In conjunction with some implementations of the first aspect, in some implementations, artificial intelligence model training tasks with the same preceding continuous logical units in all ordered logical execution sequences are aggregated into training task groups, specifically including:
[0015] Perform a bit-by-bit comparison of all ordered logical execution sequences and output the sequence comparison results;
[0016] Analyze the sequence alignment results and extract the bifurcation location information where the first logical unit difference appears;
[0017] Based on the fork position information, the ordered logic execution sequence is truncated to generate a common prefix segment;
[0018] The common prefix segments are identified as the same preceding consecutive logic units;
[0019] Artificial intelligence model training tasks that contain the same preceding continuous logic units are aggregated into training task groups.
[0020] By adopting the above technical solution, and by comparing all ordered logical execution sequences bit by bit, and analyzing the comparison results to accurately extract the bifurcation position information where the first difference in logical units appears, it is possible to extract the completely consistent common prefix segment in each sequence based on the bifurcation position. This method based on strict bit-by-bit comparison and accurate extraction ensures that the extracted preceding continuous logical units have a high degree of identity in each task, thereby improving the accuracy of training task group aggregation, reducing the probability of logical conflicts or operational anomalies during subsequent centralized execution due to errors or deviations in the extraction of common logic, and improving the stability of model training task scheduling.
[0021] In conjunction with some implementations of the first aspect, in some implementations, artificial intelligence model training tasks with the same preceding continuous logical units in all ordered logical execution sequences are aggregated into training task groups, specifically including:
[0022] Extract the header execution sequence of all ordered logical execution sequences to generate an initial prefix fragment set;
[0023] Calculate the logical feature similarity between each header execution sequence in the initial prefix fragment set to obtain a similarity matrix;
[0024] The similarity matrix is filtered according to a preset similarity threshold to select the target equivalent fragments;
[0025] The target equivalent segment is determined to be the same preceding continuous logic unit;
[0026] Artificial intelligence model training tasks that contain the same preceding continuous logic units are aggregated into training task groups.
[0027] By adopting the above technical solution, a similarity matrix is obtained by extracting the header execution sequence and calculating the logical feature similarity between them. Then, a preset similarity threshold is used to filter out the target equivalent fragments. This enables the system to effectively identify prefix fragments that are highly equivalent in underlying logical features but may have slight differences in instruction expression or subtle structure. This flexible matching method based on feature similarity expands the recognition range of common logic, improves the generalization ability and fault tolerance of extracting the same preceding continuous logical units, thereby increasing the number of tasks that can be aggregated into the same training task group and further reducing the computational resource consumption in the overall concurrent training process.
[0028] In conjunction with some implementations of the first aspect, in some implementations, after completing the training tasks of each artificial intelligence model, the method further includes:
[0029] Extract the trained network layer parameters obtained after completing the training tasks of each artificial intelligence model;
[0030] The difference between the network layer parameters after training and the initial weight matrix in the baseline context slice is calculated to obtain the personalized parameter difference set corresponding to each artificial intelligence model training task.
[0031] The network topology and initial weight matrix from the baseline context slice are loaded into memory to obtain a shared base model instance;
[0032] Establish the association between the task identifiers of each artificial intelligence model training task and the corresponding personalized parameter difference set, and generate a task-parameter mapping table;
[0033] Receive business data processing requests carrying target task identifiers, and query the task-parameter mapping table based on the target task identifiers to determine the corresponding target parameter difference set;
[0034] The target parameter difference set is dynamically loaded into a shared basic model instance, and the loaded shared basic model instance is used to process business data processing requests and output business processing results.
[0035] By adopting the above technical solution, after each model training task is completed, the difference between the trained network layer parameters and the initial weight matrix in the baseline context slice is calculated. Only the personalized parameter difference set corresponding to each task is extracted and saved. During the business inference stage, the basic model instance is kept in memory. The corresponding parameter difference set is dynamically queried and loaded according to the target task identifier of the business request for processing. This avoids saving and loading the complete network topology and full weight matrix separately for each trained task. This incremental parameter storage and dynamic loading mechanism reduces the memory occupation when deploying multiple models, reduces the consumption of storage resources, and improves the flexibility of multi-task model switching and the processing efficiency of business request response.
[0036] In conjunction with some implementation methods of the first aspect, in some implementation methods, the target parameter difference set is dynamically loaded into a shared basic model instance, and the loaded shared basic model instance is used to process business data processing requests and output business processing results, specifically including:
[0037] Analyze the target parameter difference set to determine the target network layer to be updated and the corresponding weight difference matrix in the shared base model instance;
[0038] Input business data processing requests into a shared basic model instance;
[0039] When the shared base model instance runs to the target network layer, parallel matrix calculations are performed on the input data of the current layer based on the initial weight matrix and the weight difference matrix, respectively, to obtain basic feature data and incremental feature data.
[0040] The basic feature data and incremental feature data are added and fused to obtain the output data of the target network layer, so as to output the business processing results by sharing the basic model instance.
[0041] By adopting the above technical solution, when dynamically loading the target parameter difference set into the shared base model instance, the target network layer and weight difference matrix to be updated are determined by parsing. When the model runs to this layer, parallel matrix calculations are performed on the input data based on the initial weight matrix and the weight difference matrix to obtain the basic and incremental feature data. Finally, the two are added together and fused to output the result. This processing method avoids the resource consumption caused by frequently reloading or modifying the complete model parameters for different tasks by separating the calculation paths of the basic weights and personalized differences without changing the underlying parameters of the shared base model instance. At the same time, the parallel matrix calculation method can make full use of the parallel processing capabilities of the underlying hardware, accelerate the generation process of basic and incremental features, thereby improving the computational efficiency of model inference in multi-task concurrent scenarios and reducing system memory consumption and latency overhead during task switching.
[0042] In conjunction with some implementations of the first aspect, in some implementations, after processing business data processing requests through the loaded shared basic model instance and outputting business processing results, the method further includes:
[0043] Obtain real business feedback data on the business processing results, and calculate the business loss value based on the business processing results and real business feedback data;
[0044] While keeping the memory data of the shared base model instance in a read-only locked state, backpropagation is performed based on the business loss value to calculate the incremental gradient matrix;
[0045] The target parameter difference set in the task-parameter mapping table is updated using the incremental gradient matrix to obtain the updated target parameter difference set;
[0046] Upon receiving a request for processing the next business data carrying the target task identifier, the updated target parameter difference set is dynamically loaded into the shared basic model instance for processing.
[0047] By adopting the above technical solution, after outputting the business processing results, the business loss value is calculated by obtaining real business feedback data. While keeping the shared base model instance memory data in a read-only locked state, backpropagation is performed to calculate the incremental gradient matrix, thus updating only the target parameter difference set in the task-parameter mapping table. This mechanism ensures the parameter safety of the shared base model in a multi-task concurrent environment and prevents interference from the backpropagation process of a single task on the common base weights. Since the backpropagation and parameter update process only involves a small set of personalized parameter differences, the scale of parameters that need to be calculated and overwritten is significantly reduced, thereby lowering the computational complexity and memory read / write consumption during the online fine-tuning phase of the model and improving the adaptive iteration efficiency of the model for real-time business data.
[0048] In conjunction with some implementations of the first aspect, in some implementations, the target parameter difference set in the task-parameter mapping table is updated using an incremental gradient matrix to obtain an updated target parameter difference set, specifically including:
[0049] Write the calculated incremental gradient matrix into a gradient accumulation buffer that is independent of the current business processing thread;
[0050] Check whether the number of gradient accumulations for the target task identifier in the gradient accumulation buffer has reached the preset update cycle threshold;
[0051] If the preset update cycle threshold is reached, the accumulated gradient matrix in the gradient accumulation buffer will be merged into the target parameter difference set according to the preset optimizer algorithm, and the gradient accumulation buffer will be cleared.
[0052] If the preset update cycle threshold is not reached, the target parameter difference set remains unchanged.
[0053] By adopting the above technical solution, when updating the target parameter difference set using the incremental gradient matrix, the incremental gradient matrix is written to a gradient accumulation buffer independent of the current business processing thread. Only when the number of gradient accumulations reaches a preset update cycle threshold is the accumulated gradient matrix merged into the target parameter difference set according to the optimizer algorithm. By introducing an independent buffer for gradient accumulation, the high-frequency single-request gradient calculation is effectively decoupled from the low-frequency actual parameter update process, avoiding the blocking of the main business processing thread caused by frequent memory write operations. The batch merging strategy based on the cycle threshold can smooth the gradient jitter caused by single abnormal business feedback, making the parameter update direction more accurate. This reduces the high-frequency read / write overhead during online model fine-tuning, improving the stability of parameter updates and the overall concurrent processing throughput of the system.
[0054] Secondly, embodiments of this application provide an artificial intelligence-based model training system, which includes: one or more processors and a memory; the memory is coupled to one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and one or more processors call the computer instructions to cause the system to perform the method described in the first aspect and any possible implementation thereof.
[0055] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a system, cause the system to perform the method described in the first aspect and any possible implementation thereof.
[0056] Fourthly, embodiments of this application provide a computer program product that, when run on a system, causes the system to execute the method described in any possible implementation of the first aspect.
[0057] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0058] 1. This application provides an artificial intelligence-based model training method. By parsing the ordered logical execution sequence of multiple concurrently submitted model training tasks, tasks with the same preceding continuous logical units are aggregated into training task groups. The common baseline workflow of loading a unified training sample set and initializing the pre-trained model is extracted and executed in a single centralized manner. This avoids the process of multiple training tasks repeatedly loading the same data and initializing the same model, thereby reducing redundant computing resource consumption and execution time. Subsequently, the baseline context slices produced by centralized execution are distributed to various secondary computing resources. In the reconstructed environment, personalized derivative workflows including personalized hyperparameter configuration and network layer parameter fine-tuning are executed in parallel. While meeting the independent personalized training needs of each task, this method improves the overall execution efficiency of multiple concurrent training tasks of artificial intelligence models and reduces the system computing power overhead in multi-task concurrent scenarios.
[0059] 2. This application provides an artificial intelligence-based model training method. After each model training task is completed, the difference between the trained network layer parameters and the initial weight matrix in the baseline context slice is calculated. Only the personalized parameter difference set corresponding to each task is extracted and saved. During the business inference stage, the basic model instance is kept in memory. The corresponding parameter difference set is dynamically queried and loaded according to the target task identifier of the business request for processing. This avoids saving and loading the complete network topology and full weight matrix separately for each trained task. This incremental parameter storage and dynamic loading mechanism reduces the memory occupation when deploying multiple models, reduces the consumption of storage resources, and improves the flexibility of multi-task model switching and the processing efficiency of business request response.
[0060] 3. This application provides an artificial intelligence-based model training method. After outputting the business processing results, it calculates the business loss value by acquiring real business feedback data. While keeping the shared base model instance memory data in a read-only locked state, it performs backpropagation to calculate the incremental gradient matrix, and then updates only the target parameter difference set in the task-parameter mapping table. This mechanism ensures the parameter safety of the shared base model in a multi-task concurrent environment and prevents the backpropagation process of a single task from interfering with the common base weights. Since the backpropagation and parameter update process only involves a small set of personalized parameter differences, it significantly reduces the scale of parameters that need to be calculated and overwritten, thereby reducing the computational complexity and memory read / write consumption during the online fine-tuning phase of the model and improving the adaptive iteration efficiency of the model for real-time business data. Attached Figure Description
[0061] Figure 1 This is a flowchart illustrating an artificial intelligence-based model training method in an embodiment of this application.
[0062] Figure 2 This is another flowchart illustrating an artificial intelligence-based model training method in an embodiment of this application.
[0063] Figure 3 This is another flowchart illustrating an artificial intelligence-based model training method in the embodiments of this application.
[0064] Figure 4 This is a schematic diagram of the physical device structure of an artificial intelligence-based model training system provided in an embodiment of this application. Detailed Implementation
[0065] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0066] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0067] The following example is used in conjunction with Figure 1 The following describes an artificial intelligence-based model training method in an embodiment of this application:
[0068] Please see Figure 1 This is a flowchart illustrating an artificial intelligence-based model training method in an embodiment of this application.
[0069] S101. Obtain multiple artificial intelligence model training tasks submitted concurrently within a preset time window, parse each artificial intelligence model training task, and extract the ordered logical execution sequence corresponding to each artificial intelligence model training task, which is composed of multiple network construction logic units and model training logic units.
[0070] A preset time window refers to a pre-defined time period used by the system to collect tasks submitted within that period. Its specific duration can be flexibly adjusted based on the system's processing capacity and task arrival rate, and is not limited to a fixed number of seconds or minutes. Concurrent submission refers to task requests sent to the system by multiple users or the system within the same time period. An AI model training task refers to the process of using data to train a machine learning or deep learning model to optimize its parameters. A network construction logic unit refers to the code or operational instructions used to define and construct the topology of a neural network, such as defining convolutional layers and fully connected layers. A model training logic unit refers to the code or operational instructions used to execute model forward propagation, back propagation, loss calculation, and parameter updates. An ordered logical execution sequence refers to the sequence of operations formed by arranging the above logic units in the order of execution. The system first collects all concurrently submitted AI model training tasks within the preset time window, then parses these tasks, extracts the network construction logic units and model training logic units contained in each task, and arranges them in the order of execution to form an ordered logical execution sequence corresponding to each AI model training task.
[0071] The system acquires multiple concurrently submitted AI model training tasks within a preset time window, parses each task, and extracts an ordered logical execution sequence for each task, consisting of multiple network construction logic units and model training logic units. This can be achieved through at least two methods: The system can listen to the task submission interface, store task requests in a task queue upon receipt, and batch-read all tasks from the queue at the end of the preset time window. Then, the system uses abstract syntax tree parsing technology to perform lexical and syntactic analysis on the code script of each task, identifying function calls used for network construction and loop structures used for model training, and generating an ordered logical execution sequence based on the code's control flow graph.
[0072] The system can also require users to declare the logical units of a task using a predefined task description template (such as JSON or YAML format) when submitting the task. The system reads these task description files, extracts the configuration information of the network construction logical units and model training logical units directly from them, and converts them into an ordered logical execution sequence according to the execution order defined in the template.
[0073] S102. Aggregate the training tasks of artificial intelligence models with the same preceding continuous logic unit in all ordered logic execution sequences into training task groups.
[0074] The system aggregates AI model training tasks with the same preceding continuous logical units in all ordered logical execution sequences into training task groups. The same preceding continuous logical unit refers to a consecutive segment of logical units that are identical from the beginning of the sequence in multiple ordered logical execution sequences. A training task group is a group of AI model training tasks with the same preceding continuous logical units. Sequence alignment results refer to the records of similarities and differences obtained after comparing multiple sequences position by position. Bifurcation position information refers to the index of the first occurrence of a different logical unit during sequence alignment. Common prefix segments refer to the segments that are completely identical in multiple sequences before the fork position. The head execution sequence refers to a logical unit sequence of a certain length extracted from the beginning of the ordered logical execution sequence. The initial prefix segment set refers to the set of all extracted head execution sequences. Logical feature similarity is an indicator that measures the degree of similarity between two logical unit sequences in terms of function and structure. The similarity matrix is a two-dimensional matrix where each element represents the logical feature similarity between two head execution sequences. A preset similarity threshold is a standard value used to determine whether two sequences are sufficiently similar. Only sequences with a similarity greater than or equal to this threshold are considered equivalent. The target equivalent segment refers to the header execution sequence that, after similarity filtering, is identified as having the same or similar function. The system aggregates AI model training tasks with the same preceding continuous logical units from all ordered logical execution sequences into training task groups. Through comparison or similarity calculation, it identifies the commonalities between tasks, thus achieving initial task grouping. This step can be implemented in at least two ways:
[0075] The system can perform a positional comparison of all ordered logical execution sequences and output the sequence comparison results. It then analyzes the results to extract the bifurcation position information where the first logical unit difference occurs. Based on the bifurcation position information, it truncates the ordered logical execution sequences to generate common prefix segments. These common prefix segments are identified as identical preceding consecutive logical units. Finally, it aggregates AI model training tasks containing these identical preceding consecutive logical units into a training task group. The system takes all ordered logical execution sequences as a string array as input. Starting from the first logical unit, it compares the logical units at the same position in all sequences. If they are identical, it continues to compare the next position; if they are different, it records the current position as the bifurcation position information. The system extracts the logical units from the starting position to the bifurcation position as common prefix segments and identifies them as identical preceding consecutive logical units. Tasks containing these identical preceding consecutive logical units are then aggregated into a training task group.
[0076] The system can also extract the header execution sequences of all ordered logical execution sequences to generate an initial prefix fragment set; calculate the logical feature similarity between each header execution sequence in the initial prefix fragment set to obtain a similarity matrix; filter the similarity matrix according to a preset similarity threshold to select target equivalent fragments; determine the target equivalent fragments as having the same preceding continuous logical units; and aggregate AI model training tasks containing the same preceding continuous logical units into training task groups. The system first extracts the first N logical units of all sequences as header execution sequences to generate an initial prefix fragment set. Then, the system uses an edit distance algorithm or a cosine similarity algorithm to calculate the logical feature similarity between pairs of sequences in the set, constructing a similarity matrix. Next, the system traverses the similarity matrix, extracts sequence pairs with similarity values greater than a preset similarity threshold, groups them into one category using a clustering algorithm (such as hierarchical clustering) to form target equivalent fragments, determines them as having the same preceding continuous logical units, and finally aggregates the corresponding tasks into training task groups.
[0077] S103. Define the same preceding continuous logic units as the common baseline workflow of the training task group;
[0078] The system defines the common baseline workflow for the training task group as the shared preceding continuous logical units. This common baseline workflow represents the unified training sample set loading and pre-trained neural network model initialization common AI business logic. The common baseline workflow refers to the basic process that all tasks in the training task group must execute. Unified training sample set loading refers to the process of reading the common training data required by all tasks from storage media into memory. Pre-trained neural network model initialization refers to loading a basic model that has already been trained on a large-scale dataset and assigning its parameters to the network structure of the current task. Common AI business logic refers to the operational steps shared by all tasks in the early stages of model training, without involving personalized adjustments. The system defines the extracted common preceding continuous logical units as the common baseline workflow for the training task group, meaning that these logical units represent the common operations of all tasks within the group in the early stages of training, namely, uniformly loading the training sample set and initializing the pre-trained model.
[0079] The system defines identical preceding consecutive logical units as common baseline workflows for training task groups. This can be achieved in at least two ways: The system can maintain an internal workflow registry. Once identical preceding consecutive logical units are identified, the system generates a unique global identifier for them and stores it, along with the corresponding logical unit sequence, in the workflow registry, marking it as a common baseline workflow. Simultaneously, the system records this global identifier in the metadata of the training task group for subsequent use.
[0080] The system can also employ object-oriented design patterns, encapsulating identical preceding logical units into an independent base class or interface. The system defines the operations of loading the training sample set and initializing the pre-trained model as methods of this base class. Each task in the training task group then acts as a derived class, inheriting the methods of this base class, thus logically defining these common operations as a common baseline workflow.
[0081] S104. For each AI model training task in the training task group, separate the common baseline workflow from the corresponding ordered logic execution sequence, and transform the remaining logic units in the ordered logic execution sequence into personalized derivative workflows.
[0082] The system, for each AI model training task in the training task group, separates the common baseline workflow from the corresponding ordered logical execution sequence, and transforms the remaining logical units in the ordered logical execution sequence into personalized derived workflows. These personalized derived workflows are independent training logics that include personalized hyperparameter configuration and network layer parameter fine-tuning. Separation refers to extracting the common baseline workflow from the original ordered logical execution sequence, making it an independent execution unit. The remaining logical units refer to the part remaining after removing the common baseline workflow from the ordered logical execution sequence. Personalized derived workflows refer to the subsequent execution process customized for the specific training needs of each task. Personalized hyperparameter configuration refers to the specific parameters set for model training, such as learning rate, batch size, and optimizer type; these parameters may vary across different tasks. Network layer parameter fine-tuning refers to making small updates and optimizations to the weights of some or all network layers based on the pre-trained model and the dataset of the specific task. Independent training logic refers to the independent training process performed by each task after executing the common baseline workflow. The system separates the common baseline workflow from the corresponding ordered logical execution sequence for each artificial intelligence model training task in the training task group, and transforms the remaining logical units into personalized derivative workflows. These derivative workflows contain the unique hyperparameter configuration and network layer parameter fine-tuning logic for each task.
[0083] The system targets the training tasks of various AI models within a training task group. It separates the common baseline workflow from the corresponding ordered logical execution sequences and transforms the remaining logical units in the ordered logical execution sequences into personalized derived workflows. This can be achieved in at least two ways: The system can utilize graph rewriting techniques. The system represents the ordered logical execution sequence of each task as a directed acyclic graph (DAG). The system locates the subgraph corresponding to the common baseline workflow in the graph and cuts it from the main graph. Then, the system reorganizes the remaining nodes and edges in the main graph to form a new DAG and encapsulates it as the execution script for the personalized derived workflow.
[0084] The system can also employ a dynamic truncation method based on instruction pointers. When parsing an ordered logical execution sequence, the system records the instruction pointer at the end position of the common baseline workflow. For each task, the system generates a new execution context, setting the starting instruction pointer to the recorded end position pointer. Thus, when a task begins execution, it skips the common baseline workflow portion and starts execution from the remaining logical units, thereby logically achieving the transformation into personalized derivative workflows.
[0085] S105. Allocate the first computing resources to the common baseline workflow for a single centralized execution, and determine the intermediate running data produced as the baseline context slice when the common baseline workflow execution ends.
[0086] The system allocates primary computing resources to the common baseline workflow for a single, centralized execution. Upon completion of the common baseline workflow, the resulting intermediate runtime data is defined as a baseline context slice. This baseline context slice is a persistent data package encapsulating the network topology and initial weight matrix of a pre-trained neural network model. Primary computing resources refer to the hardware resources allocated to the common baseline workflow, such as CPU, GPU, and memory, typically possessing strong computing and storage capabilities. Single centralized execution means the common baseline workflow is executed only once, and its results are shared by all tasks in the training task group. Intermediate runtime data refers to temporary data such as model states and data caches retained in memory after the common baseline workflow execution. The baseline context slice is a persistent file generated by serializing and packaging this intermediate runtime data. Network topology refers to the connection relationships and organization between layers in a neural network. The initial weight matrix refers to the specific values of the parameters in each layer of the pre-trained model. A persistent data package is a data file that can be stored long-term on disk or other non-volatile storage media. The system allocates the first computing resource to the common baseline workflow and performs a single centralized execution on that resource. After execution, the system packages the intermediate running data, which includes the network topology of the pre-trained neural network model and the initial weight matrix, into a baseline context slice.
[0087] The system allocates primary computing resources to the common baseline workflow for a single centralized execution. Upon completion of the common baseline workflow, the resulting intermediate runtime data is designated as the baseline context slice. This can be achieved in at least two ways: The system can utilize containerization technology. Based on the resource requirements of the common baseline workflow, the system dynamically schedules a Docker container with primary computing resources. Within this container, the system runs the script for the common baseline workflow, completing data loading and model initialization. After execution, the system uses the container's checkpoint functionality to snapshot and save the intermediate runtime data, such as the current container's memory state and file system changes, generating an image file as the baseline context slice.
[0088] The system can also utilize the serialization mechanism built into deep learning frameworks. The system launches a dedicated process on the primary computing resource to execute the common baseline workflow. Once model initialization is complete, the system calls the framework's saved interface (such as PyTorch's `torch.save`) to serialize the model's network topology (i.e., model class definition) and initial weight matrix (i.e., `state_dict`) into a binary file. Simultaneously, the system also writes the metadata and cache path of the loaded training sample set into this file, forming the final baseline context slice.
[0089] S106. Allocate second computing resources to each personalized derivative workflow in the training task group;
[0090] Each personalized derivative workflow refers to an execution flow that is independently owned by each task in the training task group, containing specific hyperparameters and fine-tuning logic. Allocation refers to the system assigning corresponding hardware resources to each personalized derivative workflow based on its needs. Secondary computing resources refer to the hardware resources allocated by the system to each personalized derivative workflow. Since these workflows are typically executed in parallel, secondary computing resources can be multiple independent compute nodes, GPU instances, or containers. The system needs to assess the resource requirements of each personalized derivative workflow in the training task group separately and allocate corresponding secondary computing resources from the resource pool to ensure they can run independently and efficiently.
[0091] The system allocates secondary computing resources to each personalized derivative workflow within the training task group, which can be achieved in at least two ways: The system can use cluster management tools such as Kubernetes. First, the system parses the configuration file of each personalized derivative workflow to extract its specific resource requirements, such as the number of CPU cores, GPU memory, and memory size. Then, the system sends a resource request to the API Server of the Kubernetes cluster. The cluster scheduler then allocates the most suitable Pod as the secondary computing resource for each personalized derivative workflow based on the current resource availability of each node.
[0092] The system can also implement a custom resource scheduling queue. All personalized derivative workflows are placed in a priority queue, and the status of the underlying hardware resource pool is monitored in real time. Using a polling or event-driven approach, when there are idle resources in the resource pool that meet the needs of a particular workflow, the system uses operating system-level resource isolation technology (such as cgroups) to allocate these resources as secondary computing resources to that workflow.
[0093] S107. Distribute the baseline context slices to each second computing resource for model loading and environment reconstruction. In the reconstructed environment, execute each personalized derivative workflow in parallel based on personalized hyperparameter configuration and network layer parameter fine-tuning to complete the training tasks of each artificial intelligence model.
[0094] Distribution refers to transferring the generated baseline context slices from the first computing resource or centralized storage location to the locations of various second computing resources. Model loading and environment reconstruction refers to the process of reading the baseline context slices on the second computing resources, restoring the network topology and initial weight matrix of the pre-trained model, and reconstructing the execution environment. Parallel execution refers to the simultaneous running of multiple personalized derivative workflows on their respective second computing resources without interference. Completing the training tasks of each artificial intelligence model means that each workflow, after forward propagation, backward propagation, and parameter updates, finally reaches the preset number of training rounds or convergence conditions, and outputs the trained model. The system distributes the baseline context slices to all second computing resources, reconstructs the state at the end of the common baseline workflow execution on these resources, and then, based on their respective personalized hyperparameter configurations and network layer parameter fine-tuning logic, executes all personalized derivative workflows simultaneously, ultimately completing the training task of the entire training task group.
[0095] The system distributes baseline context slices to various secondary computing resources for model loading and environment reconstruction. Within the reconstructed environment, it executes various personalized derivative workflows in parallel based on customized hyperparameter configurations and network layer parameter fine-tuning to complete the training tasks of each AI model. This can be achieved in at least two ways: The system can utilize a distributed file system (such as HDFS or Ceph). Alternatively, the system stores the baseline context slices in a distributed file system, and each secondary computing resource directly reads the slice files by mounting the file system. After reading, the deserialization module on the secondary computing resource parses the slice files, instantiates model objects in memory, and loads the weight matrix, completing the environment reconstruction. Subsequently, the system starts the execution engines of each personalized derivative workflow, reads its respective hyperparameter configuration file, and performs parallel parameter fine-tuning training based on the reconstructed model.
[0096] The system can also employ peer-to-peer (P2P) network transmission technology. The system uses the first computing resource as a seed node and each second computing resource as a peer node. The baseline context slice is divided into multiple small blocks and rapidly distributed among the nodes via the P2P protocol. When a second computing resource receives a complete slice, it uses container recovery technology to directly load a memory snapshot of the slice into its local container, instantly restoring the model state. Then, the system triggers the execution scripts of personalized derivative workflows within each container, initiating parallel model training.
[0097] In the above embodiments, by parsing the ordered logical execution sequence of multiple concurrently submitted model training tasks, tasks with the same preceding continuous logical units are aggregated into training task groups. The common baseline workflow of loading a unified training sample set and initializing a pre-trained model is extracted and executed in a single centralized manner. This avoids the process of multiple training tasks repeatedly loading the same data and initializing the same model, thereby reducing redundant computing resource consumption and execution time. Subsequently, the baseline context slices produced by centralized execution are distributed to various second computing resources. In the reconstructed environment, personalized derivative workflows including personalized hyperparameter configuration and network layer parameter fine-tuning are executed in parallel. While meeting the independent personalized training needs of each task, the overall execution efficiency of multiple artificial intelligence model concurrent training tasks is improved, and the system computing power overhead in multi-task concurrent scenarios is reduced.
[0098] The above embodiments detail how to efficiently complete the concurrent training tasks of multiple artificial intelligence models by separating the common baseline workflow and the personalized derived workflow. After completing the above model training phase, in order to further address the problems of large memory consumption and low model switching efficiency faced by multi-task models in actual deployment and business inference phases, this application embodiment further provides another artificial intelligence-based model training method based on the above training method. The following is a combination of... Figure 2 Another artificial intelligence-based model training method is described in the embodiments of this application:
[0099] Please see Figure 2 This is another flowchart illustrating an artificial intelligence-based model training method in an embodiment of this application.
[0100] S201. Extract the trained network layer parameters obtained after completing the training tasks of each artificial intelligence model;
[0101] Post-trained network layer parameters refer to the final set of weight matrices, bias vectors, and other learnable variables obtained through iterative updates via backpropagation and optimizers after a complete training cycle of an artificial intelligence model. These parameters contain unique data features and business logic patterns learned by the model from a specific training sample set. Extraction refers to the operation of reading these updated parameter data from storage media or the memory space of computing nodes and performing structured processing. After completing multiple concurrent training tasks of artificial intelligence models in the aforementioned embodiments, each personalized derivative workflow will produce a model finely tuned specifically for its task requirements. The system extracts the post-trained network layer parameters obtained after completing the training tasks of each artificial intelligence model. This process is a key bridge connecting the model training stage and the model deployment and inference stage. By extracting these parameters, which carry personalized knowledge for each task, from the training environment, the system can provide basic data support for subsequent parameter differentiation analysis and lightweight deployment, thereby avoiding the direct use of the entire large model file for deployment and creating the preconditions for realizing a multi-task shared underlying architecture.
[0102] The system extracts the trained network layer parameters obtained after completing the training tasks of each artificial intelligence model. This can be achieved in the following two ways.
[0103] At the end of model training, the training framework typically serializes and saves the model's complete state dictionary as a disk file in a specific format. The system launches a dedicated parameter parsing service, which reads these persistent files through a file system interface. Subsequently, the parsing service uses a deserialization algorithm to restore the file contents to a key-value pair data structure in memory, where the keys represent the names or identifiers of network layers, and the values represent the corresponding multidimensional parameter tensors. The system traverses this data structure, filtering out irrelevant information such as optimizer states, and accurately extracts the forward propagation computation parameters belonging to the network layers.
[0104] When the training task is about to end but memory resources have not yet been released, the system can also establish a connection with the computing process executing the training task through shared memory or a message passing interface. The system sends a parameter extraction instruction to the training process. After receiving the instruction, the training process directly calls the high-level programming interface at the bottom layer of the deep learning framework to package the network layer parameter tensors residing in its GPU memory or RAM into a standardized byte stream. Then, the training process transmits this byte stream to the system's extraction module through an inter-process communication channel. The extraction module receives and reassembles the byte stream, thereby efficiently obtaining the trained network layer parameters.
[0105] S202. Calculate the difference between the network layer parameters after training and the initial weight matrix in the baseline context slice to obtain the personalized parameter difference set corresponding to each artificial intelligence model training task.
[0106] In mathematical operations, the difference refers to the new matrix or tensor obtained by subtracting corresponding elements from two matrices or tensors of the same dimension. A personalized parameter difference set is a dataset composed of weight difference matrices from multiple network layers, precisely recording the offset of a specific task model relative to a common base model in the parameter space. The system calculates the difference between the trained network layer parameters and the initial weight matrix in the baseline context slice to obtain the personalized parameter difference set corresponding to each AI model training task. The core purpose of this operation is information decoupling. This is because the initial weight matrix in the baseline context slice is a common starting point of knowledge shared by all tasks, while the trained network layer parameters contain both common knowledge and task-specific knowledge. By performing subtraction, the system can eliminate common knowledge, retaining only the incremental information learned additionally during fine-tuning for each task. This approach significantly reduces the amount of data required to represent an independent model, allowing for the deployment of multiple models without allocating full storage and GPU memory for each model; only these smaller personalized parameter difference sets need to be saved and loaded.
[0107] The system calculates the difference between the network layer parameters after training and the initial weight matrix in the baseline context slice, obtaining a set of personalized parameter differences corresponding to each artificial intelligence model training task. This can be achieved in the following two ways.
[0108] The system first allocates two contiguous memory blocks in the graphics processor's video memory, one for storing the initial weight matrix from the baseline context slice and the other for storing the extracted post-trained network layer parameter matrix. Next, the system invokes the parallel computing core under the unified computing device architecture to launch a custom matrix subtraction kernel function. This kernel function divides the massive matrix into numerous tiny computational blocks, distributing them to thousands of stream processors to simultaneously execute element-wise floating-point subtraction instructions. After the calculation is complete, the system returns the difference result generated in video memory to main memory, constructing a personalized parameter difference set.
[0109] For environments lacking high-end graphics processing units (GPUs), the system can also leverage the CPU's advanced vector extension instruction set. The system performs memory alignment of the initial weight matrix and trained network layer parameters in memory to ensure data distribution conforms to vectorized read requirements. Subsequently, the system uses a highly optimized basic linear algebra subroutine library to perform subtraction operations on multiple adjacent floating-point numbers simultaneously using a single machine instruction. This approach fully utilizes the CPU's hardware potential, efficiently traversing the network structure layer by layer, calculating the parameter differences across all layers, and ultimately summarizing to generate a personalized set of parameter differences.
[0110] S203. Load the network topology and initial weight matrix from the baseline context slice into memory to obtain a shared base model instance;
[0111] A shared base model instance refers to a neural network object instantiated in the random access memory or video memory of a computer system. This object contains the network topology and initial weight matrix shared by all tasks and is accessed by multiple different business processes throughout its runtime lifecycle. Loading into memory refers to the process of transferring data stored on non-volatile storage devices to volatile storage space that the processor can directly and quickly address. The system loads the network topology and initial weight matrix from the baseline context slice into memory to obtain the shared base model instance. This is a cornerstone step in building a multi-task, efficient inference architecture. In traditional deployment models, if there are one hundred different tasks, the system typically needs to load one hundred complete models into memory separately, which leads to extremely large memory consumption and may even cause memory overflow. However, through this step, the system retains only one large set of base model data in physical memory. Regardless of how many concurrent personalized task requests there are at the upper layer, they will all point to and reuse the same shared base model instance at the lower layer, thus transforming memory consumption from linearly increasing with the number of tasks to a fixed constant level.
[0112] The system loads the network topology and initial weight matrix from the baseline context slice into memory to obtain a shared base model instance, which can be achieved in the following two ways.
[0113] The system can call the shared memory application programming interface provided by the operating system in the main control process to allocate a large contiguous memory segment in physical memory large enough to hold all the parameters of the base model. The system directly maps the baseline context slice file to this shared memory segment and, according to the definition of the network topology, points the weight pointers of each layer to the corresponding memory offset address, completing the initialization of the shared base model instance. Subsequently, the system passes the access handle or identifier of this shared memory segment to all worker processes responsible for handling different tasks, enabling each worker process to directly read the base model parameters in a zero-copy manner.
[0114] The system can also deploy a unified deep learning inference server program, within which a singleton object is defined to host the base model. When the inference server starts, the initialization module reads the baseline context slice, constructs the complete network topology in the server's heap memory or the bound graphics processor's memory, and assigns the initial weight matrix layer by layer to this structure. Due to the use of the singleton pattern, the system ensures that this base model instance is created and loaded only once throughout the entire lifecycle of the server process. All subsequent business requests are routed through the server's internal routing mechanism, sending data to this single shared base model instance for forward propagation computation.
[0115] S204. Establish the association between the task identifier of each artificial intelligence model training task and the corresponding personalized parameter difference set, and generate a task-parameter mapping table;
[0116] A task identifier is a globally unique and non-repeating identifier assigned by the system to each independent AI model training task. It can be a string of numbers, letters, or a universally unique code, used to accurately locate a specific task entity in a complex system. Association refers to establishing a logical mapping and binding between two originally independent data entities at the data structure level, enabling the rapid retrieval of one entity from the other. The task-parameter mapping table is a specially designed data dictionary or database table structure that uses the task identifier as the primary key or index key and the storage location or memory pointer of the personalized parameter difference set as the corresponding value. The system establishes the association between the task identifiers of each AI model training task and the corresponding personalized parameter difference set, generating the task-parameter mapping table. This step is the navigation hub for implementing dynamic request routing and precise parameter loading. In a multi-task shared architecture, the system must possess efficient addressing capabilities to instantly know the location of the customized parameters corresponding to an external request. By constructing this mapping table, the system organizes and manages the chaotic set of personalized parameter differences in a structured and indexed manner, greatly improving the hit rate and response speed of subsequent parameter retrieval.
[0117] The system establishes the association between the task identifier of each artificial intelligence model training task and the corresponding personalized parameter difference set, and generates a task-parameter mapping table, which can be implemented in the following two ways.
[0118] The system can incorporate in-memory key-value stores, such as remote dictionary servers. After generating each personalized set of parameter differences, the system serializes it into a large binary object and sends it along with its corresponding task identifier to the in-memory database. The in-memory database uses the task identifier as the key and the large binary object as the value, calculates the hash value of the key using an internal, efficient hash algorithm, and stores it in the corresponding hash slot. This method of constructing the task-parameter mapping table resides entirely in memory, providing microsecond-level ultra-fast query performance.
[0119] The system can also create a dedicated mapping table in the relational database, containing task identifier and file path columns, with the task identifier column set as the primary key to build a B-tree index. Simultaneously, the system stores each set of personalized parameter differences as independent files in a distributed file system, obtaining the absolute storage path of each file. Then, the system executes a Structured Query Language (SQL) statement to write the task identifier and its corresponding file path into the mapping table of the relational database. This approach leverages the powerful transaction management and persistence capabilities of relational databases to ensure the security and reliability of the associated data and supports the storage of massive amounts of task mapping entries.
[0120] S205. Receive a business data processing request carrying a target task identifier, and query the task-parameter mapping table according to the target task identifier to determine the corresponding target parameter difference set;
[0121] The target task identifier is a unique code explicitly specified by an external client or upstream business system when initiating a call, indicating a specific model expected to process the current data. A business data processing request refers to a network communication data packet containing the raw data to be processed and related control instructions; it represents the user's request to utilize an artificial intelligence model to complete a specific task. The target parameter difference set refers to a specific set of network layer weight difference matrices that, after retrieval, the system confirms strictly matches the target task identifier. The system receives business data processing requests carrying the target task identifier and queries the task-parameter mapping table based on the identifier to determine the corresponding target parameter difference set. This step is the trigger point and data preparation stage of the entire dynamic inference process. When the system is in a continuously running listening state, it receives a massive number of concurrent requests. The system must first parse the target task identifier from these request messages, using it as a clue to search the task-parameter mapping table. Only by accurately identifying the corresponding target parameter difference set can the system know which incremental knowledge needs to be used to modify the shared basic model instance, thereby ensuring that business data is processed by the correct personalized logic.
[0122] The system receives a business data processing request carrying a target task identifier, and queries the task-parameter mapping table based on the target task identifier to determine the corresponding target parameter difference set. This can be achieved in the following two ways.
[0123] The system can expose a Hypertext Transfer Protocol (HTTP) interface. Clients can send request messages containing the target task identifier and business data to this interface. Upon receiving the message, the system's gateway service extracts the target task identifier and immediately initiates a synchronous query to the backend task-parameter mapping table. During the query process, the gateway service's worker thread is in a blocked waiting state until the database returns the query results containing the set of target parameter differences. Subsequently, the gateway service passes this set along with the business data to the downstream inference engine.
[0124] The client can also encapsulate business data processing requests into a message body and publish it to a specific topic in the message queue cluster. The system's consumer program continuously subscribes to this topic. Once a new message arrives, the consumer program retrieves it and parses out the target task identifier. Then, the consumer program submits the query task to an asynchronous, non-blocking input / output event loop. After the event loop initiates a query request to the task-parameter mapping table, it immediately returns to process other messages. When the query results are ready, the corresponding callback function is triggered. In the callback function, the target parameter difference set is extracted, and the subsequent model loading and inference process is triggered.
[0125] S206. Dynamically load the target parameter difference set into the shared basic model instance, and use the loaded shared basic model instance to process business data processing requests and output business processing results.
[0126] The system dynamically loads the target parameter difference set into a shared base model instance, and then uses this loaded instance to process business data processing requests and output the results. Specifically, this includes: parsing the target parameter difference set to determine the target network layer to be updated and its corresponding weight difference matrix within the shared base model instance; inputting the business data processing request into the shared base model instance; when the shared base model instance reaches the target network layer, performing parallel matrix calculations on the input data of the current layer based on the initial weight matrix and the weight difference matrix to obtain basic feature data and incremental feature data; and finally, adding and fusing the basic feature data and incremental feature data to obtain the output data of the target network layer, which is then used to output the business processing results through the shared base model instance. Dynamic loading refers to the technique of injecting specific data into the computation graph or execution context at the moment of program execution without interrupting the normal operation of the shared base model instance or reallocating base model memory. The target network layer refers to the specific neural network layer in the shared base model instance whose parameters have changed during the personalized fine-tuning phase and require the application of the difference matrix. The weight difference matrix is a two-dimensional or multi-dimensional numerical array corresponding to the target network layer, recording the parameter changes. Basic feature data refers to the intermediate tensor result obtained after linearly transforming the initial weight matrix of the shared basic model instance into business data. Incremental feature data refers to the supplementary tensor result obtained after linearly transforming the same business data into a weight difference matrix. Addition and fusion refers to the operation of combining basic and personalized knowledge by performing addition on corresponding elements of these two tensors with the same dimension: basic feature data and incremental feature data. The business processing result refers to the final output of effective information such as classification labels, predicted values, or generated text after forward propagation computation throughout the network. The system parses the target parameter difference set to determine the target network layer and weight difference matrix to be updated; it inputs the request into the model; when running to the target network layer, it performs parallel computation on the input data based on the initial weight matrix and weight difference matrix respectively to obtain basic and incremental feature data; it adds and fuses these two to obtain the output of this layer, and finally outputs the business processing result through the model. This step cleverly utilizes the distributive law property of linear operations. According to the distributive law, input data multiplied by the sum of the initial weights and weight differences is equivalent to the result of input data multiplied by the initial weights plus the result of input data multiplied by the weight differences. The system utilizes this mathematical principle to perfectly and equivalently simulate the output effect of a complete fine-tuning model by adding the results through two parallel computation paths without actually modifying the basic model parameters. This achieves efficient personalized business reasoning with extremely low memory usage.
[0127] The system parses the target parameter difference set to determine the target network layer to be updated and the corresponding weight difference matrix in the shared basic model instance; it inputs the business data processing request into the shared basic model instance; when the shared basic model instance runs to the target network layer, it performs parallel matrix calculations on the input data of the current layer based on the initial weight matrix and the weight difference matrix respectively to obtain basic feature data and incremental feature data; it adds and fuses the basic feature data and incremental feature data to obtain the output data of the target network layer, so as to output the business processing result through the shared basic model instance. Specifically, this can be achieved in the following two ways.
[0128] Within the deep learning framework used, the system employs a novel custom neural network operator written in a low-level programming language. In the forward propagation function definition of this operator, the system explicitly allocates two concurrent computational streams. When business data is input to the operator, the first computational stream calls the matrix multiplication function from the basic linear algebra subroutine library, multiplying the input data by the initial weight matrix resident in memory to calculate the basic feature data. Simultaneously, the second computational stream calls the same matrix multiplication function, multiplying the input data by the dynamically passed weight difference matrix to calculate the incremental feature data. Subsequently, the system sets a synchronization barrier to ensure that both computational streams have completed execution, and then calls the tensor addition function to perform element-wise addition and fusion of the basic and incremental feature data. The fused result is then passed as the final output of the operator to the next layer.
[0129] The system can also intercept and obtain the static computation graph of the model before business data is input into the shared basic model instance. The system develops a graph traversal and rewriting engine that locates the corresponding original computation node in the computation graph based on the parsed target network layer information. The engine dynamically injects a new branch structure next to this node, containing a constant node for loading the weight difference matrix and a new matrix multiplication node. The input data edges of the original node are simultaneously connected to this new matrix multiplication node to generate incremental feature data. Next, the engine inserts an addition fusion node at the end of the original computation node and the new branch to add the basic feature data and the incremental feature data. After rewriting, the system submits the modified computation graph to the deep learning engine's scheduler for execution. The scheduler automatically utilizes the multi-core capabilities of the hardware to process the two branches in parallel, smoothly outputting the final business processing result.
[0130] In the above embodiments, after each model training task is completed, the difference between the trained network layer parameters and the initial weight matrix in the baseline context slice is calculated. Only the personalized parameter difference set corresponding to each task is extracted and saved. During the business inference stage, the basic model instance is kept in memory. The corresponding parameter difference set is dynamically queried and loaded according to the target task identifier of the business request for processing. This avoids saving and loading the complete network topology and full weight matrix separately for each trained task. This incremental parameter storage and dynamic loading mechanism reduces the memory occupation when deploying multiple models, reduces the consumption of storage resources, and improves the flexibility of multi-task model switching and the processing efficiency of business request response.
[0131] The above embodiments described how to efficiently process business data processing requests and output business processing results by dynamically loading personalized parameter difference sets. However, in dynamically changing real-world business scenarios, the model not only needs to possess efficient inference capabilities but also needs to be able to continuously adaptively optimize based on actual application effects. Therefore, based on the aforementioned completion of business inference, this application further provides another model training method based on artificial intelligence. The following, in conjunction with... Figure 3 The following describes another model training method based on artificial intelligence in the embodiments of this application:
[0132] Please see Figure 3 This is another flowchart illustrating an artificial intelligence-based model training method in the embodiments of this application.
[0133] S301. Obtain real business feedback data on the business processing results, and calculate the business loss value based on the business processing results and the real business feedback data.
[0134] Real business feedback data refers to behavioral records generated by real end-users during actual interactions after the AI model outputs predictions or generates results, or objective fact labels obtained by downstream business systems after rigorous verification. This type of data is not limited to a specific format and covers various forms such as user clickstreams, modification records, and manually reviewed confirmation results, representing the true benchmark in the business scenario. The business loss value is a scalar value obtained by quantifying the difference between the model's current output business processing result and the aforementioned real business feedback data using specific mathematical evaluation criteria. The smaller the value, the closer the model's prediction is to the reality. The system acquires real business feedback data regarding the business processing results and calculates the business loss value based on the business processing results and the real business feedback data. After completing forward inference and outputting results, the system does not stop working but enters a preparation phase for continuous monitoring and online learning. The system accurately captures real feedback information for the previously specific prediction task through continuous communication with the external environment or clients. Subsequently, the system aligns and compares the model's previous output with the newly acquired absolute true benchmark, and uses predefined error evaluation logic to accurately calculate the business loss value reflecting the model's current performance deviation. This process forms the core starting point of the closed-loop feedback system, enabling the model to perceive its own performance in a dynamically changing real business environment, providing crucial error signals and optimization directions for subsequent adaptive parameter fine-tuning.
[0135] The system acquires real business feedback data on the business processing results and calculates the business loss value based on the business processing results and real business feedback data. This can be achieved in the following two ways.
[0136] The system can embed implicit asynchronous event tracking code in client applications or front-end interfaces. When users accept, reject, or modify the model's output, the tracking code silently collects these interactions and encapsulates them into feedback log data packets with the original request identifiers. These packets are then asynchronously sent to the system's message queue cluster via the Hypertext Transfer Protocol (HTTP). The streaming data processing engine deployed in the system's backend subscribes to and consumes these logs in real time, retrieving the corresponding historical business processing results from the distributed cache based on the request identifiers. Subsequently, the system calls the built-in cross-entropy error calculation module or mean squared error calculation module to perform mathematical operations on the historical predicted probability distribution and the parsed real interaction labels, thereby deriving an accurate business loss value.
[0137] For scenarios requiring complex manual review or lengthy workflows to produce final results, the system can also be configured with a timed polling scheduler. This scheduler proactively connects to the core business relational database storing the final review results at set time intervals. The system executes Structured Query Language (SCL) commands to extract batches of verified real business feedback data. Next, the system inputs this batch of feedback data into the offline evaluation calculation engine. The engine reads the corresponding model output records from archived storage, uses a custom weighted error evaluation algorithm to calculate the deviation between the predicted and actual values for each record, and finally aggregates the data to generate the business loss value corresponding to each task request.
[0138] S302. While keeping the memory data of the shared base model instance in a read-only locked state, backpropagation is performed based on the business loss value to calculate the incremental gradient matrix.
[0139] Read-only locking refers to a strict access control mechanism applied to the physical storage area containing the initial weight matrix of the shared base model instance, through the operating system's underlying memory management unit or the memory allocation mechanism of the deep learning framework. This ensures that any process or thread can only read the data in this area and absolutely cannot perform write or modification operations. Backpropagation is the core algorithm used in neural network training or fine-tuning to calculate the partial derivatives of each layer's network parameters with respect to the loss value, starting from the output layer's business loss value and working backwards. The incremental gradient matrix is a multi-dimensional array of partial derivatives specifically calculated for the set of individual parameter differences during backpropagation. It indicates the direction and step size of these individual parameters to be adjusted to reduce the business loss value. The system maintains the memory data of the shared base model instance in a read-only locked state and performs backpropagation based on the business loss value to calculate the incremental gradient matrix. This operation is a key barrier to achieving safe concurrent fine-tuning across multiple tasks. Upon receiving an error signal, the system initiates the gradient backpropagation mechanism. Throughout the entire backpropagation chain, the system strictly adheres to memory protection rules, ensuring that the vast public basic knowledge base is protected from interference by any fine-tuning tasks. The system cleverly guides the gradient flow, avoiding the locked fundamental parameters and only performing derivative operations on the set of personalized parameter differences that represent task-specific knowledge. In this way, the system not only significantly reduces the scale of parameters that need to be calculated for gradients, greatly improving the computational efficiency of backpropagation, but also fundamentally prevents catastrophic forgetting or parameter contamination from a single task from affecting other concurrent tasks that share the same basic model.
[0140] The system keeps the memory data of the shared base model instance in a read-only locked state, performs backpropagation based on the business loss value, and calculates the incremental gradient matrix. This can be achieved in the following two ways.
[0141] When constructing the forward propagation computation graph, the system can utilize the tensor attribute control interface of the deep learning framework to force the gradient calculation requirement flags of all parameter tensors corresponding to the shared base model instance to be false, while simultaneously setting the gradient calculation requirement flag of the tensor corresponding to the target parameter difference set to true. When the system triggers the automatic differentiation engine for backpropagation based on the business loss value, the engine automatically identifies these flags during the traversal of computation graph nodes. For nodes with false flags, the engine skips their gradient calculation and storage steps, essentially overlaying a gradient mask on the computation graph; while for personalized parameter nodes with true flags, the engine strictly follows the chain rule to perform matrix multiplication and partial derivative calculation, ultimately outputting an accurate incremental gradient matrix specific to the target parameter difference set.
[0142] The system can also implement custom backpropagation operators using a unified computing architecture programming language for network layers that fuse basic and incremental feature data in the model. When the backpropagation error gradient reaches this fusion layer, the logic within the custom operator explicitly intercepts the gradient tensor. The operator completely cuts off the gradient routing path to the shared base model instance, discarding the corresponding gradient components, thus ensuring the read-only property of the base model at the physical computation level. Simultaneously, the operator guides the complete error gradient to the routing branch leading to the target parameter difference set, efficiently calculating the required incremental gradient matrix by performing independent matrix transpose and multiplication operations.
[0143] S303. Update the target parameter difference set in the task-parameter mapping table using the incremental gradient matrix to obtain the updated target parameter difference set.
[0144] The system uses the incremental gradient matrix to update the target parameter difference set in the task-parameter mapping table, obtaining the updated target parameter difference set. Specifically, this includes: writing the calculated incremental gradient matrix into a gradient accumulation buffer independent of the current business processing thread; checking whether the number of gradient accumulations for the target task identifier in the gradient accumulation buffer has reached a preset update cycle threshold; if the preset update cycle threshold has been reached, merging the accumulated gradient matrix in the gradient accumulation buffer into the target parameter difference set according to the preset optimizer algorithm, and clearing the gradient accumulation buffer; if the preset update cycle threshold has not been reached, keeping the target parameter difference set unchanged.
[0145] A gradient accumulation buffer is a dedicated temporary storage area independently allocated in the computer's main memory or video memory. It is used to safely collect and temporarily store gradient data generated from multiple backpropagations without directly modifying the actual model parameters. A preset update cycle threshold is an integer limit value set in advance by the system administrator or automated tuning algorithm, representing the number of business feedback samples that must be accumulated to trigger a substantial parameter update. The accumulated gradient matrix is the comprehensive gradient tensor obtained by combining the incremental gradient matrices collected multiple times within the buffer area through mathematical summation or averaging. A preset optimizer algorithm is a mathematical strategy used to guide how model parameters are iteratively updated based on gradients, such as stochastic gradient descent or adaptive moment estimation. Regarding the threshold relationship, the system performs a comparison operation. When the number of gradient accumulations is greater than or equal to the preset update cycle threshold, it determines that the update condition is met and performs subsequent merging and clearing operations; when the number of gradient accumulations is strictly less than the preset update cycle threshold, it determines that the condition is not met and the parameters remain unchanged. The system writes the calculated incremental gradient matrix into a gradient accumulation buffer independent of the current business processing thread. It then checks whether the number of gradient accumulations for the target task identifier in the gradient accumulation buffer has reached a preset update cycle threshold. If the threshold is reached, the accumulated gradient matrix in the gradient accumulation buffer is merged into the target parameter difference set according to the preset optimizer algorithm, and the gradient accumulation buffer is cleared. If the threshold is not reached, the target parameter difference set remains unchanged. This refined operation achieves a perfect balance between model update frequency and business processing performance. By introducing a buffer and threshold judgment, the system avoids the huge input / output overhead and lock contention caused by frequent parameter read / write operations for each feedback. The system temporarily stores high-frequency, small gradient changes, and only performs a centralized parameter update after accumulating sufficient statistically significant error information. This not only significantly improves the system's throughput but also effectively smooths the negative impact of single-sample noise on the model's fine-tuning trajectory.
[0146] The system writes the calculated incremental gradient matrix into a gradient accumulation buffer independent of the current business processing thread; it checks whether the number of gradient accumulations for the target task identifier in the gradient accumulation buffer has reached the preset update cycle threshold; if the preset update cycle threshold has been reached, the accumulated gradient matrix in the gradient accumulation buffer is merged into the target parameter difference set according to the preset optimizer algorithm, and the gradient accumulation buffer is cleared; if the preset update cycle threshold has not been reached, the target parameter difference set remains unchanged, which can be achieved in the following two ways.
[0147] The system can deploy a high-performance distributed in-memory key-value database as a gradient accumulation buffer on nodes independent of the inference service cluster. After the business processing thread calculates the incremental gradient matrix, it serializes it, appends a target task identifier, and sends it to the database. Internally, the database uses atomic addition instructions to accumulate the new gradient with existing gradients and synchronously increments the accumulation counter for that task. The system is configured with a background asynchronous worker thread that polls the counter in the database at millisecond intervals. When the worker thread detects that the counter for a task has reached a preset update cycle threshold, it immediately locks the cache key for that task and extracts the accumulated gradient matrix. Subsequently, the worker thread calls a preset adaptive moment estimation optimizer algorithm, combining the learning rate and momentum factor, to calculate the final parameter update, and writes it to the target parameter difference set in the task-parameter mapping table. Finally, it sends a command to the database to reset the counter and clear the corresponding gradient cache.
[0148] The system can also pre-allocate a tensor pool as a gradient accumulation buffer in the GPU memory of each inference execution block, thereby avoiding cross-device data transfer latency. The system instantiates a lightweight event-driven state machine for each target task. Each time the incremental gradient matrix is generated during backpropagation, an in-memory addition event is triggered, calling the underlying parallel computing core to directly accumulate the gradient to the corresponding position in the tensor pool and incrementing the internal counter of the state machine. The state machine automatically performs conditional checks after each state change; once the counter reaches a preset update cycle threshold, the state machine immediately dispatches a high-priority update event. This event triggers a dedicated kernel function that, based on a preset dynamic stochastic gradient descent optimizer algorithm, reads the accumulated gradient matrix from the tensor pool and modifies the target parameter difference set residing in GPU memory in-situ. After modification, the kernel function quickly zeros out the relevant regions in the tensor pool and resets the state machine to its initial waiting state.
[0149] S304. Upon receiving a next business data processing request carrying a target task identifier, dynamically load the updated target parameter difference set into the shared basic model instance for processing.
[0150] The next business data processing request refers to a new network communication data packet that arrives at the system immediately after the current parameter update operation in the time sequence, and whose header or metadata carries a target task identifier that matches the parameters that were just updated. Dynamic loading refers to an advanced technique that seamlessly injects the latest parameter data into the model computation context through low-level operations such as memory pointer redirection or local data replacement, without terminating the system's main process, interrupting external service connections, or re-initializing the shared basic model instance. When the system receives a next business data processing request carrying a target task identifier, it dynamically loads the updated target parameter difference set into the shared basic model instance for processing. This step marks the final implementation and closure of the model's online adaptive optimization. When an external system initiates another call for this specific task, the system can keenly detect this request and respond quickly. The system no longer uses the old personalized parameters, but instead loads the updated target parameter difference set, which has just absorbed the latest business feedback knowledge, into place with extremely low latency. Subsequently, as business data flows through the shared basic model instance, it will be guided and transformed by these latest parameters. This seamless loading mechanism enables AI models to evolve and apply knowledge on a millisecond-level timescale, ensuring that business processing results always maintain the highest level of freshness and accuracy, and greatly enhancing the system's adaptability to complex and ever-changing environments.
[0151] When the system receives a request for processing the next business data carrying the target task identifier, it dynamically loads the updated target parameter difference set into the shared basic model instance for processing. This can be achieved in the following two ways.
[0152] The system can maintain two identical physical memory regions, primary and backup, in memory space for the parameter difference set of each target task. All previous parameter update operations are performed in the backup memory region, while the inference engine's read pointer always points to the primary memory region. When the system gateway receives a request for processing the next business data carrying the target task identifier and routes it to the inference node, the scheduling controller within the inference node executes an atomic pointer swap instruction before the business data enters the computation graph. This instruction instantly redirects the inference engine's read pointer from the original primary memory region to the updated backup memory region. Subsequently, the business data smoothly flows into the shared base model instance and completes inference processing using the latest parameters pointed to by the new pointer, while the old primary memory region becomes the new backup region, awaiting the next update.
[0153] The system can also introduce a strict monotonically increasing version number mechanism for the target parameter difference set in the task-parameter mapping table. After each parameter update, the version number in the central database is incremented. Each distributed inference worker node maintains a copy of the parameters with the old version number in its local cache. When the next business data processing request arrives at an inference worker node, the latest parameter version number from the central database is automatically injected into the request message by the gateway. Before processing the request, the inference worker node compares the version number in its local cache with the latest version number carried in the request. If a version mismatch is found, the node immediately suspends the processing of the current request, triggers the underlying delayed fetch subroutine, and uses a high-speed remote procedure call to completely fetch the updated target parameter difference set from the central parameter server into its local memory, overwriting the old data and updating the local version number. After fetching, the node resumes the suspended request and uses the newly loaded parameters to complete the inference calculation of the business data.
[0154] In the above embodiments, after outputting the business processing results, the business loss value is calculated by obtaining real business feedback data. While keeping the shared base model instance memory data in a read-only locked state, backpropagation is performed to calculate the incremental gradient matrix, thereby updating only the target parameter difference set in the task-parameter mapping table. This mechanism ensures the parameter safety of the shared base model in a multi-task concurrent environment and prevents the backpropagation process of a single task from interfering with the common base weights. Since the backpropagation and parameter update process only involves a small set of personalized parameter differences, the scale of parameters that need to be calculated and overwritten is significantly reduced, thereby lowering the computational complexity and memory read / write consumption during the online fine-tuning phase of the model and improving the adaptive iteration efficiency of the model for real-time business data.
[0155] The system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 4 This is a schematic diagram of the physical device structure of an artificial intelligence-based model training system provided in an embodiment of this application.
[0156] It should be noted that, Figure 4 The structure of the system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0157] like Figure 4As shown, the system includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes based on a program stored in Read-Only Memory (ROM) 402 or a program loaded from storage portion 408 into Random Access Memory (RAM) 403, such as executing the methods described in the above embodiments. The RAM 403 also stores various programs and data required for system operation. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An Input / Output (I / O) interface 405 is also connected to the bus 404.
[0158] The following components are connected to I / O interface 405: input section 406 including a camera, infrared sensor, etc.; output section 407 including a liquid crystal display (LCD) and speakers, etc.; storage section 408 including a hard disk, etc.; and communication section 409 including a network interface card such as a LAN (Local Area Network) card and a modem, etc. Communication section 409 performs communication processing via a network such as the Internet. Drive 410 is also connected to I / O interface 405 as needed. Removable media 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 410 as needed so that computer programs read from it can be installed into storage section 408 as needed.
[0159] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit (CPU) 401, it performs the various functions defined in the present invention.
[0160] It should be noted that the computer-readable medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. The transmitted data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.
[0161] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0162] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the system described in the above embodiments; or it may exist independently and not assembled into the system. The storage medium carries one or more computer programs that, when executed by a processor of a system, cause the system to implement the methods provided in the above embodiments.
[0163] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0164] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0165] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. 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 can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can 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) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0166] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A model training method based on artificial intelligence, characterized in that, include: Get multiple AI model training tasks submitted concurrently within a preset time window, parse each AI model training task, and extract the ordered logical execution sequence corresponding to each AI model training task, which is composed of multiple network construction logic units and model training logic units. In all the ordered logic execution sequences, the training tasks of the artificial intelligence model that have the same preceding continuous logic unit are aggregated into a training task group; The same preceding continuous logic units are defined as the common baseline workflow of the training task group. The common baseline workflow represents the common artificial intelligence business logic of unified training sample set loading and pre-trained neural network model initialization. For each AI model training task in the training task group, the common baseline workflow is separated from the corresponding ordered logic execution sequence, and the remaining logic units in the ordered logic execution sequence are transformed into personalized derivative workflows. The personalized derivative workflows are independent training logics that include personalized hyperparameter configuration and network layer parameter fine-tuning. The common baseline workflow is allocated a first computing resource for single centralized execution, and at the end of the execution of the common baseline workflow, the intermediate running data produced is determined as a baseline context slice, which is a persistent data packet encapsulating the network topology and initial weight matrix of the pre-trained neural network model. Allocate second computing resources to each of the personalized derivative workflows in the training task group; The baseline context slices are distributed to each of the second computing resources for model loading and environment reconstruction. In the reconstructed environment, each of the personalized derivative workflows is executed in parallel based on the personalized hyperparameter configuration and network layer parameter fine-tuning to complete the training tasks of each of the artificial intelligence models.
2. The method according to claim 1, characterized in that, The step of aggregating the artificial intelligence model training tasks with the same preceding continuous logical units from all the ordered logical execution sequences into a training task group specifically includes: Perform a bit-by-bit comparison of all the ordered logic execution sequences and output the sequence comparison results; Analyze the sequence alignment results and extract the bifurcation location information where the first logical unit difference occurs; The ordered logic execution sequence is truncated based on the bifurcation position information to generate a common prefix segment; The common prefix segment is identified as the same preceding continuous logic unit; The training tasks of the artificial intelligence model that contain the same preceding continuous logic unit are aggregated into the training task group.
3. The method according to claim 1, characterized in that, The step of aggregating the artificial intelligence model training tasks with the same preceding continuous logical units from all the ordered logical execution sequences into a training task group specifically includes: Extract the header execution sequence of all ordered logical execution sequences to generate an initial prefix fragment set; Calculate the logical feature similarity between each header execution sequence in the initial prefix fragment set to obtain a similarity matrix; The similarity matrix is filtered according to a preset similarity threshold to select the target equivalent fragment; The target equivalent segment is determined as the same preceding continuous logic unit; The training tasks of the artificial intelligence model that contain the same preceding continuous logic unit are aggregated into the training task group.
4. The method according to claim 1, characterized in that, After completing each of the artificial intelligence model training tasks, the method further includes: Extract the trained network layer parameters obtained after completing the training tasks of each of the aforementioned artificial intelligence models; Calculate the difference between the trained network layer parameters and the initial weight matrix in the baseline context slice to obtain a personalized parameter difference set corresponding to each training task of the artificial intelligence model; The network topology and the initial weight matrix in the baseline context slice are loaded into memory to obtain a shared base model instance; Establish the association between the task identifier of each training task of the artificial intelligence model and the corresponding set of personalized parameter differences, and generate a task-parameter mapping table; Receive a business data processing request carrying a target task identifier, and query the task-parameter mapping table according to the target task identifier to determine the corresponding target parameter difference set; The target parameter difference set is dynamically loaded into the shared basic model instance, and the business data processing request is processed through the loaded shared basic model instance to output the business processing result.
5. The method according to claim 4, characterized in that, The step of dynamically loading the target parameter difference set into the shared basic model instance, and then using the loaded shared basic model instance to process the business data processing request and output the business processing result specifically includes: Analyze the target parameter difference set to determine the target network layer to be updated and the corresponding weight difference matrix in the shared base model instance; Input the business data processing request into the shared basic model instance; When the shared base model instance runs to the target network layer, parallel matrix calculations are performed on the input data of the current layer based on the initial weight matrix and the weight difference matrix to obtain basic feature data and incremental feature data. The basic feature data and the incremental feature data are added and fused to obtain the output data of the target network layer, so as to output the business processing result through the shared basic model instance.
6. The method according to claim 4, characterized in that, After processing the business data processing request through the loaded shared basic model instance and outputting the business processing result, the method further includes: Obtain real business feedback data for the business processing result, and calculate the business loss value based on the business processing result and the real business feedback data; While keeping the memory data of the shared base model instance in a read-only locked state, backpropagation is performed based on the business loss value to calculate the incremental gradient matrix; The incremental gradient matrix is used to update the target parameter difference set in the task-parameter mapping table to obtain the updated target parameter difference set. Upon receiving a next business data processing request carrying the target task identifier, the updated target parameter difference set is dynamically loaded into the shared basic model instance for processing.
7. The method according to claim 6, characterized in that, The step of updating the target parameter difference set in the task-parameter mapping table using the incremental gradient matrix to obtain the updated target parameter difference set specifically includes: Write the calculated incremental gradient matrix into a gradient accumulation buffer that is independent of the current business processing thread; Detect whether the number of gradient accumulations for the target task identifier in the gradient accumulation buffer has reached a preset update cycle threshold; If the preset update cycle threshold is reached, the accumulated gradient matrix in the gradient accumulation buffer is merged into the target parameter difference set according to the preset optimizer algorithm, and the gradient accumulation buffer is cleared. If the preset update cycle threshold is not reached, the target parameter difference set remains unchanged.
8. A model training system based on artificial intelligence, characterized in that, The system includes: One or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the system to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the system, the system performs the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product is run on the system, the system performs the method as described in any one of claims 1-7.