Model synchronization method, device and equipment for large model and medium
By using differential samples and synchronization instructions in large-scale model synchronization, large-scale parameter copying and transmission are avoided, and the problems of low synchronization efficiency and high resource consumption in traditional methods are solved, and efficient model capability synchronization is achieved.
Patent Information
- Application Number
- CN202411303894.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-20
AI Technical Summary
In large-scale inference services, traditional methods require large-scale parameter copying and transmission, resulting in inefficient synchronization and high resource consumption.
The central storage service stores the samples used by each large model in the training stage, and compares the differential samples when synchronization is required, sends differential samples and synchronization instructions to the client, so that the client model instances can be synchronized into the reasoning with the second largest model. A model instance of capability to avoid large-scale parameter copying and transmission.
This improves the model synchronization efficiency, reduces the consumption of transmission and storage resources, and achieves accurate model capability synchronization.
Smart Images

Figure CN119168091A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to technical fields such as machine learning and deep learning, and can be used in application scenarios such as generative search, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce. Specifically, it relates to a model synchronization method, device, electronic device, computer-readable storage medium, and computer program product for large models. Background Art
[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0003] At present, AI-Generated Content (AIGC) technology based on big models is rapidly empowering all walks of life, and the demand for scenario-based and customized AIGC is becoming more and more vigorous. For example, for scenarios such as medical Q&A and legal consultation, they all expect to have big model services that fit the business scenarios.
[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention
[0005] The present disclosure provides a model synchronization method, apparatus, electronic device, computer-readable storage medium, and computer program product for a large model.
[0006] According to one aspect of the present disclosure, a model synchronization method for a large model is provided, wherein a central storage service stores a plurality of first samples used by a first large model in a training phase and a plurality of second samples used by a second large model in a training phase, and a client runs a first model instance corresponding to the first large model, the method comprising: obtaining a plurality of difference samples based on the central storage service, the plurality of difference samples comprising a plurality of first difference samples, the plurality of first difference samples being samples included in a plurality of second samples but not included in the plurality of first samples; and sending a plurality of difference samples and a synchronization instruction to the client, the synchronization instruction being used to instruct the client to complete a synchronization operation, the synchronization operation comprising training the first model instance using the plurality of difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
[0007] According to another aspect of the present disclosure, a model synchronization method for a large model is provided, wherein a central storage service stores a plurality of first samples used by a first large model in a training phase and a plurality of second samples used by a second large model in a training phase, and a client runs a first model instance corresponding to the first large model, the method comprising: receiving a plurality of difference samples and synchronization instructions from the central storage service, the plurality of difference samples comprising a plurality of first difference samples, the plurality of first difference samples being samples included in the plurality of second samples but not included in the plurality of first samples; and performing a synchronization operation, the synchronization operation comprising training the first model instance using the plurality of difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
[0008] According to another aspect of the present disclosure, a model synchronization device for a large model is provided, wherein a central storage service stores a plurality of first samples used by a first large model in a training phase and a plurality of second samples used by a second large model in a training phase, and a client runs a first model instance corresponding to the first large model, and the above-mentioned device includes: a first acquisition unit, configured to acquire a plurality of difference samples based on the central storage service, the plurality of difference samples including a plurality of first difference samples, the plurality of first difference samples being samples included in the plurality of second samples but not included in the plurality of first samples; and a sending unit, configured to send the plurality of difference samples and a synchronization instruction to the client, the synchronization instruction being used to instruct the client to complete a synchronization operation, the synchronization operation including training the first model instance using the plurality of difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
[0009] According to another aspect of the present disclosure, a model synchronization device for a large model is provided, wherein a central storage service stores a plurality of first samples used by a first large model in a training phase and a plurality of second samples used by a second large model in a training phase, and a client runs a first model instance corresponding to the first large model, and the above-mentioned device comprises: a receiving unit, configured to receive a plurality of difference samples and synchronization instructions from the central storage service, the plurality of difference samples comprising a plurality of first difference samples, the plurality of first difference samples being samples included in the plurality of second samples but not included in the plurality of first samples; and an execution unit, configured to perform a synchronization operation, the synchronization operation comprising training the first model instance using the plurality of difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
[0010] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so as to enable the at least one processor to execute the above-mentioned model synchronization method for large models.
[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above-mentioned model synchronization method for a large model.
[0012] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned model synchronization method for a large model when executed by a processor.
[0013] According to one or more embodiments of the present disclosure, the samples used by each large model in the training phase can be stored through a central storage service, and when synchronization is required, the samples used by the two models are compared and difference samples are obtained; the difference samples are sent together with synchronization instructions to the synchronized model (first model instance) to train the model, so that the model is synchronized as a model instance with the capabilities of the second large model, thereby achieving synchronization of model capabilities without large-scale parameter copying and transmission, thereby improving synchronization efficiency and reducing the consumption of transmission resources and storage resources.
[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0016] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;
[0017] Figure 2 A flow chart of a model synchronization method for a large model according to an embodiment of the present disclosure is shown;
[0018] Figure 3 A schematic diagram showing a model synchronization method according to an exemplary embodiment of the present disclosure is shown;
[0019] Figure 4 A flow chart of a model synchronization method for a large model according to an embodiment of the present disclosure is shown;
[0020] Figure 5 A structural block diagram of a model synchronization device for a large model according to an embodiment of the present disclosure is shown;
[0021] Figure 6 A structural block diagram of a model synchronization device for a large model according to an embodiment of the present disclosure is shown;
[0022] Figure 7 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0024] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0025] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.
[0026] In the era of big models, the number of big model reasoning services is gradually increasing. In some cases, it is necessary to enable the device used to provide a certain reasoning service to have the ability to provide the target reasoning service. To achieve the above purpose, it is usually necessary to copy the full parameters of the model instance on the device corresponding to the target reasoning service directly to another device, and reload the parameters of the model instance to obtain the corresponding reasoning capability. For large models, due to their large parameter scale (for example, a large model may have tens of millions of parameters), copying all parameters requires a lot of time and additional disk space resources.
[0027] The embodiments of the present disclosure provide a model synchronization method for large models, which stores samples used by each large model in the training stage through a central storage service, and when synchronization is required, compares the samples used by the two models and obtains difference samples; the difference samples are sent together with synchronization instructions to the synchronized model (first model instance) to train the model, so that the model is synchronized to a model instance with the capabilities of the second large model, thereby achieving synchronization of model capabilities without large-scale parameter copying and transmission, thereby improving synchronization efficiency and reducing the consumption of transmission resources and storage resources.
[0028] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0029] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
[0030] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of a model synchronization method for a large model.
[0031] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0032] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0033] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to request an inference service or send a synchronization instruction. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.
[0034] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.
[0035] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0036] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0037] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0038] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.
[0039] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
[0040] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.
[0041] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0042] Figure 1The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.
[0043] According to an embodiment of the present disclosure, a model synchronization method for a large model is provided. A central storage service stores a plurality of first samples used by a first large model in a training phase and a plurality of second samples used by a second large model in a training phase, and a client runs a first model instance corresponding to the first large model. Figure 2 As shown, the method includes: step S201, obtaining multiple difference samples based on a central storage service, the multiple difference samples including multiple first difference samples, and the multiple first difference samples are samples included in the multiple second samples but not included in the multiple first samples; and step S202, sending multiple difference samples and synchronization instructions to the client, the synchronization instructions are used to instruct the client to complete the synchronization operation, and the synchronization operation includes training a first model instance using the multiple difference samples to synchronize the first model instance into a second model instance with the reasoning capability of the second largest model.
[0044] Therefore, the samples used by each large model in the training stage are stored through the central storage service, and when synchronization is required, the samples used by the two models are compared and difference samples are obtained; the difference samples are sent together with the synchronization instructions to the synchronized model (the first model instance) to train the model, so that the model is synchronized as a model instance with the capabilities of the second large model, thereby realizing synchronization of model capabilities without large-scale parameter copying and transmission, thereby improving synchronization efficiency and reducing the consumption of transmission resources and storage resources.
[0045] In the above method, the model instance can also be called a model copy, which can be understood as the object actually deployed on the client for processing requests. For a large model, one or more model instances of the large model can be created. Each model instance is deployed on the same or different clients and can be used to process requests. In this way, multiple model instances can be used to process multiple requests in parallel.
[0046] In some embodiments, the central storage service may be, for example, the server 120, or may be provided by the server 120. The client may be, for example, the client devices 101, 102, 103, 104, 105 and / or 106.
[0047] In some embodiments, the central storage service may store multiple samples used in the training phase of each of the multiple large models, wherein each large model is obtained by training the general large model using its own multiple samples. In some embodiments, each of the above large models may be oriented to different professional fields or different service requests, for example.
[0048] In some embodiments, each sample used to train the general large model includes a question text and a corresponding answer text.
[0049] In some embodiments, each sample in the plurality of first samples and the plurality of second samples may include a question text and a corresponding answer text.
[0050] When the central storage service receives the user's model synchronization instruction, it can first determine the large model corresponding to the first model instance that needs to be synchronized (i.e., the first large model) and the target large model that is desired to be synchronized (i.e., the second large model) based on the user's model synchronization instruction, and compare the samples corresponding to the first large model and the second large model to obtain the difference samples between the first large model and the second large model.
[0051] In some embodiments, the difference sample may include a first difference sample included in the plurality of second samples but not included in the plurality of first samples.
[0052] After determining multiple difference samples, the central storage service can send multiple difference samples and synchronization instructions to the client running the first model instance. After receiving the above information, the client can train the first model instance based on multiple difference samples, so that the first model instance is synchronized to the second model instance with the reasoning capability of the second largest model to complete the model synchronization.
[0053] In some embodiments, training the first model instance based on multiple difference samples can be inputting the question text of each difference sample into the first model instance, generating a corresponding reply text based on the first model instance, and calculating the loss based on the reply text and the answer text in the difference sample to train the first model instance through the loss.
[0054] In some embodiments, the multiple difference samples may also include multiple second difference samples, and obtaining the multiple second difference samples may include: obtaining multiple third difference samples, the multiple third difference samples are samples included in the multiple first samples but not included in the multiple third samples; and rewriting each third difference sample in the multiple third difference samples to obtain a second difference sample corresponding to each third difference sample, the second difference sample including a prompt text for guiding the model to forget the corresponding third difference sample.
[0055] Therefore, the second difference sample is obtained through the rewriting method, and the first model instance is trained based on the second difference sample, so that the first model instance can be more accurately synchronized to the model instance corresponding to the above-mentioned second largest model.
[0056] In some embodiments, the central storage service may first obtain a third difference sample included in the plurality of first samples but not included in the plurality of third samples by comparing the plurality of first samples with the plurality of second samples.
[0057] Subsequently, each third difference sample is rewritten to obtain a plurality of second difference samples. In some embodiments, a prompt text for guiding the model to forget the third difference sample can be added to each third difference sample. For example, the second difference sample can be "Please forget: <third difference sample>".
[0058] After obtaining multiple second difference samples, the first model instance can be trained based on multiple difference samples including the first difference sample and the second difference sample to obtain the second model instance. Since the first model instance has been trained with the second difference sample, the first model instance forgets the corresponding third difference sample under the guidance of the prompt information in the second difference sample, so that the model parameters of the first model instance are further adjusted, so that the model parameters of the obtained second model instance are closer to the model parameters of the second largest model, achieving more accurate model synchronization, and at the same time, can further improve the reasoning ability of the second model instance corresponding to the second largest model.
[0059] In some embodiments, the central storage service may record a first usage order of multiple first samples in the training stage of the first large model and a second usage order of multiple second samples in the training stage of the second large model, and obtaining multiple difference samples may include: sorting the multiple first difference samples and the multiple second difference samples according to the first usage order and the second usage order, respectively, to obtain multiple difference samples based on the sorted multiple first difference samples and the sorted multiple second difference samples; and wherein, training the first model instance using the multiple difference samples may include: applying each difference sample in the multiple difference samples in turn to train the first model instance.
[0060] Therefore, by sorting multiple difference samples in the order of training, and using the difference samples in sequence for model training in this order, the first model instance can be further synchronized more accurately with the model instance corresponding to the above-mentioned second largest model.
[0061] In some embodiments, the central storage service also records the order in which multiple samples of each large model are input into the large model during the training phase (ie, the first usage order of the multiple first samples and the second usage order of the multiple second samples).
[0062] In some embodiments, after obtaining multiple first difference samples and multiple second difference samples, the first difference samples and multiple second difference samples can be sorted in their respective corresponding usage order to obtain multiple rearranged difference samples; on this basis, the multiple difference samples are used in sequence to train the first model instance in the rearranged order. Thus, the training process of the first model instance based on the multiple difference samples can be closer to the training process of the second largest model, and the model parameters of the obtained second model instance can be closer to the model parameters of the second largest model, so that more accurate model synchronization is achieved.
[0063] In some embodiments, the rearranged plurality of first difference samples may be consistent with their order in the plurality of second samples.
[0064] In some embodiments, the rearranged plurality of second difference samples may be in the same order as the corresponding plurality of third difference samples in the plurality of first samples.
[0065] In some embodiments, the rearranged plurality of second difference samples may be in the opposite order to the corresponding plurality of third difference samples in the plurality of first samples. Thus, by enabling the first model instance to forget the later learned samples first, the model parameters of the obtained second model instance can be closer to the model parameters of the second largest model, thereby achieving more accurate model synchronization.
[0066] In some embodiments, a plurality of first difference samples and a plurality of second difference samples may be mixed and input into the first model instance to train it. In some embodiments, a plurality of first difference samples may be first applied to train the first model instance, and then a plurality of first difference samples may be applied to train the first model instance.
[0067] In some embodiments, training the first model instance using multiple difference samples may also include: training the first model instance using multiple second difference samples to obtain a third model instance; and training the third model instance using multiple first difference samples to obtain the second model instance.
[0068] Therefore, by first applying the second difference sample for model training and then using the first difference sample for model training, the first model instance can be further synchronized more accurately to the model instance corresponding to the above-mentioned second largest model.
[0069] In some exemplary embodiments, the central storage service may include a storage module and a logic module. The storage module may be a kv type storage unit, which may store three types of lists: a sample list <sample list, prompt_list>, a model name list <model name list, model_list>, and a model list <model name, seq_list>. The sample list stores all samples involved in all large models and the unique sample identification information corresponding to each sample; the model name list stores the model names corresponding to all large models; the name of the model list is the model name corresponding to the list, and the list stores the sample identification information of each sample used by the large model in the training phase in order.
[0070] In some exemplary embodiments, after the central storage service receives a synchronization instruction, the corresponding model list can be found through the model name through the logic module of the central storage service, and the sample identification information in the two model lists can be compared to determine the identification information of the difference sample; then, based on the identification information of the difference sample, the corresponding sample can be obtained in the sample list, and the corresponding sample can be rewritten and sorted, and then sent to the corresponding client together with the synchronization instruction.
[0071] In some exemplary embodiments, when performing a difference comparison between two model lists, the sample identification information in the two model lists can be first sorted according to a preset rule (for example, in alphabetical order or by number), and then the sorted lists are compared. In this way, the efficiency of the difference comparison can be further improved.
[0072] In some exemplary embodiments, for example, the samples corresponding to the first large model include A, B, C, and D, and the samples corresponding to the second large model include F, B, E, and A; when comparing the differences, the samples of the two large models are first sorted into A, B, C, D and A, B, E, and F, respectively, and then the first difference samples E and F and the third difference samples C and D can be determined; the third difference samples C and D are rewritten to obtain the corresponding second difference samples C1 and D1; then, they are rearranged according to their original order to obtain difference samples C1, D1, F, and E, and the above difference samples are sent to the client together with the synchronization instruction.
[0073] In some embodiments, after training to obtain the second model instance, if the training samples of the second largest model are updated (that is, the second largest model is further trained with new samples), the client corresponding to the second largest model can update the new samples to the central storage service; after receiving the new samples, the central storage service can synchronize the new samples to the client running the second model instance to ensure synchronization and consistency between the second model instance and the second largest model.
[0074] In some embodiments, the client can provide inference services based on the first model instance being trained during the synchronization operation.
[0075] Therefore, during the synchronization process, reasoning services are continuously provided to avoid service interruptions caused by model synchronization.
[0076] Figure 3 A schematic diagram of a model synchronization method according to an exemplary embodiment of the present disclosure is shown.
[0077] In some exemplary embodiments, Figure 3 As shown, the user can use the console 310 to trigger the model synchronization method for the large model. The console 310 can be, for example, a web page console. The user can select the large model (i.e., the second large model) that he wants to synchronize and the model instance (the first model instance) that needs to be synchronized and its corresponding client in the console 310 according to the needs. The central storage service 320 can store multiple samples used in the training phase corresponding to each of the multiple large models. The client 330 can run the first model instance corresponding to the first large model.
[0078] When the user issues the above-mentioned synchronization instruction through the console 310, the central storage service 320 can obtain multiple difference samples by executing the above-mentioned method, and send the multiple difference samples and the synchronization instruction to the client 330. The sidecar component corresponding to the first model instance on the client 330 receives the above-mentioned synchronization information, and sends the above-mentioned multiple difference samples to the first model instance in sequence to complete the training of the first model instance.
[0079] In some embodiments, a model synchronization method for a large model is provided. A central storage service stores a plurality of first samples used by a first large model in a training phase and a plurality of second samples used by a second large model in a training phase, and a client runs a first model instance corresponding to the first large model. Figure 4 As shown, the method includes: step S401, receiving multiple difference samples and synchronization instructions from a central storage service, the multiple difference samples include multiple first difference samples, and the multiple first difference samples are samples included in the multiple second samples but not included in the multiple first samples; and step S402, performing a synchronization operation, the synchronization operation includes using the multiple difference samples to train a first model instance to synchronize the first model instance into a second model instance having the reasoning capability of a second large model.
[0080] Understandably, Figure 4 The operations and effects of steps S401 to S402 can be referred to in Figure 2 Steps S201-S202 in are not described in detail here.
[0081] In some embodiments, the multiple difference samples may also include multiple second difference samples, and the multiple second difference samples can be obtained by performing the following operations through the central storage service: obtaining multiple third difference samples, the multiple third difference samples are samples included in the multiple first samples but not included in the multiple third samples; and rewriting each third difference sample in the multiple third difference samples to obtain a second difference sample corresponding to each third difference sample, the second difference sample containing a prompt text for guiding the model to forget the corresponding third difference sample.
[0082] In some embodiments, the central storage service records a first usage order of multiple first samples in the training stage of the first large model and a second usage order of multiple second samples in the training stage of the second large model, and the acquisition of multiple difference samples may also include: sorting the multiple first difference samples and the multiple second difference samples according to the first usage order and the second usage order, respectively, to obtain multiple difference samples based on the sorted multiple first difference samples and the sorted multiple second difference samples; and wherein, training the first model instance using the multiple difference samples may include: applying each difference sample in the multiple difference samples in turn to train the first model instance.
[0083] In some embodiments, training the first model instance using multiple difference samples may include: training the first model instance using multiple second difference samples to obtain a third model instance; and training the third model instance using the multiple first difference samples to obtain the second model instance.
[0084] In some embodiments, during the synchronization operation, the client can provide inference services based on the first model instance being trained.
[0085] In some embodiments, each sample in the plurality of first samples and the plurality of second samples may include a question text and a corresponding answer text.
[0086] In some embodiments, Figure 5As shown, a model synchronization device 500 for a large model is provided. The central storage service stores a plurality of first samples used by the first large model in the training phase and a plurality of second samples used by the second large model in the training phase, and the client runs a first model instance corresponding to the first large model. The above-mentioned device 500 includes: a first acquisition unit 510, configured to acquire a plurality of difference samples based on the central storage service, the plurality of difference samples including a plurality of first difference samples, the plurality of first difference samples being samples included in the plurality of second samples but not included in the plurality of first samples; and a sending unit 520, configured to send a plurality of difference samples and a synchronization instruction to the client, the synchronization instruction being used to instruct the client to complete the synchronization operation, the synchronization operation including training the first model instance using the plurality of difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
[0087] It is understood that the operations and effects of the units 510 and 520 in the device 500 can be referred to as Figure 2 Steps S201-S202 in are not described in detail here.
[0088] In some embodiments, the multiple difference samples also include multiple second difference samples, and obtaining the multiple second difference samples may include: obtaining multiple third difference samples, the multiple third difference samples are samples included in the multiple first samples but not included in the multiple third samples; and rewriting each third difference sample in the multiple third difference samples to obtain a second difference sample corresponding to each third difference sample, the second difference sample including a prompt text for guiding the model to forget the corresponding third difference sample.
[0089] In some embodiments, the central storage service may record a first usage order of multiple first samples in the training stage of the first large model and a second usage order of multiple second samples in the training stage of the second large model. The first acquisition unit may also be configured to: sort the multiple first difference samples and the multiple second difference samples according to the first usage order and the second usage order, respectively, to obtain multiple difference samples based on the sorted multiple first difference samples and the sorted multiple second difference samples; and wherein, training the first model instance using the multiple difference samples may include: sequentially applying each difference sample in the multiple difference samples to train the first model instance.
[0090] In some embodiments, training the first model instance using multiple difference samples may include: training the first model instance using multiple second difference samples to obtain a third model instance; and training the third model instance using the multiple first difference samples to obtain the second model instance.
[0091] In some embodiments, Figure 6As shown, a model synchronization device 600 for a large model is provided. The central storage service stores a plurality of first samples used by the first large model in the training phase and a plurality of second samples used by the second large model in the training phase, and the client runs a first model instance corresponding to the first large model. The above-mentioned device 600 includes: a receiving unit 610, configured to receive a plurality of difference samples and synchronization instructions from the central storage service, the plurality of difference samples including a plurality of first difference samples, and the plurality of first difference samples are samples included in the plurality of second samples but not included in the plurality of first samples; and an execution unit 620, configured to perform a synchronization operation, the synchronization operation including training the first model instance using the plurality of difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
[0092] It is understood that the operations and effects of the units 610 to 620 in the device 600 can be referred to as Figure 4 Steps S401-S402 in are not described in detail here.
[0093] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.
[0094] refer to Figure 7 , a block diagram of an electronic device 700 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0095] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0096] Multiple components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 can be any type of device that can input information to the electronic device 700. The input unit 706 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 707 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 708 can include but is not limited to a disk, an optical disk. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0097] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the above-mentioned model synchronization method for large models. For example, in some embodiments, the above-mentioned model synchronization method for large models may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the above-mentioned model synchronization method for large models may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the above-mentioned model synchronization method for a large model in any other appropriate manner (for example, by means of firmware).
[0098] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0099] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0100] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0102] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0103] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0104] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0105] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.
Claims
1. A model synchronization method for a large model, wherein: The central storage service stores a plurality of first samples used by the first large model in the training phase and a plurality of second samples used by the second large model in the training phase, and the client runs a first model instance corresponding to the first large model. The method includes: Acquire a plurality of difference samples based on the central storage service, the plurality of difference samples including a plurality of first difference samples, the plurality of first difference samples being samples included in the plurality of second samples but not included in the plurality of first samples; and The multiple difference samples and synchronization instructions are sent to the client, where the synchronization instructions are used to instruct the client to complete a synchronization operation, and the synchronization operation includes training the first model instance using the multiple difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
2. The method according to claim 1, wherein: The plurality of difference samples further include a plurality of second difference samples, and obtaining the plurality of second difference samples includes: Acquire a plurality of third difference samples, where the plurality of third difference samples are samples included in the plurality of first samples but not included in the plurality of third samples; and Each third difference sample among the plurality of third difference samples is rewritten to obtain a second difference sample corresponding to each third difference sample, wherein the second difference sample includes a prompt text for guiding the model to forget the corresponding third difference sample.
3. The method according to claim 2, wherein: The central storage service records a first usage order of the plurality of first samples in the training phase of the first large model and a second usage order of the plurality of second samples in the training phase of the second large model, and the obtaining of the plurality of difference samples comprises: The plurality of first difference samples and the plurality of second difference samples are sorted according to the first use order and the second use order respectively, so as to obtain the plurality of difference samples based on the sorted plurality of first difference samples and the sorted plurality of second difference samples; and wherein, The using the plurality of difference samples to train the first model instance comprises: Each difference sample in the plurality of difference samples is sequentially applied to train the first model instance.
4. The method according to claim 2 or 3, wherein: The using the plurality of difference samples to train the first model instance comprises: training the first model instance using the plurality of second difference samples to obtain a third model instance; and The third model instance is trained using the plurality of first difference samples to obtain the second model instance.
5. The method according to any one of claims 1 to 4, wherein: During the synchronization operation, the client provides an inference service based on the first model instance being trained.
6. The method according to any one of claims 1 to 5, wherein: Each sample in the plurality of first samples and the plurality of second samples includes a question text and a corresponding answer text.
7. A model synchronization method for a large model, wherein: The central storage service stores a plurality of first samples used by the first large model in the training phase and a plurality of second samples used by the second large model in the training phase, and the client runs a first model instance corresponding to the first large model. The method includes: receiving a plurality of difference samples and a synchronization instruction from the central storage service, the plurality of difference samples comprising a plurality of first difference samples, the plurality of first difference samples being samples included in the plurality of second samples but not included in the plurality of first samples; and Performing a synchronization operation includes training the first model instance using the multiple difference samples to synchronize the first model instance to a second model instance having reasoning capabilities of the second large model.
8. The method according to claim 7, wherein: The plurality of difference samples further include a plurality of second difference samples, and the plurality of second difference samples are obtained by the central storage service performing the following operations: Acquire a plurality of third difference samples, where the plurality of third difference samples are samples included in the plurality of first samples but not included in the plurality of third samples; and Each third difference sample among the plurality of third difference samples is rewritten to obtain a second difference sample corresponding to each third difference sample, wherein the second difference sample includes a prompt text for guiding the model to forget the corresponding third difference sample.
9. The method according to claim 8, wherein: The central storage service records a first usage order of the plurality of first samples in the training phase of the first large model and a second usage order of the plurality of second samples in the training phase of the second large model, and the acquisition of the plurality of difference samples further includes: The plurality of first difference samples and the plurality of second difference samples are sorted according to the first use order and the second use order respectively, so as to obtain the plurality of difference samples based on the sorted plurality of first difference samples and the sorted plurality of second difference samples; and wherein, The using the plurality of difference samples to train the first model instance comprises: Each difference sample in the plurality of difference samples is sequentially applied to train the first model instance.
10. The method according to claim 8 or 9, wherein: The using the plurality of difference samples to train the first model instance comprises: training the first model instance using the plurality of second difference samples to obtain a third model instance; and The third model instance is trained using the plurality of first difference samples to obtain the second model instance.
11. The method according to any one of claims 7 to 10, wherein: During the synchronization operation, the client provides an inference service based on the first model instance being trained.
12. The method according to any one of claims 7 to 11, wherein: Each sample in the plurality of first samples and the plurality of second samples includes a question text and a corresponding answer text.
13. A model synchronization device for a large model, wherein: The central storage service stores a plurality of first samples used by the first large model in the training phase and a plurality of second samples used by the second large model in the training phase, and the client runs a first model instance corresponding to the first large model. The device includes: A first acquisition unit is configured to acquire a plurality of difference samples based on the central storage service, wherein the plurality of difference samples include a plurality of first difference samples, and the plurality of first difference samples are samples included in the plurality of second samples but not included in the plurality of first samples; and A sending unit is configured to send the multiple difference samples and a synchronization instruction to the client, wherein the synchronization instruction is used to instruct the client to complete a synchronization operation, and the synchronization operation includes training the first model instance using the multiple difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
14. The device according to claim 13, wherein: The plurality of difference samples further include a plurality of second difference samples, and obtaining the plurality of second difference samples includes: Acquire a plurality of third difference samples, where the plurality of third difference samples are samples included in the plurality of first samples but not included in the plurality of third samples; and Each third difference sample among the plurality of third difference samples is rewritten to obtain a second difference sample corresponding to each third difference sample, wherein the second difference sample includes a prompt text for guiding the model to forget the corresponding third difference sample.
15. The device according to claim 14, wherein: The central storage service records a first usage order of the plurality of first samples in the training phase of the first large model and a second usage order of the plurality of second samples in the training phase of the second large model, and the first acquisition unit is further configured to: sorting the plurality of first difference samples and the plurality of second difference samples according to the first use order and the second use order respectively, so as to obtain the plurality of difference samples based on the sorted plurality of first difference samples and the sorted plurality of second difference samples; And among them, The using the plurality of difference samples to train the first model instance comprises: Each difference sample in the plurality of difference samples is sequentially applied to train the first model instance.
16. The device according to claim 14 or 15, wherein: The using the plurality of difference samples to train the first model instance comprises: training the first model instance using the plurality of second difference samples to obtain a third model instance; and The third model instance is trained using the plurality of first difference samples to obtain the second model instance.
17. A model synchronization device for a large model, wherein: The central storage service stores a plurality of first samples used by the first large model in the training phase and a plurality of second samples used by the second large model in the training phase, and the client runs a first model instance corresponding to the first large model. The device includes: a receiving unit configured to receive a plurality of difference samples and a synchronization instruction from the central storage service, the plurality of difference samples including a plurality of first difference samples, the plurality of first difference samples being samples included in the plurality of second samples but not included in the plurality of first samples; and An execution unit is configured to perform a synchronization operation, wherein the synchronization operation includes training the first model instance using the multiple difference samples to synchronize the first model instance to a second model instance having the reasoning capability of the second large model.
18. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.
19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-12.
20. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Method and equipment for realizing model updating
CN113159332A
Model training method and device, electronic equipment and storage medium
CN115329956A
Deep learning model training method and device, inference method and device, equipment and medium
CN117744732A
Method for implementing model update and device thereof
US20220366310A1
