A large model data storage method for multiple scenarios
By counting scene attributes during the reasoning process of the large model, and classifying and storing the model data according to this value, the problem of low professionalism and low service quality of the large model in each application scenario is solved, and the storage resources are affected by the problem. Efficient data management and service quality improvement under limited circumstances.
Patent Information
- Application Number
- CN202410092978.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-22
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-01-22
AI Technical Summary
When storage resources are limited, the professionalism and service quality of the large model in various application scenarios is not high, mainly due to the low quality of the data set corpus and the lack of wide coverage.
By counting the scene attributes according to the corresponding relationship of the calculation data and the scenario attributes in the inference process of the target model, the reference count value of the scene attribute is obtained, and the model data is classified according to this value to store it into different storage resources in different storage resources , To provide different service quality.
In the case of limited storage resources, it provides storage resources with high performance and low latency for strong professional model data, which has improved the service quality and professionalism of large models in each application scenario.
Smart Images

Figure CN118228821B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and in particular, relates to a large model data storage method for multiple scenarios. Background Art
[0002] Generally speaking, the training of large models follows a certain process, including pre-training, supervised fine-tuning, reward modeling, and reinforcement learning. The pre-training stage is the starting point of any large model training and the main stage of large model training, which occupies more than 95% of the model training time. It trains a basic model through a huge data set as the basis of the large model.
[0003] However, the corpus in the dataset used for pre-training is mainly crawled from the Internet, with the characteristics of large quantity, low quality, and no annotations, and is not highly professional. For example, the corpus of GPT-3 includes 67% of regular web crawling datasets, 15% of clean crawling datasets (such as ad-free), and 18% of high-quality training corpus datasets from Github, Wikipedia, papers, stock trading information, etc. It can be seen that the proportion of high-quality corpus is not high, and it covers various scenarios and fields, resulting in a lower proportion of high-quality corpus in each scenario and field, affecting the professionalism of the large model.
[0004] Therefore, a method for processing large model data for multiple scenarios is needed to improve the professionalism and service quality of large models in various application scenarios under the condition of limited storage resources. Summary of the invention
[0005] The embodiments of the present application provide a large model data storage method for multiple scenarios, which can solve the problem of low professionalism and service quality of large models in various application scenarios when storage resources are limited.
[0006] The present application provides a large model data storage method for multiple scenarios, including:
[0007] In the process of target model inference, the scene attributes are counted according to the correspondence between the participating calculation data and the scene attributes to obtain the reference count value of the scene attributes, wherein the target model is obtained by merging multiple scene models, the scene attributes are defined according to the corpus source and the corresponding scene corresponding to the model data, and the participating calculation data are the data participating in the feedforward neural network calculation in the target model;
[0008] According to the reference count value of the scene attribute, the model data corresponding to the scene attribute is classified and stored in different storage resources for subsequent reasoning applications of the target model.
[0009] The above method uses the target model to participate in the calculation of data in the process of reasoning application, records the number of references of the scene attributes corresponding to these data, and obtains the reference count value of the scene attribute. This shows that the scene attribute with a higher reference count value has a higher applicability and relevance to the reasoning application, that is, the model data corresponding to the scene attribute is considered to have a strong professionalism in the reasoning application. Since the scene attribute is defined according to the corpus source and the corresponding scene corresponding to the model data, the service level of different scenes can be distinguished. Therefore, the model data is classified according to the reference count value of the scene attribute and stored in different storage resources to provide different service qualities for the reasoning application. In the case of limited storage resources, providing storage resources with higher performance and lower latency for model data with strong professionalism can provide better service quality for reasoning applications.
[0010] In a possible implementation manner, before the step of counting the scene attributes according to the correspondence between the participating calculation data and the scene attributes, the step further includes:
[0011] Obtain training corpora from different sources based on the definition of scene attributes;
[0012] Based on the training corpus, the basic scene model is obtained through pre-training;
[0013] The basic scene model is trained and fine-tuned to obtain multiple scene models, and the model parameters of the multiple scene models are added with scene attributes;
[0014] Merge multiple scene models to get the target model.
[0015] The above method obtains training corpora from different sources according to the definition of scene attributes, and trains them respectively to obtain basic scene models, and further trains and fine-tunes the basic scene models to obtain multiple scene models, and finally obtains the target model. This shows that the model data in the target model has scene attributes and has a corresponding relationship with the scene attributes.
[0016] In a possible implementation, the steps of classifying the model data corresponding to the scene attributes according to the reference count values of the scene attributes and storing them in different storage resources include:
[0017] According to the reference count value of the scene attribute, the model data corresponding to the scene attribute is classified to obtain classified data;
[0018] The classified data includes first-category data and second-category data; a reference count value of a scene attribute corresponding to any model data in the first-category data is greater than a reference count value of a scene attribute corresponding to any model data in the second-category data;
[0019] The first type of data is stored in the first type of storage resource, and the second type of data is stored in the second type of storage resource;
[0020] The read and write performance corresponding to the first type of storage resources is higher than the read and write performance corresponding to the second type of storage resources, and the network delay corresponding to the first type of storage resources is lower than the network delay corresponding to the second type of storage resources.
[0021] The above method classifies the model data corresponding to the scene attributes according to the reference count value, and stores the model data with high scene attribute reference count values in storage resources with higher performance and lower latency, and stores the model data with low scene attribute reference count values in storage resources with lower performance and higher latency. Different storage resources are used for model data with different reference count values, so that when the model reads data, it can ensure that the model data that needs to be read frequently can be read at a high speed, which meets the reading requirements of the model data while reducing the cost of data storage. In other words, when storage resources are limited, through reasonable configuration, storage resources are effectively utilized to achieve better reasoning application service quality.
[0022] In a possible implementation, the step of classifying the model data corresponding to the scene attribute according to the reference count value of the scene attribute includes:
[0023] The model data corresponding to the scene attributes are periodically classified with the first preset time length as a period.
[0024] In a possible implementation, the classified data further includes third-category data, a reference count value of a scene attribute corresponding to any model data in the third-category data is smaller than a reference count value of a scene attribute corresponding to any model data in the second-category data, and the method further includes:
[0025] When the storage time of the third type of data is longer than the second preset time, the third type of data is discarded, and the second preset time is longer than the first preset time.
[0026] The above method further reduces storage costs by discarding model data corresponding to scene attributes with low long-term reference times, increases the proportion of model data with higher professionalism in the model data, and improves the professionalism of the model.
[0027] In a possible implementation, the method further includes:
[0028] At the end of the cycle, the low-participation model data is stored as an object, and the low-participation model data is the model data whose corresponding scene attribute reference count value is zero.
[0029] The above method stores the model data that is not involved in the calculation in an object storage after the cycle ends. It uses the characteristics of object storage that do not require the maintenance of complex directory and file structures, and do not require the purchase of expensive storage devices. It meets the storage needs of large amounts of data while achieving better cost for long-term preservation of large-scale data.
[0030] In a possible implementation, after the step of storing the low participation model data in an object at the end of the cycle, the method further includes:
[0031] When the object storage duration of the low participation model data is greater than the second preset duration, the low participation model data is discarded.
[0032] The above method discards the model data when the scene attributes corresponding to the model data have not been referenced for a long time, processes the redundant data in the model, further reduces the storage cost, reduces the proportion of non-professional model data in the model data, and improves the professionalism of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 It is a flowchart of a large model data storage method for multiple scenarios provided in an embodiment of the present application;
[0035] Figure 2 It is a schematic diagram of the encoding and decoding process of the large model;
[0036] Figure 3 This is a schematic diagram of a scene attribute reference counting process provided by an embodiment of the present application;
[0037] Figure 4 is a schematic diagram of a pre-training process provided by a specific embodiment of the present application;
[0038] Figure 5 It is a schematic diagram of a process for classifying and marking scene attributes provided by an embodiment of the present application;
[0039] Figure 6 It is a schematic diagram of the process of classifying and marking vector data provided by an embodiment of the present application;
[0040] Figure 7 It is a schematic diagram of the model data classification storage process provided by a specific embodiment of the present application. DETAILED DESCRIPTION
[0041] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0042] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0043] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0044] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0045] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0046] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0047] At present, the corpus used by large models in the training process is mainly directly crawled from the Internet, with the characteristics of large quantity, low quality, no annotation, and low professionalism. For example, the corpus of GPT-3 includes 67% of regular web crawling data sets, 15% of clean crawling data sets (such as ad-free), and 18% of high-quality training corpus data sets from Github, Wikipedia, papers, stock trading information, etc., of which the proportion of high-quality corpus is not high and covers various fields. In this way, the proportion of high-quality corpus in various fields is even lower, which will directly affect the professionalism and service quality of the model.
[0048] Based on the above issues, see Figure 1 The embodiment of the present application proposes a large model data storage method for multiple scenarios, including:
[0049] Step S102: In the process of target model inference, the scene attributes are counted according to the correspondence between the participating calculation data and the scene attributes to obtain the reference count value of the scene attributes, wherein the target model is obtained by merging multiple scene models, the scene attributes are defined according to the corpus source and the corresponding scene corresponding to the model data, and the participating calculation data are the data participating in the feedforward neural network calculation in the target model;
[0050] Step S104: Classify the model data corresponding to the scene attributes according to the reference count values of the scene attributes, and store them in different storage resources for subsequent reasoning applications of the target model.
[0051] Among them, the target model is a model with a huge number of parameters, generally with a parameter volume of more than one billion, including but not limited to large language models, general large models, vertical large models, AIGC (AI-Generated Content) and specific implementations of more large models in the future. The large model is not limited to a single model file, but can be a collection of multiple model files that jointly provide inference application services to the outside world. For example, the inference program in the large model system loads multiple model files and integrates large model data to provide external services; the training program in the large model system loads multiple model files through multiple computing nodes or NPUs (Neural Processing Units), or splits a single model file into multiple model files, calculates in parallel, and aggregates weight data to save as a large model.
[0052] The data in the large model, that is, the model parameters, is a collection of tensor data related to the model structure. For example, the transformer model using the decoder-only framework consists of multiple identical layers, each of which includes a self-attention block and a multi-layer perceptron (MLP) block. The model parameters of the self-attention block include the weight matrix and bias of Q, K, V, and the weight matrix and bias of the output O; the multi-layer perceptron block consists of 2 linear layers, including the weight matrices and biases of these linear layers. The self-attention block and the multi-layer perceptron block each have a layer normalization, which contains 2 trainable model parameters. In addition, the word embedding matrix also has a large number of parameters.
[0053] The data involved in the calculation includes the data calculated by the feedforward neural network (FFN), namely the prompt word, the parameters of the feedforward neural network, and the generated result. In the Transformer architecture, MLP is actually FFN. The parameters of the feedforward neural network here are the weight matrix and bias of the MLP linear layer; the prompt word is in the form of vector data as the input of the feedforward neural network; the generated result is in the form of vector data as the output of the feedforward neural network.
[0054] See also Figure 2 In the process of reasoning, the general big data model takes the prompt word as input, and obtains the reasoning data by calculating the encoder m times and the decoder n times. The large model, especially the transformer (a deep learning network based on the attention mechanism) large model, includes FFN (Feed Forward Neural Network) calculation in both the encoder and the decoder in its model architecture, and the vector data of each calculation result describes the process of prompting the prediction result. When the vector data participates in the FFN calculation, the corresponding scene attribute is referenced and counted to determine the reference count value of the scene attribute, which shows the applicability and relevance of the scene attribute to the reasoning application.
[0055] In this embodiment, the model data corresponds to scenario attributes, which are defined by the model designer based on the corpus source and scenario corresponding to the model data. The corpus source includes datasets such as regular web crawling datasets, clean crawling datasets, and professional datasets such as Github, Wikipedia, papers, and stock trading information. The scenario is an application scenario that participates in the calculation of data, such as medical consultation scenarios, teaching scenarios, and financial scenarios. The scenario attributes are defined by the designer according to different values and meanings based on needs, and can be related to a certain profession or a certain dialogue application scenario.
[0056] In an optional implementation, when model data is referenced for calculation, the scene attribute corresponding to the data involved in the calculation is determined, and the scene attribute is counted once to obtain the reference count value of the scene attribute. Specifically, a separate vector database is used to record the number of times each scene attribute is referenced each time vector data is referenced, and each time it is used, it is increased by 1 to obtain the reference count value of each scene attribute. Figure 3 When vector data a is referenced, if its corresponding scene attribute is determined to be n, the reference count value of scene attribute n changes from Sn to Sn+1, and the reference count values of other scene attributes remain unchanged.
[0057] Regarding step S104, in an optional implementation, the step of classifying the model data corresponding to the scene attribute according to the reference count value of the scene attribute includes:
[0058] The model data corresponding to the scene attributes are periodically classified with the first preset time length as a period.
[0059] In an optional implementation, the model data corresponding to the scene attributes are classified according to the reference count values of all scene attributes, and the model data of different categories are stored in different storage resources respectively, and the corresponding model data are allocated to different storage resources according to the reference count values corresponding to the scene attributes.
[0060] In a specific implementation, after determining the address or resource location where the data needs to be stored, the storage resource monitoring tool can be used to measure the storage resource's IOPS (input / output operations per second), throughput, response time and other performance indicators, and the configuration program can be used to achieve rapid deployment of data to resources.
[0061] The beneficial effects of this embodiment are:
[0062] This embodiment uses the target model to participate in the calculation of data during the reasoning application process, records the number of references to the scene attributes corresponding to these data, and obtains the reference count value of the scene attribute. This shows that the scene attribute with a higher reference count value has a higher applicability and relevance to the reasoning application, that is, the model data corresponding to the scene attribute is considered to have a strong professionalism in the reasoning application. Since the scene attribute is defined according to the corpus source and the corresponding scene corresponding to the model data, the service level of different scenes can be distinguished. Therefore, the model data is classified according to the reference count value of the scene attribute and stored in different storage resources to provide different service qualities for the reasoning application. In the case of limited storage resources, providing storage resources with higher performance and lower latency for model data with strong professionalism can provide better service quality for reasoning applications.
[0063] According to the above embodiment, in yet another embodiment:
[0064] The step of counting the scene attributes according to the corresponding relationship between the participating calculation data and the scene attributes also includes:
[0065] Obtain training corpora from different sources based on the definition of scene attributes;
[0066] Based on the training corpus, the basic scene model is obtained through pre-training;
[0067] The basic scene model is trained and fine-tuned to obtain multiple scene models, and the model parameters of the multiple scene models are added with scene attributes;
[0068] Merge multiple scene models to get the target model.
[0069] See also Figure 4 The model designer defines the scene attributes. When training the target model, the pre-trained corpus is first obtained from different sources of each scene according to the definition of the scene attributes. These classified corpora are trained to obtain multiple basic scene models and FFN vectorized data with scene attributes, and multiple scene models are obtained respectively, which are finally merged into a large model.
[0070] The beneficial effects of this embodiment are:
[0071] This embodiment obtains training corpora from different sources according to the definition of scene attributes, and trains them respectively to obtain basic scene models, and further trains and fine-tunes the basic scene models to obtain multiple scene models, and finally obtains the target model. This shows that the model data in the target model carries scene attributes and has a corresponding relationship with the scene attributes.
[0072] In practice, we often encounter problems such as limited storage resource costs, insufficient service quality in specific scenarios, and insufficient professional capabilities of large models. To improve the service capabilities of large models in specific scenarios, we can use more specific corpora in more fields, introduce fine-tuning guided by field experts, and strengthen learning to improve the professional capabilities of large models, but these methods will lead to an increase in storage resource costs.
[0073] Based on the above problems, the present application proposes in another embodiment according to the above embodiments:
[0074] The steps of classifying the model data corresponding to the scene attributes according to the reference count values of the scene attributes and storing them in different storage resources include:
[0075] Classify the model data corresponding to the scene attribute according to the reference count value of the scene attribute to obtain classified data;
[0076] The classified data includes first-category data and second-category data; a reference count value of a scene attribute corresponding to any model data in the first-category data is greater than a reference count value of a scene attribute corresponding to any model data in the second-category data;
[0077] The first type of data is stored in the first type of storage resource, and the second type of data is stored in the second type of storage resource;
[0078] The read and write performance corresponding to the first type of storage resources is higher than the read and write performance corresponding to the second type of storage resources, and the network delay corresponding to the first type of storage resources is lower than the network delay corresponding to the second type of storage resources.
[0079] In an optional implementation, the scene attributes can be classified according to the reference count value of the scene attribute and multiple preset values. Exemplarily, when the reference count value of the scene attribute is greater than the preset value a, it is marked as a Class A scene attribute; when the reference count value of the scene attribute is greater than the preset value b and less than or equal to the preset value a, it is marked as a Class B scene attribute; when the reference count value of the scene attribute is greater than the preset value c and less than or equal to the preset value b, it is marked as a Class C scene attribute, and so on...wherein, a>b>c, the preset value a, preset value b, and preset value c can be formulated by the model designer.
[0080] Alternatively, the scene attribute classification interval can be determined based on the reference count values of all scene attributes and the category of storage resources. For example, if the data involved in the calculation corresponds to 6 scene attributes, namely A, B, C, D, E, and F, and their reference count values are 220, 470, 350, 560, 410, and 490 respectively, and there are 3 categories of storage resources, then the scene attributes can be marked as D and F as Class I scene attributes, A and C as Class III scene attributes, and B and E as Class II scene attributes according to the scene attribute reference count values corresponding to the above 6 scene attributes.
[0081] In an alternative embodiment, see Figure 5 After classifying the scene attributes, the scene attributes are marked as Hot, Normal, and Cold in turn according to the reference count of the scene attributes at regular intervals. Optional, see Figure 6 , according to the marking of the scene attributes, the corresponding vector data is marked as Hot, Normal, and Cold in turn.
[0082] In this embodiment, the first category of data and the second category of data are two categories of model data in the classified scene attributes, not a fixed category of data. The first category of storage resources and the second category of storage resources are two categories of storage resources with different read and write performance and network latency, not a fixed category of storage resources. Storage resources refer to the hardware and software infrastructure used to store and process large-scale data and models. These resources include but are not limited to storage devices, storage networks, storage management systems, distributed storage systems, etc. The reading speed of the first category of storage resources is greater than that of the second category of storage resources, and its storage performance is higher than that of the second category of storage resources and its latency is lower than that of the second category of storage resources.
[0083] During each FFN calculation, vector data parameters are referenced from the large model, and the reference count is calculated based on the corresponding scene classification attribute. Then, all vector data in the scene are marked according to the count and a certain strategy is used to store the large model data in a classified manner. For vector data marked as Hot, high-performance, low-latency storage resources are configured. For vector data marked as Normal or Cold, storage resources with lower performance and greater latency are selected.
[0084] Among them, high performance and low latency of storage resources are relative concepts. For example, storage resource A: configure a solid-state drive with high read and write performance, and when distributed storage is used, it is necessary to use technologies such as Smart NIC (Smart Network Interface Card) to reduce communication overhead; storage resource B: configure a mechanical hard disk with low read and write performance, and when distributed storage is used, there is no need to consider reducing communication overhead. Comparing the two, storage resource A is a high-performance, low-latency storage resource, and the cost of configuration and deployment is also high.
[0085] The beneficial effects of this embodiment are:
[0086] This embodiment classifies the model data corresponding to the scene attributes according to the reference count value, and stores a class of model data with high scene attribute reference count values in a storage resource with higher performance, and a class of model data with low scene attribute reference count values in a storage resource with lower performance. Different storage resources are used for data with different reference count values, so that when the model reads data, it can ensure that the frequently read data can be read at a high speed, which meets the reading requirements of the model data and reduces the cost of data storage. In other words, when storage resources are limited, through reasonable configuration, storage resources are effectively utilized to achieve better reasoning application service quality.
[0087] According to the above embodiment, in yet another embodiment:
[0088] The classified data further includes third-category data, a reference count value of a scene attribute corresponding to any model data in the third-category data is less than a reference count value of a scene attribute corresponding to any model data in the second-category data, and the method further includes:
[0089] When the storage time of the third type of data is longer than the second preset time, the third type of data is discarded, and the second preset time is longer than the first preset time.
[0090] Since large models involve massive amounts of data, only a small portion of the data may be involved in the calculation within the first preset period of time, but data objects that are not involved in the calculation may still be referenced, so the storage cost of this part of the data needs to be considered. Object storage does not require the maintenance of complex directory and file structures, nor does it require the purchase of expensive storage devices, which can achieve a better cost for long-term storage of large-scale data.
[0091] In an optional embodiment, at the end of the cycle, the low participation model data is stored as an object, and the low participation model data is model data whose corresponding scene attribute reference count value is zero. When the duration of the low participation model data being stored as an object is greater than the second preset duration, the low participation model data is discarded.
[0092] The above implementation method will process the vector data that is not involved in the calculation, and the storage method can be object storage, which further reduces the cost of storage resources. The data will be discarded after exceeding a certain time threshold. This method of automatically optimizing the large model using a vector database can not only process the redundant data of the large model, but also reasonably allocate storage resources, while taking into account the quality of reasoning services, it can effectively reduce the cost of storage resources. In this process, the data of the large model will be greatly optimized, especially in the situational awareness process for specific industry applications, it can perceive the commonly used prompt words in the industry and the parameter data in the multi-layer perception block (MLP, Multi-Layer Perceptron) of the large model, especially when facing different scenarios, it can provide different levels of service quality.
[0093] See also Figure 7 In a specific implementation, the data involved in the calculation is recorded through the vector database when the model data participates in the calculation, and a reference count is performed according to the scene attributes corresponding to the data involved in the calculation. At regular intervals, the scene attributes are marked as Hot, Normal, and Cold in turn according to the reference counts of the scene attributes. And according to the marking of the scene attributes, the corresponding vector data are marked as Hot, Normal, and Cold in turn. For the vector data marked as Hot, high-performance, low-latency storage resources are configured. For the vector data marked as Normal and Cold, storage resources with lower performance and greater latency are selected. For the vector data marked as Cold, aging processing is performed after exceeding a certain time threshold, and it is discarded after a period of time.
[0094] The beneficial effects of this embodiment are:
[0095] This embodiment stores the data that does not participate in the calculation in an object storage after the cycle ends. It utilizes the characteristics of object storage that does not need to maintain complex directory and file structures, and does not need to purchase expensive storage devices. It meets the storage needs of a large amount of data while achieving a better cost for long-term storage of large-scale data. It discards low-participation model data after a long time, processes redundant data in the model, further reduces storage costs, reduces the proportion of non-professional model data in the model data, and improves the professionalism of the model.
[0096] In an optional embodiment, the vector database used in the present application can store model data and process vector data, that is, after the data is calculated by FFN, the data used in the calculation and the result data obtained by the calculation are stored in the vector database.
[0097] According to the above embodiment, in yet another embodiment:
[0098] Determine that the reference count value of the specified scene attribute is less than the first preset value or the reference count value of the specified scene attribute is less than the second preset value. When the specified scene attribute is an indispensable scene in the reasoning application, the reference count value of the specified scene attribute is weighted or biased according to a preset counting strategy to obtain an adjusted reference count value of the specified scene attribute.
[0099] For some scenarios, the corresponding model data is used less frequently but is more important, so this part of the data also needs to be retained.
[0100] The preset counting strategy may be set by a model designer or according to application requirements.
[0101] The beneficial effects of this embodiment are:
[0102] This embodiment weights or biases the reference count value of the specified scene attribute when the reference count value is insufficient, thereby improving the reference count value of the specified scene attribute, avoiding data in the scene from being discarded, and ensuring data integrity of the application scene.
[0103] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0104] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in one or more computer-readable storage media. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0106] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0107] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0108] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A large model data storage method for multiple scenarios, characterized in that: include: In the process of target model inference, the scene attributes are counted according to the correspondence between the participating calculation data and the scene attributes to obtain the reference count value of the scene attributes, wherein the target model is obtained by merging multiple scene models, the scene attributes are defined according to the corpus source and the corresponding scene corresponding to the model data, and the participating calculation data are data participating in the feedforward neural network calculation in the target model; Classifying the model data corresponding to the scene attribute according to the reference count value of the scene attribute, and storing them in different storage resources for subsequent reasoning application of the target model; The method further comprises: Determine that the reference count value of the specified scene attribute is less than a first preset value or the reference count value of the specified scene attribute is less than a second preset value. When the specified scene attribute is an indispensable scene in the reasoning application, the reference count value of the specified scene attribute is weighted or biased according to a preset counting strategy to obtain an adjusted reference count value of the specified scene attribute.
2. The method for storing large model data for multiple scenarios according to claim 1 is characterized in that: Before the step of counting the scene attributes according to the corresponding relationship between the participating calculation data and the scene attributes, the step further includes: Acquire a training corpus from different sources according to the definition of the scene attributes; Pre-training to obtain a basic scene model according to the training corpus; Training and fine-tuning the basic scene model to obtain multiple scene models, wherein the model parameters of the multiple scene models are added with the scene attributes; The multiple scene models are combined to obtain the target model.
3. The multi-scenario oriented large model data storage method according to claim 1 or 2, characterized in that: The step of classifying the model data corresponding to the scene attribute according to the reference count value of the scene attribute and storing them in different storage resources comprises: Classifying the model data corresponding to the scene attribute according to the reference count value of the scene attribute to obtain classified data; The classified data includes first-category data and second-category data; a reference count value of a scene attribute corresponding to any model data in the first-category data is greater than a reference count value of a scene attribute corresponding to any model data in the second-category data; storing the first category data in a first category storage resource, and storing the second category data in a second category storage resource; The read and write performance corresponding to the first type of storage resources is higher than the read and write performance corresponding to the second type of storage resources, and the network delay corresponding to the first type of storage resources is lower than the network delay corresponding to the second type of storage resources.
4. The multi-scenario oriented large model data storage method according to claim 3, characterized in that: The step of classifying the model data corresponding to the scene attribute according to the reference count value of the scene attribute comprises: The model data corresponding to the scene attribute are periodically classified with a first preset time length as a period.
5. The multi-scenario large model data storage method according to claim 4 is characterized in that: The classified data further includes third-category data, a reference count value of a scene attribute corresponding to any model data in the third-category data is smaller than a reference count value of a scene attribute corresponding to any model data in the second-category data, and the method further includes: When the storage time of the third type of data is longer than a second preset time, the third type of data is discarded, and the second preset time is longer than the first preset time.
6. The method for storing large model data for multiple scenarios according to claim 5 is characterized in that: Also includes: At the end of the cycle, the low participation model data is stored as an object, wherein the low participation model data is model data whose corresponding scene attribute reference count value is zero.
7. The multi-scenario oriented large model data storage method according to claim 6 is characterized in that: After the step of storing the low participation model data in an object at the end of the cycle, the following step is further included: When the object storage duration of the low participation model data is greater than the second preset duration, the low participation model data is discarded.
Citation Information
Patent Citations
Data classified storage method, device and system
CN112506433A