Method and system for inhibiting forgetting of agent in combination with meta-learning memory replay

By constructing a dynamic memory bank and a meta-reinforcement learning memory controller, the agent can autonomously perceive the risk of forgetting and dynamically manage memory, solving the problems of forgetting old knowledge and wasting computing resources under limited memory, and achieving stable response and efficient resource utilization in complex task flows.

CN123159474APending Publication Date: 2026-11-24CHINA FUTONG TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611345633.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In intelligent agent applications, existing technologies cannot effectively manage memory banks with limited memory, resulting in the rapid forgetting of old knowledge or waste of computing resources. They are unable to autonomously perceive the risk of forgetting and perform accurate storage and replay operations, making it difficult to maintain accurate responses in complex task flows.

Method used

A dynamic memory bank and a meta-reinforcement learning memory controller are constructed. Memory operations are driven by forgetting prediction signals and task rewards. By combining a composite reward function and a curriculum-based task sequence, the agent achieves cross-task adaptive memory management and dynamically adjusts storage, deletion, and replay strategies.

Benefits of technology

It achieves precise suppression of forgetting under limited memory, improves the retention rate of key experiences, reduces computational overhead, and ensures the stable response capability of the agent in complex task flows.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159474A_ABST
    Figure CN123159474A_ABST
Patent Text Reader

Abstract

The application discloses an agent forgetting inhibition method and system combining meta-learning memory replay, and relates to the field of artificial intelligence and continuous learning; the application drives a controller output to store, delete, replay and the like through a dynamic memory bank and a meta-reinforcement learning memory controller, a forgetting prediction signal and a task reward, optimizes a policy network in a meta-training stage by using a composite reward function and a course task sequence optimization strategy, makes the controller learn to adaptively manage memory across tasks, and deploys the controller to run in a frozen state and calibrates the forgetting prediction online, combines a dynamic importance replay weight and an admission deletion mechanism based on conflict perception, and realizes active, accurate and low-overhead inhibition of forgetting of an agent in a continuous task stream.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and continuous learning, specifically to a method and system for suppressing forgetting in intelligent agents by combining meta-learning memory replay. Background Technology

[0002] In the deployment of intelligent agent applications that receive new business data sequentially, such as intelligent customer service systems that need to gradually expand the scope of new fault mode identification by integrating question-and-answer knowledge from new product lines or fault diagnosis systems in batches, the model must continuously absorb new task knowledge while maintaining accurate response capabilities to completed tasks. Constrained by user privacy regulations and data storage compliance requirements, enterprises often cannot retain all original training samples for extended periods, only maintaining a limited memory buffer. This forces the intelligent agent to resist forgetting old knowledge by replaying a small number of key historical samples under strict memory limitations. However, the similarity and pace of change in actual business task flows are unpredictable, placing extremely high demands on dynamic memory management.

[0003] Traditional memory replay methods generally rely on pre-set fixed rules, such as triggering replays at equal intervals, selecting replay samples using uniform random sampling, and eliminating samples based on storage time. These fixed strategies are completely unaware of the model's current level of forgetting. When processing multiple low-similarity tasks consecutively, insufficient replay frequency may lead to a rapid decline in the performance of older tasks. Conversely, frequent redundant replays when high-similarity tasks appear waste computational resources. When task features drift slowly over time, the fixed rules cannot adjust autonomously; parameters must be reset by operations personnel based on experience. This not only results in delayed response but also makes it difficult to accurately identify and retain truly easily covered boundary samples within limited memory. Furthermore, the forgetting suppression effect is unstable and difficult to deploy at scale.

[0004] In summary, given the reality of highly uncertain business task flows and limited computing and memory resources, the key issue to be addressed in achieving reliable lifelong learning is how to enable intelligent agents to autonomously perceive the risk of forgetting, proactively decide when to discard and replay stored data, and adaptively adjust sampling strategies. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide an agent forgetting suppression method and system that combines meta-learning memory replay. It can construct a dynamic memory bank and a meta-reinforcement learning memory controller. The forgetting prediction signal and task reward jointly drive the controller to output actions such as storage, deletion, and replay. During the meta-training stage, a composite reward function and a curriculum-based task sequence optimization policy network are used to enable the controller to learn to adaptively manage memory across tasks. During deployment, the controller is frozen and forgetting prediction is calibrated online. Combined with dynamic importance replay weights and a conflict-aware admission deletion mechanism, the agent can achieve proactive, accurate, and low-cost suppression of forgetting in a continuous task flow.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: On one hand, it combines a meta-learning memory replay-based agent forgetting suppression method, the specific steps of which are as follows: Step 1: Construct a dynamic memory bank, which stores experience samples collected by the agent during continuous task learning in the form of key-value pairs. Each sample contains a state embedding vector, an action label, and a task identifier. The maximum capacity of the memory bank is set to M. Step 2: Construct a memory controller based on meta-reinforcement learning. The input interface of the memory controller receives a state vector composed of an internal forgetting prediction signal and an external task reward. The output interface outputs a probability distribution of memory operation actions. The selectable memory operation actions include storing the current experience into the memory bank, deleting a specified sample from the memory bank, triggering a memory replay training step, and maintaining the current state without operation. The external task reward is a performance metric of the agent on the current task, which is obtained by standardizing the change in verification accuracy. Step 3: In the meta-training phase, multiple different task sequences are sampled from the preset task distribution. A predefined composite reward function is used as the optimization objective. The meta-reinforcement learning algorithm is used to update the policy network parameters of the memory controller. The composite reward function is composed of a weighted sum of a new task accuracy improvement term, a historical task forgetting penalty term, and a computational cost term, enabling the memory controller to quickly adapt to memory management across tasks. Step 4: In the deployment phase, the trained memory controller and the agent's basic model are placed in the new task flow. At each time step, the memory controller outputs action decisions based on real-time forgetting prediction signals and task feedback. The agent dynamically maintains the memory bank based on the decision results and performs memory replay when the decision triggers replay, so as to suppress catastrophic forgetting.

[0007] Further, in step two, the internal forgetting prediction signal is generated as follows: After the agent completes learning a small batch of new task data, the forgetting prediction module extracts a subset of reference samples belonging to each completed historical task from the dynamic memory. The number of samples extracted for each historical task is no less than a fixed proportion of the total number of samples stored in the memory for that task. These reference samples are input into the current model to calculate the cross-entropy loss. The current loss of each historical task is compared with the baseline loss at the end of training for that task to obtain the loss increment. Then, the loss increments of all historical tasks are summed by time decay weight. The decay weight is determined by the time interval between the end time of each historical task and the current time, and the larger the time interval, the stronger the decay. After scale normalization, the weighted sum is concatenated with the memory saturation and the maximum mean difference of the feature distributions of the current task and historical tasks to form a multi-dimensional real vector as the internal forgetting prediction signal. The memory saturation is defined as the ratio of the number of stored samples to the upper limit of capacity M. The maximum mean difference of the feature distribution is calculated after mapping by a Gaussian kernel function. The forgetting prediction module is updated synchronously with the memory controller during meta-training to calibrate the prediction accuracy.

[0008] Furthermore, in step two, the memory controller consists of a policy network and a value network. The policy network outputs the probability distribution of memory operation actions, and the value network outputs the value estimate of the current state. The policy network and the value network share all hidden layer parameters except for the output layer. The number of hidden layers in the shared part is at least two layers, and the number of neurons in each hidden layer decreases layer by layer. The input of the shared network includes the forgetting prediction signal, memory bank saturation, current task embedding, time steps since the last replay, and one-hot encoding of the previous memory operation action. The current task embedding is obtained by mapping the task identifier through a learnable embedding matrix. The output layer of the policy network outputs the same probability value as the number of operable actions using the Softmax function. The output layer of the value network is a linear unit. After each decision, the memory controller adjusts its parameters according to the immediate reward signal. The immediate reward is determined by the weighted difference between the increase in accuracy of the current batch of new task tests and the decrease in the average accuracy of historical tasks.

[0009] Furthermore, in step two, after triggering the memory replay action, the memory controller performs importance sampling based on a dynamic replay weight vector. The update of this weight vector is accomplished by a meta-learning sub-network within the memory controller. This meta-learning sub-network consists of a multilayer perceptron, whose internal structure comprises an input layer, two hidden layers, and an output layer. The input layer receives a joint feature vector formed by concatenating the preprocessed gradient feature vector with the forgetting prediction signal; the dimension is denoted as... The number of neurons in the first hidden layer is The value is rounded up to 1.5 times the value of the first hidden layer. The number of neurons in the second hidden layer is the same as that in the first hidden layer. Both layers use the LeakyReLU activation function, and each hidden layer is followed by a batch normalization layer and a dropout layer with a dropout rate of 0.1 to prevent overfitting. The output layer is a linear mapping layer with the same number of neurons as the current number of samples N in the memory bank, and it outputs an N-dimensional real-valued update increment vector. ,Should Substitute it directly into the iteration rule as a correction term. ,in This refers to the weight vector from the previous time step maintained internally by the controller. The meta-learning step size is used to ensure that the subnetwork's output strictly matches the original iterative formula, ultimately generating a normalized non-negative replay weight vector. The optimization objective of this subnetwork during the meta-training phase is to minimize the validation forgetting on multiple future tasks; specifically, a meta-loss function is defined. ,in Forward steps, For the original discount factor, For the first The global forgetting amount is measured step by step. The sub-network parameters are updated through backpropagation and Adam optimizer. The learning rate is set to 0.1 times the learning rate of the main controller in the meta-training stage. The training of the sub-network does not depend on additional labeled data. Its gradient is passed to the internal parameters of the sub-network entirely through the chain dependency of the meta-loss function on the replay weights, thereby achieving end-to-end meta-learning optimization. The preprocessing method for gradients as network input is as follows: First, obtain the gradient vector of the loss function of the agent's base model with respect to all trainable parameters of the model on the current batch of data. ,in This represents the total number of model parameters; due to Typically, the size is large, and directly inputting it into the subnetwork will cause the curse of dimensionality and serious computational overhead. Therefore, the following dimensionality reduction and normalization process is adopted: (1) Grouping by network layer, Decomposed into gradient sub-vectors of each layer (2) For each layer, calculate the L2 norm of the gradient subvector of that layer. And replace the complete gradient subvector with this norm, thereby compressing the dimension from P to the number of network layers L. (3) Perform global L2 normalization on the compressed L-dimensional vector, that is ,in (4) The normalized layer gradient norm vector The signal vector is concatenated with the forgetting prediction signal vector to form a joint feature vector, which serves as the final input to the meta-learning sub-network. This preprocessing method preserves the crucial information of the relative intensity of gradients at each layer while controlling the input dimensionality to within a certain range. Magnitude To forget the dimension of the predicted signal, the subnetwork can be trained and inferred efficiently, and L2 normalization makes the input features robust to gradient scale changes in different tasks and training stages.

[0010] Furthermore, in step two, the memory controller employs a deletion rule based on the evaluation of the influence of sample forgetting when performing the deletion operation. This rule is implemented by a deletion evaluation module within the memory controller. Each time a deletion decision is triggered, the deletion evaluation module extracts the storage timestamp, the number of times the sample has been replayed, and the average gradient conflict value from the dynamic memory for each sample. The gradient conflict value is defined as the negative cosine similarity between the gradient generated by the sample and the average gradient of the current batch of new task samples. These three feature values ​​are normalized to the 0-1 interval and then input into a three-layer perceptron. This perceptron consists of an input layer, a single hidden layer, and an output layer. The input layer contains three neurons, corresponding to the normalized storage timestamp, the number of times the sample has been replayed, and the average gradient conflict value. The hidden layer contains 16 neurons and uses the ReLU activation function. To enhance generalization ability, additional neurons are added after the hidden layer. A Dropout layer with a dropout rate of 0.1 is set to prevent overfitting. The output layer contains one neuron and uses the Sigmoid activation function to nonlinearly map the network output to the 0-1 interval, which serves as the forgetting impact score for that sample. The forgetting impact scores of all samples are sorted, and the sample with the lowest score is deleted. If the scores are equal, the sample with the earliest storage timestamp is deleted first. The three-layer perceptron is optimized together with the memory controller in the meta-training stage using a policy gradient approach. Its optimization objective is to minimize the performance degradation of historical tasks within multiple consecutive task steps after the deletion operation. Specifically, the negative value of the performance degradation of historical tasks within a preset number of steps after the deletion operation is used as the supervision signal for policy gradient updates. This signal is backpropagated layer by layer to the hidden and output layers of the perceptron through temporal difference errors, and the weight matrix and bias vector of each layer are updated synchronously to minimize the negative impact of the deletion operation on forgetting.

[0011] Furthermore, the dynamic memory bank introduces an admission control mechanism based on novelty and conflict potential when storing new experience samples. When the memory controller issues an action command to store the current experience, the storage management module first calculates the minimum value of the feature space Euclidean distance between the current sample and existing samples of the same task in the memory bank. If this minimum value is less than a preset threshold... If the storage is not performed, the action will be considered invalid. At the same time, the offset between the current sample and the center points of samples from different task classes will be calculated. If the offset is greater than a preset threshold, the action will be considered invalid. The sample is then marked as a potential conflict sample and given extra storage priority. When the memory bank is full and a new sample needs to be inserted, a forced deletion process is triggered. This process excludes samples marked as potential conflicts samples when selecting the sample with the lowest forgetting impact score. Set as the 10th percentile of the feature distance distribution of samples from similar tasks. The two thresholds are set as the 90th percentile of the distance distribution between the center points of the heterogeneous task samples. After each complete task is learned, these two thresholds are recalculated based on the contents of the memory bank, so that the memory bank can prioritize the retention of key experiences in the distribution edges and conflict areas with limited capacity.

[0012] Furthermore, in step three, the composite reward function used to update the memory controller policy parameters is calculated at the end of a task sequence segment, specifically as follows: ,in This represents the total number of steps in the current task sequence. This is a discount factor, and its value is between 0.95 and 0.995. , , These are balancing coefficients, and the three are set to 1.0, 0.5, and 0.01 respectively during meta-training initialization, and are adjusted jointly with the controller parameters through gradient descent during training. Indicates the first The accuracy of the agent in the current task is the change compared to the previous step, and the accuracy is represented by a real number between 0 and 1. For the first The global forgetting amount is measured step by step and is defined as the average difference between the current validation accuracy and the historical peak accuracy of all historical tasks. The cost penalty term is calculated and defined as the natural logarithm of the product of the number of replayed samples and the total number of current model parameters if a replay is triggered, and 0 if no replay is triggered. The meta-reinforcement learning algorithm employs a proximal policy optimization algorithm and uses... As the total reward for the trajectory, the policy network and value network parameters are updated after collecting multiple trajectories in each meta-iteration. During the update, a policy entropy regularization term is added to the loss function to encourage exploration, and the entropy coefficient is set to 0.01. The setting of this composite reward function enables the memory controller to achieve a trade-off between improving new knowledge learning, suppressing old knowledge forgetting, and saving computational overhead.

[0013] Furthermore, in step three, the construction of the task sequence adopts a course-style increasing difficulty strategy. In each meta-training cycle, multiple tasks are extracted from the basic task distribution. The first few tasks are low-similarity task pairs with mutually exclusive input distributions; the middle few tasks are medium-similarity task pairs with some overlapping input features; and the last few tasks are high-similarity task pairs sharing a large number of input features but with opposite label mappings. This construction forces the memory controller to learn basic storage and replay rhythms early on, learn to distinguish overlapping representations in the middle, and learn to resolve catastrophic forgetting caused by feature conflicts in the later stages. Meta-training continues until the average global forgetting amount on the verification task sequence no longer decreases over multiple consecutive evaluation cycles, at which point it terminates. The verification task sequence includes multiple task types that did not appear in the training. The controller parameters with the lowest average forgetting amount during the verification process are selected as the final deployment parameters. Simultaneously, during the verification period, the frequency distribution of replay triggering by the memory controller in different task similarity intervals is recorded, and this distribution is encoded as the controller's prior bias. The specific method for using the prior bias vector is as follows: The task similarity interval is uniformly divided into Q discrete intervals according to the numerical range. The value of Q matches the input layer structure of the policy network. For each verification task, the maximum mean difference of the feature distribution between it and the current task is calculated as the similarity metric. Based on the interval index where the metric falls, the replay trigger count of the corresponding interval is accumulated. After all verification tasks are processed, the accumulated count of each interval is L2 normalized to form a Q-dimensional real vector, which is used as the prior bias vector. During the deployment phase, this prior bias vector is directly concatenated with the forgetting prediction signal at the current time, the memory bank saturation, the current task embedding, the time step since the last replay, and the one-hot encoding of the last memory operation in the input layer of the policy network to form the joint input feature vector of the policy network. Based on this, the policy network integrates the prior association knowledge between task similarity and replay requirements learned in the meta-training phase when making decisions, thereby improving the decision quality and generalization stability of the controller in different task transfer scenarios.

[0014] Furthermore, in step four, during the deployment phase, when the agent faces a new online task flow, the memory controller operates in a frozen state, but its internal forgetting prediction module continues online calibration. The calibration method involves recalculating the baseline loss using a small number of validation samples from each completed task and updating the historical task baseline loss table in the forgetting prediction module. If the global forgetting amount shows a monotonically increasing trend over 3 to 8 consecutive task cycles and the increase exceeds a preset warning line, a brief meta-adaptation process is initiated. This process allows the memory controller to perform a one-step gradient update based on the experience of the most recent 3 to 5 tasks, using a learning rate at least one order of magnitude lower than the final learning rate of the meta-training phase. After the update, the frozen state is immediately restored. The warning line value is set based on the statistical fluctuation range of the forgetting amount during the meta-training phase. The specific calculation method for the warning line is as follows: during the meta-training phase, the global forgetting amount is recorded once after each task cycle is completed, and the average value is calculated after collecting the forgetting amount data for all task cycles. and standard deviation The warning line Defined as ,in The sensitivity coefficient; The numerical range is 2.0-3.0. During the meta-training phase, grid search optimization is performed based on performance feedback from the validation set. The default value is 2.5. This value range is set based on the following: when... When the threshold is below 2.0, the warning line is too narrow, and normal forgetting fluctuations are easily misjudged as abnormal trends, thus triggering unnecessary meta-adaptation and interfering with the stability of the controller's frozen state; when When the threshold is above 3.0, the warning line is too wide, and only extreme forgetting events can trigger a response, which may miss slow forgetting accumulation situations that require timely intervention. During the deployment phase, the warning line is frozen and remains unchanged, or the statistical parameters are recalculated every 5-10 task cycles using a sliding window method based on the forgetting data collected online to achieve adaptive updates to the warning line. This mechanism gives the system the ability to adapt to slow distribution drift without disrupting the learned memory management strategy.

[0015] On the other hand, an agent forgetting suppression system that incorporates meta-learning memory replay includes: Dynamic memory module: Used to store experience samples sampled by the agent during continuous task learning in key-value pairs, with a maximum capacity of M. It supports retrieval by task identifier and sampling by weight. Its output is connected to the forgetting prediction module and the replay execution module. Forgetting prediction module: After each learning batch, it extracts historical task reference samples from the dynamic memory module, calculates the weighted loss increment, and splices the memory saturation and distribution difference measure to generate an internal forgetting prediction signal. Its output is connected to the input of the meta-reinforcement learning memory controller module. The meta-reinforcement learning memory controller module has a built-in policy network and a meta-learning sub-network. Its input end receives the forgetting prediction signal output by the forgetting prediction module and the state vector composed of external task rewards. Its output end outputs the decision of four discrete actions: storage, deletion, replay, and no operation. When outputting the replay decision, it provides a dynamic replay weight vector to the replay execution module through the meta-learning sub-network. When outputting the deletion decision, it calculates the sample forgetting impact score through the built-in deletion evaluation module to perform deletion that minimizes forgetting. Replay Execution Module: Its input is connected to the Meta-Reinforcement Learning Memory Controller Module and the Dynamic Memory Bank Module. It is used to sample a batch of samples from the Dynamic Memory Bank Module according to the Dynamic Replay Weight Vector after receiving the replay trigger signal, and mix them with the current task data to perform gradient updates on the agent's basic model. Meta-training module: Used to perform end-to-end optimization of the policy parameters of the meta-reinforcement learning memory controller module on the task sequence distribution using a composite reward function to give it the ability to adapt quickly across tasks and provide curriculum-based task sequence generation and verification evaluation functions. This meta-training module only works in conjunction with other modules during the meta-training phase and is inactive during the deployment phase.

[0016] Compared with existing technologies, this agent-based forgetting suppression method and system combining meta-learning memory replay has the following beneficial effects: I. The method proposed in this invention integrates memory storage, discarding, and replay decisions into an adaptive strategy framework of meta-reinforcement learning. The memory controller judges the current forgetting risk in real time based on forgetting prediction signals and external task rewards, and autonomously decides the timing and type of operation. This breaks the passive management paradigm of fixed-frequency replay and random sampling. When an upward forgetting trend is detected, it can actively trigger replay based on dynamic importance weights, while suppressing unnecessary replay calculations when task interference is small. This significantly improves the retention rate of key experiences in the limited-capacity memory bank, while keeping the replay calculation overhead to the minimum necessary level. This achieves a balance between precise suppression of catastrophic forgetting and efficient use of resources.

[0017] Second, this invention introduces a composite reward function and a curriculum-based task sequence construction during the meta-training phase. The memory controller is forced to learn the optimal balance strategy among improving the accuracy of new tasks, penalizing the amount of forgetting old tasks, and calculating the computational cost of replay. The controller, after training convergence, can still maintain its generalization ability when deployed in a frozen state. With the continuous online calibration of the forgetting prediction module and the admission deletion mechanism based on conflict potential, when the task flow distribution slowly drifts, the system can maintain effective memory management through short-term meta-adaptation without retraining. This provides an adaptive forgetting suppression scheme without manual parameter tuning for lifelong learning of intelligent agents in actual business scenarios.

[0018] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0020] Figure 1 A flowchart of the overall process for agent forgetting suppression methods that combine meta-learning memory replay; Figure 2 The process for generating internal forgetting prediction signals; Figure 3 This is a flowchart of a deletion mechanism based on the influence of forgetting. Detailed Implementation

[0021] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0022] Example 1 This embodiment applies to a continuous task learning scenario for an autonomous mobile robot in a dynamic warehouse environment. The robot needs to perform multiple progressive tasks in the warehouse: initially, it undertakes goods sorting; in the middle stage, it adds shelf inspection; and later, it further undertakes goods handling path planning. Each task shares a visual perception module and a motion control module, but the task objectives and reward functions differ. If a conventional end-to-end training method is used, the robot will catastrophically forget the execution strategies of previous tasks after learning new ones. This embodiment applies an agent-based forgetting suppression method combining meta-learning memory replay to the robot system, enabling it to maintain its ability to execute existing tasks while continuously learning new ones.

[0023] In this embodiment, the basic model of the intelligent agent adopts a structure based on the combination of deep convolutional neural network and reinforcement learning policy network. The input of the model is the RGB-D image captured by the depth camera on the robot, and the output is the robot's action command, including five discrete actions: forward, backward, left turn, right turn, and grasping, and their corresponding Q-value estimates.

[0024] Step 1: Construct a dynamic memory.

[0025] Initialize a dynamic memory bank on the robot control computer. This memory bank stores data in key-value pairs, where each sample's key is its sample ID, and the value is a triplet: a state embedding vector, an action label, and a task identifier. The state embedding vector is obtained by global average pooling of features extracted from the convolutional layers of the agent's base model, and has a dimension of 512. The action label is the index of the actual action performed by the robot, and the task identifier is a hash encoding of the name of the current training task. The memory bank's capacity limit M is set to 10,000 samples, employing a storage structure combining a circular buffer and a priority queue. When the sample count reaches the limit, samples must be evicted according to a subsequent deletion strategy before new samples can be added.

[0026] Step 2: Construct a memory controller based on meta-reinforcement learning.

[0027] The memory controller consists of a policy network and a value network, which share all hidden layer parameters except for the output layer. The shared hidden layer has three layers with 256, 128, and 64 neurons respectively, all using the ReLU activation function. The policy network output layer outputs four probability values ​​using the Softmax function, corresponding to the actions of "storing the current experience in the memory bank," "deleting a specified sample from the memory bank," "triggering a memory replay training step," and "maintaining the current state without taking any action." The value network output layer is a linear unit that outputs the value estimate of the current state.

[0028] The input to the memory controller is a state vector formed by concatenating the internal forgetting prediction signal and the external task reward, with the dimension being the sum of the dimensions of the internal forgetting prediction signal and the external task reward.

[0029] The internal forgetting prediction signal is generated as follows: After the robot completes a small batch of new task data learning, the forgetting prediction module extracts a subset of reference samples belonging to each completed historical task from the dynamic memory. The number of samples extracted for each historical task is 20% of the total number of samples stored in the memory for that task. These reference samples are input into the current agent model to calculate the cross-entropy loss. The current loss of each historical task is compared with the baseline loss at the end of training for that task to obtain the loss increment. The loss increments of all historical tasks are then summed using a time-decay weighted average, with the decay weights determined by the formula... Calculation, where For the first The time interval between the end time of a historical task and the current time. The time constant is 500 steps. The weighted sum, after being scaled to the [0, 1] interval using min-max normalization, is concatenated with the memory bank saturation and the difference between the maximum mean of the feature distributions of the current task and historical tasks to form a multidimensional real vector as the internal forgetting prediction signal. Memory bank saturation is defined as the ratio of the number of stored samples to the upper capacity limit M; MMD is calculated using a Gaussian radial basis kernel function, with the kernel bandwidth taken as the median of the Frobenius norm of the feature covariance matrix for each task.

[0030] The external task reward is a performance metric of the robot on the current task, calculated by standardizing the change in validation accuracy. Specifically, after completing a full training cycle, the classification accuracy of the current model is calculated on the reserved validation set. The difference between this accuracy and the accuracy of the previous cycle is divided by the accuracy of the previous cycle to obtain the standardized reward value, which ranges from -1 to 1.

[0031] Step 3: Meta-training phase.

[0032] Multiple different task sequences are sampled from a pre-defined task distribution for meta-training. Each meta-training cycle contains 8 tasks, and the task sequences are constructed using a course-style increasing difficulty strategy: the first 3 tasks are low-similarity task pairs, the middle 3 tasks are medium-similarity task pairs, and the last 2 tasks are high-similarity task pairs.

[0033] The policy network parameters of the memory controller are updated using a proximal policy optimization algorithm. The composite reward function is calculated after each task sequence segment is completed (i.e., after all 8 tasks are completed): in, The discount factor is the total number of steps in the current task sequence. =0.99, balance coefficient =1.0、 =2.0、 =0.1. Indicates the first The accuracy of the robot on the current task validation set. For the first The global amount of forgetting measured step by step, The cost penalty term is the normalized value of the FLOPs cost for each replay operation, ranging from [0, 0.1].

[0034] Meta-training continues until the average global forgetting on the validation task sequence no longer decreases over five consecutive evaluation periods. The validation task sequence includes six task types not encountered during training, and the controller parameters with the lowest average forgetting during validation are selected as the final deployment parameters. During validation, the frequency distribution of replay triggers by the memory controller within different task similarity intervals is recorded, and this distribution is encoded into a 4-dimensional prior bias vector. This prior bias is provided as additional input to the policy network during deployment.

[0035] Step 4: Deployment phase.

[0036] The trained memory controller is deployed together with the agent's base model in the warehouse robot system. At each time step, the memory controller outputs action decisions based on real-time forgetting prediction signals and task feedback. When the memory controller outputs the "trigger memory replay" action, the replay execution module samples a batch of samples from the dynamic memory bank according to the dynamic replay weight vector, mixes it with the latest batch of data for the current task, and updates the gradient of the agent's base model.

[0037] During deployment, the memory controller operates in a frozen state, but its internal forgetting prediction module continues online calibration. The calibration method is as follows: after each complete task, the baseline loss is recalculated using a small number of validation samples from that task, and the historical task baseline loss table in the forgetting prediction module is updated. If a monotonically increasing global forgetting rate is detected over three consecutive task cycles, and the increase exceeds a preset warning threshold, a brief meta-adaptation process is initiated. This process allows the memory controller to adjust its learning rate based on the experience of the most recent three tasks, using the final learning rate from the meta-training phase (1×10⁻⁶). -4 One-tenth of ) (i.e., 1×10 -5 Perform a gradient update, and immediately restore the frozen state after the update.

[0038] This embodiment applies an agent-based forgetting suppression method that combines meta-learning memory replay to an autonomous mobile robot in a warehouse. This enables the robot to adaptively manage its experience memory bank during the continuous learning of progressive tasks such as goods classification, shelf inspection, and path planning. Under limited storage capacity, it prioritizes the retention of samples most valuable for preventing forgetting. Furthermore, through a cross-task memory management strategy obtained through meta-training, it effectively suppresses catastrophic forgetting and ensures the robot's long-term stable operation in a dynamic warehouse environment.

[0039] Example 2 This embodiment applies to a scenario of continuous learning of user interests in a personalized news recommendation system. This recommendation system needs to continuously learn the changing trends of user interests based on real-time reading behavior, sequentially mastering user content preferences in multiple fields such as technology, sports, finance, and entertainment. Because user interests have dynamic evolutionary characteristics and old interests may be overwritten when new interests emerge, the recommendation model is prone to forgetting early user interests during continuous learning, causing recommended content to deviate from the user's actual needs. This embodiment applies an agent-based forgetting suppression method combining meta-learning memory replay to this recommendation system, enabling it to maintain accurate modeling of historical interests while continuously learning new user interests.

[0040] In this embodiment, the basic agent model adopts a Transformer-based sequence recommendation model. The input of this model is the embedding vector of the titles and categories of the news articles clicked by the user in the last 30 times, and the output is the predicted click-through rate of the candidate news articles. The total number of model parameters is approximately 12 million.

[0041] Step 1: Construct a dynamic memory.

[0042] Initialize a dynamic memory on the recommender system server. This memory stores data in key-value pairs, with each sample containing: a state embedding vector, an action label, and a task identifier. The maximum memory capacity M is set to 50,000 samples.

[0043] Step 2: Construct a memory controller based on meta-reinforcement learning.

[0044] The policy network and value network of the memory controller share hidden layer parameters. There are four hidden layers with 512, 256, 128, and 64 neurons respectively, and the activation function for all layers is LeakyReLU. The policy network output layer outputs the probability distribution of the four actions using the Softmax function. The value network output layer consists of linear units.

[0045] The internal forgetting prediction signal is generated as follows: After the recommendation model completes learning from each mini-batch of new user behavior data, the forgetting prediction module extracts a subset of reference samples belonging to each historical interest stage from the dynamic memory. The number of samples extracted for each historical stage is 15% of the total number of samples stored in the memory for that stage. The increment between the cross-entropy loss and the baseline loss for each historical stage on the current model is calculated and summed using time-decay weighted averages. The decay weights are based on... Calculation, where For the first The time interval between the end of each historical stage and the current moment. =14 days. The weighted sum, after normalization, is concatenated with the memory bank saturation, the MMD of the current stage, and the MMD of the historical stage to form the internal forgetting prediction signal. The kernel function of the MMD uses a linear combination of multiple Gaussian kernels to enhance the sensitivity to differences in distribution at different scales.

[0046] External task rewards are calculated using a standardized method based on the change in click-through rate (CTR) of recommendations made by users at their current interest stage. Specifically, after processing 10,000 pieces of user behavior data, the average CTR of the most recent 1,000 recommendations is calculated. The difference between this CTR and the CTR of the previous calculation period is divided by the baseline CTR to obtain the standardized reward value.

[0047] Step 3: Meta-training phase.

[0048] Meta-training is performed by sampling task sequences from a pre-defined distribution of user interest evolution patterns. Each meta-training cycle contains 10 tasks: the first 4 tasks represent significantly different interest domains, the middle 3 tasks represent partially overlapping interest domains, and the last 3 tasks represent highly similar interest domains with opposite labels.

[0049] The parameters of the composite reward function are set as follows: =0.95, =1.5、 =2.5、 =0.05. Wherein For the CTR on the current task validation set, This represents the total amount of forgetting. This is the cost penalty term. Meta-training uses a trust region policy optimization algorithm to update controller parameters, with the maximum KL divergence constraint set to 0.01.

[0050] The meta-training termination condition is that the average global forgetting amount on the validation task sequence no longer decreases over eight consecutive evaluation periods. The validation task sequence contains eight user interest evolution patterns that did not appear in the training. The controller parameters with the lowest average forgetting amount during the validation process are selected as the final deployment parameters. During the validation period, the frequency distribution of each action triggered by the controller in different interest similarity intervals is recorded and encoded as a prior bias vector.

[0051] Step 4: Deployment phase.

[0052] The trained memory controller and recommendation model are deployed together in the online recommendation system. The memory controller runs in a frozen state, but its forgetting prediction module is continuously calibrated online. The calibration frequency is to recalculate the baseline loss and update the baseline loss table after processing each complete interest phase. If the global forgetting amount is detected to have a monotonically increasing trend over four consecutive interest phases and the increase exceeds the warning threshold, the meta-adaptation process is initiated, using the final learning rate of the meta-training phase (5 × 10⁻⁶). -5After performing a gradient update on one-tenth of the original value, the system is restored to its original state.

[0053] During deployment, when the memory controller outputs a deletion decision, the deletion evaluation module extracts the storage timestamp, number of replays, and average gradient conflict value of each sample in the memory bank. The gradient conflict value is defined as the negative cosine similarity between the gradient generated by the sample and the average gradient of the current batch of new task samples. After normalizing these three features to the [0, 1] interval, they are input into a three-layer perceptron, which outputs a forgetting impact score. After sorting the forgetting impact scores of all samples, the sample with the lowest score is deleted. If scores are equal, the sample with the earliest storage timestamp is deleted first.

[0054] When storing new samples, the dynamic memory also performs admission control: it calculates the minimum Euclidean distance in the feature space between the current sample and existing samples of the same task in the memory. If this minimum value is less than a preset threshold... If not, storage will not be performed. Simultaneously, the offset between the current sample and the center points of samples from different task classes will be calculated. If the offset exceeds a preset threshold... If a sample is found to be a potential conflict sample, it is marked as such and given additional storage priority. When the memory bank is full and a new sample needs to be inserted, the forced deletion process excludes samples marked as potential conflict samples when selecting the sample with the lowest forgetting impact score. and The calculation is recalculated based on the memory bank content after each complete learning phase of interest is achieved.

[0055] This embodiment applies an agent-based forgetting suppression method that combines meta-learning memory replay to a personalized news recommendation system. This enables the recommendation model to adaptively manage the memory and forgetting of historical interest samples as it continuously learns the evolution of users' cross-domain interests. With limited memory capacity, it prioritizes the retention of experience samples that are most critical to maintaining the accuracy of multi-interest modeling. This effectively suppresses the catastrophic forgetting of old interests when the recommendation model learns new interests, thereby improving user satisfaction in long-term service of the recommendation system.

[0056] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. An agent forgetting inhibition method combined with meta-learning memory replay, characterized in that, The specific steps of this method are as follows: Step 1: Construct a dynamic memory bank, which stores experience samples collected by the agent during continuous task learning in the form of key-value pairs. Each sample contains a state embedding vector, an action label, and a task identifier. The maximum capacity of the memory bank is set to M. Step 2: Construct a memory controller based on meta-reinforcement learning. The input interface of the memory controller receives a state vector composed of an internal forgetting prediction signal and an external task reward. The output interface outputs a probability distribution of memory operation actions. The selectable memory operation actions include storing the current experience into the memory bank, deleting a specified sample from the memory bank, triggering a memory replay training step, and maintaining the current state without operation. The external task reward is a performance metric of the agent on the current task, which is obtained by standardizing the change in verification accuracy. Step 3: In the meta-training phase, multiple different task sequences are sampled from the preset task distribution. A predefined composite reward function is used as the optimization objective. The meta-reinforcement learning algorithm is used to update the policy network parameters of the memory controller. The composite reward function is composed of a weighted sum of a new task accuracy improvement term, a historical task forgetting penalty term, and a computational cost term, enabling the memory controller to quickly adapt to memory management across tasks. Step 4: In the deployment phase, the trained memory controller and the agent's basic model are placed in the new task flow. At each time step, the memory controller outputs action decisions based on real-time forgetting prediction signals and task feedback. The agent dynamically maintains the memory bank based on the decision results and performs memory replay when the decision triggers replay.

2. The method of claim 1, wherein, In step two, the internal forgetting prediction signal is generated as follows: After the agent completes learning a small batch of new task data, the forgetting prediction module extracts a subset of reference samples belonging to each completed historical task from the dynamic memory. The number of samples extracted for each historical task is no less than a fixed proportion of the total number of samples stored in the memory for that task. These reference samples are input into the current model to calculate the cross-entropy loss. The current loss of each historical task is compared with the baseline loss at the end of training for that task to obtain the loss increment. Then, the loss increments of all historical tasks are summed in a time-decay weighted manner. The decay weight is determined by the time interval between the end time of each historical task and the current time, and the larger the time interval, the stronger the decay. After the weighted sum is normalized by scale, it is concatenated with the memory saturation and the maximum mean difference of the feature distributions of the current task and the historical tasks to form a multi-dimensional real vector as the internal forgetting prediction signal. The memory saturation is defined as the ratio of the number of stored samples to the upper limit of capacity M.

3. The method of claim 1, wherein the agent forgetfulness inhibition method is combined with meta-learning memory replay. In step two, the memory controller consists of a policy network and a value network. The policy network outputs the probability distribution of the memory operation actions, and the value network outputs the value estimate of the current state. The policy network and the value network share all hidden layer parameters except for the output layer. The number of hidden layers in the shared part is at least two layers, and the number of neurons in each hidden layer decreases layer by layer. The output layer of the policy network outputs the same probability value as the number of operable actions using the Softmax function. The output layer of the value network is a linear unit. The memory controller adjusts its parameters according to the immediate reward signal after each decision.

4. The agent forgetting suppression method combining meta-learning memory replay according to claim 1, characterized in that, In step two, after triggering the memory replay action, the memory controller performs importance sampling based on a dynamic replay weight vector. The update of this weight vector is accomplished by a meta-learning sub-network within the memory controller. This meta-learning sub-network consists of a multilayer perceptron, whose internal structure comprises: an input layer, two hidden layers, and an output layer. The input layer receives a joint feature vector formed by concatenating the preprocessed gradient feature vector with the forgetting prediction signal; the dimension is denoted as... The number of neurons in the first hidden layer is The value is rounded up to 1.5 times the value of the first hidden layer. The number of neurons in the second hidden layer is the same as that in the first hidden layer. Both layers use the LeakyReLU activation function, and each hidden layer is followed by a batch normalization layer and a dropout layer with a dropout rate of 0.1 to prevent overfitting. The output layer is a linear mapping layer with the same number of neurons as the current number of samples N in the memory bank, and it outputs an N-dimensional real-valued update increment vector. ,Should Substitute it directly into the iteration rule as a correction term. ,in The previous time step weight vector maintained internally by the controller The meta-learning step size is used to ultimately generate a normalized non-negative replay weight vector. The optimization objective of this subnetwork during the meta-training phase is to minimize the amount of validation forgetting on multiple future tasks; Its meta-loss function is defined as ,in Forward steps, For the original discount factor, For the first The global forgetting amount measured in the step is used to update the sub-network parameters through backpropagation and the Adam optimizer. The learning rate is set to 0.1 times the learning rate of the main controller in the meta-training phase. The preprocessing method for using the gradient as network input is as follows: obtain the gradient vector of the loss function of the agent's base model with respect to all trainable parameters of the model on the current batch of data. The network is decomposed into gradient sub-vectors for each layer. For each layer, calculate the L2 norm of the gradient subvector of that layer. The dimension is compressed from P to the number of network layers L; the compressed L-dimensional vector is then subjected to global L2 normalization, i.e. ,in ; the normalized layer gradient norm vector The input dimension is concatenated with the forgetting prediction signal vector to form a joint feature vector, which serves as the final input to the meta-learning sub-network; this keeps the input dimension controlled within a certain range. Magnitude Dimension of the forgetting prediction signal.

5. The agent forgetting suppression method combining meta-learning memory replay according to claim 1, characterized in that, In step two, the memory controller employs a deletion rule based on the evaluation of the influence of sample forgetting when performing the deletion operation. This rule is implemented by a deletion evaluation module within the memory controller. Each time a deletion decision is triggered, the deletion evaluation module extracts the storage timestamp, the number of times the sample has been replayed, and the average gradient conflict value of the most recent sampling for each sample in the dynamic memory. The gradient conflict value is defined as the negative cosine similarity between the gradient generated by the sample and the average gradient of the current batch of new task samples. After normalizing these three feature values ​​to the 0-1 interval, they are input into a three-layer perceptron. The perceptron outputs a forgetting influence score between 0 and 1. The forgetting influence scores of all samples are sorted, and the sample with the lowest score is deleted. If the scores are equal, the sample with the earliest storage timestamp is deleted first. The three-layer perceptron is optimized together with the memory controller in the meta-training stage using a policy gradient approach. Its optimization signal is the negative value of the historical task performance degradation within a preset number of steps after the deletion operation, so as to minimize the negative impact of the deletion operation on forgetting.

6. The agent forgetting suppression method combining meta-learning memory replay according to claim 5, characterized in that, The dynamic memory also incorporates an admission control mechanism based on novelty and conflict potential when storing new experience samples. When the memory controller issues an action command to store the current experience, the storage management module first calculates the minimum value of the feature space Euclidean distance between the current sample and existing samples of the same task in the memory. If this minimum value is less than a preset threshold... If the storage is not performed, the action will be considered invalid. At the same time, the offset between the current sample and the center points of samples from different task classes will be calculated. If the offset is greater than a preset threshold, the action will be considered invalid. The sample is then marked as a potential conflict sample and given extra storage priority. When the memory bank is full and a new sample needs to be inserted, a forced deletion process is triggered. This process excludes samples marked as potential conflicts samples when selecting the sample with the lowest forgetting impact score. Set as the 10th percentile of the feature distance distribution of samples from similar tasks. The two thresholds are set as the 90th percentile of the distance distribution between the center points of the heterogeneous task samples. After each complete task is learned, these two thresholds are recalculated based on the contents of the memory bank, so that the memory bank can prioritize the retention of key experiences in the distribution edges and conflict areas with limited capacity.

7. The agent forgetting suppression method combining meta-learning memory replay according to claim 1, characterized in that, In step three, the composite reward function used to update the memory controller policy parameters is calculated at the end of a task sequence segment, specifically as follows: ,in This represents the total number of steps in the current task sequence. As a discount factor, , , For balance coefficient, Indicates the first The verification accuracy of the intelligent agent on the current task. For the first The global amount of forgetting measured step by step, This is for calculating cost penalties.

8. The agent forgetting suppression method combining meta-learning memory replay according to claim 1, characterized in that, In step three, the construction of the task sequence adopts a course-style progressive difficulty strategy. In each meta-training cycle, multiple tasks are extracted from the basic task distribution. The first few tasks are low-similarity task pairs with mutually exclusive input distributions. The middle few tasks are medium-similarity task pairs with some overlapping input features. The last few tasks are high-similarity task pairs that share a large number of input features but have opposite label mappings. This construction forces the memory controller to learn the basic storage and replay rhythm in the early stage, learn to distinguish overlapping representations in the middle stage, and learn to resolve catastrophic forgetting caused by feature conflicts in the later stage. Meta-training continues until the average global forgetting amount on the verification task sequence no longer decreases in several consecutive evaluation cycles. The verification task sequence contains multiple task types that have not appeared in the training. The controller parameters with the lowest average forgetting amount during the verification process are selected as the final deployment parameters. At the same time, during the verification period, the frequency distribution of replay triggered by the memory controller in different task similarity intervals is recorded and encoded as the controller's prior bias. During deployment, this prior bias is provided as an additional input to the policy network.

9. The agent forgetting suppression method combining meta-learning memory replay according to claim 1, characterized in that, In step four, during the deployment phase, when the agent faces a new online task flow, the memory controller runs in a frozen state, but its internal forgetting prediction module continues to be calibrated online. The calibration method is to recalculate the baseline loss using a small number of validation samples divided from the task after each complete task is processed, and update the historical task baseline loss table in the forgetting prediction module. If the global forgetting amount is detected to be monotonically increasing over multiple consecutive task cycles and the increase exceeds the preset warning line, a short meta-adaptation process is initiated. This process allows the memory controller to perform a one-step gradient update based on the experience of several recent tasks at a learning rate at least one order of magnitude lower than the final learning rate of the meta-training phase. After the update, the frozen state is immediately restored. The warning line value is set according to the statistical fluctuation range of the forgetting amount during the meta-training phase.

10. An agent forgetting suppression system combining meta-learning memory replay, applicable to the agent forgetting suppression method combining meta-learning memory replay as described in any one of claims 1-9, characterized in that, The system includes: Dynamic memory module: Used to store experience samples sampled by the agent during continuous task learning in key-value pairs, with a maximum capacity of M. It supports retrieval by task identifier and sampling by weight. Its output is connected to the forgetting prediction module and the replay execution module. Forgetting prediction module: After each learning batch, it extracts historical task reference samples from the dynamic memory module, calculates the weighted loss increment, and splices the memory saturation and distribution difference measure to generate an internal forgetting prediction signal. Its output is connected to the input of the meta-reinforcement learning memory controller module. The meta-reinforcement learning memory controller module has a built-in policy network and a meta-learning sub-network. Its input end receives the forgetting prediction signal output by the forgetting prediction module and the state vector composed of external task rewards. Its output end outputs the decision of four discrete actions: storage, deletion, replay, and no operation. When outputting the replay decision, it provides a dynamic replay weight vector to the replay execution module through the meta-learning sub-network. When outputting the deletion decision, it calculates the sample forgetting impact score through the built-in deletion evaluation module to perform deletion that minimizes forgetting. Replay Execution Module: Its input is connected to the Meta-Reinforcement Learning Memory Controller Module and the Dynamic Memory Bank Module. It is used to sample a batch of samples from the Dynamic Memory Bank Module according to the Dynamic Replay Weight Vector after receiving the replay trigger signal, and mix them with the current task data to perform gradient updates on the agent's basic model. Meta-training module: Used to perform end-to-end optimization of the policy parameters of the meta-reinforcement learning memory controller module on the task sequence distribution using a composite reward function to give it the ability to adapt quickly across tasks and provide curriculum-based task sequence generation and verification evaluation functions. This meta-training module only works in conjunction with other modules during the meta-training phase and is inactive during the deployment phase.