A method and system for rapidly constructing intelligent agents based on enhanced retrieval

Through multi-dimensional task analysis, architecture search and optimization, knowledge distillation and adaptive compression of intelligent agent systems, the problems of efficient construction and lightweighting of intelligent agent systems in resource-constrained environments were solved, and real-time operation and improved retrieval accuracy on 1GB memory devices were achieved.

CN120407751BActive Publication Date: 2025-09-12JIANGSU HUIZHI INTELLIGENT DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510912995.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-09-12
Estimated Expiration
2045-07-03

AI Technical Summary

Technical Problem

In the existing technology, the construction of intelligent agent systems faces the problems of obvious differences in the requirements for retrieval model architecture in different application scenarios, high resource consumption, and reduced retrieval accuracy after the model is lightweight. It is difficult to achieve the automation and efficient construction of intelligent agent retrieval capabilities and adapt them to resource-constrained environments.

Method used

By analyzing and parameterizing retrieval task characteristics, building a multi-dimensional task analysis system, performing multi-objective architecture search and optimization, and conducting a hierarchical knowledge distillation transfer chain, combined with task-oriented adaptive compression and automated evaluation, a closed-loop optimization process is formed to generate an optimization model adapted to the target device.

Benefits of technology

It achieves real-time operation on 1GB memory devices, improves the retrieval accuracy of lightweight models, shortens the development cycle of intelligent agents from prototype to product, and adapts to deployment environments with various resource constraints.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407751B_ABST
    Figure CN120407751B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and discloses a method and system for quickly constructing an intelligent agent based on enhanced retrieval, wherein the method and system for quickly constructing an intelligent agent based on enhanced retrieval include: constructing a multi-dimensional task analysis system to automatically characterize the characteristics of the retrieval task through features such as data distribution, query complexity, and semantic requirements; executing a progressive architecture evolution algorithm to automatically find the optimal architecture that satisfies the multi-dimensional balance of retrieval accuracy, computational complexity, and memory usage based on the task feature vector; constructing a hierarchical knowledge distillation transfer chain to achieve efficient knowledge transfer from large models to small models through feature matching and attention guidance; implementing mixed precision quantization and structured pruning at different levels based on sensitivity analysis to adapt to the target deployment environment; the present invention reduces the model volume, improves the inference speed, and reduces energy consumption, so that the enhanced retrieval intelligent agent can run efficiently on resource-constrained devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a method and system for rapidly constructing an intelligent agent based on enhanced retrieval. Background Art

[0002] With the rapid development of artificial intelligence technology, intelligent agent systems have been widely used in various industries. Among them, retrieval-enhanced intelligent agents effectively expand the information boundaries and problem-solving capabilities of the model through the ability to acquire external knowledge.

[0003] However, the current construction of intelligent agent systems faces three prominent technical challenges: different application scenarios have significantly different requirements for retrieval model architectures, making traditional manual tuning methods time-consuming and ineffective; mainstream large-scale retrieval models are resource-intensive, making them difficult to deploy efficiently on edge devices with limited computing power and memory; and the migration from complex large models to lightweight models often results in significant performance degradation, leading to a significant reduction in retrieval accuracy after the model is lightweighted. These issues collectively hinder the rapid construction and widespread application of retrieval-enhanced intelligent agents.

[0004] In existing technologies, model architecture selection mainly relies on expert experience or simple hyperparameter search, which makes it difficult to find the optimal architecture in complex and changing application scenarios; for model lightweighting, single technologies such as pruning, quantization, and knowledge distillation are mainly used, and there is a lack of systematic optimization methods; for knowledge transfer between large and small models, direct distillation often leads to serious performance loss.

[0005] Therefore, how to realize the automated and efficient construction of intelligent agent retrieval capabilities so that it can be applied to resource-constrained environments while maintaining high retrieval performance has become a technical problem that needs to be solved. Summary of the Invention

[0006] The present invention provides a method and system for rapidly constructing an intelligent agent based on enhanced retrieval, which solves the technical problems of automatic construction and lightweight and efficient deployment of intelligent agent retrieval capabilities in related technologies.

[0007] The present invention provides a method for rapidly constructing an intelligent agent based on enhanced retrieval, comprising the following steps:

[0008] Analyze and parameterize retrieval task characteristics, build a multi-dimensional task analysis system, and automatically characterize retrieval task characteristics through data distribution, query complexity, semantic requirements, and other features to form a task characteristic vector;

[0009] Multi-objective architecture search and optimization: Based on the task feature vector, a progressive architecture evolution algorithm is executed to automatically find the optimal model architecture that satisfies the multi-dimensional balance of retrieval accuracy, computational complexity, and memory usage;

[0010] A hierarchical knowledge distillation chain builds a multi-level distillation structure from the original large model to the target lightweight model based on the optimal model architecture. It achieves efficient knowledge transfer through feature matching and attention guidance, and outputs a preliminary lightweight model.

[0011] Task-oriented adaptive compression: Based on preliminary lightweight models and model sensitivity analysis, mixed-precision quantization and structured pruning are performed on different layers to generate optimized models adapted to the target device.

[0012] Automated evaluation and iterative improvement: Based on the optimization model, a multi-scenario evaluation system is built. Reinforcement learning algorithms are applied to optimize distillation paths and hyperparameters. Dynamic adjustments and continuous optimization are performed to form a closed-loop optimization process and output the final deployment model.

[0013] In a preferred embodiment, in the retrieval task feature analysis and parameterization step, the multi-dimensional task analysis system extracts three types of key features: data distribution features, query complexity features, and semantic requirement features, and generates a low-dimensional task feature vector through a feature fusion network.

[0014] In a preferred embodiment, the feature fusion process is implemented by weighted combination, that is, the data distribution features, query complexity features and semantic requirement features are multiplied by the corresponding weight matrices respectively and then added together, and then the final task feature vector is generated through a nonlinear activation function.

[0015] In a preferred embodiment, the multi-objective architecture search and optimization step adopts a weighted comprehensive scoring function, which comprehensively considers three aspects: performance loss, computational complexity loss, and memory usage loss, and balances the importance of each objective through a weight coefficient.

[0016] In a preferred embodiment, in the hierarchical knowledge distillation transfer chain step, the scale of the intermediate model is designed according to a linear decreasing rule from the original large model to the target lightweight model, ensuring a smooth transition of knowledge during the transfer process.

[0017] In a preferred embodiment, in the hierarchical knowledge distillation transfer chain step, the feature matching loss function is implemented by calculating the sum of squared Euclidean distances between the feature representations of the corresponding layers of the student model and the teacher model, and assigning different weights according to the importance of the layers.

[0018] In a preferred embodiment, in the task-oriented adaptive compression step, parameter sensitivity evaluation is measured by calculating the average absolute value of the gradient of the validation set loss function with respect to each layer parameter, thereby determining the degree of influence of different layer parameters on model performance.

[0019] In a preferred embodiment, in the task-oriented adaptive compression step, a mixed precision quantization strategy is adopted, 8-bit quantization is adopted for the high sensitivity layer, 4-bit quantization is adopted for the medium sensitivity layer, and 2-bit quantization is adopted for the low sensitivity layer.

[0020] In a preferred embodiment, it also includes automated evaluation and iterative improvement steps: building a multi-scenario evaluation system, applying reinforcement learning algorithms to optimize distillation paths and hyperparameters, performing dynamic adjustments and continuous optimization, and forming a closed-loop optimization process.

[0021] In a preferred embodiment, a system for rapidly constructing an intelligent agent based on enhanced retrieval is used to execute a method for rapidly constructing an intelligent agent based on enhanced retrieval, comprising:

[0022] Retrieval task analysis subsystem, used to perform retrieval task characteristic analysis and parameterization;

[0023] Architecture search subsystem, used to perform multi-objective architecture search and optimization;

[0024] Knowledge distillation subsystem, used to execute the hierarchical knowledge distillation transfer chain;

[0025] Model compression subsystem for performing task-oriented adaptive compression;

[0026] The evaluation and optimization subsystem is used to perform automated evaluation and iterative improvement.

[0027] The beneficial effects of the present invention are:

[0028] In terms of model lightweighting, compared with traditional compression methods, the present invention can reduce the number of model parameters, improve the inference speed, and reduce energy consumption, so that the enhanced retrieval agent can run in real time on a 1GB memory device, expanding the application scenarios of the agent.

[0029] In terms of performance preservation, the present invention improves the retrieval accuracy of the lightweight model through hierarchical knowledge distillation transfer chain and multi-objective optimization, improves the accuracy in complex semantic retrieval tasks, and reduces performance loss in the lightweight process.

[0030] In terms of construction efficiency, the automated architecture search and evaluation optimization system of the present invention reduces manual intervention time, shortens the development cycle of intelligent agents from prototype to product from several weeks to several hours, and greatly improves the efficiency of intelligent agent construction.

[0031] The present invention provides strict resource controllability. Through adaptive compression technology, it can accurately control the size, computational complexity and memory usage of the model according to the resource constraints of the target deployment environment, thereby achieving precise adaptation and efficient operation on various devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flow chart of a method for rapidly constructing an intelligent agent based on enhanced retrieval of the present invention. DETAILED DESCRIPTION

[0033] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that these embodiments are discussed solely to enable those skilled in the art to better understand and implement the subject matter described herein, and that the functions and arrangements of the elements discussed may be varied without departing from the scope of this specification. Various examples may omit, substitute, or add various processes or components as needed. Furthermore, features described in some examples may be combined in other examples.

[0034] At least one embodiment of the present invention discloses a method for rapidly constructing an intelligent agent based on enhanced retrieval, such as Figure 1 As shown, the following steps are included:

[0035] Step 1: Analyze and parameterize retrieval task characteristics. Build a multi-dimensional task analysis system to automatically characterize retrieval task characteristics through data distribution, query complexity, semantic requirements, and other features to form a task characteristic vector.

[0036] It includes the following sub-steps:

[0037] Step 1.1, build a multi-dimensional task characteristic analysis system;

[0038] A feature extraction algorithm is used to perform multi-dimensional feature analysis on the retrieval task. The input is the retrieval task dataset of the agent to be constructed, and the output is the feature vector of the retrieval task. The specific implementation is as follows:

[0039] Preprocess the input retrieval task dataset and extract three types of key features:

[0040] Data distribution characteristics, including query length distribution, document length distribution, word frequency statistics, etc.

[0041] Query complexity characteristics, including query type distribution, semantic complexity, and multi-hop reasoning requirements;

[0042] Semantic demand characteristics, including exact matching demand degree, semantic matching demand degree, etc.

[0043] In some embodiments, feature extraction may also include domain-specific features, such as term density in the financial field, expertise requirement in the medical field, etc., so as to capture more refined task characteristics for specific vertical fields.

[0044] The feature extraction algorithm, one of the innovations of this application, can be applied in intelligent customer service scenarios. For example, it can analyze user query logs to extract query length distribution, common question type distribution, and semantic matching requirements. These features will guide subsequent architecture selection. For example, in scenarios where short queries are predominant, complex long text processing capabilities may not be necessary, thus simplifying the model architecture.

[0045] These original features are processed through the feature fusion network to generate low-dimensional feature vectors. The feature fusion process can be expressed as:

[0046] ;

[0047] in, Represents the final task feature vector, which is a low-dimensional representation obtained by fusing multiple features and is used to guide subsequent architecture selection; Represents data distribution characteristics, including query length distribution, document length distribution, word frequency statistics and other data statistics; Represents query complexity characteristics, including query type distribution, semantic complexity, multi-hop reasoning requirements and other query difficulty indicators; Represents semantic demand characteristics, including semantic understanding requirements such as exact matching requirement degree and semantic matching requirement degree; 、 、 The weight matrices representing data distribution features, query complexity features, and semantic requirement features are used to adjust the importance of different feature categories in the fusion process; It is a nonlinear activation function used to introduce nonlinear transformation and enhance feature expression capabilities.

[0048] The feature fusion network can adopt the attention mechanism to dynamically adjust the importance weights of different feature groups according to the task type, so that the system can better adapt to the characteristic differences in different fields.

[0049] In practical applications, such as when building a medical question-answering system, the feature fusion network can fuse medical terminology density (data features), diagnostic reasoning complexity (query features), and professional terminology understanding requirements (semantic features) into a unified feature vector. This vector indicates that the medical question-answering system requires strong professional vocabulary understanding and reasoning capabilities, and thus tends to choose complex architectures that include medical knowledge enhancement modules in subsequent architecture searches.

[0050] Step 1.2, establish a differentiable retrieval component library;

[0051] Build a differentiable component library containing various retrieval model components. The input is a set of basic components of the retrieval model, and the output is a parameterizable component operation graph.

[0052] According to the embodiment of the present application, in the specific implementation, three types of basic components are first defined:

[0053] Encoder components, including BERT-like encoders, CNN encoders, RNN encoders, and other types, are used for text representation extraction;

[0054] Interaction layer components, including attention interaction, dot product interaction, cosine similarity calculation, etc., are used to calculate the relevance between queries and documents;

[0055] Aggregation layer components, including pooling layers, fully connected layers, etc., are used to generate the final relevance score.

[0056] In some embodiments, the component library can be expanded to include domain-specific functional modules, such as an ontology mapping module in the medical field, a clause association module in the legal field, etc., so as to improve adaptability to tasks in specific fields.

[0057] In addition, these components are constructed as a differentiable computational graph, and the selection of each component is achieved through a soft selection mechanism, namely:

[0058] ;

[0059] in, The final architectural representation is a weighted combination of all selected components; An index representing the component type; Represents the option index in a specific type of component; Indicates the In the class component The weight of an option determines its importance in the final architecture; Represents the corresponding component operation, that is, the actual computing function or module executed.

[0060] Weight Calculated by soft selection function:

[0061] ;

[0062] in, Indicates the In the class component The soft selection weight of an option determines the importance of the option in the final architecture; are the corresponding architecture parameters, which are initially set to random values ​​and are continuously optimized during the subsequent architecture search process; represents the natural exponential function; Indicates the All possible options for class components Perform summation; Indicates in The indices of all possible options in the class component are the variables of the sum operation; the entire formula implements the softmax function to ensure that the sum of the weights of all options in the same class component is 1, making the architecture selection differentiable.

[0063] For complex search spaces, a hierarchical architectural parameter representation can be introduced to separate component selection from component configuration, thereby reducing the complexity of the search space while maintaining flexibility.

[0064] Step 1.3, implement architecture soft selection mapping;

[0065] The task feature vector is used to guide the initialization of architecture parameters. The input is the task feature vector and the component library, and the output is the initialized architecture parameters.

[0066] In the specific implementation, a mapping network is constructed to map the task feature vector to the initial value of the architecture parameter:

[0067] ;

[0068] in, Indicates the In the class component The architecture parameter values ​​of the options, which will be used to calculate the soft selection weights later ; Represents the task feature vector, which contains multi-dimensional feature information such as data distribution, query complexity, and semantic requirements of the retrieval task; represents a multilayer perceptron network, which is a feedforward neural network used to learn the mapping relationship between task characteristics and optimal architecture parameters; Represents the task feature vector After inputting into the multilayer perceptron, the output In the class component In this way, the system can automatically initialize more appropriate architecture parameters according to the characteristics of the retrieval task, thus accelerating the subsequent architecture search process.

[0069] Step 2: Multi-objective architecture search and optimization. Based on the task feature vector, a progressive architecture evolution algorithm is executed to automatically find the optimal model architecture that satisfies the multi-dimensional balance of retrieval accuracy, computational complexity, and memory usage.

[0070] It includes the following sub-steps:

[0071] Step 2.1, build a multi-objective evaluation system;

[0072] A multi-dimensional evaluation index system is established, with the input being the candidate retrieval model architecture and the output being the evaluation score of the architecture in multiple target dimensions.

[0073] Three types of evaluation indicators are defined:

[0074] Retrieval performance indicators, including Mean Average Precision (MAP), Normalized Discounted Cumulative Gain (NDCG), recall rate, and other indicators that measure retrieval accuracy;

[0075] Computational complexity metrics, including floating-point operations per second (FLOPs) and inference latency, which measure computational efficiency.

[0076] Memory consumption indicators, including the number of model parameters, runtime memory usage, and other indicators that measure storage requirements.

[0077] Construct a weighted comprehensive scoring function:

[0078] ;

[0079] in, Represents the total loss function, which is used to comprehensively evaluate the overall performance of the model; represents the performance loss, which measures the performance of the model in terms of retrieval accuracy; Represents complexity loss, which measures the computational complexity of the model; Represents memory loss, which measures the storage requirements of the model; is the weight coefficient of complexity loss, which is used to adjust the importance of computational complexity in the overall evaluation; Is the weight coefficient of memory loss, which is used to adjust the importance of memory consumption in the overall evaluation. and The value of can balance the relationship between the model's retrieval performance, computational efficiency, and memory usage according to the needs of the actual application scenario.

[0080] These loss functions are defined as:

[0081] ;

[0082] ;

[0083] ;

[0084] in, Represents the performance loss, which is calculated as 1 minus the average of all retrieval performance indicators; Indicates the total number of retrieval performance indicators; Indicates the The normalized value of a retrieval performance indicator ranges from 0 to 1, with larger values ​​indicating better performance. Indicates the computational complexity loss, which is calculated by dividing the number of floating-point operations of the current model by the maximum number of floating-point operations allowed. The smaller the value, the higher the computational efficiency. Indicates memory loss, which is calculated by dividing the number of parameters in the current model by the maximum number of parameters allowed. The smaller the value, the less memory is used. Indicates the floating-point operation number of the current model; Indicates the number of parameters of the current model; Indicates the upper limit of the maximum floating-point operations allowed by the system; The three loss functions together constitute the evaluation criteria of the multi-objective evaluation system.

[0085] Step 2.2, implement the progressive architecture evolution algorithm;

[0086] A progressive evolution strategy is used to optimize the architecture parameters. The input is the initial architecture parameters and a multi-objective evaluation system, and the output is the optimized architecture parameters.

[0087] When implementing it, we start with a simple infrastructure and use the following iterative optimization process:

[0088] For the current architecture parameters Calculating soft selection weights ;

[0089] Build a retrieval model based on the soft selection weights and evaluate it on the validation set;

[0090] Calculating multi-objective loss ;

[0091] Update the architecture parameters via gradient descent:

[0092] ;

[0093] in, Indicates the iteration round, that is, the number of iterations of the current optimization algorithm; is the learning rate, which controls the step size of each parameter update; Indicates the During the round of iteration Class component The architecture parameters of the options; Represents the updated architecture parameters; Represents a multi-objective loss function For architecture parameters The partial derivative of , indicating the direction of parameter update. This formula implements the architecture parameter optimization process based on gradient descent.

[0094] In some implementations, a second-order optimization method, such as the Newton method or the quasi-Newton method, may be employed to accelerate the convergence of the architecture parameters, especially when the search space is large.

[0095] To prevent falling into a local optimal solution, the system can introduce periodic random perturbations or adopt strategies such as simulated annealing to strike a balance between exploration and utilization.

[0096] The progressive architecture evolution algorithm is one of the core innovative algorithms of this application. Its specific application in the process of building intelligent entities can be reflected in the e-commerce recommendation system scenario.

[0097] In the initial stage, the algorithm can start with a simple content-based encoder and then gradually introduce complex components such as user behavior interaction layer and multimodal feature fusion layer.

[0098] Through continuous iterative evaluation, the algorithm may find that in this scenario, modeling the user's historical click sequence contributes most to recommendation accuracy. Therefore, it will gradually increase the complexity of components related to sequence modeling while keeping other components relatively simple, thereby finding the optimal balance between performance and resource consumption.

[0099] As the iterations progress, the architecture complexity is gradually increased, expanding the architecture search space by introducing new component options or increasing component connections. After each increase in complexity, the optimal parameters from the previous stage are used as the starting point for further optimization to avoid falling into local optimality.

[0100] Step 2.3, perform architecture determination and discretization;

[0101] The optimized soft architecture parameters are converted into a deterministic architecture, with the input being the optimal soft architecture parameters and the output being the deterministic retrieval model architecture.

[0102] According to an embodiment of the present application, during specific implementation, for each type of component, the option with the largest weight is selected as the final option:

[0103] ;

[0104] in, represents the optimal component option index finally selected, Indicates taking the parameter value that makes the following expression reach the maximum value. Represents a collection of all optional component options. Indicates the Class component The soft selection weight of each option is calculated, where the larger the weight, the better the option. Through this formula, the system can select the option with the highest weight for each type of component, thereby determining the final model architecture.

[0105] At the same time, multiple options with similar weights are recorded as alternatives for subsequent model integration. The final output is the determined retrieval model architecture, including the specific encoder type, interaction mode and aggregation method, as well as the connection relationship between them.

[0106] Step 3: A hierarchical knowledge distillation chain is constructed based on the optimal model architecture. A multi-level distillation structure is constructed from the original large model to the target lightweight model. Efficient knowledge transfer is achieved through feature matching and attention guidance, and a preliminary lightweight model is output.

[0107] It includes the following sub-steps:

[0108] Step 3.1, build the knowledge transfer chain architecture;

[0109] A hierarchical model transfer chain structure is established, with the input being the original large-scale retrieval model and the target lightweight model architecture, and the output being a transfer chain containing multiple intermediate-scale models.

[0110] When implementing it, first determine the length of the transfer chain , determined by the scale difference between the original model and the target model. Then, design Intermediate Model , so that it forms a large model from the original To target lightweight model A decreasing scale sequence, where 、 、 Respectively represent 、 、 an intermediate model; Represents the target lightweight model.

[0111] Each intermediate model uses the same architecture type as the target model, but with decreasing scale, generally following the following rules:

[0112] ;

[0113] in, Indicates the The number of parameters of the model, Indicates the index position of the model in the transfer chain ( From 0 to ), Represents the original large model, represents the target lightweight model, Represents the total length of the transfer chain, that is, the total number of models minus 1, represents the parameter ratio of the target lightweight model to the original large model. This formula ensures a smooth decrease in model size from the original large model to the target lightweight model, avoiding knowledge transfer losses caused by large differences in parameter values ​​between adjacent models.

[0114] Step 3.2: Implement feature matching and attention guidance;

[0115] Perform feature matching and attention-guided knowledge transfer for adjacent model pairs in the transfer chain, with the input being the teacher model and student models , the output is the trained student model.

[0116] The feature matching process aligns the intermediate layer feature representation of the model, and the loss function is:

[0117] ;

[0118] in, represents the feature matching loss function, which is used to measure the difference between the feature representation of the student model and the teacher model; Represents the index of the model layer, used to traverse each layer of the model; 、 Represents the student model and teacher model The feature representation of the layer, that is, the output vector or tensor of each layer; It is the layer weight coefficient, which is used to adjust the importance of feature matching at different layers. Usually, the closer to the output layer, the greater the weight; Represents the square of the Euclidean distance, which is used to calculate the degree of difference between two feature representations; Indicates that the sum operation is performed on all selected model layers, taking into account the feature matching of each layer.

[0119] In some embodiments, feature matching can be extended from simple Euclidean distance to more complex distribution matching, such as by minimizing the KL divergence or JS divergence between student features and teacher features. This method can better preserve distribution information, especially when the feature distribution exhibits multimodal characteristics.

[0120] Different distance metrics can be used for different types of feature representations. For example, dynamic time warping (DTW) distance can be used for sequence features, and graph edit distance can be used for graph structure features.

[0121] The attention guidance process ensures that the student model focuses on the same input region as the teacher model by aligning the attention maps:

[0122] ;

[0123] in, represents the attention-guided loss function, which is used to measure the difference in attention distribution between the student model and the teacher model; Represents the attention weight matrix generated by the student model when processing the input data, reflecting which parts of the input the student model focuses on; Represents the attention weight matrix of the teacher model, which serves as the learning target of the student model; It represents the Frobenius norm, a kind of matrix norm, which is used to calculate the Euclidean distance between two attention matrices. The smaller the value, the more similar the two attention distributions are.

[0124] Feature matching and attention guidance are the key innovative technologies of this application. In the application scenario of financial risk control intelligent agents, large-scale teacher models may construct complex feature representations on multiple dimensions of transaction data, including time patterns, amount distribution, merchant categories, etc.

[0125] Through feature matching, the small student model not only learns the final risk control decisions but also learns how to extract these intermediate features. For example, when detecting an unusual trading pattern, the student model focuses on the same key trading features as the teacher model (such as geographic location spans within a short period of time and sudden changes in trading frequency). This significantly reduces the model size while maintaining high-accuracy risk identification capabilities.

[0126] The final distillation loss function combines feature matching, attention guidance and task-specific loss:

[0127] ;

[0128] in, is the final distillation loss function, which is used to guide the training of the student model; It is a loss function for a specific retrieval task, such as ranking loss or classification loss, which ensures that the student model can complete the original task; is the feature matching loss, which is used to align the intermediate layer feature representations of the student model and the teacher model; is the attention-guided loss, ensuring that the student model focuses on the same input region as the teacher model; 、 、 are the weight coefficients representing task learning, feature matching, and attention respectively.

[0129] The distillation process can introduce a curriculum learning strategy, starting from simple samples and gradually increasing the sample complexity, so that the student model can learn the knowledge of the teacher model more smoothly.

[0130] Step 3.3, perform progressive knowledge transfer;

[0131] Knowledge distillation is performed sequentially on the transfer chain. The input is the constructed transfer chain and the initialized model parameters, and the output is the trained target lightweight model.

[0132] According to an embodiment of the present application, in a specific implementation, the distillation process is performed in order from large to small:

[0133] Use pre-trained original large model As the first teacher model;

[0134] For each pair of adjacent models , use the method in step 3.2 to perform knowledge distillation and train the student model ;

[0135] After training is completed, the current student model is turned into the teacher model for the next stage and the distillation process continues;

[0136] Repeat the above process until the target lightweight model Training completed.

[0137] This progressive knowledge transfer method effectively reduces information loss during the knowledge compression process by narrowing the scale gap between adjacent models, enabling the final lightweight model to better retain the retrieval capability of the original large model.

[0138] Step 4: Task-oriented adaptive compression: Based on the preliminary lightweight model and model sensitivity analysis, mixed-precision quantization and structured pruning are performed on different layers to generate an optimized model adapted to the target device;

[0139] It includes the following sub-steps:

[0140] Step 4.1, perform model sensitivity analysis;

[0141] This step analyzes the importance of parameters at each layer of the model. The input is a lightweight model, and the output is the sensitivity score of the parameters at each layer.

[0142] When implementing it, first define the parameter sensitivity evaluation function:

[0143] ;

[0144] in, is the loss function on the validation set, which represents the overall performance index of the model on the validation dataset; It is Layer weight parameter, representing the model's The first layer trainable parameters; It represents the partial derivative of the loss function with respect to the weight parameter, reflecting the influence of the parameter on the model performance; It is the size of the gradient after taking the absolute value, which is a quantitative indicator of the importance of the parameter; is the total number of parameters in this layer, used to normalize the calculation results; Indicates the The overall sensitivity score of the layer. A larger value indicates that the layer has a more significant impact on the model performance.

[0145] In some implementations, in addition to gradient-based sensitivity analysis, perturbation analysis can be used. This involves adding varying degrees of noise to a parameter and observing the resulting change in model performance to assess parameter importance. This approach is also applicable to non-differentiable evaluation metrics.

[0146] For complex network structures, a sensitivity assessment method based on graph analysis can be used to consider the centrality of parameters in the network connection graph and identify the key parameters that have the greatest impact on information flow.

[0147] Sensitivity analysis algorithms have important applications in the deployment of video analysis agents. For example, in a security monitoring system, sensitivity analysis may reveal that the convolutional layer responsible for facial feature extraction in the model has the greatest impact on the final recognition accuracy, while the layer responsible for background scene analysis has a relatively small impact.

[0148] Based on this discovery, the system retains higher precision (8 bits) for the facial feature extraction related layer, and uses lower precision quantization (2 to 4 bits) for the background analysis layer, thereby significantly reducing the model size and inference latency while maintaining key recognition capabilities, enabling the intelligent agent to run efficiently on devices with limited computing resources such as edge cameras.

[0149] In order to improve the stability of sensitivity assessment, the average sensitivity can be calculated using multiple batches of data:

[0150] ;

[0151] in, Indicates the The average sensitivity score of the layer parameters, It is in The first calculation is based on the batch data Layer parameter sensitivity, is the total number of batches used to calculate the sensitivity. This formula improves the stability and reliability of the sensitivity assessment by averaging the sensitivities calculated across multiple data batches, reducing the potential impact of fluctuations in a single batch of data.

[0152] Finally, based on the sensitivity scores, the model layers are divided into high-sensitivity layer, medium-sensitivity layer and low-sensitivity layer, providing a basis for subsequent differentiated compression.

[0153] Step 4.2, apply mixed precision quantization;

[0154] Perform differential accuracy quantization on the model, with model parameters and sensitivity scores as input and a quantized low-precision model as output.

[0155] According to the embodiment of the present application, the following quantification strategy is adopted in the specific implementation:

[0156] For the high-sensitivity layer, 8-bit quantization is used to retain higher precision:

[0157] ;

[0158] in, Indicates the The raw floating-point weight parameters of the layer, Indicates the minimum value of the layer parameter, Indicates the maximum value of the layer parameter, Indicates normalizing the parameters to Interval operations, Indicates mapping the normalized value to Integer interval, The function ensures that the value does not exceed the valid range. Indicates that rounding operation is performed. Represents the quantized 8-bit integer weight value.

[0159] For the medium sensitivity layer, 4-bit quantization is used:

[0160] ;

[0161] in, Indicates the The weight parameters of the layer after 4-bit quantization; Indicates the The original weight parameters of the layer; Indicates the The minimum value of the layer weight parameter; Indicates the The maximum value of the layer weight parameter; Represents the rounding function; Represents a clipping function that limits values ​​to a valid range; The range of integers that can be represented by 4 bits is 0-15, a total of 16 different values. This formula implements the quantization process of linearly mapping floating-point weights to 4-bit integer representation.

[0162] For the low-sensitivity layer, 2-bit quantization is used:

[0163] ;

[0164] in, Indicates the The weight parameters of the layer after 2-bit quantization; Indicates the The original weight parameters of the layer; Indicates the The minimum value of the layer weight parameter; Indicates the The maximum value of the layer weight parameter; Represents the rounding function; Represents a clipping function that limits values ​​to a valid range; Represents the normalization of weights, mapping the weights to the interval [0, 1]; multiplying by 3 yields a value in the interval [0, 3], corresponding to the four possible values ​​(0, 1, 2, 3) after 2-bit quantization.

[0165] For particularly important parameter blocks, asymmetric quantization can be used to improve accuracy:

[0166] ;

[0167] in, Indicates the The weight parameters of the layer after asymmetric quantization; Indicates the The weight parameters of the layer are quantized into integer form; is the quantization scaling factor used to map integer values ​​back to the floating-point range, and its value is calculated based on the distribution characteristics of the layer parameters; is the zero offset value used to handle asymmetric weight distributions, ensuring a more accurate representation of the original weight distribution during quantization, especially when the weight distribution is not centered around zero. This asymmetric quantization method, by separately calculating the scaling factor and zero offset for each layer parameter, more accurately preserves the distribution characteristics of the original parameters and reduces information loss during quantization.

[0168] Step 4.3, perform structured pruning;

[0169] Through structured pruning, connections with smaller contributions are removed. The input is a quantized model, and the output is a further compressed sparse model.

[0170] When implementing this, first calculate the importance scores for the parameters of each layer of the model or the entire substructure:

[0171] ;

[0172] in, Indicates the The importance score of the layer parameter is used to evaluate the contribution of the parameter to the model performance; It is The absolute value of the layer parameter reflects the magnitude of the parameter itself; Represents the gradient of the loss function with respect to the layer parameters, reflecting the degree of influence of parameter changes on model performance; It is the size of the gradient after taking the absolute value; the product of the two comprehensively considers the size and sensitivity of the parameter. The larger the value, the more important the parameter or structure is to the model and the more it should be retained.

[0173] Set pruning threshold based on importance score , for each layer:

[0174] Remove connections whose importance is below a threshold:

[0175] ;

[0176] in, represents the weight matrix after pruning, represents the original weight matrix, represents the importance score of the weight, Indicates the The pruning threshold of the layer, It is an indicator function, which takes the value of 1 when the weight importance is greater than the threshold, otherwise it is 0, thus removing the low-importance connections;

[0177] For each structural unit (such as the entire filter or attention head), evaluate its overall importance and remove the units with the lowest importance.

[0178] After the pruning operation, a short-term fine-tuning is performed to restore the performance.

[0179] The final pruning rate is adaptively adjusted based on the resource constraints of the target device. For devices with extremely limited computing resources, more aggressive pruning can be performed, sacrificing some accuracy in exchange for higher efficiency.

[0180] Step 4.4, optimize the inference calculation graph;

[0181] Perform inference graph optimization on the quantized and pruned model, with the compressed model as input and the optimized computation graph suitable for the target hardware as output.

[0182] According to the embodiments of the present application, the specific implementation includes:

[0183] Operator fusion, combining multiple consecutive operations into a single efficient operation;

[0184] Memory planning to optimize the storage and reuse of intermediate results;

[0185] Parallel scheduling, reasonably distribute computing tasks to fully utilize the parallel characteristics of hardware.

[0186] Specific inference optimizations are performed for different target deployment platforms, such as ARM mobile processors, FPGAs, or custom AI accelerators, to further improve the model's running efficiency on the target device.

[0187] Step 5: Automated evaluation and iterative improvement. Based on the optimization model, a multi-scenario evaluation system is built. Reinforcement learning algorithms are applied to optimize the distillation path and hyperparameters. Dynamic adjustments and continuous optimization are performed to form a closed-loop optimization process, and the final deployment model is output.

[0188] It includes the following sub-steps:

[0189] Step 5.1, build a multi-scenario evaluation system;

[0190] Establish an evaluation environment covering various retrieval scenarios, with the input being the compressed and optimized model and the output being the comprehensive performance score of the model in each scenario.

[0191] In the specific implementation, we build an evaluation dataset with different retrieval difficulties and characteristics, covering:

[0192] Simple words match the scene;

[0193] Semantic retrieval scenario;

[0194] Multi-round interactive retrieval scenario;

[0195] Noisy data retrieval scenario.

[0196] For each scenario, corresponding evaluation indicators and weights are designed, comprehensively considering retrieval accuracy, response time and resource consumption.

[0197] In some embodiments, the evaluation system can introduce adversarial sample testing to evaluate the robustness and exception handling capabilities of the model by generating boundary cases and abnormal inputs, which is particularly important for safety-critical applications.

[0198] Multi-scenario evaluation can use automated sensitivity analysis to systematically change input parameters (such as query length, noise level, etc.) and plot the model performance curve as the parameters change, so as to fully understand the strengths and limitations of the model.

[0199] In practical applications, such as building an intelligent customer service robot, the multi-scenario evaluation system will evaluate model performance in multiple scenarios simultaneously: testing accuracy and response speed in a simple FAQs matching scenario;

[0200] Test context understanding capabilities in complex multi-turn dialogue scenarios;

[0201] Test robustness in scenarios with noisy data (e.g., user spelling errors and poor grammar).

[0202] By integrating the evaluation results of these scenarios, the system can identify scenarios where the model performs poorly and make targeted adjustments for optimization. For example, if the model's ability to understand context in multiple rounds of conversation is insufficient, the system will automatically enhance the expressiveness of the relevant modules, while potentially sacrificing some response speed to improve the overall user experience.

[0203] The evaluation results are presented in the form of performance analysis charts, which clearly show the model's performance in various aspects and bottlenecks, providing direction for subsequent optimization.

[0204] Step 5.2: Apply reinforcement learning to optimize the distillation path and hyperparameters.

[0205] The reinforcement learning algorithm is used to automatically search for the optimal distillation path and hyperparameters. The input is the feedback data of the evaluation system, and the output is the optimized distillation strategy.

[0206] According to the embodiment of the present application, in a specific implementation, a policy space is first defined, including:

[0207] delivery chain length and structure;

[0208] The weight coefficient of the distillation loss function;

[0209] Layer selection for feature matching;

[0210] Hyperparameters such as learning rate and number of training rounds.

[0211] Then, a reinforcement learning agent is built to gradually learn the optimal strategy by continuously trying different strategy combinations and obtaining evaluation feedback.

[0212] A gradient-based strategy search algorithm is used, and the optimization goal is the comprehensive performance score of the model in the evaluation system.

[0213] During the learning process, the agent can automatically adjust the most suitable distillation strategy according to the characteristics of different retrieval tasks. For example, for semantically complex tasks, the weight of feature matching may be increased; while for simple matching tasks, more emphasis may be placed on model lightweighting.

[0214] Step 5.3, perform dynamic adjustment and continuous optimization;

[0215] The optimization direction is dynamically adjusted based on the evaluation feedback. The input is the model performance analysis data, and the output is the adjusted optimization strategy and improved model.

[0216] According to an embodiment of the present application, during implementation, the system analyzes performance profiling data to identify the main bottlenecks of the current model:

[0217] If the bottleneck is retrieval accuracy, adjust the architecture search space and add component options with stronger model expressiveness;

[0218] If the bottleneck is inference speed, optimize computationally intensive operations such as attention calculation or sequence processing;

[0219] If the bottleneck is memory usage, strengthen parameter sharing or increase the intensity of structured pruning.

[0220] Based on the identified bottlenecks, the system automatically adjusts the focus of each optimization step, such as re-executing the architecture search, adjusting the distillation strategy, or modifying the compression scheme, forming a closed-loop optimization process to continuously improve model performance until the predetermined goals are met.

[0221] Application examples of this embodiment:

[0222] Intelligent customer service scenario application:

[0223] The method for rapidly constructing an intelligent agent based on enhanced retrieval of the present invention can be applied to the rapid construction and deployment of an enterprise intelligent customer service system. The following takes the construction of an after-sales service intelligent agent on an e-commerce platform as an example to explain the specific application process of the method of the present invention in detail.

[0224] Predefined model library construction:

[0225] For e-commerce after-sales service scenarios, a predefined model library containing the following models is built:

[0226] Basic encoder: 10 mainstream pre-training models including BERT-base Chinese pre-training model, RoBERTa-wwm-ext Chinese pre-training model, MacBERT pre-training model, and DeBERTa-v3-base model;

[0227] Interaction layer: Five interaction mechanisms, including Cross-Attention mechanism, Co-Attention mechanism, and Dot-ProductAttention;

[0228] Aggregation layer: 6 aggregation methods including average pooling, maximum pooling, and self-attention pooling;

[0229] Feature analysis network: There are four types of feature analysis networks, including Transformer-based text analysis network and CNN-based feature extraction network.

[0230] Feature analysis of e-commerce after-sales knowledge base:

[0231] Collect historical Q&A data and knowledge base documents from after-sales service on e-commerce platforms, covering categories such as return and exchange policies, logistics issues, and product quality issues, totaling 100,000 Q&A pairs and 5,000 knowledge documents. Use a feature analysis system for processing:

[0232] Semantic feature analysis: We perform semantic analysis on question-answer pairs and knowledge documents to extract key information, such as question type, sentiment, and key entities. This analysis found that e-commerce after-sales service issues primarily focus on areas such as "refund process," "logistics status," and "product quality." These issues are also diverse in their expression, with the same question potentially being expressed in multiple ways.

[0233] Structural feature analysis: Analyze the structural features of knowledge base documents, including paragraph division, title hierarchy, list structure, etc. We found that most knowledge documents adopt a hierarchical structure, and important information often appears in the title and at the beginning of the paragraph.

[0234] Interaction feature analysis: By analyzing the semantic association patterns between user questions and answers, we found that in after-sales service, user questions are often incomplete or contain implicit information, requiring the intelligent agent to understand the user's true intention through context.

[0235] Based on the analysis results, the feature fusion network generates a 16-dimensional low-dimensional feature vector, consisting of 6 dimensions for semantic features, 4 dimensions for structural features, and 6 dimensions for interaction features. This feature vector contains the core feature information of the e-commerce after-sales service text data.

[0236] Execute the architecture evolution algorithm:

[0237] According to the 16-dimensional features of the feature vector, set the constraints of the architecture evolution algorithm:

[0238] Response speed limit: The response time for a single query shall not exceed 100ms;

[0239] Accuracy requirement: Top-3 recall rate is not less than 95%;

[0240] Resource limit: Model size does not exceed 500MB.

[0241] The execution process of the evolutionary algorithm is as follows:

[0242] Initialize the population: randomly generate 50 different encoder interaction layer and aggregation layer combinations;

[0243] Fitness evaluation: Evaluate the performance of each combination on the e-commerce after-sales dataset;

[0244] Evolution iteration: 200 rounds of evolution iterations were performed, including crossover, mutation, and selection operations;

[0245] Optimal solution selection: The five architecture combinations with the highest fitness are selected to enter the next stage.

[0246] After algorithm optimization, the optimal architecture was ultimately selected: a MacBERT-base encoder + a Cross-Attention interaction layer + a self-attention pooling aggregation layer. This architecture performed best on feature vectors in e-commerce after-sales scenarios, balancing accuracy and efficiency.

[0247] Building a knowledge distillation chain:

[0248] Starting from the optimal architecture, we build a three-level knowledge distillation chain:

[0249] Teacher model: MacBERT-base encoder (110M parameters) + Cross-Attention interaction layer + Self-Attention Pooling aggregation layer;

[0250] Intermediate student model: 6-layer Transformer encoder (60M parameters) + simplified Cross-Attention interaction layer + self-attention pooling aggregation layer;

[0251] The final lightweight model: 4-layer Transformer encoder (25M parameters) + dot-product attention interaction layer + weighted average pooling aggregation layer.

[0252] During the distillation process, 100,000 question-answer pairs and 5,000 knowledge documents from an e-commerce after-sales platform were used as distillation data, and 3,000 manually annotated high-quality question-answer pairs were introduced as alignment data.

[0253] Differential Compression:

[0254] For the final lightweight model, implement a differential compression strategy:

[0255] Coding layer compression: Apply weight pruning technology to retain 85% of the weights and reduce the number of parameters;

[0256] Interaction layer optimization: Design a simplified dot-product attention mechanism to reduce computational complexity;

[0257] Simplified aggregation layer: weighted average pooling is used instead of complex pooling operations;

[0258] Quantization: Quantize the model weights to 8 bits to further reduce the model size.

[0259] After differential compression, the final lightweight retrieval model is only 15MB in size, the single query response time is reduced to 35ms, and the Top-3 recall rate is maintained at 96.8%, meeting the efficient response needs of e-commerce after-sales intelligent agents.

[0260] Deployment and Evaluation:

[0261] The constructed lightweight retrieval model was deployed to the after-sales service system of the e-commerce platform and a comprehensive evaluation was conducted:

[0262] Efficiency evaluation:

[0263] Single query response time: average 35ms, meeting instant response requirements;

[0264] System resource usage: CPU utilization peak does not exceed 30%, and memory usage does not exceed 200MB;

[0265] Concurrent processing capability: A single machine can process 200 user queries simultaneously.

[0266] Effect evaluation:

[0267] Question understanding accuracy: 92.5%, 15% higher than traditional methods;

[0268] Knowledge retrieval accuracy: Top-1 accuracy is 85.3%, Top-3 accuracy is 96.8%;

[0269] User satisfaction: The test user satisfaction reached 4.6 / 5 points, an increase of 22% compared to the original system.

[0270] Comparative experiment: Compared with traditional retrieval methods based on BM25 and TF-IDF, this system achieves the following results under the same hardware conditions:

[0271] Response speed increased by 65% ​​(from 100ms to 35ms);

[0272] Retrieval accuracy increased by 25% (Top-3 accuracy increased from 71.8% to 96.8%).

[0273] System resource usage is reduced by 40%.

[0274] Compared to agents built directly using large language models:

[0275] Deployment costs reduced by 90%;

[0276] Response speed increased by 98%;

[0277] The accuracy rate in answering knowledge questions in specific fields increased by 12%.

[0278] Medical consultation agent application examples:

[0279] To demonstrate the versatility of the method of the present invention, its application in the construction of a medical consultation intelligent agent is briefly described below.

[0280] Feature analysis and architecture selection:

[0281] Given the unique characteristics of medical consultation texts (rich in technical terms and requiring high semantic accuracy), the feature analysis system generated a 20-dimensional feature vector focused on technical terminology recognition and semantic accuracy. The optimal architecture selected by the architecture evolution algorithm is: BioBERT encoder + Co-Attention interaction layer + multi-head self-attention aggregation layer.

[0282] Knowledge distillation and compression:

[0283] Through a three-level knowledge distillation chain and a differentiated compression strategy, we ultimately obtained a lightweight retrieval model of 18MB in size, which maintained an accuracy rate of over 95% while keeping the response time within 40ms.

[0284] Application effect:

[0285] After deployment, the medical consultation agent received a satisfaction score of 4.5 / 5 among 5,000 test users. It can accurately understand more than 90% of medical consultation questions and quickly retrieve relevant knowledge, greatly improving the efficiency and accuracy of medical consultation.

[0286] Application example summary:

[0287] From the above two application examples, it can be seen that the method for rapidly constructing intelligent agents based on enhanced retrieval of the present invention has the following advantages:

[0288] Efficiency: It can quickly build lightweight retrieval-enhanced agents for specific fields, shortening the deployment cycle from traditional months to days.

[0289] Accuracy: Achieve high-accuracy retrieval results through feature analysis, architecture evolution, and knowledge distillation;

[0290] Lightweight: The final model is small in size and occupies few resources, making it suitable for deployment in resource-constrained environments;

[0291] Versatility: The method is applicable to a variety of different fields and only needs to be appropriately adjusted according to the characteristics of the field;

[0292] Scalability: The constructed intelligent agent is easy to maintain and update, and its performance can be continuously optimized as the knowledge base expands.

[0293] The above application examples fully demonstrate the application value and technical advantages of the present invention in actual scenarios, and provide an effective solution for the rapid construction of various intelligent entities.

[0294] The above describes an embodiment of the present invention, but this embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Ordinary technicians in this field can also make more forms of equivalent embodiments based on the inspiration of this embodiment, all of which are protected by this embodiment.

Claims

1. A method for rapidly constructing an intelligent agent based on enhanced retrieval, characterized in that: The following steps are involved: Analyze and parameterize retrieval task characteristics, build a multi-dimensional task analysis system, and automatically characterize retrieval task characteristics through data distribution, query complexity, semantic requirements, and other features to form a task characteristic vector; Multi-objective architecture search and optimization uses a progressive architecture evolution algorithm based on the task feature vector to automatically find the optimal model architecture that satisfies the multi-dimensional balance between retrieval accuracy, computational complexity, and memory usage. The steps of executing the progressive architecture evolution algorithm include: We started with a simple infrastructure and adopted the following iterative optimization process: For the current architecture parameters Calculating soft selection weights ; Build a retrieval model based on soft selection weights and evaluate it on the validation set; Calculate multi-target loss ; Update the architecture parameters via gradient descent: ; in, Indicates the iteration round, that is, the number of iterations of the current optimization algorithm; is the learning rate, which controls the step size of each parameter update; Indicates the During the round of iteration Class component The architecture parameters of the options; Represents the updated architecture parameters; Represents a multi-objective loss function For architecture parameters The partial derivative of , indicating the direction of parameter update; A hierarchical knowledge distillation chain builds a multi-level distillation structure from the original large model to the target lightweight model based on the optimal model architecture. It achieves efficient knowledge transfer through feature matching and attention guidance, and outputs a preliminary lightweight model. Task-oriented adaptive compression performs mixed-precision quantization and structured pruning on different layers based on a preliminary lightweight model and model sensitivity analysis to generate an optimized model adapted to the target device. The steps of model sensitivity analysis are: analyzing the importance of parameters at each layer of the model, with the input being a lightweight model and the output being the sensitivity score of the parameters at each layer; defining the parameter sensitivity evaluation function: ; in, is the loss function on the validation set, which represents the overall performance index of the model on the validation dataset; It is Layer weight parameter, representing the model's The first layer trainable parameters; Represents the partial derivative of the loss function with respect to the weight parameter, reflecting the degree of influence of the parameter on the model performance; It is the size of the gradient after taking the absolute value, which is a quantitative indicator of the importance of the parameter; It is The total number of parameters of the layer, used to normalize the calculation results; Indicates the The overall sensitivity score of the layer, the larger the value, the better. The more significant the layer's impact on model performance; Automated evaluation and iterative improvement: Based on the optimization model, a multi-scenario evaluation system is built. Reinforcement learning algorithms are applied to optimize distillation paths and hyperparameters. Dynamic adjustments and continuous optimization are performed to form a closed-loop optimization process and output the final deployment model.

2. The method for rapidly constructing an intelligent agent based on enhanced retrieval according to claim 1, characterized in that: In the retrieval task feature analysis and parameterization step, the multi-dimensional task analysis system extracts three types of key features: data distribution features, query complexity features, and semantic requirement features, and generates a low-dimensional task feature vector through a feature fusion network.

3. The method for rapidly constructing an intelligent agent based on enhanced retrieval according to claim 2, characterized in that: The feature fusion process is implemented through weighted combination, that is, the data distribution features, query complexity features and semantic requirement features are multiplied by the corresponding weight matrix respectively and then added together, and then the final task feature vector is generated through a nonlinear activation function.

4. The method for rapidly constructing an intelligent agent based on enhanced retrieval according to claim 1, characterized in that: The multi-objective architecture search and optimization step adopts a weighted comprehensive scoring function, which comprehensively considers three aspects: performance loss, computational complexity loss, and memory usage loss, and balances the importance of each objective through a weight coefficient.

5. The method for rapidly constructing an intelligent agent based on enhanced retrieval according to claim 1, characterized in that: In the hierarchical knowledge distillation transfer chain step, the scale of the intermediate model is designed according to the linear decreasing rule from the original large model to the target lightweight model, ensuring a smooth transition of knowledge during the transfer process.

6. The method for rapidly constructing an intelligent agent based on enhanced retrieval according to claim 1, characterized in that: In the hierarchical knowledge distillation transfer chain step, the feature matching loss function is implemented by calculating the sum of squared Euclidean distances between the feature representations of the corresponding layers of the student model and the teacher model, and assigning different weights according to the importance of the layers.

7. The method for rapidly constructing an intelligent agent based on enhanced retrieval according to claim 1, characterized in that: In the task-oriented adaptive compression step, parameter sensitivity is evaluated by calculating the average absolute value of the gradient of the validation set loss function with respect to the parameters of each layer, thereby determining the degree of influence of different layer parameters on model performance.

8. The method for rapidly constructing an intelligent agent based on enhanced retrieval according to claim 1, characterized in that: In the task-oriented adaptive compression step, a mixed precision quantization strategy is adopted, 8-bit quantization is adopted for the high sensitivity layer, 4-bit quantization is adopted for the medium sensitivity layer, and 2-bit quantization is adopted for the low sensitivity layer.

9. The method for rapidly constructing an intelligent agent based on enhanced retrieval according to claim 1, characterized in that: It also includes automated evaluation and iterative improvement steps: building a multi-scenario evaluation system, applying reinforcement learning algorithms to optimize distillation paths and hyperparameters, performing dynamic adjustments and continuous optimization, and forming a closed-loop optimization process.

10. A system for rapidly building an intelligent agent based on enhanced retrieval, for executing a method for rapidly building an intelligent agent based on enhanced retrieval according to any one of claims 1 to 9, characterized in that: include: Retrieval task analysis subsystem, used to perform retrieval task characteristic analysis and parameterization; Architecture search subsystem, used to perform multi-objective architecture search and optimization; Knowledge distillation subsystem, used to execute the hierarchical knowledge distillation transfer chain; Model compression subsystem for performing task-oriented adaptive compression; The evaluation and optimization subsystem is used to perform automated evaluation and iterative improvement.

Citation Information

Patent Citations

  • Information matching method and system based on large language model

    CN118484510A

  • Method for automatically compressing multitask-oriented pre-trained language model and platform thereof

    US20220188658A1