Large-scale language model classification integration method based on distributed collaboration
Through the distributed collaboration large-scale language model classification integration method, the probability distribution and variance of the model output are used to judge the model strength and weakness, and the integrated model is constructed, which solves the problem of performance degradation in large-scale language model integration, and achieves efficient and economical integration Performance improvement.
Patent Information
- Application Number
- CN202411407116.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-10
AI Technical Summary
Existing large-scale language model integration methods have a problem of performance degradation in classification tasks, especially when model performance varies greatly in different fields. Traditional methods such as voting method and Boosting require retraining of the model, and isomorphic models are merged. The method has strict constraints on the model structure, increasing the risk of computational complexity and performance degradation.
A large-scale language model classification integration method based on distributed collaboration is proposed. The models are grouped through grouping functions, the output probability distribution is obtained using softmax function, the average variance and initial threshold of each model are calculated, the model strength and weakness type are judged, and Building an integrated model based on the optimal variance threshold avoids the need to retrain the model and improves the performance of the integrated model.
This method improves classification performance and is more applicable in model integration in different fields, avoids the strict consistency requirements of the model architecture, saves resources, and achieves excellent performance under specific problems.
Smart Images

Figure CN119294562A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of deep learning, and in particular relates to a distributed large-scale language model classification integration method. Background Art
[0002] With the advancement of large-scale language models, the number of general-purpose large models has increased significantly. However, since the training data of each model is different, any single large model has its own unique features. However, due to the sensitivity and confidentiality of the data, it is challenging to centrally manage private data from different fields to retrain more efficient general-purpose large models.
[0003] Therefore, how to integrate these large models with different performance to produce a better general large model has become a problem to be solved. Ensemble learning is a machine learning technology that improves the overall performance and generalization ability of the model by combining the prediction results of multiple learners (base models). The main idea of ensemble learning is to reduce the bias and variance that a single model may bring by combining the advantages of multiple models.
[0004] Assume there is an M-based model (h1,h2,…,h M ), for an input sample x, the prediction result of ensemble learning It can be expressed as:
[0005]
[0006] in, Is a function that combines the outputs of multiple base models into the final prediction result. This function It can be in many forms, therefore, different integration algorithms emerge. The present invention divides the integration method into the integration of homogeneous models and the integration of heterogeneous models.
[0007] In the context of homogeneous model ensembles, consistency of model structure is a key requirement. Existing methods such as linear summation, task arithmetic [1] 、TI ES [2] and DARE [3] Etc., usually the model is synthesized in a formulaic way. However, these methods often lead to a decrease in the performance of the synthesized model in practical applications, and have strict constraints on the isomorphism of the model. Specifically, for a given model M1 and M1, the linear addition method can be expressed as:
[0008] M sum =αM1+βM2
[0009] Where α and β are weight parameters.
[0010] In the context of heterogeneous model integration, the consistency of model structure is not necessary, so different models can have different architectures and features. [4] The method is a typical heterogeneous model integration method, which sorts and filters the outputs of multiple models and trains a summary model to understand and regenerate the filtered content. Specifically, the LLM-Blender method can be expressed as:
[0011] 1. Model output sorting and screening: Assume there are n heterogeneous models M1, M2, …M n , each model M i Produce an output y for input x i First, these outputs are sorted and filtered to obtain the filtered output set {y′1,y′2,…,y′ k}, where k≤n.
[0012] 2. Training summary model: Next, train a summary model S to understand and regenerate the filtered content. The summary model S accepts the filtered output set {y′1,y′2,…,y′ k} as input and generate the final output y final .
[0013] Therefore, for a given input x, the heterogeneous model integration process can be expressed as:
[0014] {y′1,y′2,…,y′ k}=SortAndFilter(M1(x),M2(x),…,M n (x)
[0015] y final =S(y′1,y′2,…,y′ k )
[0016] Among them, SortAndFilter is the function used to sort and filter the model output, and S is the summary model.
[0017] A major problem with this approach is that it requires an additional summary model S to be trained, which increases the complexity of computation and training. In addition, how to effectively sort and filter model outputs is also a challenge, because the outputs of different models may vary greatly in quality and style.
[0018] The above large model integration methods are applicable to integration in any situation. Since its scope is too complex, this article focuses on large models completing classification tasks. Therefore, the following are some integration methods specifically for classification tasks.
[0019] Traditional classification ensemble methods are mostly used for small models, such as voting, bagging [5] Boosting [6] And other methods.
[0020] However, in the field of large models, can the above method be simply applied to classification problems? The answer is no. As described in LLM-Blender, large models are trained on private domain datasets, and their performance in different fields varies. Therefore, simply applying the voting method will lead to performance degradation.
[0021] Explanation for performance degradation: For problems in a specific field, there are a small number (x) of models that are strong models in this field, M, and a group of models whose average performance in the overall field is not much different. str ong, its accuracy is high, and there are a large number (y) of models that are weak models in this field M weak , its accuracy is low, where x<<y, which means x is much smaller than y. Therefore, in this case, no matter whether hard voting, soft voting or bagging method is used, better performance will not be achieved.
[0022] In addition, both Boosting and LLM-Blender require retraining multiple large models, which is obviously unrealistic in the current era when training large models requires a lot of manpower and material resources. At the same time, isomorphic model merging methods such as TIES will lead to varying degrees of model performance degradation, and at the same time have strong constraints on the model structure. The advantages and disadvantages of various integration methods are shown in Table 1.
[0023] Table 1: Summary of advantages and disadvantages of ensemble methods
[0024]
[0025]
[0026] In view of the above problems and the limitations of current technical methods, taking classification problems as an example, new methods need to be further studied to improve the classification performance of integrated large models. Therefore, this paper proposes a large-scale language model classification integration method based on distributed collaboration to solve the problem of decreased effect after integration. At the same time, only less parameter search is required to obtain better model performance.
[0027] [1]Ilharco G, Ribeiro MT, Wortsman M, et al.Editing models with taskarithmetic[J].arXiv prepr int arXiv:2212.04089,2022.
[0028] [2] Yadav P, Tam D, Choshen L, et al. Ties-merging: Resolving interference when merging models [J]. Advances in Neural Information Processing Systems, 2024, 36.
[0029] [3]Yu L,Yu B,Yu H,et al.Language models are super mario:Absorbingabilities from homologous models as a free lunch[C] / / Forty-firstInternational Conference on Machine Learning.2024.
[0030] [4]Jiang D, Ren
[0031] [5]Quinlan J R.Bagging,boosting,and C4.5[C] / / Aaai / Iaai,vol.1.1996:725-730.
[0032] [6]Schapire R EA brief introduction to boosting[C] / / Ijcai.1999,99(999):1401-1406. Summary of the invention
[0033] In view of the difficulties in the prior art, the present invention provides a large-scale language model classification integration method based on distributed collaboration, which is committed to aggregating different large models to improve the classification performance of the integrated model. The present invention can quickly improve the performance of the integrated model through an easy-to-use and efficient integration method. This research focuses on optimizing the comprehensive capabilities and accuracy of large models to ensure excellent performance in various application scenarios while avoiding a large amount of retraining. Through technological innovation, the present invention is committed to providing solutions for the continuous and stable development of AI technology in data science and other key fields.
[0034] In order to solve the problems of the prior art, the present invention adopts the following technical solutions:
[0035] A large-scale language model classification integration method based on distributed collaboration includes the following steps:
[0036] S1. Group the large model through the grouping function, use the original activation value logits of the large model and apply the softmax function to obtain the output probability distribution of the large model;
[0037] S2. Using dataset t s The average variance of each model output probability distribution is calculated according to the following formula;
[0038]
[0039] Where: k is the total number of categories, m is the data set t s The size of For large model M i The mean of the output probability distribution, p ij Indicates the large model M i The probability value of option j;
[0040] S3. Using dataset t s Calculate the initial threshold σ for each group according to the following formula: init ;
[0041]
[0042] in: and They are two large models M in the group. i and M j In the dataset t s The average variance of
[0043] S4. Determine the variance of the large model in the current sample through the following formula and the optimal variance threshold σ for the group threshold The relationship between the strong and weak types of the large model is obtained;
[0044]
[0045] in, For model M i The variance of the probability distribution of the current sample output is
[0046] σ threshold is the optimal threshold for the group to which the model belongs;
[0047] S5. According to the judgment result, if there is a strong model in the group, the strong model result is directly output; if both models in the group are weak models, the two models are subtracted and the result is output;
[0048] S6. Average the output results of each group of outputs to obtain the output results of the integrated model.
[0049] Further, in S1-S4, the following search algorithm is used to obtain the optimal variance threshold σ threshold , and according to the optimal variance threshold σ threshold Construct the best ensemble model M(σ threshold ) process, including:
[0050] c. Let σ0 = σ init ;
[0051] d. Control the precision of the search through the attenuation factor; where the attenuation factor is:
[0052] α=0.98,
[0053] c. In each iteration, the threshold is updated according to the following formula
[0054] σ k+1 =ασ k
[0055] d. Use evaluation index A to measure the performance of the updated integrated model A k+1 ; if A k+1 >A k , then continue searching, otherwise end the loop to obtain the optimal variance threshold σ threshold And proceed to the next step;
[0056] Among them, A k+1 =A(M(σ k+1 ), t s ) That is, when the threshold is σ k+1 When using the data set t s Calculate the integrated model M(σ k+1 ) performance A k+1
[0057] e. By the optimal variance threshold σ threshold Constructing the integrated model M(σ threshold );
[0058] The above steps a to e describe the hyperparameter space Search for the best σ threshold , so that the model M(σ threshold ) in the dataset t s Performance on A(M(σ threshold );t s) to achieve the best;
[0059]
[0060] Beneficial Effects
[0061] 1. Higher applicability. In the process of using this solution, it is only necessary to obtain the probability distribution of the large model on the classification options, unlike the isomorphic model integration method, which requires strict consistency in the model architecture, so it is more applicable.
[0062] 2. High performance. As shown in the experimental conclusions below, the method proposed in this paper achieves better integrated performance on the MMLU dataset, whether compared with hard voting or soft voting methods, or a single independent model.
[0063] 3. More suitable for large model application scenarios. Due to the different performance of large models in different fields, there are a small number of strong models and a large number of weak models for specific problems. This solution starts from the perspective of fewer strong models and more weak models, and is specifically designed to solve the problem of poor performance of integrated models in this case. Therefore, this solution is naturally suitable for the integration of applications and large models.
[0064] 4. Economical. Since this solution only operates on the output, it avoids retraining large models. However, the training of large models is expensive and experience-dependent. Therefore, compared with bagging, l lm-b lender and other solutions, this solution can avoid retraining large models and save more resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 :A flow chart of a large-scale language model classification integration method based on distributed collaboration in the present invention.
[0066] Figure 2 : Graph showing experimental results of a large-scale language model classification integration method based on distributed collaboration in the present invention.
[0067] Figure 3 : Model diagram of a large-scale language model classification integration method based on distributed collaboration in the present invention. DETAILED DESCRIPTION
[0068] The following is combined with Figure 1 The present invention is described as follows:
[0069] The integrated model method proposed in this invention can be seen Figure 3 .like Figure 3 As shown, the present invention mainly includes the following modules.
[0070] a. Grouping module: Group multiple large language models into pairs.
[0071] b. Protocol module: A distributed collaboration protocol is used to judge the strength of the models in each group based on the threshold of each group, and the result after the collaboration of the two models is output. The specific distributed collaboration protocol is shown in Table 2.
[0072] Table 2: Distributed protocol table
[0073]
[0074] Explanation of decision making: If there is a strong model in the group, the result of the strongest model is directly used; if both models in the group are weak models, their results are considered unreliable, so the results of the two models are subtracted to reduce the interference of the unreliable results of the weak model on the overall results. The results of multiple groups of models are averaged to obtain the final result of the integrated model.
[0075] c. Output module: average the results of each group of models as the final output of the integrated model.
[0076] The following is a detailed explanation of each module.
[0077] 1. Grouping module: model grouping and offline reasoning
[0078] Collect various models to prepare for integration. Since the performance of large models in different fields is usually quite different, in order to highlight the effect of the integration of models with different performance in the verification field, n large models are selected for offline reasoning M = M1, M2…M n .
[0079] Group the models into groups of two. Use the grouping function f(x) to group the large model and get the grouped large model. For example: f(M) = f(M1,M2…M n )=(M1,M2),(M3,M4)…(M n-1 ,M n ). Note: The grouping function here can be arbitrary.
[0080] After grouping the large model, the output of the large model can be obtained offline.
[0081] Although the large model can get the answer through prompts, due to the instability of the large model's output, it cannot be guaranteed that its output is the label of the option. Therefore, the usual method is used for the model output, that is, to analyze the model's original activation value logtis.
[0082] For example, if the prompt given to the large model is:
[0083] "Question: xxx options: A.XXX, B.XXX, C.XXX, D.XXX, the above are my questions and options, please choose one from ABCD as the answer, your answer is:"
[0084] The above is a feasible prompt. However, due to the randomness of the large model, the output of the large model may be "A", or it may be "My answer is A", or it may be "After analyzing this question, I think the answer is A". Therefore, it is a very challenging problem to parse the answer classified by the large model in this way.
[0085] However, the logits method can avoid this problem. For example, the large model outputs [logits1, logtis2, logits3...]. You can choose the large model to output the first logits, which represents the probability distribution of the first child in the entire dictionary, such as "Hello: 0.1, Yes: 0.05, A: 0.6, B: 0.1, C: 0.01, D: 0.03, 1: 0.02, F: 0.2...".
[0086] These logits reflect the probability of each word output by the model. The following are the detailed steps and formula descriptions of the conversion process from logits to the final prediction:
[0087] a. Use prompts to input the large model, get the first logits output by the large model, and select the probability corresponding to ABCD as the classification answer of the large model.
[0088] b. Use the softmax function to convert logits into probabilities so that the sum of all probabilities for each option is 1. The Softmax function is defined as follows:
[0089]
[0090] Where xi(i=1,2,3,4) represents the probability value of option (A,B,C,D) respectively, and softmax(xi) is the predicted probability of option i.
[0091] c. The final predicted answer of the model is argmax(softmax(X1),softmax(X2),softmax(X3),softmax(X4)), which is the option with the maximum probability.
[0092] The output distribution of each large model in each group in the data set is stored offline for subsequent parameter search.
[0093] 2. Protocol Module
[0094] According to the protocol in Table 1, each sample needs to be dynamically evaluated to determine the performance of each model when processing the sample, so as to determine whether it is a strong model or a weak model. To achieve this goal, this paper proposes a training algorithm to construct the corresponding discriminant function.
[0095] 2.1 Determine the initial threshold for each group of models
[0096] For a test set T = {t1, t2, t3, ...} with different domain knowledge, where t i Represents test sets of knowledge in different fields, such as math multiple-choice test set t1, physics multiple-choice test set t2, etc. In the test large model set M = {M1, M2, ..., M n Any model M in i Although the average ability of the test set T may be almost the same, in a specific test subset t i There may be significant differences in performance on . For example, for the mathematical subset t i , each model M in the set M i The performance on this subset may be very different. Therefore, it is necessary to dynamically identify the performance strengths and weaknesses of the large model for specific samples in order to better perform distributed collaboration and achieve more effective integration results.
[0097] For classification problems, the variance of the output probability distribution can be used to measure the performance of the model on the current problem. For example, assuming that the large model M i The output probability distribution of the integrated model M is {A:0.6, B:0.2, C:0.1, D:0.1}, while the output probability distribution of the large model M2 is {A:0.25, B:0.25, C:0.25, D:0.25}. It can be concluded that the integrated model M i There is a higher confidence in option A, while the confidence of the integrated model M2 on the four options is similar. In order to quantify this difference, the variance of the probability distribution is selected to model the performance of the large model on the current problem.
[0098] Assume model M i The output probability for option j is p ij , then the model M i The variance of the output probability distribution of It can be expressed as:
[0099]
[0100] Where k is the total number of options. For model M iThe mean of the output probabilities. By comparing the variances of different models, we can measure the performance differences of the models. Models with larger variances have higher confidence in some options and behave as strong models, while models with smaller variances have lower confidence in various options and behave as weak models.
[0101] 2.2. Determine the threshold for grouping
[0102] First, randomly sample part of the data set T = {t1, t2, t3, ...} s As a test set, the mean of the variance of the model output probability distribution is calculated on the test set, denoted as The mean value represents the performance of the model to a certain extent, where:
[0103]
[0104] Where: k is the total number of categories, m is the data set t s The size of For large model M i The mean of the output probability distribution, p ij Indicates the large model M i The probability value of option j.
[0105] Based on the mean of the variance of each model in the group, the grouping threshold can be calculated. Suppose the two models in the group are in the data set t s The mean variances of and Then the variance threshold σ of the grouping of these two models is init for:
[0106]
[0107] This variance threshold represents the average performance level of the two models within the group.
[0108] 2.3. Application of Distributed Collaboration Protocol
[0109] Based on the variance threshold of the grouping, the following conditional discriminant function can be designed to determine the strength of the model. The specific conditional discriminant function of the strong and weak model can be expressed as:
[0110]
[0111] in, For model M i The variance of the probability distribution of the current sample output, σ threshold is the optimal parameter threshold for the group to which the model belongs. This threshold is updated iteratively and is equal to σ at the beginning of the iteration. init . Note that here is calculated for a specific sample, σthreshold In the data set t s Calculated statistical features. Therefore, the strength of the model changes dynamically based on the group it belongs to and its results on a specific sample. Compared with determining the strength of a model a priori instead of calculating it in real time based on a sample, this method has better flexibility and accuracy.
[0112] After determining the strength and weakness of the model, the distributed protocol in Table 2 is applied. When there is a strong model between the two models in the group, the result of the strong model is output. When both models in the group are weak models, the results of the two models are subtracted and used as the result of the group to avoid inaccurate results generated by (a large number of) weak models, which may cause disturbances (noise) to the results of the strong model.
[0113] 3. Output module: average the output of each group of models as the final output of the integrated model
[0114] The grouped model f(M) = f(M1,M2…M n )=(M1,M2),(M3,M4)…(M n-1 ,M n ), after applying the protocol model in 2., we get the results of each group, and average these results to get the final result of the integrated model.
[0115] 4. Train the model to get the best grouping threshold
[0116] According to the descriptions in 1, 2, and 3, the final structure of the integrated model is determined. However, there is still a problem, that is, how to determine the optimal grouping threshold σ threshold , so that the integrated model shows the best performance. Therefore, a search algorithm is designed to find the most appropriate threshold. Drawing on the idea of dynamic learning rate, the cyclic update strategy is set as follows:
[0117] a. Let σ0 = σ init ;
[0118] b. Control the precision of the search through the attenuation factor; where the attenuation factor is:
[0119] α=0.98,
[0120] c. In each iteration, the threshold is updated according to the following formula
[0121] σ k+1 =ασ k
[0122] d. Use evaluation index A to measure the performance of the updated integrated model A k+1 ; if A k+1 >A k, then continue searching, otherwise end the loop to obtain the optimal variance threshold σ threshold And proceed to the next step;
[0123] Among them, A k+1 =A(M(σ k+1 ), t s ) That is, when the threshold is σ k+1 When using the data set t s Calculate the integrated model M(σ k+1 ) performance A k+1 .
[0124] e. By the optimal variance threshold σ threshold Constructing the integrated model M(σ threshold );
[0125] For the evaluation index A of the classification task, there are various evaluation indicators, such as F1 score, precision and recall, which are very important for evaluating model performance. Precision measures how many of the samples predicted as positive are truly positive samples. The formula is as follows: Among them, TP represents true positives (i.e., the number of samples correctly predicted as positive), and FP represents false positives (i.e., the number of samples incorrectly predicted as positive). Recall rate indicates how many of all true positive samples are correctly predicted as positive. The formula is as follows: Among them, FN represents false negative examples (i.e., the number of samples that are incorrectly predicted as negative). The F1 score is the harmonic mean of precision and recall, which is used to find a balance between precision and recall. The higher the F1 score, the better the performance of the model. Its formula is as follows: These evaluation indicators have different focuses in different application scenarios. For example, in some cases, precision may be more important, while in other cases, recall may be more critical. The F1 score provides a way to comprehensively consider precision and recall, allowing us to more comprehensively evaluate the performance of the model.
[0126] It should be noted that the model training here is different from the usual model parameter training. It is mainly aimed at the parameter threshold for judging the strong and weak models in the integrated model, rather than updating the parameters of each model. In this way, this solution can avoid updating the model, making the process efficient and economical. That is, effectively in the hyperparameter space Search for the best σ threshold , so that the model M(σ threshold ) in the dataset t s Performance on A(M(σ threshold);t s ) to achieve the best:
[0127]
[0128] Where A(M(σ); t s ) means that in the data set t s The performance of the integrated model under a specific threshold σ is measured using the evaluation indicator A.
[0129] Based on the above technical solution, the following experiments were designed to verify the effectiveness of the method in the present invention.
[0130] 1. Determination of the integrated model.
[0131] The following eight large language models are selected for integration. Table 3 summarizes the model names and model sizes (number of parameters).
[0132] Table 3: Statistics of model size (number of parameters) of 8 large language models
[0133] Model Name Model size (number of parameters) AlphaMonarch 7Billion Daredevil 8Billion internlm2 7Billion Meta-Llama-3 8Billion Omnarch 7Billion OrpoLlama-3 8Billion UltraMerge 7Billion Zebrafish 7Billion
[0134] The above 8 models are all based on the decoder on ly structure and use autoregression for inference. The number of parameters of each model is roughly the same, which also means that the average performance in all fields is relatively similar. However, due to the differences in their training data, the performance of each model in a specific field varies greatly, satisfying the condition that "the performance of the model is similar in all fields, but the performance in different fields varies greatly". Therefore, choosing this experimental setting can ensure that the overall (average) performance of the model on the data set is similar. However, for any specific field, the strengths of different models vary, and this difference does not show regularity with the size of the model parameters.
[0135] After the model is determined, offline reasoning is performed to obtain the probability distribution output of the model on the four options ABCD.
[0136] 2. Model grouping and initial threshold calculation
[0137] As mentioned above, any grouping algorithm can be used to group models. Therefore, we choose to group the models in order, and finally get four groups of models: ((AlphaMonarch, Daredevil), (internlm2, Meta-Llama-3), (Omnarch, OrpoLlama-3) (UltraMerge, Zebrafish)), and calculate the initial threshold T on the validation set of the dataset. init .
[0138] 3. Model parameter search
[0139] The above process can be simplified into the following pseudo code.
[0140]
[0141] Use the above pseudo code to train (search) the optimal thresholds of these 4 groups of 8 models, and finally determine the hyperparameter σ threshold , the hyperparameter σ threshold This allows the model to achieve the best classification performance on the data set.
[0142] 4. Experimental verification
[0143] This example uses the MMLU (Massive Multitask Language Understanding) English dataset as experimental material. This benchmark covers 57 subjects, including STEM (science, technology, engineering and mathematics), humanities and social sciences, to evaluate the integration performance of different ensemble methods in large model classification. Each subject contains dev, val and test datasets in the dataset. During the parameter search process, only the dev dataset is used as the test dataset. s To initialize the threshold.
[0144] Table 4 shows the accuracy of the soft voting method, the hard voting method, the method proposed in this paper, and the two large models internlm2-7B and omnarch_8B on the MMLU dataset.
[0145] Table 4: Experimental results of soft voting, hard voting, and our method
[0146]
[0147] Among them, Category represents all the categories of the data set. From left to right in the table header, it represents intern lm2-7B, soft voting, omnarch_8B, hard voting, and the results of the method in this paper, where the blue font represents the best performance. It can be seen that the performance of the method of the present invention in most categories exceeds that of the independent model (internlm2-7B, omnarch-8B) model, as well as the integrated method (hard voting, soft voting) method, verifying the effectiveness of the integrated method of the present invention. Among them, the following figure is used as a visual display, and it can also be seen that the method of the present invention (on the right) has achieved the best performance in most categories.
Claims
1. A large-scale language model classification integration method based on distributed collaboration, comprising the following steps: S1. Group the large model through the grouping function, use the original activation value logits of the large model and apply the softmax function to obtain the output probability distribution of the large model; S2. Using dataset t s The average variance of each model output probability distribution is calculated according to the following formula; in: k is the total number of categories, m is the data set t s The size of For large model M i The mean of the output probability distribution, p ij Indicates the large model M i The probability value of option j; S3. Using dataset t s Calculate the initial threshold σ for each group according to the following formula: init ; in: and They are two large models M in the group. i and M j In the dataset t s The average variance of S4. Determine the variance of the large model in the current sample through the following formula and the optimal variance threshold σ for the group threshold The relationship between the strong and weak types of the large model is obtained; in, For model M i The variance of the probability distribution of the current sample output is σ threshold is the optimal threshold for the group to which the model belongs; S5. According to the judgment result, if there is a strong model in the group, the strong model result is directly output; if both models in the group are weak models, the two models are subtracted and the result is output; S6, averaging the output results of each group of outputs to obtain the output results of the integrated model; S7. Obtain the optimal variance threshold σ according to the search algorithm threshold , and according to the optimal variance threshold σ threshold Construct the best ensemble model M(σ threshold ).
2. The method for large-scale language model classification integration based on distributed collaboration according to claim 1, characterized in that: The following search algorithm is used in steps S1-S7 to obtain the optimal variance threshold σ threshold , and according to the optimal variance threshold σ threshold Construct the best ensemble model M(σ threshold ) process, including: a. Let σ0 = σ init ; b. Control the precision of the search through the attenuation factor; where the attenuation factor is: α=0.98, c. In each iteration, the threshold is updated according to the following formula s k+1 =as k d. Use evaluation index A to measure the performance of the updated integrated model A k+1 ; if A k+1 >A k , then continue searching, otherwise end the loop to obtain the optimal variance threshold σ threshold And proceed to the next step; Among them, A k+1 =A(M(σ k+1 ), t s ) That is, when the threshold is σ k+1 When using the data set t s Calculate the integrated model M(σ k+1 ) performance A k+1 . e. By the optimal variance threshold σ threshold Constructing the integrated model M(σ threshold ); Among them: The above steps a to e describe the hyperparameter space Search for the best σ threshold , so that the model M(σ threshold ) in the dataset t s Performance on A(M(σ threshold );t s ) reaches the best; wherein: the optimal variance threshold σ threshold for: