A large model automatic evolution system and method with active learning capability
By designing active learning and large model automatic evolution systems, the problem of insufficient adaptive capabilities of AI systems in new data and rapidly changing environments has been solved, real-time updates of large models and cross-domain knowledge transfer have been achieved, improving efficiency and flexibility.
Patent Information
- Application Number
- CN202410611940.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-17
AI Technical Summary
Existing AI systems lack adaptive capabilities when faced with new data and rapidly changing environments, and are difficult to update in real time and transfer cross-domain knowledge, resulting in insufficient performance and flexibility.
A large model automatic evolution system with active learning capabilities is designed. Diverse data are collected through the data module, the generation module generates QA evaluation data sets, the evaluation module evaluates the model, guides the module to formulate optimization plans, and the planning module executes optimization to achieve large-scale model optimization. Iterative optimization of models. The system combines active learning, self-assessment, cross-guidance and dynamic learning plans to reduce manual intervention and achieve near-real-time updates and cross-domain adaptation.
Large models can be updated in near real-time, reducing manual intervention, improving generalization capabilities and scene adaptation capabilities, reducing update costs, realizing cross-domain knowledge transfer, enhancing autonomous learning capabilities, and adapting to rapidly changing data environments.
Smart Images

Figure CN118195032B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence, and specifically relates to a large model automatic evolution system and method with active learning capability. Background Art
[0002] Modern artificial intelligence systems, despite significant progress in multiple areas, still have important limitations. These systems often rely on large-scale data sets for training, which limits their effectiveness in dealing with new data types and unknown situations. For example, once encountering new information that is significantly different from the training data, existing AI models often have difficulty adapting effectively, which leads to limitations in practical applications, especially when rapid response to new data and environmental changes is required.
[0003] On the other hand, AI technology is increasingly facing challenges in real-time data processing and self-updating. With the rapid increase in the amount of information and the continuous evolution of data types, traditional AI models are unable to effectively absorb and integrate new information, especially without human intervention. This lack of adaptive capabilities limits the application of AI technology in dynamic environments, such as online learning, real-time decision making, and other fields.
[0004] In addition, existing AI systems also show obvious deficiencies in cross-domain knowledge transfer. When AI systems face knowledge or data in new fields, they often need to be retrained or significantly adjusted. This not only increases the consumption of time and resources, but also limits the flexibility and applicability of AI technology in a rapidly changing world. Therefore, developing an AI system that can evolve by itself and effectively learn and adapt across domains has become an important need and challenge in this field.
[0005] In modern artificial intelligence technology, autonomous learning and self-adaptation are key development directions. Current AI systems mostly rely on initial training with large-scale data sets, and after training, these systems show obvious limitations in adapting to new data and situations. In particular, in terms of processing real-time data streams and continuously changing information, existing AI systems often require additional human intervention to maintain their effectiveness. In addition, these systems also have difficulties in cross-domain knowledge transfer and understanding new domain information. Therefore, developing an AI agent that can update and self-evolve in real time to adapt to the rapidly changing data environment and the emergence of new knowledge has become an important research direction in this field.
[0006] In existing artificial intelligence technologies, especially in the application of large machine learning models, a significant challenge is how to adapt these models to the rapidly changing data environment and the emergence of new knowledge. After the initial training, the adaptability and update capabilities of traditional AI models are limited, resulting in insufficient performance and flexibility in practical applications. Summary of the invention
[0007] In order to achieve the above purpose, the technical solution adopted in this application is:
[0008] In response to the problems in the prior art, the present invention proposes a self-evolving AI agent, which aims to solve these limitations in the prior art through continuous autonomous learning and adaptive mechanisms.
[0009] In order to achieve the above purpose, the technical solution adopted in this application is:
[0010] In a first aspect, the present invention discloses a large model automatic evolution system with active learning capability, comprising:
[0011] Data module, used to collect user interaction data and external public data;
[0012] The generation module generates QA evaluation data based on the collected data according to the prompt engineering;
[0013] The evaluation module uses the QA evaluation data to test and evaluate the large model to obtain evaluation conclusions and data sets;
[0014] The guidance module formulates an optimization plan based on the evaluation conclusions and the generated data set through automation and rules, and generates the direction for further optimization of the large model;
[0015] The planning module is used to execute the optimization plan. It can call the corresponding computing resources and data resources according to the generated optimization plan to realize the iterative optimization of the large model.
[0016] Furthermore, the data module automatically obtains information from a variety of heterogeneous data sources, including data crawling and preliminary analysis of the data to identify the most valuable information for the learning and evolution process;
[0017] Data crawling is divided into internal data reading and external data reading. Internal data reading uses the structured database MySQL, and external data reading uses crawlers to crawl public data.
[0018] The specific steps of preliminary data analysis include: first, removing invalid characters; then segmenting the data to obtain the segmented data; and finally, extracting data information from the segmented data to generate key information of the corresponding data.
[0019] Furthermore, the step of generating the QA evaluation data set by the generation module using the prompt engineering includes:
[0020] Template-based prompt generation: a series of question and answer templates are pre-designed, and the collected external knowledge data is filled into the blank positions of the template according to the set rules to generate preliminary QA pairs;
[0021] Enhance QA generation using knowledge graphs;
[0022] Use the pre-trained large language model to optimize and enhance the generated preliminary QA pairs;
[0023] Iterate and optimize the prompt template. Through continuous iteration, the effect of the prompt template is gradually improved to generate higher quality QA pairs.
[0024] Manual screening and post-processing,The generated QA pairs are manually screened and post-processed. During the post-processing, the expressions of some QA pairs are polished and corrected. All QA pairs are aggregated to finally obtain the QA evaluation data set.
[0025] Furthermore, the evaluation module uses the QA evaluation data to test and evaluate the large model to obtain the evaluation conclusion and data set, including the following steps:
[0026] Data preparation: obtain the historical QA evaluation data set, recorded as historical data; obtain the QA evaluation data set composed of the external knowledge data newly acquired from the environment, recorded as new data; merge the new data with the historical data to obtain the latest QA evaluation data set for evaluation;
[0027] Model prediction: use the agent’s current model M to predict the QA evaluation data set and obtain the prediction results;
[0028] Evaluation indicator calculation: compare the prediction results with the true labels of the QA evaluation data set and calculate various evaluation indicators, including accuracy, precision, recall and F1 score;
[0029] Evaluation results analysis: analyze the various indicators obtained, including the indicator performance on new data, compare it with the indicator performance on historical data, and judge the generalization ability of the model on new data; the indicator performance of model M on each category or data subset, identify the deviations or weaknesses of model M.
[0030] Furthermore, the guidance module formulates an optimization plan through automation and rules to generate the direction of further optimization of the large model. The process includes adjusting the model structure and reselecting the training algorithm. In terms of model structure adjustment, the large model is implemented based on the Transformer architecture, and the guidance module recommends increasing or decreasing the number of layers in the Transformer architecture, or changing the type of activation function. In terms of the selection of training algorithms, the guidance module uses the Adam adaptive learning rate optimizer to automatically adjust the learning rate according to changes in the gradient.
[0031] In a second aspect, the present invention discloses a working method of a large model automatic evolution system with active learning capability, comprising:
[0032] Collect user interaction data and external public data through data modules;
[0033] Through the generation module, according to the prompt engineering, the QA evaluation data set is generated for the collected data;
[0034] Through the evaluation module, the large model is tested and evaluated using the generated QA evaluation data set to generate evaluation conclusions and data sets;
[0035] Through the guidance module, based on the evaluation conclusions and the generated data set, an optimization plan is formulated through automation and rules to generate the direction for further optimization of the large model;
[0036] By executing the optimization plan through the planning module, the corresponding computing resources and data resources can be called according to the generated optimization plan to achieve iterative optimization of the large model.
[0037] Compared with the prior art, the advantages and positive effects of the present invention are:
[0038] 1. The present invention proposes a large model automatic evolution system and method with active learning capabilities, which can achieve near real-time updates for external knowledge, master the latest knowledge, and alleviate the differences between new content and new scenes. At the same time, the entire process is executed in an automated manner, reducing manual intervention and reducing the cost and price of updates. Through the present invention, the large model can have autonomous learning capabilities, so that the large model has more powerful generalization capabilities and scene adaptation capabilities, thereby better meeting user needs.
[0039] 2. The intelligent agent of the present invention combines advanced mechanisms such as active learning, self-assessment, cross-guidance, and dynamic learning plan formulation. Through these mechanisms, it can obtain information from diverse data sources in real time, automatically generate QA evaluation data sets, and evaluate and adjust its own learning process based on these data sets. In addition, it also uses manual annotation and large model collaboration to optimize learning effects, thereby achieving cross-domain adaptability and knowledge transfer. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0041] Figure 1 It is a schematic diagram of the structure of the large model automatic evolution system with active learning capability of the present invention;
[0042] Figure 2 This is a method flow chart of the large model automatic evolution system with active learning capability of the present invention. DETAILED DESCRIPTION
[0043] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.
[0045] Embodiment 1, as Figure 1-Figure 2 As shown, this embodiment provides a large model automatic evolution system with active learning capability, which mainly includes a data module, a generation module, an evaluation module, a guidance module and a planning module.
[0046] Data module: usually includes data warehouse, data preprocessing tools and data annotation tools, etc. The data module is used for data acquisition, storage, comparison and processing of the entire system. On the one hand, according to the system settings, it can realize the capture of external knowledge, including API, crawler, database, document, etc.; on the other hand, it can realize the efficient use of data, including knowledge increment storage, noise data cleaning, data format conversion, etc. Through crawlers, interfaces, databases and other methods, it can obtain external knowledge in real time or near real time and make incremental updates.
[0047] How the data module works: It is responsible for collecting, cleaning, and preparing the data needed to train the model. This process includes obtaining data from external sources, formatting and normalizing the data, and labeling the data using manual or automated methods.
[0048] As an implementation method, the data module specifically adopts advanced data acquisition technology, which can automatically obtain information from a variety of heterogeneous data sources (such as network data, graphic information, documents, etc.). This process not only includes traditional data capture, but also involves preliminary analysis of data to identify the most valuable information for learning and evolution processes. Data capture is divided into internal data reading and external data reading. Internal data reading adopts reading structured database MySQL; external data reading is to crawl public data such as Baidu Encyclopedia and Wikipedia through crawlers. Preliminary analysis of data: first remove invalid characters, including marks, garbled characters, non-Unicode encoded content, etc.; then segment the data, and obtain the segmented data with paragraphs and sentences as granularity; finally, extract data information from the segmented data. The technical solutions for data information extraction include NER entity recognition, jieba keyword recognition, and LSTM-based summary generation technology to generate key information of the corresponding data. The key information includes summary, knowledge points, and the main content and keywords mentioned in the paragraph or sentence description. In addition, by continuously monitoring the changes in data streams, AI agents can actively identify new knowledge and new trends to achieve real-time learning and adaptation.
[0049] Generation module: including model architecture (such as neural network), initialization parameters and model training algorithm, etc. The generation module is a large model evaluation data generation module. Based on the newly added external knowledge, it generates an evaluation data format acceptable to the large model, which is convenient for subsequent evaluation of the large model's grasp of current knowledge. Usually, the generation of QA evaluation data sets can be achieved with the help of technologies such as GPT-4 and prompt engineering.
[0050] How the Generate module works: It trains or fine-tunes the model using the data provided by the Data module. This process includes selecting a suitable algorithm, defining the loss function and optimizer, and adjusting the model parameters to minimize the error through the back-propagation algorithm.
[0051] As an implementation method, in the process of generating the QA evaluation data set by the generation module using the prompt engineering, this embodiment mainly adopts the following technical solutions:
[0052] Template-based prompt generation. This embodiment pre-designs a series of question and answer templates, such as "Question 1: What is X? Answer: X is A+B.", "Question 2: What is the definition of Y? Answer: The definition of Y is AB.", etc. Then, the collected external knowledge data is filled into the blank positions of these templates according to the set rules to generate preliminary QA pairs.
[0053] In the above template, "A" and "B" are variables that need to be dynamically filled according to external knowledge data. Certain rules need to be followed when filling. As an implementation method, the rules are set as follows: 1. Filling rules for "A" variables: extract entities and their modifying components such as attributives and appositives from external knowledge data as the filling content of "A". For example, if the knowledge data is "red apples are a kind of fruit", then extract "red apples" to fill in "A". 2. Filling rules for "B" variables: extract the superordinate concepts, attributes, functions, components, etc. of entities from external knowledge data as the filling content of "B". For example, if the knowledge data is "apple is a kind of fruit", then extract "fruit" to fill in "B". 3. Filling rules for entity words X and Y: Generally, the core noun entities in the knowledge data are selected as X and Y in the question template. An example is as follows: External knowledge data: "Red apples are a kind of fruit, and apple trees bear apples after blooming."; Question: "What is the definition of apple?"; Answer: "The definition of apple is fruit".
[0054] Enhance QA generation using knowledge graphs. A domain knowledge graph is constructed to store structured knowledge such as entities, attributes, and relationships. When generating QA pairs, entities and their attributes related to external knowledge data are extracted from the knowledge graph to enrich the background information of questions and answers, thereby increasing the diversity and information content of QA pairs.
[0055] Optimize QA quality with large language models. Use pre-trained large language models, such as GPT-4, to optimize and enhance the generated preliminary QA pairs. Specifically, the preliminary QA pairs are input into the GPT-4 model, which expands, supplements, and rewrites the questions and answers based on contextual information to generate more natural and coherent QA pairs.
[0056] Iteratively optimize prompt templates. Regularly analyze the quality of generated QA pairs, identify the prompt templates with poor performance, and iteratively optimize them. Optimization methods include adjusting the language style of the template, adding and deleting keywords in the template, modifying the sentence structure of the template, etc. Through continuous iteration, the effect of the prompt template is gradually improved, and higher quality QA pairs are generated.
[0057] Manual screening and post-processing. To further ensure the quality of the QA pairs, we arranged for manual screening and post-processing of the generated QA pairs. During the screening process, irrelevant, erroneous, and redundant QA pairs were eliminated; during the post-processing process, the expressions of some QA pairs were polished and corrected, and all QA pairs were aggregated to finally obtain the QA evaluation data set.
[0058] Evaluation module: includes evaluation criteria (such as accuracy, recall rate, F1 score, etc.) and test data sets. On the one hand, the evaluation module evaluates the capabilities of the big model based on the generated evaluation data and determines which knowledge content the big model has not yet mastered. On the other hand, based on the evaluation results, the knowledge content that the big model has not mastered is enhanced, including the export of existing knowledge of the big model itself and the data processing of knowledge that has not been mastered, to generate the training data set and evaluation set of the big model.
[0059] How the evaluation module works: It evaluates the performance of the model generated by the generation module. This usually involves comparing the output of the model with the actual value and using various indicators to measure the accuracy, robustness and generalization ability of the model.
[0060] As an implementation method, the self-assessment mechanism of the assessment module can be divided into the following key steps:
[0061] Step 1: Data preparation, obtain the historical QA evaluation data set and the QA evaluation data set consisting of the external knowledge data newly acquired from the environment. The QA evaluation data set consisting of the external knowledge data newly acquired from the environment is denoted as , and the historical QA evaluation dataset that the agent has learned Merge to get the latest QA evaluation dataset for evaluation:
[0062]
[0063] Step 2: Model prediction. Use the agent’s current model M to evaluate the QA dataset Make predictions and get prediction results The model structure of model M is Qwen1.5-72B, which is an Alibaba open source model of the Qwen series, version 1.5, and a model with a parameter scale of 72B.
[0064] Step 3: Calculate the evaluation index. The true labels of the QA evaluation dataset Compare and calculate various evaluation indicators, such as accuracy, precision, recall, F1 score, etc. Taking accuracy as an example, its calculation formula is:
[0065] in: represent The number of samples in; i represents For each sample; represent The label of sample i in the dataset; Representatives The predicted label for sample i in the dataset.
[0066] Step 4: Analysis of evaluation results. Analyze the indicators obtained in step 3, focusing on the following two aspects: (1) New data The performance of indicators on the (1) The performance of the indicators of model M on each category or data subset is compared to determine the generalization ability of the model on new data; (2) The performance of the indicators of model M on each category or data subset is used to identify the deviations or weaknesses of model M.
[0067] As an implementation method, the step of identifying the deviation or weakness of the model includes: drawing a confusion matrix (Confusion Matrix) of the model M on different categories / subsets. The confusion matrix intuitively shows the situation in which the model M incorrectly predicts a certain category as other categories. Categories with more incorrect prediction cases are often the weaknesses of the model M. For example, in a handwritten digit recognition task, the confusion matrix shows that the number "1" is often incorrectly predicted as "7", but "7" is rarely predicted as "1". This indicates that the model M may not have learned enough features of the number "1", so that it is easily confused with "7", and the model M has deviations in this regard.
[0068] Step 5: Adaptive adjustment. According to the analysis results of step 4, the model M is adaptively adjusted to accept new knowledge. The specific adjustment method uses the MAML (Model-Agnostic Meta-Learning) algorithm. Assume that the model parameters are , the learning rate is , the loss function on the new data is , then the parameter update formula is:
[0069]
[0070] Here are the new parameters That is, the adjusted model parameters are compared with the model parameters , and has better adaptability to new data.
[0071] Step 6: Model update. Update the new parameters obtained in step 5 Apply to model M to get the updated model , used for subsequent prediction and learning tasks. According to the steps of the above self-evaluation mechanism, the formal expression is:
[0072]
[0073] Where: M represents the current model of the agent; Represents the new model obtained after self-assessment and adaptive adjustment; represents the operation of applying the updated parameters to the original model M, i.e., the model updating process in step 6; represents the model parameters; represents the learning rate; Indicates that in the new data The loss function calculated above measures the performance of the model on new data; Represents the loss function For model parameters The gradient of , which indicates how to adjust the parameters to reduce the loss on new data; It indicates that the model parameters are updated according to the gradient descent method, which is the adaptive adjustment process in step 5.
[0074] Guidance module: including feedback mechanism, tuning strategy and user interaction interface, etc. The guidance module can generate an optimization plan based on the evaluation set and evaluation performance, and guide the further optimization direction of the large model, including iteration rounds, training methods, loss functions, etc.
[0075] How the guidance module works: It provides feedback based on the evaluation results of the evaluation module to guide the further optimization of the model. This process involves adjusting the model structure, reselecting the training algorithm, or changing the training process of the model.
[0076] As an implementation method, the guidance module is a key part of the present invention responsible for formulating and executing the optimization plan. It ensures that the large model can continuously improve itself according to the evaluation results through a highly automated process. The module first receives performance feedback from the evaluation module, which includes but is not limited to key indicators such as accuracy, recall, F1 score, etc., which reflect the performance of the model on a specific task. Then, the guidance module uses advanced machine learning algorithms, such as decision trees, to conduct in-depth analysis of these evaluation results to identify the shortcomings of the model when processing data. The decision tree plays a key role in this process. It represents the decision path through a tree structure, thereby helping the module determine the best optimization strategy.
[0077] For example, in a model performance evaluation, the evaluation results show that the model performs well on a binary classification task with an accuracy of 78%, a recall of 65%, and an F1 score of 71%. Based on these results, the guidance module uses a decision tree algorithm for analysis. The decision tree first determines whether the accuracy reaches the 80% threshold. If not, it further determines whether the recall is less than 70%. In this example, the accuracy is 78%, which does not reach the 80% threshold; at the same time, the recall is 65%, which is less than the 70% threshold. According to the preset rules of the decision tree, this situation usually indicates that the model has an underfitting problem, that is, the model's ability to fit the training data is insufficient.
[0078] In addition to underfitting, decision trees can also help guide modules to determine whether the model has problems such as overfitting or non-convergence. Overfitting judgment: If the accuracy of the model on the training set is higher than 95%, but the accuracy on the test set is significantly lower (such as lower than 70%), this usually indicates that the model overfits the training data and has poor generalization ability. If the loss of the training set continues to decrease during the training process, but the loss of the validation set increases, the so-called "reversal" phenomenon, it also suggests that the model may be overfitting. Non-convergence judgment: If the loss of the training set and validation set is still high (such as higher than the preset threshold) after multiple rounds of training, and it fluctuates without a significant downward trend, it indicates that the model may not converge. If the gradient of the model explodes or disappears during training, resulting in a rapid increase in loss or premature termination of training, it also indicates that the model does not converge. Based on the above judgment criteria, the decision tree can further refine the optimization strategy: For underfitting, the model complexity can be increased, such as deepening the number of network layers, adding feature engineering, etc. For overfitting, regularization, data enhancement, early stopping and other measures can be taken. If there is no convergence, you can adjust the learning rate, optimizer, or redesign the model structure.
[0079] Once the optimization direction is determined, the guidance module will develop an optimization plan through automation and rules to generate the direction for further optimization of the large model. This process includes adjusting the model structure, reselecting the training algorithm, or changing the model training process. In terms of model structure adjustment, the large model is implemented based on the Transformer architecture. The guidance module will suggest increasing or decreasing the number of layers in the Transformer architecture, or changing the type of activation function. As a core technology in current deep learning, Transformer is particularly suitable for processing sequence data, such as text or time series. Its self-attention mechanism can capture long-distance dependencies in the data. In terms of the selection of training algorithms, the guidance module will recommend the use of an adaptive learning rate optimizer such as Adam, which can automatically adjust the learning rate according to the change of gradient, thereby accelerating the convergence process of the model.
[0080] As an implementation method, the guidance module develops optimization plans through automation and rules to generate a case study of the direction of further optimization of the large model: developing a Transformer-based machine translation model for translating English into Chinese. Automation and rules are the execution code for running the translation model. After preliminary training and evaluation, the guidance module found that the model had an underfitting problem and the BLEU score on the test set was low.
[0081] According to the analysis results of the decision tree, the guidance module automatically generates the following optimization plan: 1. Increase the number of encoder and decoder layers of Transformer from the original 6 layers to 12 layers to improve the expressiveness of the model. 2. Add layer normalization operations to each layer of Transformer to stabilize the training process. 3. During the training process, use the Adam optimizer, set the initial learning rate to 0.0001, and adopt the learning rate warmup strategy, that is, within the first 4000 steps, the learning rate increases linearly from 0 to 0.0001, and then uses the inverse square root decay. 4. In the data preprocessing stage, perform more fine-grained word segmentation on the training data (such as using the BPE algorithm) to alleviate the problem of unregistered words. After the above optimization, the BLEU score of the translation model increased from the original 25.8 to 38.5, with significant results.
[0082] The specific implementation of determining the optimization direction and generating an optimization plan involves multiple steps, including data analysis, model selection, hyperparameter adjustment, etc. The following is a detailed implementation method for determining the optimization direction:
[0083] Step 1.1, Data Analysis: Use statistical methods to analyze the evaluation results and identify specific tasks or datasets where the model performs poorly. Apply tools such as confusion matrix, ROC curve, etc. to gain insight into the model's performance on different categories.
[0084] Step 1.2, Model Diagnosis: Use model diagnostic techniques (such as confusion matrix) to identify overfitting or underfitting problems in the model. Use regularization techniques (such as Dropout, L1 / L2 regularization) to reduce the risk of overfitting.
[0085] Step 1.3, decision tree analysis: Build a decision tree model, use the evaluation results as input, and output optimization suggestions. The decision tree recursively divides the data set to provide customized optimization directions for different performance issues; for specific examples, see the guidance module given above, which uses automation and rules to formulate optimization plans and generate directions for further optimization of large models.
[0086] Specific execution steps to generate an optimization plan:
[0087] Step 2.1, model structure adjustment: According to the optimization direction, automatically adjust the number of layers, heads or activation functions of the Transformer architecture. Apply neural architecture search (NAS) technology to find the optimal network structure.
[0088] A specific implementation method for adjusting the model structure is given to develop a Transformer-based dialogue generation model for building a chatbot. Preliminary evaluation shows that the responses generated by the model are not fluent and natural enough. The guidance module decides to use NAS technology to automatically search for the optimal Transformer architecture. The specific implementation steps are as follows: 1. Define the search space: specify the adjustable hyperparameters of the Transformer architecture and their value ranges, such as: the number of encoder and decoder layers: integers from 2 to 12; the number of attention heads: integers from 4 to 16; the hidden layer dimension of the feedforward network (FFN): integers from 128 to 2048; activation functions: ReLU, GELU, Swish, etc.;
[0089] 2. Select NAS algorithm: Use the ENAS (Efficient NAS) algorithm based on reinforcement learning. This algorithm can efficiently search large-scale architecture space through parameter sharing and policy gradient optimization.
[0090] 3. Define the Reward function: The Reward function is used to evaluate the performance of each candidate architecture, and it is necessary to balance the model quality and computational efficiency. Here, a weighted sum method is adopted, and Perplexity and inference speed are used as the two components of Reward, and the weight coefficient is set.
[0091] 4. Automatic search and evaluation: The ENAS algorithm automatically samples candidate architectures in the search space and evaluates their rewards on the validation set. After multiple rounds of iterations, the algorithm will select the architecture with the highest reward as the optimal structure.
[0092] 5. Retrain and fine-tune: Use the searched optimal architecture to retrain the Transformer model on the complete training data and make necessary fine-tuning to further improve performance.
[0093] After NAS optimization, the architecture of the dialogue model is set to: 6 layers of encoder and decoder, 8 attention heads, FFN dimension of 1024, GELU activation function. In manual evaluation, the optimized model generates more fluent and natural responses, and user satisfaction is significantly improved.
[0094] Step 2.2, training algorithm selection: Select the most suitable training algorithm (such as Adam, SGD) based on the characteristics of the task and the dataset. Implement learning rate scheduling strategies, such as learning rate decay or periodic adjustment.
[0095] Step 2.3, loss function customization: Design a weighted loss function for unbalanced datasets, such as weighted cross entropy loss. Experiment with different loss functions and select the one that performs best on the validation set.
[0096] Step 2.4, multi-objective optimization: Use multi-objective optimization techniques such as Pareto optimization to consider multiple performance indicators at the same time. Use genetic algorithms or other heuristic search methods to balance the optimization of different indicators.
[0097] Step 2.5, User Interaction: Provide a user interaction interface to allow researchers or developers to make optimization suggestions based on experience. Adjust the automated optimization process based on user feedback.
[0098] Step 2.6, Plan Execution: Pass the optimization plan to the planning module and call computing resources to perform the optimization. Monitor the optimization process to ensure that the plan is executed according to the established goals.
[0099] Through the above steps, the guidance module can automatically determine the optimization direction and generate a detailed optimization plan. This process combines data analysis, machine learning algorithms, deep learning technology and user interaction to ensure that the large model can effectively improve itself based on the evaluation results.
[0100] In the above example, for the underfitting problem, the decision tree algorithm will automatically match a series of preset optimization strategies, such as increasing the model capacity (such as increasing the number of Transformer layers or hidden layer dimensions), extending the training time (such as increasing the number of training epochs from 10 to 20), introducing more advanced feature extraction methods (such as using pre-trained word vectors), etc. The guidance module comprehensively considers the effects of these strategies, the required computing resources and training time, and finally gives the following specific optimization plan: increase the number of Transformer layers of the model from 12 to 24, increase the number of training epochs from 10 to 15, and use pre-trained word vectors as the initial weights of the Embedding layer. This optimization plan aims to improve model performance and solve the underfitting problem by enhancing model capacity and feature extraction capabilities while moderately extending training time.
[0101] In addition, the guidance module also considers the adjustment of the loss function to better capture the patterns and relationships in the data. For example, if the model performs poorly when dealing with an unbalanced data set, the guidance module will recommend using a weighted cross entropy loss function to give more attention to the minority class. When generating an optimization plan, the module also takes into account the need for multi-objective optimization, considering multiple performance indicators at the same time to achieve comprehensive optimization of model performance.
[0102] To improve the transparency and explainability of the optimization process, the guidance module also includes a user interface that allows researchers or developers to view the model's performance curves, heat maps, etc., and manually enter optimization suggestions. The interface is designed to provide intuitive feedback to help users understand the strengths and weaknesses of the model and adjust the automated rules as needed.
[0103] Finally, the guidance module passes the optimization plan to the planning module, which is responsible for calling computing resources to perform the optimization. This process forms a closed-loop feedback system that ensures that the model can be improved after each iteration, thereby maintaining optimal performance in a changing data environment. Through this automated and intelligent optimization process, the guidance module significantly improves the adaptability and learning efficiency of large models, enabling them to better meet user needs.
[0104] Planning module: including project management tools, progress tracking system and resource allocation mechanism, etc. The planning model can execute the specific optimization plan of the big model according to the suggestions of the guidance module and improve the capabilities of the big model.
[0105] Working principle: Coordinate the operation of the entire system, including setting project goals, allocating tasks and resources, and monitoring progress. Ensure the coordination of various modules of the system to achieve the goal of automatic evolution. The overall interaction logic is shown in Figure 2 .
[0106] This embodiment aims to address the limitations of traditional artificial intelligence systems in real-time data processing and adaptive updating. This intelligent agent combines advanced mechanisms such as active learning, self-assessment, cross-guidance, and dynamic learning plan formulation. Through these mechanisms, it can obtain information from diverse data sources in real time, automatically generate QA evaluation data sets, and evaluate and adjust its own learning process based on these data sets. In addition, it also uses manual annotation and large model collaboration to optimize learning effects, thereby achieving cross-domain adaptability and knowledge transfer. This embodiment has the following innovations:
[0107] Automatic data collection: Ability to automatically obtain information from multiple data sources (such as the Internet, multimedia materials, documents).
[0108] Real-time active learning: By constantly monitoring changes in data streams, new knowledge and trends can be learned instantly.
[0109] Generate QA evaluation dataset: Use the evaluation module to process the collected data to generate key evaluation data for the learning process, namely the QA evaluation dataset.
[0110] Self-assessment mechanism: Self-judge and adjust the acceptance of new knowledge based on the QA evaluation data set.
[0111] Cross-guided learning: Combining methods such as manual annotation, model collaboration and cross-validation to improve learning efficiency.
[0112] Dynamic learning planning: Automatically plan future learning strategies based on assessment and learning data.
[0113] Cross-domain adaptability: Ability to process and adapt data and knowledge from multiple domains.
[0114] Embodiment 2: This embodiment provides a working method of a large model automatic evolution system with active learning capability, including:
[0115] Collect user interaction data and external public data through data modules;
[0116] Through the generation module, according to the prompt engineering, the QA evaluation data set is generated for the collected data;
[0117] Through the evaluation module, the large model is tested and evaluated using the generated QA evaluation data set to generate evaluation conclusions and data sets;
[0118] Through the guidance module, based on the evaluation conclusions and the generated data set, an optimization plan is formulated through automation and rules to generate the direction for further optimization of the large model;
[0119] By executing the optimization plan through the planning module, the corresponding computing resources and data resources can be called according to the generated optimization plan to achieve iterative optimization of the large model.
[0120] Specifically, 1. Data acquisition and active learning mechanism. The AI agent of the present invention adopts advanced data acquisition technology and can automatically acquire information from a variety of heterogeneous data sources (such as network data, graphic information, documents, etc.). This process not only includes traditional data capture, but also involves preliminary analysis of data to identify the most valuable information for learning and evolution. Data capture is divided into internal data reading and external data reading. Internal data reading uses structured database MySQL; external data reading is to crawl public data such as Baidu Encyclopedia and Wikipedia through crawlers. Preliminary data analysis: First, invalid characters are removed. Invalid characters include html tags, garbled characters, non-Unicode encoded content, etc.; then the data is segmented, with paragraphs and sentences as the granularity, and the segmented data is obtained; finally, data information is extracted from the segmented data. The technical solution for data information extraction includes NER entity recognition, jieba keyword recognition, and LSTM-based summary generation technology to generate key information of the corresponding data. The key information includes summary and knowledge points, which represent the main content and mentioned keywords described in the paragraph or sentence. In addition, by constantly monitoring changes in data streams, AI agents can proactively identify new knowledge and trends, enabling real-time learning and adaptation.
[0121] 2. Generate evaluation data. The collected data is processed by the generation module inside the agent. The generation module is responsible for analyzing and screening the data and generating a QA evaluation data set for further learning. The QA evaluation data set includes evaluation data on the validity, relevance and reliability of the data. The design of the generation module enables the AI agent to extract key information from complex data and provide accurate guidance for its own learning process.
[0122] 3. Self-evaluation and adaptive adjustment. The agent has an internal evaluation module that uses a self-evaluation mechanism that can judge and adjust its acceptance of new knowledge based on the QA evaluation data set. This process is key to self-evolution because it allows the AI agent to identify and correct deficiencies and deviations in its learning process. In addition, the self-evaluation mechanism also provides the agent with the ability to self-calibrate, ensuring that its performance and accuracy are maintained in a changing environment.
[0123] 4. Cross-guidance and learning data generation. In order to further improve learning efficiency and data quality, the AI agent of the present invention adopts a cross-guidance mechanism. The cross-guidance mechanism includes methods such as manual annotation, large model collaboration, and cross-validation to generate higher quality learning data. Through this diversified learning method, the agent can transfer and optimize knowledge between different models and data sources, thereby achieving more comprehensive and in-depth learning.
[0124] 5. Dynamic learning plan formulation,Finally, based on the evaluation results and newly generated learning data, the agent can automatically plan and optimize its future learning plan. This process involves dynamic adjustment of learning goals, resource allocation, and time planning, making the AI agent more efficient and targeted in future learning.
[0125] To facilitate understanding of the embodiment, an embodiment is given below, taking a conversation and chatting scenario as an example:
[0126] The data module continuously collects user interaction data and external public data, stores them incrementally, and converts them into a format that is easy to use.
[0127] The generation module generates a QA evaluation dataset based on the collected data based on techniques such as prompt engineering.
[0128] The evaluation module uses the generated QA evaluation data set to test and evaluate the large model and check the large model's responses. At the same time, based on the large model's response results, it enhances the knowledge that the large model answers incorrectly and rewrites it through large models such as GPT-4. At the same time, it uses historical data sets to export the knowledge of the large model to ensure that the existing knowledge is not lost after the model is adjusted.
[0129] Based on the evaluation conclusions of the evaluation module and the generated data set, the guidance module develops an optimization plan through automation and rules to generate the direction for further optimization of the large model. This process includes adjusting the model structure, reselecting the training algorithm, or changing the model training process. In terms of model structure adjustment, the large model is implemented based on the Transformer architecture, and the guidance module will suggest increasing or decreasing the number of layers in the Transformer architecture, or changing the type of activation function.
[0130] The planning module is where the guidance module is executed. It can call on corresponding computing resources and data resources according to the generated plan to achieve iterative optimization of the large model.
[0131] The self-evolving AI agent of the present invention represents a major breakthrough in AI technology. Through its unique active learning mechanism, self-assessment, and dynamic learning plan formulation capabilities, this agent is not only able to adapt to new data and environments in real time, but also to transfer and absorb knowledge across domains. This makes it have great application potential in areas such as real-time data analysis, automated decision support, personalized learning, and predictive modeling. In addition, its adaptive ability and flexibility also open up new possibilities for future AI research and applications.
[0132] Through the iteration of the above five modules, the large model in the application scenario can automatically learn and master new knowledge, thereby improving the scenario adaptability of the large model.
[0133] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A large model automatic evolution system with active learning capability, characterized in that: include: Data module, used to collect user interaction data and external public data; The data module obtains information from a variety of heterogeneous data sources, including data capture and preliminary analysis of data; data capture is divided into internal data reading and external data reading. Internal data reading uses the structured database MySQL, and external data reading uses crawlers to capture public data; the specific steps of preliminary data analysis include: first, remove invalid characters; then segment the data to obtain the segmented data; finally, extract data information from the segmented data to generate key information of the corresponding data; various heterogeneous data sources include network data, graphic information and documents; key information includes abstracts, knowledge points, and the main content and keywords mentioned in the paragraph or sentence description; The generation module generates the QA evaluation dataset based on the collected data according to the prompt engineering; The evaluation module uses the QA evaluation data set to test and evaluate the large model to obtain evaluation conclusions and data sets. The steps include: Step 1: Data preparation: obtain the historical QA evaluation data set and the QA evaluation data set consisting of the external knowledge data newly acquired from the environment; the QA evaluation data set consisting of the external knowledge data newly acquired from the environment is recorded as , and the historical QA evaluation dataset that the agent has learned Merge to get the latest QA evaluation dataset for evaluation: Step 2: Model prediction, using the agent’s current model M to evaluate the QA dataset Make predictions and get prediction results ; Step 3: Calculate the evaluation index and predict the results The true labels of the QA evaluation dataset Compare and calculate various evaluation indicators, including accuracy, precision, recall, and F1 score; Step 4: Analyze the evaluation results. Analyze the indicators obtained in step 3, focusing on the following two aspects: (1) New data The performance of indicators on the (2) The performance of the model M on each category or data subset is compared to determine the generalization ability of the model on new data; (3) The performance of the model M on each category or data subset is used to identify the deviations or weaknesses of the model M. The steps for identifying the deviations or weaknesses of the model include: drawing the confusion matrix of the model M on different categories or subsets; the confusion matrix intuitively shows the situation where the model M incorrectly predicts a category as another category; Step 5, adaptive adjustment, according to the analysis results of step 4, adaptively adjust the acceptance degree of model M to new knowledge. The specific adjustment method uses the MAML algorithm; assuming that the model parameters are , the learning rate is , the loss function on the new data is , the parameter update formula is: Here are the new parameters That is, the adjusted model parameters are compared with the model parameters , has better adaptability to new data; Step 6: Model update, the new parameters obtained in step 5 Apply to model M to get the updated model , used for subsequent prediction and learning tasks, formally expressed as: Where: M represents the current model of the agent; Represents the new model obtained after self-assessment and adaptive adjustment; represents the operation of applying the updated parameters to the original model M, i.e., the model updating process in step 6; represents the model parameters; represents the learning rate; Indicates that in the new data The loss function calculated above measures the performance of the model on new data; Represents the loss function For model parameters The gradient of , which indicates how to adjust the parameters to reduce the loss on new data; Indicates updating the model parameters according to the gradient descent method, which is the adaptive adjustment process in step 5; The guidance module formulates an optimization plan based on the evaluation conclusions and the generated data set through automation and rules, and generates the direction for further optimization of the large model; The specific implementation of determining the optimization direction and generating an optimization plan involves multiple steps. The following is a detailed implementation method for determining the optimization direction: Step 1.1, Data Analysis: Use statistical methods to analyze the evaluation results and identify specific tasks or datasets where the model performs poorly. Apply confusion matrix and ROC curve tools to gain insight into the model's performance on different categories. Step 1.2, model diagnosis: Use model diagnosis techniques to identify overfitting or underfitting problems in the model; use regularization techniques to reduce the risk of overfitting; Step 1.3, decision tree analysis: Build a decision tree model, use the evaluation results as input, and output optimization suggestions; the decision tree recursively divides the data set to provide customized optimization directions for different performance issues; Use decision trees to determine whether the model is overfitting, non-converging, or underfitting; Specific execution steps to generate an optimization plan: Step 2.1, model structure adjustment: according to the optimization direction, automatically adjust the number of layers, heads or activation functions of the Transformer architecture; apply neural architecture search technology to find the optimal network structure; guide the module to decide to use NAS technology to automatically search for the optimal Transformer architecture; the specific implementation steps are as follows:
1. Define the search space: specify the adjustable hyperparameters of the Transformer architecture and their value ranges, the number of encoder and decoder layers: integers from 2 to 12; the number of attention heads: integers from 4 to 16; the dimension of the hidden layer of the feedforward network: integers from 128 to 2048; activation functions: ReLU, GELU, Swish; 2. Select the NAS algorithm: use ENA based on reinforcement learning S algorithm, which can efficiently search large-scale architecture space through parameter sharing and policy gradient optimization; 3. Define Reward function: The Reward function is used to evaluate the performance of each candidate architecture, which needs to balance model quality and computational efficiency; adopt a weighted sum method, take Perplexity and inference speed as the two components of Reward, and set the weight coefficient; 4. Automatic search and evaluation: The ENAS algorithm automatically samples candidate architectures in the search space and evaluates their rewards on the validation set; after multiple rounds of iterations, the algorithm will select the architecture with the highest reward as the optimal structure; 5. Retrain and fine-tune: Use the searched optimal architecture to retrain the Transformer model on the complete training data; Step 2.2, training algorithm selection: select the most suitable training algorithm based on the characteristics of the task and the dataset; Step 2.3, loss function customization: Design a weighted loss function for the imbalanced data set, experiment with different loss functions, and select the loss function that performs best on the validation set; Step 2.4, multi-objective optimization: adopt the multi-objective optimization technology of Pareto optimization, consider multiple performance indicators at the same time, and use genetic algorithm to balance the optimization of different indicators; Step 2.5, user interaction: Provide a user interaction interface to allow researchers or developers to make optimization suggestions based on experience and adjust the automated optimization process based on user feedback; Step 2.6, plan execution: pass the optimization plan to the planning module; The planning module is used to execute the optimization plan. It can call the corresponding computing resources and data resources according to the generated optimization plan to realize the iterative optimization of the large model.
2. The large model automatic evolution system with active learning capability according to claim 1, characterized in that: The step of the generation module generating a QA evaluation data set using the prompt engineering includes: Template-based prompt generation: a series of question and answer templates are pre-designed, and the collected external knowledge data is filled into the blank positions of the template according to the set rules to generate preliminary QA pairs; Enhance QA generation using knowledge graphs; Use the pre-trained large language model to optimize and enhance the generated preliminary QA pairs; Iterate and optimize the prompt template. Through continuous iteration, the effect of the prompt template is gradually improved to generate higher quality QA pairs. Manual screening and post-processing,The generated QA pairs are manually screened and post-processed. During the post-processing, the expressions of some QA pairs are polished and corrected. All QA pairs are aggregated to finally obtain the QA evaluation data set.
3. A working method of a large model automatic evolution system with active learning capability as claimed in claim 1, characterized in that: include: Collect user interaction data and external public data through data modules; Prompt engineering through the generation module, generate QA evaluation data for the collected data; The evaluation module uses the produced QA data to test and evaluate the large model to generate evaluation conclusions and data sets; Through the guidance module, based on the evaluation conclusions and the generated data set, an optimization plan is formulated through automation and rules to generate the direction for further optimization of the large model; By executing the optimization plan through the planning module, the corresponding computing resources and data resources can be called according to the generated optimization plan to achieve iterative optimization of the large model.
Citation Information
Patent Citations
Method and device for automatically constructing domain knowledge base based on large language model
CN116702766A
Knowledge base retrieval method and device based on large language model self-evaluation and self-feedback
CN116932717A
Large model knowledge updating method and device based on knowledge graph
CN116932776A
Learning training platform of automatic valuation model
CN117235524A
Care question and answer model training method based on transfer learning and expert feedback
CN117542471A
