Large model relation graph construction method and system based on model information analysis

By obtaining and analyzing feature information in the model warehouse, judging and determining model relationships, the problems of incomplete model relationship information and inefficient manual analysis in the existing technology are solved, and efficient and automated model relationship analysis and transparency are achieved.

CN119940576AInactive Publication Date: 2025-05-06北京开放传神科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510203639.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-05-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has shortcomings in the judgment of model relationships, lacks detailed explanation of the development and evolution of the model from the base model, the model relationship information is incomplete and inconsistent, and it relies on manual analysis to be inefficient and susceptible to subjective factors.

Method used

By obtaining the feature information of each target model in the model warehouse, including base model, model parameters, model structure and performance indicators, we judge whether the preset relationship rules are met with the base model. If not, we will determine the scoring rules based on the feature information, calculate the score sum of each relationship, determine the relationship between the target model and the base model, and build a model relationship diagram.

Benefits of technology

The relationship between the target model and the base model is realized, classification efficiency is improved, artificial error is reduced, and transparency and interpretability of model decisions are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940576A_ABST
    Figure CN119940576A_ABST
Patent Text Reader

Abstract

According to the large model relation graph construction method and system based on model information analysis, the relation between the target model and the base model is automatically analyzed in the mode of combining logic inference (relation rules) and quantitative calculation (scoring rules), the classification efficiency is greatly improved, and personal errors are reduced. Meanwhile, a directed acyclic graph data structure is adopted, the relationship between the models is visually displayed, and the types and directions of the edges are clearly marked, so that the evolution path and association relationship of the models are conveniently and quickly understood, and the transparency and interpretability of model decision making are favorably improved. In addition, new model relation types and rules can be dynamically expanded, along with evolution of a large model technology, the method can be adapted to new model optimization and construction methods, and long-term applicability is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of large models, and in particular relates to a large model relationship diagram construction method and system based on model information analysis. Background Art

[0002] In recent years, with the increasing complexity of artificial intelligence (AI) models, it has become increasingly difficult to identify and understand the relationships between different models, especially in the context of the widespread use of fine-tuning technology. Modern AI models usually go through multiple versions of iteration, optimization, and adjustment. Different research teams or companies may conduct secondary development based on existing models, making the problem of model traceability increasingly prominent. In practical applications, model traceability requires comprehensive recording of the model's origin, development history, data sets used, training process, and the history of all modifications and fine-tuning. Accurately identifying and recording the relationships between models is crucial to improving the transparency of the model decision-making process.

[0003] This transparency is particularly important in areas that rely heavily on explainability, such as financial services, medical diagnosis, and legal compliance. For these areas, the decisions of AI models must not only be highly accurate, but also traceable in order to verify their rationality and compliance. For example, in financial risk control scenarios, regulators may require that every decision made by an AI model can be traced back to specific training data and modification history; in the field of medical diagnosis, doctors and patients need to clarify the training source of the model to ensure the reliability of its diagnostic recommendations. Therefore, the traceability of the model not only helps to enhance the credibility of model decisions, but also provides strong support for key business scenarios.

[0004] However, the existing technology still has major defects in model relationship judgment. At present, model traceability mainly relies on the descriptive information in the model README file or related documents, and these descriptions usually only mark the base model (BaseModel), lacking a detailed description of the evolution of the model from the base model. In addition, different developers have different standards and specifications for document writing, which may lead to incomplete and inconsistent model relationship information, and even human omissions. Therefore, accurately identifying the evolutionary relationship between models often requires a lot of manual analysis, which is not only inefficient, but also easily affected by subjective factors, affecting the accuracy and completeness of traceability. Therefore, there is an urgent need for a more efficient and automated technical means to improve the accuracy and transparency of model traceability. Summary of the invention

[0005] The present invention provides a method and system for constructing a large model relationship diagram based on model information analysis, so as to solve the problems in the prior art of lack of detailed description of the evolution of the model from the base model, incomplete and inconsistent model relationship information, and manual analysis which is not only inefficient but also easily affected by subjective factors.

[0006] In order to solve the above technical problems, the embodiments of the present invention disclose the following technical solutions:

[0007] One aspect of the present invention provides a method for constructing a large model relationship graph based on model information analysis, comprising:

[0008] Acquire feature information of each target model in the model warehouse, wherein the feature information includes at least a base model, model parameters, model structure, and performance indicators;

[0009] For each target model, determine whether any preset relationship rule is satisfied between the target model and the base model according to the feature information; each relationship rule is matched with at least one relationship, and the relationship includes at least quantization, distillation, pruning, fine-tuning, adaptation and merging;

[0010] If so, determining the relationship between the target model and the base model;

[0011] If not, determining the preset scoring rules satisfied by the target model according to the feature information, each scoring rule having a score on a relationship;

[0012] Calculate the sum of scores of each relationship between the target model and the base model based on the satisfied scoring rules, and take the relationship with the highest sum of scores as the relationship between the target model and the base model;

[0013] A model relationship graph is constructed based on the relationship between all target models and the corresponding base models.

[0014] Optionally, the acquiring feature information of each target model in the model warehouse includes:

[0015] Get the base model of the target model from the README file or inheritance chain;

[0016] Use the API method of the deep learning framework to obtain the storage space, parameter quantity, parameter type, parameter accuracy of the target model, as well as the number of neural network layers, the type and parameters of each layer, and the connection method between layers;

[0017] Get the accuracy and inference speed of the target model from the README file or technical report.

[0018] Optionally, the method further includes:

[0019] The following relationship rules are preset:

[0020] When there are multiple base models, or when a structure that integrates multiple base models is used, it is determined to be a merge relationship;

[0021] When the parameter value is less than the base model by a preset first parameter value difference, it is determined to be a pruning relationship;

[0022] When the difference between the parameter quantity and the base model does not exceed the preset second parameter quantity difference, and the parameter types are different, it is determined to be a quantitative relationship; the first parameter quantity difference is greater than the second parameter quantity difference;

[0023] When an adapter layer is added compared to the base model, it is determined as an adaptation relationship;

[0024] When the structure is reduced or the layers are reduced compared to the base model, it is determined to be a distilled relationship or a pruned relationship;

[0025] When the difference between the accuracy and the base model is lower than a preset second accuracy difference, and the difference between the target model storage space and the base model exceeds a preset space difference, or the difference between the inference speed and the base model exceeds a preset speed difference, it is determined to be a pruning relationship or a distillation relationship;

[0026] When the accuracy of the target model in processing any task is greater than that of the base model, and the difference exceeds a preset first accuracy difference, or when the inference speed is greater than that of the base model, and the difference exceeds a preset speed difference, it is determined to be a fine-tuning relationship or an adaptation relationship; the first accuracy difference is greater than the second accuracy difference;

[0027] When the accuracy of the target model is less than that of the base model, the difference is lower than the preset second accuracy difference, and the inference speed is greater than that of the base model, and the difference exceeds the preset speed difference, it is determined to be a quantization relationship or a pruning relationship.

[0028] Optionally, the method further includes:

[0029] For each relationship, a plurality of scoring rules are pre-set based on the degree of change of feature information between the target model and the base model, and each of the scoring rules has a score on the relationship.

[0030] Optionally, when there is more than one relationship with the largest total score, the relationship between the target model and the base model is determined based on user input data.

[0031] Optionally, constructing a model relationship graph based on the relationship between all target models and corresponding base models includes:

[0032] The DAG directed acyclic graph data structure is used to establish the model topology relationship, wherein the node is the model, the model includes the target model and the base model, the edge is the relationship between the target model and the base model, and the base model points to the target model;

[0033] A graphic tool is used to generate a model relationship diagram from the model topological relationship.

[0034] Another aspect of the present invention provides a large model relationship diagram construction system based on model information analysis, comprising:

[0035] A feature information acquisition module is configured to acquire feature information of each target model in the model warehouse, wherein the feature information at least includes a base model, model parameters, model structure, and performance indicators;

[0036] The relationship rule judgment module is configured to judge, for each target model, whether any preset relationship rule is satisfied between the target model and the base model according to the feature information; each relationship rule is matched with at least one relationship, and the relationship includes at least quantization, distillation, pruning, fine-tuning, adaptation and merging; if so, determine the relationship between the target model and the base model;

[0037] A scoring rule determination module, configured to determine, when a preset relationship rule is not satisfied between the target model and the base model, a preset scoring rule satisfied by the target model according to the feature information, each scoring rule having a score on a relationship;

[0038] a relationship determination module, configured to calculate the sum of scores of the target model and the base model in each relationship based on the satisfied scoring rules, and take the relationship with the highest sum of scores as the relationship between the target model and the base model;

[0039] The relationship graph construction module is configured to construct a model relationship graph based on the relationship between all target models and corresponding base models.

[0040] The present invention discloses a large model relationship diagram construction method and system based on model information analysis, which automatically analyzes the relationship between the target model and the base model by combining logical inference (relationship rules) and quantitative calculation (scoring rules), greatly improves classification efficiency and reduces human errors.

[0041] At the same time, the directed acyclic graph (DAG) data structure is used to intuitively display the relationship between models, and the edge type and direction are clearly marked, which facilitates the rapid understanding of the model's evolution path and association relationship, and helps to improve the transparency and explainability of model decisions. In addition, the present invention can dynamically expand new model relationship types and rules. With the evolution of large model technology, it can adapt to emerging model optimization and construction methods to ensure long-term applicability.

[0042] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.

[0044] Figure 1 A schematic diagram of a process for constructing a large model relationship graph based on model information analysis provided by an embodiment of the present invention;

[0045] Figure 2 A structural schematic diagram of a large model relationship diagram construction system based on model information analysis provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0047] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0048] According to the training objectives and application scenarios, in the embodiments disclosed in the present invention, the following six model relationships are taken as examples, but the method and system provided by the present invention are not limited to application to these six model relationships.

[0049] 1. Relationships formed through model performance optimization:

[0050] Use specific techniques to improve the performance of the model, such as increasing accuracy, accelerating inference speed, and reducing model size.

[0051] Quantized: The main goal is to reduce the model size and accelerate the inference process of the model. It is usually used for deployment on resource-constrained devices.

[0052] Distillation: Aims to transfer knowledge from large models to small models to maintain high performance while reducing the size of the model and improving operating efficiency.

[0053] Pruning: Reduce the size of the model and improve the inference speed by removing unimportant parameters or neurons. The goal is to make the model lightweight while minimizing the loss of accuracy.

[0054] 2. Relationships formed through model knowledge transfer:

[0055] Transfer the knowledge of existing models to new models or tasks to improve the learning efficiency and performance of the new models.

[0056] Fine-tune: Based on the pre-trained model, retrain the data of specific tasks to make the model better suited to these tasks.

[0057] Adapter: Adapts to specific tasks by adding a small number of trainable parameter layers (Adapter layers) inside the pre-trained model, aiming to retain the knowledge of the original model while improving the performance of new tasks.

[0058] 3. Model structure and strategy innovation

[0059] Innovate model structures or synthesis strategies to achieve more effective information processing capabilities in new application scenarios.

[0060] Merge: Create a more powerful or more suitable model for a specific task by combining the advantages of multiple models or strategies. This may involve techniques such as model fusion and ensemble learning.

[0061] Figure 1 A flowchart of a method for constructing a large model relationship diagram based on model information analysis provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method comprises the following steps:

[0062] Step S100: Acquire feature information of each target model in the model warehouse.

[0063] The characteristic information at least includes base model, model parameters, model structure and performance indicators.

[0064] In one embodiment disclosed in the present invention, step S100 can be implemented in the following manner:

[0065] (1) Get the base model of the target model from the README file or inheritance chain.

[0066] For example, from the "Pretrained Model" or "Base Model" section in the README file; or, from a well-documented inheritance chain / lineage, such as "BaseModel:Model C->Model B->Model A".

[0067] (2) Use the API method of the deep learning framework to obtain the storage space, parameter quantity, parameter type, parameter accuracy of the target model, as well as the number of neural network layers, the type and parameters of each layer, and the connection method between layers.

[0068] Get the model parameters of the model. The model parameters include at least storage space, parameter quantity, parameter type and parameter precision. The storage space is the space occupied by the decompressed model file on the disk; the parameter quantity is the total number of model parameters (total parameter quantity / trainable parameter quantity); the parameter type and precision can be expressed as floating point numbers (such as float32, float64), integers (such as int8, int4), etc., whether to quantize and the quantization type int8 / FP16 / dynamic quantization, etc.

[0069] Use the APIs provided by various deep learning frameworks (such as TensorFlow and PyTorch) to obtain the number and type of parameters. For example, in PyTorch, you can use model.parameters() in combination with the param.requires_grad attribute to obtain trainable parameters; in TensorFlow / Keras, you can use model.summary() or model.get_weights().

[0070] Get the structure of the model, including at least the number of neural network layers, the type and parameters of each layer, and the connection method between layers. The configuration information of each layer is as follows: layer type, such as convolutional layer, fully connected layer, Transformer layer, etc.; layer parameters, such as convolution kernel size, number of channels, hidden layer dimension, number of attention heads, etc.; connection method: the connection method between layers in the model, such as residual connection, skip connection, recurrent connection, attention type in Transformer, etc.

[0071] The information obtained by APIs of different frameworks (such as TensorFlow and PyTorch) may be slightly different and need to be processed uniformly.

[0072] (3) Obtaining the accuracy and inference speed of the target model from the README file or technical report is to obtain performance indicators under a specific evaluation data set and evaluation method. Among them, accuracy is the prediction accuracy of the model on a specific task, confidence interval / standard deviation; inference speed is the time required for one inference measured under a specified hardware environment (such as CPU model, GPU model, batch size).

[0073] Step S200: For each target model, determine whether any preset relationship rule is satisfied between the target model and the base model according to the feature information.

[0074] Each relation rule is matched with at least one relation, and the relations include at least quantization, distillation, pruning, fine-tuning, adaptation and merging.

[0075] In one embodiment disclosed in the present invention, the following relationship rules are preset:

[0076] (1) When the target model has multiple base models, or when the target model has a structure that integrates multiple base models, it is determined to be a merge relationship. That is, if the target model has multiple base models, it is determined to be a Merge relationship.

[0077] (2) When the parameter quantity of the target model is less than the parameter quantity of the base model, and the difference between the two exceeds a preset first parameter quantity difference, it is determined to be a pruning relationship, and the first parameter quantity difference is a preset larger value, such as 10. That is, if the parameter quantity of the target model is much less than that of the base model, it is determined to be a pruning relationship.

[0078] (3) When the difference between the parameter quantity of the target model and the parameter quantity of the base model does not exceed the preset second parameter quantity difference, and the parameter types are different, it is determined to be a quantitative relationship, wherein the first parameter quantity difference is greater than the second parameter quantity difference, and the second parameter quantity difference is a smaller value, such as 1. That is, if the parameter quantities of the target model and the base model are similar, but the two have different parameter example types, it is determined to be a quantitative relationship.

[0079] (4) When the target model has an additional adapter layer compared to the base model in terms of structure, it is determined to be an adaptation relationship.

[0080] (5) When the target model has a reduced structure or fewer layers compared to the base model, it is determined to be a distillation relationship or a pruning relationship.

[0081] (6) When the accuracy of the target model is compared with that of the base model, and the difference between the two is lower than the preset second accuracy difference, and the difference between the target model storage space and the base model exceeds the preset space difference, or the difference between the target model storage space and the base model reasoning speed exceeds the preset speed difference, it is determined to be a pruning relationship or a distillation relationship. The second accuracy difference is a preset smaller value, such as 0.5; the preset space difference and speed difference are both larger values. That is, if the accuracy of the target model and the base model are similar, but there are significant differences in model storage space or reasoning speed, it can be determined to be a pruning relationship or a distillation relationship.

[0082] (7) When the accuracy of the target model in processing any task is greater than that of the base model, and the difference exceeds the preset first accuracy difference, or when the inference speed is greater than that of the base model, and the difference exceeds the preset speed difference, it is determined to be a fine-tuning relationship or an adaptation relationship, wherein the first accuracy difference is greater than the second accuracy difference, which is a preset larger value. That is, the performance of the target model is significantly improved when executing a specific task, and it can be determined to be a fine-tuning relationship or an adaptation relationship.

[0083] (8) When the accuracy of the target model is less than that of the base model, and the difference between the two is less than the preset second accuracy difference, and the inference speed is greater than the inference speed of the base model, and the difference between the two exceeds the preset speed difference, it is determined to be a quantization relationship or a pruning relationship. That is, if the accuracy of the target model is slightly lower than that of the base model, but the inference speed is significantly improved, it is a quantization relationship or a pruning relationship.

[0084] If it is determined according to the feature information that any preset relationship rule is satisfied between the feature information and the base model, step S300 is executed.

[0085] Step S300: Determine the relationship between the target model and the base model.

[0086] The matched relationship in the satisfied relationship rule is taken as the relationship between the target model and the base model.

[0087] If any preset relationship rule is not satisfied between the target model and the base model, step S400 is executed.

[0088] Step S400: Determine the preset scoring rules satisfied by the target model according to the feature information, each scoring rule having a score on a relationship.

[0089] If a definite relationship conclusion is not obtained according to the above preset relationship rules, the present invention will further adopt a quantitative calculation method. This method sets multiple scoring rules for each relationship type and assigns a score to each scoring rule to indicate the importance of the scoring rule in judging the model relationship, wherein the score of each rule can be adjusted according to the user's input information.

[0090] In an embodiment disclosed in the present invention, for each relationship, a plurality of scoring rules are pre-set based on the degree of change of feature information between the target model and the base model, and each scoring rule has a score on the relationship.

[0091] The following are specific examples of the scoring rules for each relationship, for understanding only, not all examples:

[0092] In the following introduction to the scoring rules, the upper limit of a certain difference used is a larger value, indicating a significant difference; the lower limit of a certain difference used is a smaller value, indicating a small difference.

[0093] (1) The following scoring rules are pre-set for the matching relationship:

[0094] 1. When the parameter quantity of the target model is greater than the parameter quantity of the base model, and the difference between the two is less than the preset lower limit of the parameter quantity difference, 1.0 points are recorded. That is, the parameter quantity of the target model is slightly greater than the parameter quantity of the base model (for example, an increase of <10%).

[0095] 2. When the target model structure only adds less than the preset number of adaptation layers compared to the base model structure, 0.5 points are scored, and the preset number is a small value, such as 2. That is, the target model structure is basically the same as the base model structure, but a small number of adapter layers are added between some layers.

[0096] 3. When the amount of training data of the target model is less than the preset training data threshold, 0.5 points are recorded, where the training data threshold is a relatively small value, that is, the target model is trained on the basis of the base model, or is obtained by fine-tuning, and the amount of training data is relatively small.

[0097] 4. When the accuracy of the target model in processing any task is greater than that of the base model in processing the task, and the difference between the two exceeds the preset upper limit of the accuracy difference, or when the inference speed of the target model in processing any task is greater than that of the base model in processing the task, and the difference between the two exceeds the preset upper limit of the speed difference, 0.5 points will be given. That is, the performance of the target model in processing a certain task or some tasks is significantly improved, for example, the performance is significantly improved in the task of adding an adapter, and the performance is close to that of the base model in other tasks.

[0098] (2) For the merger relationship, the following scoring rules are pre-set:

[0099] 1. When the target model has multiple base models and the target model structure is not completely identical to any of the base models, a score of 0.7 is given. In other words, the structure of the target model has changed significantly and is not completely identical to any single base model.

[0100] 2. When the accuracy and inference speed of the target model in executing all tasks are lower than the preset task difference lower limit, a score of 0.7 is recorded. That is, the target model has balanced performance in multiple tasks and is not particularly outstanding in any task.

[0101] 3. When the target model has multiple base models and the parameter amount is the middle value of all base model parameter amounts, or the parameter amount is greater than the middle value but not more than the preset difference, a score of 0.6 is recorded. That is, the parameter amount of the target model is between multiple base models or slightly increased. For example, if the target model is formed by merging multiple base models, its parameter amount will be the middle value of the base model parameter amount. If other information is merged on a base model, such as through knowledge distillation, it may be slightly higher than the middle value.

[0102] (3) For the quantitative relationship, the following scoring rules are pre-set:

[0103] 1. When the target model has smaller parameters and storage space than the base model, and the difference exceeds the corresponding preset difference upper limit, 1.5 points are scored. That is, the target model has significantly smaller parameters and storage space than the base model. For example, after using int8 quantization, the model size is about 1 / 4 of the base model.

[0104] 2. If the target model structure is exactly the same as the base model and only the parameter accuracy changes, a score of 1.0 is given.

[0105] 3. When the target model's inference speed is greater than the base model's inference speed, and the difference exceeds the preset speed difference upper limit, 0.5 points will be scored. In other words, the target model's inference speed is significantly improved, and the inference speed of the quantized model is usually significantly improved.

[0106] (4) For fine-tuning relationships, the following scoring rules are pre-set:

[0107] 1. When the target model structure is exactly the same as the base model, 1.5 points will be awarded.

[0108] 2. When the accuracy and inference speed of the target model in any task are greater than those of the base model, and the differences exceed the corresponding preset difference upper limit, a score of 1.0 is recorded. That is, the performance of the target model in a certain task is significantly improved compared with the base model.

[0109] 3. When the amount of training data exceeds the preset training amount threshold, 0.5 points are recorded. That is, the amount of training data for the target model is relatively large, and a larger data set is usually required to fully fine-tune the model.

[0110] 4. When the difference between the target model parameter and the base model is lower than the preset lower limit of the parameter difference, and the parameter value changes, 0.5 points will be recorded. That is, the parameter value of the target model does not change much or increases slightly, the main change is the specific value of the parameter, and the total amount of the parameter does not change much.

[0111] (5) For the distillation relationship, the following scoring rules are pre-set:

[0112] 1. When the target model has smaller parameters and storage space than the base model, and the difference exceeds the corresponding preset difference upper limit, a score of 1.0 is recorded. That is, the target model has significantly smaller parameters and storage space than the base model.

[0113] 2. When the target model has smaller parameters and storage space than the base model, and the difference exceeds the corresponding preset upper limit of the difference, and the difference between the accuracy and inference speed of the target model and the base model is lower than the corresponding preset lower limit of the difference, a score of 0.7 is recorded. That is, although the target model becomes smaller, its performance does not drop significantly compared with the base model, but its performance on a certain task is still maintained.

[0114] 3. If the output data or probability distribution of the base model is included in the training data of the target model, 0.5 points will be awarded.

[0115] 4. When the target model structure is simpler than the base model, 0.3 points will be given. For example, the structure of the student model is simpler than that of the teacher model.

[0116] (6) For pruning relationships, the following scoring rules are pre-set:

[0117] 1. When the target model parameter quantity and storage space are both smaller than the base model, and the difference exceeds the corresponding preset second difference upper limit, 0.8 points are recorded, the second parameter quantity difference upper limit is smaller than the parameter quantity difference upper limit mentioned in the above embodiment, and the second space difference upper limit is smaller than the space difference upper limit mentioned in the above embodiment. That is, the parameter quantity and storage space of the target model are slightly reduced compared with the base model, but the reduction is smaller than the quantitative relationship.

[0118] 2. When the target model structure reduces the number of connections or neurons compared to the base model, 0.8 points will be awarded.

[0119] 3. When the target model's inference speed is higher than the base model, 0.5 points will be given. That is, the inference speed will be improved due to the reduction in the amount of calculation.

[0120] Step S500: Calculate the total score of each relationship between the target model and the base model based on the satisfied scoring rules, and take the relationship with the highest total score as the relationship between the target model and the base model.

[0121] Suppose that a model is analyzed and it is found that:

[0122] The parameter amount is slightly larger than that of the base model (Adapter+1.0);

[0123] The structure is basically the same (Adapter+0.5, Fine-tune+1.5, Quantized+1.0);

[0124] Significant performance improvement on specific tasks (Adapter+0.5, Fine-tune+1.0);

[0125] The storage space is significantly reduced (Quantized + 1.5, Distillation + 1.0);

[0126] Calculate the score:

[0127] Adapter: 1.0+0.5+0.5=2.0;

[0128] Fine-tune: 1.5+1.0=2.5;

[0129] Quantized: 1.0+1.5=2.5;

[0130] Distillation:1.0.

[0131] In this case, the scores of Fine-tune and Quantized are the same and the highest, and it can be inferred that the model is a fine-tuned or quantized base model, or both. In one embodiment disclosed in the present invention, when there is more than one relationship with the largest sum of scores, the relationship between the target model and the base model is determined based on the user's input data.

[0132] Step S600: construct a model relationship diagram based on the relationship between all target models and corresponding base models.

[0133] In one embodiment disclosed in the present invention, step S600 may be implemented in the following manner:

[0134] The DAG directed acyclic graph data structure is used to establish the model topology relationship, where a node is a single model, the model includes a target model and a base model, the edge represents the relationship between the target model and the base model, and the base model points to the target model.

[0135] For each model, add it as a node in the topological relationship. According to the base model information of each target model, add an edge from the base model node to the corresponding target model node to the topological relationship, and mark the relationship between the two.

[0136] Use graphical tools to generate a model relationship diagram from the model topology. In order to facilitate understanding and communication, the topology relationship can be displayed in a visual form. For example, graphical tools (such as Graphviz, NetworkX, PyVis) are used to generate a model relationship diagram.

[0137] Figure 2 A schematic diagram of the structure of a large model relationship diagram construction system based on model information analysis provided by an embodiment of the present invention, such as Figure 2 As shown, the system includes the following modules:

[0138] The feature information acquisition module 1 is configured to acquire feature information of each target model in the model warehouse, wherein the feature information at least includes a base model, model parameters, model structure and performance indicators;

[0139] The relationship rule judgment module 2 is configured to judge, for each target model, whether any preset relationship rule is satisfied between the target model and the base model according to the feature information; each relationship rule is matched with at least one relationship, and the relationship includes at least quantization, distillation, pruning, fine-tuning, adaptation and merging; if so, determine the relationship between the target model and the base model;

[0140] A scoring rule determination module 3 is configured to determine, when the target model and the base model do not satisfy the preset relationship rule, the preset scoring rule satisfied by the target model according to the feature information, each scoring rule having a score on a relationship;

[0141] A relationship determination module 4 is configured to calculate the total score of each relationship between the target model and the base model based on the satisfied scoring rules, and take the relationship with the highest total score as the relationship between the target model and the base model;

[0142] The relationship graph construction module 5 is configured to construct a model relationship graph based on the relationship between all target models and corresponding base models.

[0143] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for constructing a large model relationship diagram based on model information analysis, characterized in that: include: Acquire feature information of each target model in the model warehouse, wherein the feature information includes at least a base model, model parameters, model structure, and performance indicators; For each target model, determine whether any preset relationship rule is satisfied between the target model and the base model according to the feature information; each relationship rule is matched with at least one relationship, and the relationship includes at least quantization, distillation, pruning, fine-tuning, adaptation and merging; If so, determining the relationship between the target model and the base model; If not, determining the preset scoring rules satisfied by the target model according to the feature information, each scoring rule having a score on a relationship; Calculate the sum of scores of each relationship between the target model and the base model based on the satisfied scoring rules, and take the relationship with the highest sum of scores as the relationship between the target model and the base model; A model relationship graph is constructed based on the relationship between all target models and the corresponding base models.

2. The construction method according to claim 1, characterized in that: The obtaining of feature information of each target model in the model warehouse includes: Get the base model of the target model from the README file or inheritance chain; Use the API method of the deep learning framework to obtain the storage space, parameter quantity, parameter type, parameter accuracy of the target model, as well as the number of neural network layers, the type and parameters of each layer, and the connection method between layers; Get the accuracy and inference speed of the target model from the README file or technical report.

3. The construction method according to claim 2, characterized in that: The method further comprises: The following relationship rules are preset: When there are multiple base models, or when a structure that integrates multiple base models is used, it is determined to be a merge relationship; When the parameter value is less than the base model by a preset first parameter value difference, it is determined to be a pruning relationship; When the difference between the parameter quantity and the base model does not exceed the preset second parameter quantity difference, and the parameter types are different, it is determined to be a quantitative relationship; the first parameter quantity difference is greater than the second parameter quantity difference; When an adapter layer is added compared to the base model, it is determined as an adaptation relationship; When the structure is reduced or the layers are reduced compared to the base model, it is determined to be a distilled relationship or a pruned relationship; When the difference between the accuracy and the base model is lower than a preset second accuracy difference, and the difference between the target model storage space and the base model exceeds a preset space difference, or the difference between the inference speed and the base model exceeds a preset speed difference, it is determined to be a pruning relationship or a distillation relationship; When the accuracy of the target model in processing any task is greater than that of the base model, and the difference exceeds a preset first accuracy difference, or when the inference speed is greater than that of the base model, and the difference exceeds a preset speed difference, it is determined to be a fine-tuning relationship or an adaptation relationship; the first accuracy difference is greater than the second accuracy difference; When the accuracy of the target model is less than that of the base model, the difference is lower than the preset second accuracy difference, and the inference speed is greater than that of the base model, and the difference exceeds the preset speed difference, it is determined to be a quantization relationship or a pruning relationship.

4. The construction method according to claim 1, characterized in that: The method further comprises: For each relationship, a plurality of scoring rules are pre-set based on the degree of change of feature information between the target model and the base model, and each of the scoring rules has a score on the relationship.

5. The construction method according to claim 1, characterized in that: When there is more than one relationship with the largest total score, the relationship between the target model and the base model is determined according to the user's input data.

6. The construction method according to claim 1, characterized in that: The model relationship diagram is constructed based on the relationship between all target models and corresponding base models, including: The DAG directed acyclic graph data structure is used to establish the model topology relationship, wherein the node is the model, the model includes the target model and the base model, the edge is the relationship between the target model and the base model, and the base model points to the target model; A graphic tool is used to generate a model relationship diagram from the model topological relationship.

7. A large model relationship diagram construction system based on model information analysis, characterized in that: include: A feature information acquisition module is configured to acquire feature information of each target model in the model warehouse, wherein the feature information at least includes a base model, model parameters, model structure, and performance indicators; The relationship rule judgment module is configured to judge, for each target model, whether any preset relationship rule is satisfied between the target model and the base model according to the feature information; each relationship rule is matched with at least one relationship, and the relationship includes at least quantization, distillation, pruning, fine-tuning, adaptation and merging; if so, determine the relationship between the target model and the base model; A scoring rule determination module, configured to determine, when a preset relationship rule is not satisfied between the target model and the base model, a preset scoring rule satisfied by the target model according to the feature information, each scoring rule having a score on a relationship; a relationship determination module, configured to calculate the sum of scores of the target model and the base model in each relationship based on the satisfied scoring rules, and take the relationship with the highest sum of scores as the relationship between the target model and the base model; The relationship graph construction module is configured to construct a model relationship graph based on the relationship between all target models and corresponding base models.