Large model fine tuning parameter version chain management method and system, terminal and medium
By constructing a parameter version chain management method and utilizing parameter incremental calculation and index structure, the problems of large storage overhead and insufficient consistency control in large model fine-tuning management are solved, and efficient and reliable parameter recovery and version management are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-04-03
AI Technical Summary
Existing large-scale model fine-tuning management systems suffer from huge storage overhead and long loading times under full storage mode, while lack effective time-series indexes and log consistency control under incremental storage mode.
By calculating the difference between model parameters as parameter increments, and combining time indexes and model indexes to construct parameter version chains, incremental superposition is performed using memory mapping and vectorized calculation methods. A two-layer index structure is established, and hash mapping and binary search algorithms are introduced to achieve fast retrieval and efficient recovery.
It significantly reduces storage overhead, supports parameter recovery at any point in time, improves the response speed and computing throughput of the recovery process, and enhances the fault tolerance and data stability of the system.
Smart Images

Figure CN121785643A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of large model fine-tuning technology, specifically involving a method, system, terminal, and medium for managing the version chain of large model fine-tuning parameters. Background Technology
[0002] With the widespread application of large-scale pre-trained models in natural language processing, image recognition, and multimodal tasks, the scale of model parameters has grown exponentially.
[0003] In the process of model fine-tuning, in order to adapt to the needs of different domains or tasks, the parameters of the pre-trained model are usually updated through continuous incremental training steps.
[0004] Each fine-tuning operation generates a large amount of new parameter weight data, which needs to be saved to support model version management, rollback, and traceability.
[0005] Existing large model fine-tuning management systems typically employ full parameter snapshot storage or incremental file rollback mechanisms: In the full storage mode, a complete model parameter file is generated after each fine-tuning, resulting in huge storage overhead and long loading time; in the incremental storage mode, only the parameter differences between adjacent versions are recorded, and rollback is achieved through chain stacking. However, most systems only complete version stacking based on the file system or object storage layer, lacking effective time-series indexing and log consistency control. Summary of the Invention
[0006] This invention addresses the problems in the prior art by providing a method, system, terminal, and medium for managing version chains of fine-tuning parameters for large models. This solves the problem in the background art where, under the full storage method, a complete model parameter file is generated after each fine-tuning, resulting in huge storage overhead and long loading time. At the same time, it also solves the problem in the background art where, under the incremental storage method, version stacking is completed based on the file system or object storage layer, and there is a lack of effective time-series indexing and log consistency control.
[0007] The technical solution adopted in this invention is as follows: Firstly, this application provides a method for managing the version chain of fine-tuning parameters for large models, which includes the following steps: Step S1: During the fine-tuning of the large model, for the nth fine-tuning operation, calculate the difference between the model parameters after this fine-tuning and the model parameters after the (n-1)th fine-tuning, and denot it as the parameter increment ΔW. n ; Step S2: Increment the parameter ΔW n The timestamp, model identifier, and fine-tuning metadata of this fine-tuning are encapsulated into a pre-write log entry, and this pre-write log entry is appended to the established continuous pre-write log sequence in the time series database in chronological order; Step S3: Build a time index based on the timestamp of the pre-write log entry, build a model index based on the model identifier, associate the pre-write log entries corresponding to different time points according to the time sequence to form a parameter version chain, and record the start and end positions and parameter data pointers of each log entry in the time index. Step S4: When a request to restore the model parameters after the i-th fine-tuning corresponding to the target time point is received, the log interval before the target time point is retrieved by time index, and the parameter increment ΔW corresponding to that interval is loaded. i The continuous log entries are written to memory, and the parameter increments recorded in the log entries are accumulated sequentially according to time to obtain the parameter increments from ΔW1 to ΔW. i The parameter increment set W constitutes i The corresponding relationship is W i =ΔW1+…+ΔW i Based on the parameter increment set W i Reconstruct the model parameter state corresponding to the target time point; Step S5: During log replay, incremental overlay operation is performed using memory mapping and vectorized calculation. The calculation results are used to generate a snapshot of the model parameters at the target time point in memory and cached.
[0008] Furthermore, step S1 includes: During the nth fine-tuning operation, the training epoch, learning rate, and gradient update status are monitored in real time. When parameter convergence is detected or a preset iteration threshold is reached, incremental calculation is performed to calculate the difference between the model parameter matrix after the (n-1)th and nth fine-tuning operations. The parameter increment ΔW is obtained using tensor differencing. n And the parameter increment ΔW n The compression encoding process is performed before encapsulation.
[0009] Furthermore, step S2 includes: When generating pre-write log entries, a unique log sequence number and timestamp are assigned to each entry, the model identifier is mapped to the primary index key, and the compressed and encoded parameter increment ΔW is... n The fine-tuning metadata is organized as log data units in the form of binary data blocks; During the writing process, log data units are written to the pre-allocated log storage area of the time-series database in a sequential append manner, and the logical offset and physical page address of each log data unit are recorded. The log index table is updated after writing.
[0010] Furthermore, step S3 includes: After the log entries are written, sort all log entries according to their timestamps and create a corresponding time index node for each timestamp. Each time index node includes a timestamp value, log sequence number, log start offset, data block length, and checksum. Establish independent model index tables for different model identifiers, record the index addresses of all time index nodes associated with the model identifier in the model index table, and form a singly linked list structure according to the time order; A bidirectional reference relationship is established between the time index table and the model index table, and the corresponding positions of the model identifier and the time index node are recorded through hash mapping; Upon receiving a query request, a binary search is performed based on the target timestamp to locate the target time index node, and the corresponding log block is accessed directly through the offset field of the index node.
[0011] Furthermore, in step S4: Before executing log replay, increment ΔW for each parameter in the parameter increment set Wᵢ. k Establish a memory mapping table, k=1, ..., i, and map the log data block addresses in the time series database to the process virtual memory space one by one. Divide the mapping region into a continuous tensor page region, and each tensor page region corresponds to a set of parameter matrix elements. During incremental overlay, the parallel computing engine is invoked to perform batch data retrieval based on the starting address and stride parameter of the tensor page region, and the increment ΔW of each parameter is calculated. k After being aligned according to the tensor dimension, the data is loaded into the computation unit cache, and element-wise summation of matrix units of the same dimension is performed using a vectorized instruction set.
[0012] Furthermore, data consistency checks are performed based on the checksum of the tensor page area. For page areas marked as abnormal in the check results, a skip-playback compensation operation is performed to skip the damaged page areas and reload the parameter incremental data blocks corresponding to the adjacent normal page areas. Increment ΔW of all parameters k After the overlay is completed, a page area mapping verification table is generated, which records the starting address, final offset position, data length and verification result of each tensor page area. This table is used for the integrity verification of subsequent model parameter snapshots and log tracking.
[0013] Furthermore, it also includes the following steps: Step S6: Utilize the transaction commit and data verification mechanism of the time series database to perform integrity checks and consistency updates on the log entries before writing, and periodically generate intermediate snapshot files in the background to update the time index and model index.
[0014] Secondly, this application provides a large model fine-tuning parameter version chain management system for implementing the large model fine-tuning parameter version chain management method as described in the first aspect. The system includes: The fine-tuning increment calculation unit is used to calculate the difference between the model parameters after the nth fine-tuning and the model parameters after the (n-1)th fine-tuning during the large model fine-tuning process, and obtain the parameter increment ΔW. n ; The log encapsulation and writing unit is used to increment the parameter ΔW. n The timestamp, model identifier, and fine-tuning metadata of this fine-tuning are encapsulated into a pre-write log entry, and the pre-write log entry is written into the established continuous pre-write log sequence in the time series database in chronological order; The index building unit is used to build a time index based on the timestamp of the pre-write log entry, build a model index based on the model identifier, associate the pre-write log entries corresponding to different time points according to the time sequence to form a parameter version chain, and record the start and end positions of the log entries and parameter data pointers in the index table; The log replay and parameter recovery unit is used to, upon receiving a model parameter recovery request for a target time point, retrieve the log interval prior to the target time point using a time index and load the corresponding parameter increment ΔW within the log interval. k The model parameter state corresponding to the target time point is reconstructed by performing cumulative calculations based on the time sequence. The memory mapping and vectorized computation unit is used to establish the parameter increment set W during log replay. i The memory mapping table maps the log data block addresses in the time series database to the virtual memory space. The parallel computing engine calls the vectorized instruction set to perform element-wise summation of the same-dimensional matrix units in order to generate and cache the model parameter snapshots at the target time point in memory. The data verification and playback compensation unit is used to perform data consistency detection based on the check code of the tensor page area, perform jump playback compensation operation on abnormal page areas, and generate a page area mapping verification table to record the offset position and verification result of each tensor page area. The transaction and snapshot maintenance unit is used to perform integrity checks and consistency updates on pre-write log entries, periodically generate intermediate snapshot files, and update the time index and model index to maintain the order of the parameter version chain and the correspondence between the data.
[0015] Thirdly, this application provides a terminal, including: The memory is used to store the version chain management program for fine-tuning parameters of the large model; A processor is configured to implement the steps of the large model fine-tuning parameter version chain management method as described in the first aspect when executing the large model fine-tuning parameter version chain management device.
[0016] Fourthly, this application provides a computer-readable storage medium that stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the large model fine-tuning parameter version chain management method as described in the first aspect.
[0017] As can be seen from the above technical solutions, the advantages of the present invention are: By transforming parameter updates during the fine-tuning of large models into traceable parameter increments, and combining time indexes and model indexes to construct a parameter version chain, model parameter changes are made traceable and recoverable over time. This enables multi-version management without having to save the entire model, significantly reducing storage overhead and supporting parameter recovery at any point in time.
[0018] By introducing gradient monitoring and convergence judgment logic in the fine-tuning stage, incremental calculation is triggered only when the set convergence conditions are met or the iteration threshold is reached, thereby avoiding redundant parameter difference records. Furthermore, tensor difference and compression coding methods are used to reduce the storage and transmission costs of a single increment, thereby improving the efficiency of incremental calculation.
[0019] By assigning unique sequence numbers and physical page addresses to log entries before writing, and recording logical offsets and updating log index tables when writing to the time-series database, the storage structure of incremental parameter data is made sequentially consistent and locatable, enabling fast tracking and data anomaly location based on sequence numbers, and improving the read and write reliability of the log layer.
[0020] By establishing a two-layer structure that includes time indexes and model indexes, and using hash mapping and binary search algorithms to directly locate log entries at specific time points, the time delay caused by traditional linear retrieval is avoided, enabling fast retrieval of model versions and efficient access to parameter blocks, thereby improving the response speed of the parameter recovery process.
[0021] By mapping the parameter increment set Wᵢ to a contiguous memory address space and using a vectorized instruction set for parallel matrix summation during increment stacking, the increment calculation process is completed in memory, avoiding frequent disk I / O operations and significantly improving the computational throughput and real-time performance of parameter playback.
[0022] By introducing tensor page area checksum detection and a skip-playback compensation mechanism during vectorized computation, dynamic page area replacement and reloading are performed when abnormal pages are detected. This effectively prevents parameter chain breaks caused by log area corruption and improves the system's fault tolerance and data stability during incremental playback.
[0023] By performing log entry status checks and hash verifications during the transaction commit phase, and combining this with periodic snapshot synchronization tasks to rebuild and update time indexes and model indexes, the database layer maintains a consistent data chain structure after multiple rounds of fine-tuning. This ensures that the index correspondence between the parameter version chain and snapshot records remains constant, thereby enhancing the continuous reliability and data consistency of the entire system. Attached Figure Description
[0024] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart illustrating the steps of the large model fine-tuning parameter version chain management method in the embodiment. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Please see Figure 1 As shown, this invention provides a method for managing the version chain of fine-tuning parameters for large models, including the following steps: Step S1: During the fine-tuning of the large model, for the nth fine-tuning operation, calculate the difference between the model parameters after this fine-tuning and the model parameters after the (n-1)th fine-tuning, and denot it as the parameter increment ΔW. n ; In practical implementation, difference calculation can be achieved by monitoring the parameter storage interface during model training. Specifically, after each fine-tuning task, the system automatically extracts the current weight matrix and the previously fine-tuned weight matrix, and performs the difference calculation operation in the GPU memory. To reduce computational load, difference extraction can be performed only on the subset of parameters where gradient updates occur, thus avoiding redundant calculations from full parameter comparison. When the model structure is large, a hierarchical calculation method can be used to calculate the difference between the weights of different layers separately, and then perform difference aggregation. This calculation process can be automatically triggered by the callback function of the training framework without manual intervention.
[0028] Step S2: Increment the parameter ΔW nThe timestamp, model identifier, and fine-tuning metadata of this fine-tuning are encapsulated into a pre-write log entry, and this pre-write log entry is appended to the established continuous pre-write log sequence in the time series database in chronological order; In practical applications, a time-series database system with sequential write capabilities, such as InfluxDB or TimescaleDB, can be used as the log data management engine. After each fine-tuning, the system automatically generates corresponding log entries. These log entries are encapsulated in a structured binary format, containing information such as parameter increments, timestamps, model identifiers, training epochs, and dataset identifiers. Log entries are stored in a sequential append-only manner during writing, and the pre-write log sequence maintained in the database is created during system initialization. The write process is executed by an asynchronous task queue, enabling data persistence without affecting front-end training performance.
[0029] Step S3: Build a time index based on the timestamp of the pre-write log entry, build a model index based on the model identifier, associate the pre-write log entries corresponding to different time points according to the time sequence to form a parameter version chain, and record the start and end positions and parameter data pointers of each log entry in the time index. In the implementation, the time index and model index can be maintained using a dual-table structure. The system automatically updates the index tables after each new log entry is written. The time index table uses the timestamp as the key, recording the offset position and data block length of the log entry. The model index table uses the model identifier as the key, storing pointers to all log entries related to that model. A foreign key reference is established between the two index tables, allowing the time index node to be found backwards using the model identifier. At the database level, a structure combining hash indexes and skip lists can be used to improve query efficiency. The index creation process is periodically updated by a system daemon thread.
[0030] Step S4: When a request to restore the model parameters after the i-th fine-tuning corresponding to the target time point is received, the log interval before the target time point is retrieved by time index, and the parameter increment ΔW corresponding to that interval is loaded. i The continuous log entries are written to memory, and the parameter increments recorded in the log entries are accumulated sequentially according to time to obtain the parameter increments from ΔW1 to ΔW. i The parameter increment set W constitutes i The corresponding relationship is W i =ΔW1+…+ΔW i Based on the parameter increment set W i Reconstruct the model parameter state corresponding to the target time point; In this embodiment, the system can receive recovery requests through a backend recovery interface. This interface locates the corresponding log interval in the time index table based on the target timestamp and calls the database read interface to batch load the required log entries. After the log data is loaded into memory, the system automatically parses the parameter incremental data block for each entry and performs cumulative calculations in chronological order. This calculation process can be executed in parallel by a GPU or a multi-threaded CPU, thereby restoring the complete model parameter state corresponding to any point in time within seconds. The restored parameter matrix can be directly loaded into the model weight space for inference or further fine-tuning.
[0031] Step S5: During log replay, incremental overlay operation is performed using memory mapping and vectorized calculation methods. The calculation results are used to generate a snapshot of the model parameters at the target time point in memory and cached. In practical implementation, when performing log replay, the system uses a memory mapping mechanism to directly map log file segments from the database to the process's virtual memory space, thus avoiding redundant I / O reads and writes. The mapped parameter increment data is quickly located using a tensor index management structure and loaded into the computation buffer by the parallel computing engine. Subsequently, the system calls the underlying vectorized instruction set (such as the AVX or CUDA kernel) to perform element-wise matrix summation, achieving rapid aggregation of parameter increments. The computation results generate a complete snapshot of the model parameters in memory and are written to the memory cache to support immediate callbacks or subsequent version comparison operations.
[0032] Step S6: Utilize the transaction commit and data verification mechanism of the time series database to perform integrity checks and consistency updates on the log entries before writing, and periodically generate intermediate snapshot files in the background to update the time index and model index; In this embodiment, the system initiates a transaction commit process after each log write, scanning for uncommitted log entries to ensure consistent data commit order. The system verifies log integrity by calculating the hash value of each log data block and comparing it with a checksum field in the index table. If inconsistencies are found, the system automatically triggers an overwrite mechanism to correct the abnormal data blocks. A background daemon periodically performs snapshot synchronization on all logs, generating intermediate snapshot files and updating the time and model indexes to maintain the continuity of the log chain structure and the timeliness of the indexes. Snapshot files are stored in a separate persistent directory for rapid recovery after a system restart.
[0033] In some embodiments, step S1 includes: During the nth fine-tuning operation, the training epoch, learning rate, and gradient update status are monitored in real time. When parameter convergence is detected or a preset iteration threshold is reached, incremental calculation is performed to calculate the difference between the model parameter matrix after the (n-1)th and nth fine-tuning operations. The parameter increment ΔW is obtained using tensor differencing. nAnd the parameter increment ΔW n The compression encoding process is performed before encapsulation.
[0034] In practical implementation, the system incorporates a gradient monitoring module during fine-tuning training to determine the degree of convergence by recording the trend of loss value changes. When the loss change falls below a threshold or the number of iterations reaches a set upper limit, the incremental calculation module is automatically triggered. The calculated ΔW... n Before encapsulation, the data undergoes quantization and compression, for example, using FP16 precision or sparse coding strategies, to reduce storage space usage. The compressed data is then checked using a CRC checksum to generate a verification code before being written to the log, which is used for subsequent data consistency checks.
[0035] In some embodiments, step S2 includes: When generating pre-write log entries, a unique log sequence number and timestamp are assigned to each entry, the model identifier is mapped to the primary index key, and the compressed and encoded parameter increment ΔW is... n The fine-tuning metadata is organized as log data units in the form of binary data blocks; During the writing process, log data units are written to the pre-allocated log storage area of the time-series database in a sequential append manner, and the logical offset and physical page address of each log data unit are recorded. The log index table is updated after writing.
[0036] In a specific embodiment, during the log generation phase, the system calls the pre-write log interface of the database driver layer to form log data units to be written through a memory buffer. Each log unit contains a sequence number, timestamp, model ID, and parameter increment data block. The write operation is performed by a sequential write thread, which sequentially appends data to the pre-allocated file space of the database and updates the log offset table in real time. The offset table can be called by the subsequent retrieval process to accurately locate the log block address.
[0037] In some embodiments, step S3 includes: After the log entries are written, sort all log entries according to their timestamps and create a corresponding time index node for each timestamp. Each time index node includes a timestamp value, log sequence number, log start offset, data block length, and checksum. Establish independent model index tables for different model identifiers, record the index addresses of all time index nodes associated with the model identifier in the model index table, and form a singly linked list structure according to the time order; A bidirectional reference relationship is established between the time index table and the model index table, and the corresponding positions of the model identifier and the time index node are recorded through hash mapping; Upon receiving a query request, a binary search is performed based on the target timestamp to locate the target time index node, and the corresponding log block is accessed directly through the offset field of the index node.
[0038] In practice, the system's index generation module runs automatically after the log write operation is completed. To improve retrieval performance, the time index table is implemented using a skip list structure and employs a partitioned search method with logarithmic search efficiency, ensuring that retrieval time changes slowly with data size as the number of logs increases. The model index table uses a hash mapping structure for storage, with the model identifier as the key and the time index node address as the value. The offset information stored in the index node directly corresponds to the physical location in the log file. During recovery or query operations, the system can perform random access based on this offset to quickly locate the corresponding incremental data block.
[0039] In some embodiments, in step S4: Before executing log replay, increment ΔW for each parameter in the parameter increment set Wᵢ. k Establish a memory mapping table, k=1, ..., i, and map the log data block addresses in the time series database to the process virtual memory space one by one. Divide the mapping region into a continuous tensor page region, and each tensor page region corresponds to a set of parameter matrix elements. During incremental overlay, the parallel computing engine is invoked to perform batch data retrieval based on the starting address and stride parameter of the tensor page region, and the increment ΔW of each parameter is calculated. k After being aligned according to the tensor dimension, the data is loaded into the computation unit cache, and element-wise summation of matrix units of the same dimension is performed using a vectorized instruction set.
[0040] In a specific embodiment, the system employs a unified memory management module to load the database file system into the virtual space via a memory mapping mechanism. The mapped log data area is divided into several pages, each containing a fixed number of parameter matrix data. The system records the starting address and step size information of each page through a mapping table. During the superposition calculation, the calculation engine reads the mapping table pointer and sequentially retrieves ΔW. k The corresponding data blocks are loaded into the cache through multi-threading or GPU parallel processing. The computation module performs element-wise operations using vectorized instructions, thereby completing large-scale matrix superposition in a short time.
[0041] In some embodiments, data consistency detection is performed based on the check code of the tensor page area, and a skip-playback compensation operation is performed on the page area marked as abnormal in the detection result, skipping the damaged page area and reloading the parameter incremental data block corresponding to the adjacent normal page area. Increment ΔW of all parameters kAfter the overlay is completed, a page area mapping verification table is generated to record the starting address, final offset position, data length and verification result of each tensor page area, which is used for the integrity verification of subsequent model parameter snapshots and log tracking. During implementation, the system checks the checksum of each tensor page during the playback phase to identify data corruption or inconsistencies. When an abnormal page is detected, the system automatically skips that page and loads the adjacent normal pages, performing page-level playback compensation to restore data continuity. The processing results of all page regions are recorded in a mapping verification table, which includes page region address, offset, length, and status flag fields. This table is written to the database index after playback for subsequent snapshot verification and error localization.
[0042] In some embodiments, this application provides a large model fine-tuning parameter version chain management system, the system comprising: The fine-tuning increment calculation unit is used to calculate the difference between the model parameters after the nth fine-tuning and the model parameters after the (n-1)th fine-tuning during the large model fine-tuning process, and obtain the parameter increment ΔW. n ; The log encapsulation and writing unit is used to increment the parameter ΔW. n The timestamp, model identifier, and fine-tuning metadata of this fine-tuning are encapsulated into a pre-write log entry, and the pre-write log entry is written into the established continuous pre-write log sequence in the time series database in chronological order; The index building unit is used to build a time index based on the timestamp of the pre-write log entry, build a model index based on the model identifier, associate the pre-write log entries corresponding to different time points according to the time sequence to form a parameter version chain, and record the start and end positions of the log entries and parameter data pointers in the index table; The log replay and parameter recovery unit is used to, upon receiving a model parameter recovery request for a target time point, retrieve the log interval prior to the target time point using a time index and load the corresponding parameter increment ΔW within the log interval. k The model parameter state corresponding to the target time point is reconstructed by performing cumulative calculations based on the time sequence. The memory mapping and vectorized computation unit is used to establish the parameter increment set W during log replay. i The memory mapping table maps the log data block addresses in the time series database to the virtual memory space. The parallel computing engine calls the vectorized instruction set to perform element-wise summation of the same-dimensional matrix units in order to generate and cache the model parameter snapshots at the target time point in memory. The data verification and playback compensation unit is used to perform data consistency detection based on the check code of the tensor page area, perform jump playback compensation operation on abnormal page areas, and generate a page area mapping verification table to record the offset position and verification result of each tensor page area. The transaction and snapshot maintenance unit is used to perform integrity checks and consistency updates on pre-write log entries, periodically generate intermediate snapshot files, and update the time index and model index to maintain the order of the parameter version chain and the correspondence between the data.
[0043] In some embodiments, this application provides a terminal, including: The memory is used to store the version chain management program for fine-tuning parameters of the large model; A processor is used to execute the steps of the large model fine-tuning parameter version chain management method when implementing the large model fine-tuning parameter version chain management system.
[0044] In some embodiments, this application provides a computer-readable storage medium that stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the large model fine-tuning parameter version chain management method.
[0045] It is understood that the systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can be a personal computer, a laptop computer, a personal digital assistant, a tablet computer, a wearable device, or any combination of these devices.
[0046] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0047] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0048] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0049] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0050] It should be understood that although the terms first, second, third, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of one or more embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "in response to a determination," or "when," or "in the event of a determination."
[0051] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.
Claims
1. A method for managing version chains of fine-tuning parameters in a large model, characterized in that, Includes the following steps: Step S1: During the fine-tuning of the large model, for the nth fine-tuning operation, calculate the difference between the model parameters after this fine-tuning and the model parameters after the (n-1)th fine-tuning, and denot it as the parameter increment ΔW. n ; Step S2: Increment the parameter ΔW n The timestamp, model identifier, and fine-tuning metadata of this fine-tuning are encapsulated into a pre-write log entry, and this pre-write log entry is appended to the established continuous pre-write log sequence in the time series database in chronological order; Step S3: Build a time index based on the timestamp of the pre-write log entry, build a model index based on the model identifier, associate the pre-write log entries corresponding to different time points according to the time sequence to form a parameter version chain, and record the start and end positions and parameter data pointers of each log entry in the time index. Step S4: When a request to restore the model parameters after the i-th fine-tuning corresponding to the target time point is received, the log interval before the target time point is retrieved by time index, and the parameter increment ΔW corresponding to that interval is loaded. i The continuous log entries are written to memory, and the parameter increments recorded in the log entries are accumulated sequentially according to time to obtain the parameter increments from ΔW1 to ΔW. i The parameter increment set W constitutes i The corresponding relationship is W i =ΔW1+…+ΔW i Based on the parameter increment set W i Reconstruct the model parameter state corresponding to the target time point; Step S5: During log replay, incremental overlay operation is performed using memory mapping and vectorized calculation. The calculation results are used to generate a snapshot of the model parameters at the target time point in memory and cached.
2. The method for managing the version chain of fine-tuning parameters for large models according to claim 1, characterized in that, Step S1 includes: During the nth fine-tuning operation, the training epoch, learning rate, and gradient update status are monitored in real time. When parameter convergence is detected or a preset iteration threshold is reached, incremental calculation is performed to calculate the difference between the model parameter matrix after the (n-1)th and nth fine-tuning operations. The parameter increment ΔW is obtained using tensor differencing. n And the parameter increment ΔW n The compression encoding process is performed before encapsulation.
3. The method for managing the version chain of fine-tuning parameters for large models according to claim 1, characterized in that, Step S2 includes: When generating pre-write log entries, a unique log sequence number and timestamp are assigned to each entry, the model identifier is mapped to the primary index key, and the compressed parameter increment ΔW is... n The fine-tuning metadata is organized as log data units in the form of binary data blocks; During the writing process, log data units are written to the pre-allocated log storage area of the time-series database in a sequential append manner, and the logical offset and physical page address of each log data unit are recorded. The log index table is updated after writing.
4. The method for managing the version chain of fine-tuning parameters for large models according to claim 3, characterized in that, Step S3 includes: After the log entries are written, sort all log entries according to their timestamps and create a corresponding time index node for each timestamp. Each time index node includes a timestamp value, log sequence number, log start offset, data block length, and checksum. Establish independent model index tables for different model identifiers, record the index addresses of all time index nodes associated with the model identifier in the model index table, and form a singly linked list structure according to the time order; A bidirectional reference relationship is established between the time index table and the model index table, and the corresponding positions of the model identifier and the time index node are recorded through hash mapping; Upon receiving a query request, a binary search is performed based on the target timestamp to locate the target time index node, and the corresponding log block is accessed directly through the offset field of the index node.
5. The method for managing the version chain of fine-tuning parameters for large models according to claim 4, characterized in that, In step S4: Before executing log replay, increment ΔW for each parameter in the parameter increment set Wᵢ. k Establish a memory mapping table, k=1, ..., i, and map the log data block addresses in the time series database to the process virtual memory space one by one. Divide the mapping region into a continuous tensor page region, and each tensor page region corresponds to a set of parameter matrix elements. During incremental overlay, the parallel computing engine is invoked to perform batch data retrieval based on the starting address and stride parameter of the tensor page region, and the increment ΔW of each parameter is calculated. k After being aligned according to the tensor dimension, the data is loaded into the computation unit cache, and element-wise summation of matrix units of the same dimension is performed using a vectorized instruction set.
6. The method for managing the version chain of fine-tuning parameters for large models according to claim 5, characterized in that, Perform data consistency checks based on the checksum of the tensor page area, and perform a skip-playback compensation operation on the page areas marked as abnormal in the detection results, skipping the damaged page areas and reloading the parameter incremental data blocks corresponding to the adjacent normal page areas. Increment ΔW of all parameters k After the overlay is completed, a page area mapping verification table is generated, which records the starting address, final offset position, data length and verification result of each tensor page area. This table is used for the integrity verification of subsequent model parameter snapshots and log tracking.
7. The method for managing the version chain of fine-tuning parameters for large models according to claim 1, characterized in that, It also includes the following steps: Step S6: Utilize the transaction commit and data verification mechanism of the time series database to perform integrity checks and consistency updates on the log entries before writing, and periodically generate intermediate snapshot files in the background to update the time index and model index.
8. A large model fine-tuning parameter version chain management system, used to implement the large model fine-tuning parameter version chain management method as described in any one of claims 1-7, characterized in that, The system includes: The fine-tuning increment calculation unit is used to calculate the difference between the model parameters after the nth fine-tuning and the model parameters after the (n-1)th fine-tuning during the large model fine-tuning process, and obtain the parameter increment ΔW. n ; The log encapsulation and writing unit is used to increment the parameter ΔW. n The timestamp, model identifier, and fine-tuning metadata of this fine-tuning are encapsulated into a pre-write log entry, and the pre-write log entry is written into the established continuous pre-write log sequence in the time series database in chronological order; The index building unit is used to build a time index based on the timestamp of the pre-write log entry, build a model index based on the model identifier, associate the pre-write log entries corresponding to different time points according to the time sequence to form a parameter version chain, and record the start and end positions of the log entries and parameter data pointers in the index table; The log replay and parameter recovery unit is used to, upon receiving a model parameter recovery request for a target time point, retrieve the log interval prior to the target time point using a time index and load the corresponding parameter increment ΔW within the log interval. k The model parameter state corresponding to the target time point is reconstructed by performing cumulative calculations based on the time sequence. The memory mapping and vectorized computation unit is used to establish the parameter increment set W during log replay. i The memory mapping table maps the log data block addresses in the time series database to the virtual memory space. The parallel computing engine calls the vectorized instruction set to perform element-wise summation of the same-dimensional matrix units in order to generate and cache the model parameter snapshots at the target time point in memory. The data verification and playback compensation unit is used to perform data consistency detection based on the check code of the tensor page area, perform jump playback compensation operation on abnormal page areas, and generate a page area mapping verification table to record the offset position and verification result of each tensor page area. The transaction and snapshot maintenance unit is used to perform integrity checks and consistency updates on pre-write log entries, periodically generate intermediate snapshot files, and update the time index and model index to maintain the order of the parameter version chain and the correspondence between the data.
9. A terminal, characterized in that, include: The memory is used to store the version chain management program for fine-tuning parameters of the large model; The processor is configured to implement the steps of the large model fine-tuning parameter version chain management method as described in claim 1 when executing the large model fine-tuning parameter version chain management device.
10. A computer-readable storage medium, characterized in that, The storage medium stores computer instructions. When the computer reads the computer instructions from the storage medium, the computer executes the large model fine-tuning parameter version chain management method as described in claim 1.
Citation Information
Cited By
A differential method for recording hearing aid fitting data and processes
CN122132052A
A differential method for recording hearing aid fitting data and process
CN122132052B