Agent reinforcement learning method and system based on gaussian adaptive prompt guidance
By dividing the training set into difficulty clusters and using a Gaussian adaptive cueing mechanism to dynamically allocate guidance depth for each task, and combining group relative strategy to optimize loss and auxiliary loss, the problem of low training efficiency in long-view sparse reward tasks is solved, and the training efficiency and performance of the agent are improved.
Patent Information
- Application Number
- CN202611226786.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-11-20
AI Technical Summary
Existing agent reinforcement learning methods suffer from problems such as cross-task heterogeneity mismatch, the dilemma between probe overhead and accuracy, and single-point hypothesis errors in long-view sparse reward tasks, resulting in low training efficiency.
A Gaussian adaptive prompting guidance method is adopted, which divides the training set into difficulty clusters and dynamically allocates guidance depth for each task through the Gaussian adaptive prompting guidance mechanism. The joint loss is formed by combining the group relative policy optimization loss and the auxiliary teacher-forced loss to update the agent parameters.
It achieves adaptive matching of the information band neighborhood for each task without increasing probe trajectory overhead, improving training efficiency and final performance, especially in long-field-of-view sparse reward tasks such as embodied control and web navigation.
Smart Images

Figure CN123140140A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and reinforcement learning technology, and particularly relates to an agent reinforcement learning method and system based on Gaussian adaptive prompting guidance. Background Technology
[0002] Large Language Model (LLM) agents have demonstrated significant capabilities in complex tasks such as web navigation, embodied control, and scientific experiments. These agents need to execute decision sequences spanning dozens of steps and receive sparse terminal reward signals only upon task completion. This leads to a situation where on-policy exploration from the initial state almost never reaches a successful final state, a problem known as "reward sparsity." This causes "advantage collapse" in mainstream policy optimization methods like Group Relative Policy Optimization (GRPO) as the task horizon grows. Reward sparsity here refers to the phenomenon that, because long-term tasks only return a binary reward in the final state, agents starting from the initial state during on-policy exploration almost never reach a successful final state, resulting in extremely scarce effective reward signals available for policy updates. Hint-based reinforcement learning, by preserving a prefix of an expert trajectory before each trajectory sampling, allows the policy to begin exploration from an intermediate state closer to the final state, offering an effective way to alleviate this problem. In this paradigm, the amount of expert prefixes retained (i.e., guidance depth) is a core design variable determining the success or failure of training: retaining too few will result in very few successful explorations; retaining too many will lead to reward saturation, zero within-group variance, and damage to advantage estimation. However, existing guidance depth selection methods exhibit systematic failures when task difficulty is heterogeneous and the horizon increases, exhibiting the following core flaws:
[0003] Cross-task heterogeneity misattribution: Scheduling methods write the guidance depth as a deterministic function of training steps or batch-level feedback, so that all tasks in the entire batch share the same depth value. However, the difficulty of different tasks within the same batch varies greatly. A single depth will cause simple tasks to be over-guided and difficult tasks to be under-guided, resulting in no effective learning signals at either end of the sampling trajectory.
[0004] The Probing Cost-Accuracy Dilemma: Per-sample probe methods run additional probe trajectories multiple times at several candidate depths for each task, estimating the empirical success rate and selecting the optimal depth. While this type of method can achieve task-level resolution, the cost of probe trajectories is extremely high—the estimation is noisy and prone to errors when comparable to the main sampling budget; to approximate near-zero mismatch, it often requires up to 20 times the main budget of additional trajectories, which is impractical in engineering.
[0005] The structural error of the single-point assumption: Existing methods, whether scheduling-based or probe-based, implicitly assume that there is a unique optimal guidance depth for each task. However, diagnostic analysis reveals that for each task, the guidance depth that can maintain "just learnable" is not a single point, but rather constitutes a band-shaped neighborhood around the optimal depth for that task; forcibly compressing it into a single point inevitably results in the loss of training signals that could have been obtained within the neighborhood.
[0006] Therefore, there is an urgent need for a policy learning method that can adaptively assign a differentiated guidance depth that covers the neighborhood of its information band for each task with varying difficulty in long-field-of-view tasks without introducing additional probe trajectory overhead or relying on external prediction networks or manual annotation, so as to solve problems such as cross-task mismatch, high probe overhead and single-point hypothesis error. Summary of the Invention
[0007] The technical problem to be solved by this invention is to overcome the aforementioned deficiencies of the prior art. To this end, this invention proposes an agent reinforcement learning method and system based on Gaussian adaptive prompting guidance.
[0008] To achieve the above-mentioned objectives, the present invention specifically adopts the following technical solution:
[0009] In a first aspect, the present invention provides an agent reinforcement learning method and system based on Gaussian adaptive prompting guidance, comprising the following steps:
[0010] S1: Before training begins, the training set is first divided offline into multiple difficulty clusters according to the length of the expert trajectory. This ensures that expert trajectories with similar difficulty levels in the e-commerce webpage navigation task belong to the same difficulty cluster, and that each difficulty cluster remains unchanged throughout the entire training process of the agent. Then, the training set is divided into several batches for agent training.
[0011] S2: When training the agent using the current batch, the prefix post-state of each expert trajectory in the current batch is obtained through the Gaussian adaptive cueing guidance mechanism. Starting from the prefix post-state, the agent interacts with the e-commerce webpage environment in multiple steps. When the e-commerce webpage navigation task is completed or the maximum number of interaction steps is reached, a webpage interaction trajectory is formed. After the agent independently samples multiple webpage interaction trajectories, the joint loss formed by the weighted combination of the group relative strategy optimization loss and the auxiliary teacher-forced loss is used to update the agent parameters. After the update, the mean, variance, and global baseline scalar of each difficulty cluster are simultaneously refreshed based on the experience success rate of each expert trajectory for the next batch of training.
[0012] S3: Repeat S2 iteratively until the preset maximum number of iterations is reached, and use the optimized agent as the web page interactive agent to complete reinforcement learning.
[0013] Based on the above scheme, each step can be implemented in the following preferred manner.
[0014] As a preferred embodiment of the first aspect mentioned above, in S2, the pre-prefixed state is obtained through the Gaussian adaptive cueing mechanism as follows:
[0015] S21: Read a global baseline scalar and the mean and variance of the task experience success rate within each difficulty cluster from the scheduler; then, synthesize the center and broadening of the truncated Gaussian distribution specific to each expert trajectory in the current batch online;
[0016] S22: For the i-th expert trajectory in the current batch, perform only one sampling from its truncated Gaussian distribution to obtain the guidance depth, and then set the guidance depth in... By truncating the interval, we obtain the guidance ratio of the i-th expert trajectory in the current batch, and then use this guidance ratio... Converted to prefix length And execute the i-th expert trajectory in the e-commerce webpage environment. Each action, after which the prefix state is reached, is completed. .
[0017] As a preferred embodiment of the first aspect mentioned above, in step S21, for the i-th expert trajectory in the current batch, its corresponding center... With broadening They are respectively:
[0018]
[0019]
[0020] in, To limit the value to The clipping function within; For global baseline scalar; Adjust the strength coefficient around the center; The target success rate is set in advance; For the kth difficulty cluster The average success rate of internal task experience; Let V be the variance of the success rate of task experience within the k-th difficulty cluster; This is a function to find the maximum value. To broaden the strength coefficient; To broaden the lower limit.
[0021] As a preferred embodiment of the first aspect mentioned above, in step S22, the prefix length corresponding to the i-th expert trajectory in the current batch is... Calculate using the following formula:
[0022]
[0023] in, The function is for finding the minimum value; Let be the length of the i-th expert trajectory; This is the floor function.
[0024] As a preferred embodiment of the first aspect above, in step S2, the empirical success rate of the i-th expert trajectory in the current batch is calculated using the following formula:
[0025]
[0026] in, For the state after the prefix Starting point: the number of webpage interaction trajectories sampled. For the state after the prefix Starting with a binary reward for the j-th webpage interaction trajectory provided by the e-commerce webpage environment, the reward is given when the e-commerce webpage navigation task is successful. The value is 1 when the e-commerce webpage navigation task fails. It is 0.
[0027] As a preferred embodiment of the first aspect above, in step S2, the mean, variance, and global baseline scalar of each difficulty cluster are refreshed based on the experience success rate of each expert trajectory within the current batch, specifically as follows:
[0028] First, calculate the average batch success rate. variance of batch success rate :
[0029]
[0030]
[0031] Subsequently, for each difficulty cluster appearing in the current batch, its corresponding mean and variance are updated using an exponential moving average. For difficulty clusters not appearing in the current batch, their mean and variance remain unchanged.
[0032]
[0033]
[0034] Finally, the average success rate at the cluster level The sign of the difference between the global baseline scalar and the mean batch success rate is used to perform a fixed-amplitude update:
[0035]
[0036]
[0037] in, This is the current batch size; The coefficient of the exponential moving average; For the sign function; Update the step size for the global baseline scalar; This is the set of expert trajectories that fall into the kth difficulty cluster in the current batch.
[0038] Secondly, the present invention provides an agent reinforcement learning system based on Gaussian adaptive prompting guidance, comprising:
[0039] The data acquisition module is used to acquire user command text;
[0040] The task execution module is used to input user command text into a web page interactive agent trained according to the Gaussian adaptive prompting-guided agent reinforcement learning method as described in any of the above-mentioned first aspect schemes. The web page interactive agent continuously interacts with the target e-commerce web page environment to complete the global goal.
[0041] Thirdly, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can implement the agent reinforcement learning method based on Gaussian adaptive prompting as described in any of the solutions of the first aspect above.
[0042] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the agent reinforcement learning method based on Gaussian adaptive prompting as described in any of the solutions of the first aspect above.
[0043] Fifthly, the present invention provides a computer electronic device, which includes a memory and a processor;
[0044] The memory is used to store computer programs;
[0045] The processor is configured to, when executing the computer program, implement the agent reinforcement learning method based on Gaussian adaptive prompting as described in any of the embodiments of the first aspect above.
[0046] Compared with the prior art, the present invention has the following advantages:
[0047] In reinforcement learning training for long-view sparse reward tasks, this invention models the expert trajectory prefix guidance depth of each training batch as a truncated Gaussian distribution. Using a two-layer structure—a global baseline scalar and an exponential moving average of the difficulty clusters of each task—the center and broadening of this truncated Gaussian distribution are synthesized online at the start of each training batch. Based on this, a differentiated guidance ratio is obtained for each task, and an expert prefix of appropriate length is executed to reach an intermediate state closer to the final state. Then, the agent independently samples multiple trajectories in this state and performs group-relative policy optimization. Compared to existing scheduling or probe-based methods that treat guidance depth as a single scalar, this mechanism characterizes guidance depth in a distributed manner, matching the empirical structure that "information bands are neighborhoods rather than single points." This allows tasks within the same difficulty cluster to proactively cover different depth scales within their information band neighborhoods, structurally eliminating cross-task mismatch. All of its distribution parameters are refreshed using derived statistics from the same set of trajectories used for policy optimization in this batch, without introducing any additional probe trajectories. This achieves task-by-task differentiation under an equivalent sampling budget, avoiding the multiplied overhead of probe-based methods.
[0048] Furthermore, this invention smooths the success rate noise of a single task into a cluster-level difficulty and dispersion estimate through intra-cluster exponential moving average, and provides a progress-aware overall offset with a global baseline scalar, enabling the center and breadth of the guidance depth to adapt simultaneously with policy progress and task difficulty. Simultaneously, an auxiliary teacher-forced loss, which only applies to the prefixes actually hit in the current batch, is introduced and weighted with the group-relative policy optimization loss, providing adaptive stabilization for the sampling-policy loop. This mechanism can operate solely with expert trajectories and termination rewards, eliminating the need for process reward models, value network distillation, or manual difficulty labeling, and introducing only minimal additional overhead proportional to batch size and cluster number at each step. Therefore, this invention models the guidance depth as a truncated Gaussian distribution over difficulty clusters, synthesizes distribution parameters online through global-cluster local decomposition, and employs a zero-probe policy-scheduling closed loop, significantly improving the training efficiency and final performance of agent policy models in long-view sparse reward tasks such as embodied control and web navigation. Attached Figure Description
[0049] Figure 1 This is an overall flowchart of the method of the present invention;
[0050] Figure 2 A schematic diagram illustrating the logic of online synthesis and sampling of truncated Gaussian distribution parameters;
[0051] Figure 3 A schematic diagram of the scheduling parameter refresh process for zero probes;
[0052] Figure 4 The system block diagram provided for this invention;
[0053] Figure 5 This is a schematic diagram of a computer electronic device provided by the present invention. Detailed Implementation
[0054] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. Technical features in the various embodiments of the present invention can be combined accordingly without mutual conflict.
[0055] In the description of this invention, it should be understood that the terms "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include at least one of those features.
[0056] like Figure 1 As shown, in a preferred embodiment of the present invention, the agent reinforcement learning method based on Gaussian adaptive prompting includes the following steps S1 to S3. The specific implementation process of each step will be described in detail below.
[0057] S1: Before training begins, the training set is first divided offline into multiple difficulty clusters according to the length of the expert trajectory. This ensures that expert trajectories with similar difficulty levels in the e-commerce webpage navigation task belong to the same difficulty cluster, and that each difficulty cluster remains unchanged throughout the entire training process of the agent. Then, the training set is divided into several batches for agent training.
[0058] It should be noted that in step S1 of this invention, since longer expert trajectories generally indicate a more difficult e-commerce webpage navigation task, this embodiment divides the e-commerce webpage navigation task into three categories—short-range, medium-range, and long-range—based on the length of the expert trajectories, which aligns with the typical short-medium-long difficulty distribution of long-range tasks. Specifically, this invention employs equal-frequency binning, equal-distance binning, or Jenks' natural breakpoint binning as the aforementioned offline binning methods. The purpose is to ensure that expert trajectories of similar length (i.e., similar task difficulty) fall into the same cluster, facilitating subsequent statistical smoothing of the task response within the same cluster. This invention clusters into three clusters in total. Each difficulty cluster refers to the set of expert trajectories containing similar difficulties obtained by performing a one-time offline binning of the training set according to the length of each expert trajectory. The number of difficulty clusters here is... The preferred value is 3, but it can also be adjusted within the range of 2 to 8 depending on the length of the expert trajectory.
[0059] S2: When training the agent using the current batch, the prefix post-state of each expert trajectory in the current batch is obtained through the Gaussian adaptive cueing guidance mechanism. Starting from the prefix post-state, the agent interacts with the e-commerce webpage environment in multiple steps. When the e-commerce webpage navigation task is completed or the maximum number of interaction steps is reached, a webpage interaction trajectory is formed. After the agent independently samples multiple webpage interaction trajectories, the joint loss formed by the weighted combination of the group relative strategy optimization loss and the auxiliary teacher-forced loss is used to update the agent parameters. After the update, the mean, variance, and global baseline scalar corresponding to each difficulty cluster are simultaneously refreshed based on the experience success rate of each expert trajectory for the next batch of training.
[0060] It should be noted that in step S2 of this invention, obtaining the prefixed state through the Gaussian adaptive cueing mechanism specifically involves:
[0061] S21: Read a global baseline scalar and the mean and variance of the task experience success rate within each difficulty cluster from the scheduler; then, synthesize the center and broadening of the truncated Gaussian distribution specific to each expert trajectory in the current batch online.
[0062] In step S21 of this invention, for the i-th expert trajectory in the current batch, its corresponding center... With broadening They are respectively:
[0063]
[0064]
[0065] in, To limit the value to The clipping function within; A global baseline scalar for tracking the overall guidance level required by the current strategy; Adjust the strength coefficient around the center; The target success rate is set in advance; For the kth difficulty cluster The average success rate of internal task experience; Let V be the variance of the success rate of task experience within the k-th difficulty cluster; This is a function to find the maximum value. To broaden the strength coefficient; To broaden the lower bound, the center of the above truncated Gaussian distribution corresponds to the expected value after truncation, and the broadening corresponds to the standard deviation after truncation.
[0066] In step S21 of this embodiment, the preferred value for the target success rate is 0.5. Here, this embodiment adopts the classic value of "just learnable" in course learning, and its value can also be finely adjusted within the range of 0.4 to 0.6; the preferred value for the center adjustment intensity coefficient is 1.0, which can be adjusted within the range of 0.5 to 2.0. If the value is too large, it will be too sensitive to the difference in difficulty between clusters; the preferred value for the broadening adjustment intensity coefficient is 1.0, which can be adjusted within the range of 0.5 to 2.0; the preferred value for the broadening lower limit is 0.1, which can be adjusted within the range of 0.05 to 0.2.
[0067] It should be noted that, as Figure 2 As shown, the meaning of the above synthesis formula is: the average success rate of task experience, used to reflect the difficulty of that difficulty cluster. When the average success rate of task experience within the k-th difficulty cluster is lower than the target success rate, the difference is... If the value is positive, the center of each expert trajectory in the difficulty cluster shifts deeper above the global baseline scalar to deepen the prefix and improve the success rate; conversely, if the value is negative, it shifts shallower. The variance of the task experience success rate reflects the dispersion of the e-commerce webpage navigation task's response to the current strategy within the difficulty cluster. When the variance within the difficulty cluster is large (i.e., the difficulty is dispersed within the cluster), the broadening is increased accordingly, allowing the sampled guidance depth to cover a wider range of the task's information band neighborhood. The lower limit of the broadening is used to prevent the distribution from degenerating into a deterministic single point. Since each expert trajectory within the same cluster shares the same mean and variance, the center of its truncated Gaussian distribution coincides with the broadening, thereby exploring different depth scales within the same information band neighborhood. This step is one of the core innovations of this invention.
[0068] It should be noted that, in this invention, the aforementioned information band refers to the neighborhood of values formed by the guiding depth that allows the empirical success rate to be maintained near "just learnable" (approximately 0.5) for a given task. This invention has diagnosed that when estimating the empirical success rate along a depth grid for the same task and using its Bernoulli variance as a proxy for information content, aligning each task according to its optimal depth that brings the success rate closest to 0.5 results in an information content envelope that exhibits a unimodal, approximately symmetrical shape that can be well fitted by a Gaussian curve. This structural conclusion indicates that the information band is a neighborhood rather than a single point, and supports the use of a Gaussian distribution family as the sampling distribution for the guiding depth in this invention.
[0069] S22: For the i-th expert trajectory in the current batch, perform only one sampling from its truncated Gaussian distribution to obtain the guidance depth. And will guide the depth in By truncating the interval, we can obtain the guidance ratio of the i-th expert trajectory in the current batch. The guiding ratio was then converted into a prefix length. And execute the i-th expert trajectory in the e-commerce webpage environment. Each action, after which the prefix state is reached, is completed. .in, For Centered on For a broadened truncated Gaussian distribution.
[0070] In step S22 of this invention, the prefix length corresponding to the i-th expert trajectory in the current batch is... Calculate using the following formula:
[0071]
[0072] in, This is a function to find the minimum value, used to ensure that the prefix length does not exceed [a certain value]. That is, at least one action is reserved for the agent to make its own decision; The length of the i-th expert trajectory is the total number of actions contained in the i-th expert trajectory. This is the floor function.
[0073] In step S22 of this invention, when truncating the guidance depth, if the guidance depth is greater than 1, its value is recorded as 1; conversely, if the guidance depth is less than 0, its value is recorded as 0. Here, guidance depth refers to the number of prefix actions retained and executed from the expert trajectory; guidance ratio refers to the proportion of the prefix length to the length of the entire expert trajectory. A prefix refers to a continuous sequence of actions in the expert trajectory that starts from the initial action and has a length equal to the guidance depth. The longer the retained prefix, the more the agent explores from an intermediate state closer to the final state; if the guidance depth is too shallow, exploration will still be rarely successful; if it is too deep, reward saturation and within-group variance will return to zero, thus destroying advantage estimation. Furthermore, this invention samples the guidance depth only once for each expert trajectory in the current batch, and the previous... The environment state reached after each action is executed sequentially is called the post-prefix state. This state is shared as a unified starting state by all corresponding webpage rollouts, thus avoiding repeated execution on the same prefix and saving interaction overhead. The environment state includes observable elements such as the current e-commerce webpage type, clickable control positions, and product information. The actions mentioned above can be specific operations that interact with the webpage, such as clicking the search box, entering product keywords, or clicking the "Add to Cart" button.
[0074] It should be noted that the calculation methods for the group-relative policy optimization loss and the auxiliary teacher-forced loss in step S2 of this invention are both existing technologies. This embodiment explains the calculation methods for the above two losses as follows:
[0075]
[0076]
[0077] in, and The execution prefix lengths are respectively The Middle The environmental conditions and corresponding expert actions of each step; To assist the teacher-forced loss, supervision is only applied to the variable-length expert prefix tokens that are actually hit by Gaussian sampling in this batch. That is, each step in the prefix length is performed using an expert action. To monitor objectives and maximize the effectiveness of strategies in environmental states and instructions Output the conditional probability of the expert action. ; For the current batch; For parameters intelligent agents; The group relative strategy optimization loss uses the binary reward of each web page interaction trajectory after in-group normalization as the advantage estimate. To assist teacher-forced loss weights; This is the joint loss ultimately used for backpropagation.
[0078] It should be noted that the reason for introducing the auxiliary teacher-forced loss in this invention is that the set of prefix tokens affected by the auxiliary supervision changes naturally with the evolution of the Gaussian sampler, synchronizes with the sampling policy, and has an adaptive stabilizing effect on the sampling-policy cycle. If only the group relative policy optimization loss is used, advantage collapse is likely to occur during training on long-term tasks; if only the auxiliary teacher-forced loss is used, it degenerates into supervised fine-tuning (SFT) of the sampled prefix, and cannot learn the decision policy in the later stages of the prefix. Therefore, this embodiment weights the two. The combination of these steps is essential and is one of the core innovations of this invention.
[0079] In this embodiment, the preferred weight of the auxiliary teacher-forced loss is 0.5, which can be adjusted within the range of 0.1 to 1.0. The agent parameter update uses the AdamW optimizer, and the group-relative policy optimization loss is achieved by using the pruning agent objective of proximate policy optimization. It should be noted that the above-mentioned group-relative policy optimization loss can also be replaced by other policy gradient methods based on the calculation of group relative advantage, such as adjacent group-level or hierarchical policy optimization objectives. It is only necessary to connect the Gaussian adaptive cueing guidance mechanism and the auxiliary teacher-forced loss of this invention, and its core mechanism remains unchanged.
[0080] It should be noted that in step S2 of this invention, the experience success rate of the i-th expert trajectory in the current batch is calculated using the following formula:
[0081]
[0082] in, For the state after the prefix Starting point: the number of webpage interaction trajectories sampled. For the state after the prefix Starting with a binary reward for the j-th webpage interaction trajectory provided by the e-commerce webpage environment, the reward is given when the e-commerce webpage navigation task is successful. The value is 1 when the e-commerce webpage navigation task fails. It is 0.
[0083] In this embodiment, the preferred value for the number of web page interaction trajectories is 8, which is consistent with the general configuration of Group Relative Strategy Optimization (GRPO).
[0084] It should be noted that in step S2 of the present invention, as Figure 3 As shown, based on the experience success rate of each expert trajectory within the current batch, the mean, variance, and global baseline scalar values for each difficulty cluster are refreshed as follows:
[0085] First, calculate the average batch success rate. variance of batch success rate :
[0086]
[0087]
[0088] Subsequently, for each difficulty cluster appearing in the current batch, its corresponding mean and variance are updated using an exponential moving average. For difficulty clusters not appearing in the current batch, their mean and variance remain unchanged.
[0089]
[0090]
[0091] Finally, the average success rate at the cluster level The sign of the difference between the global baseline scalar and the mean batch success rate is used to perform a fixed-amplitude update:
[0092]
[0093]
[0094] in, This is the current batch size; The coefficient of the exponential moving average; For the sign function; Update the step size for the global baseline scalar; This is the set of expert trajectories that fall into the kth difficulty cluster in the current batch.
[0095] It should be noted that, in this invention, the above-mentioned refresh process means: intra-cluster statistics , The empirical success rate noise of individual expert trajectories is smoothed into cluster-level difficulty and dispersion estimates using an exponential moving average, which is then used for the next batch of synthetic distribution parameters. The global baseline scalar, when the cluster-level success rate mean deviates from the batch-level success rate mean, is adjusted by a fixed amplitude. Moving in the direction of correction—using signs instead of differences for updates—prevents updates from being dominated by batch noise and avoids divergence caused by self-feedback. This is because all the statistics used for the above updates... , , , All trajectories are directly derived from the same batch of trajectories already collected by S2, and the entire scheduling parameter refresh does not introduce any additional probe trajectories. This step is one of the core innovations of this invention.
[0096] In this embodiment, the preferred value of the exponential moving average coefficient is 0.2, which can be adjusted within the range of 0.1 to 0.5. A larger value results in a faster response but poorer smoothness. The preferred value of the global baseline scalar update step size is 0.1, which can be adjusted within the range of 0.05 to 0.2. Too large a value leads to drastic fluctuations, while too small a value results in a slow response. The preferred initial value of the global baseline scalar is 0.8. The initial values of the mean and variance of the success rate of task experience for each difficulty cluster can be set as follows: The initial values are selected from within the batch, and these initial values only determine the prefix length of the first batch, and are updated in subsequent batches according to the refresh process described above.
[0097] S3: Repeat S2 iteratively until the preset maximum number of iterations is reached, and use the optimized agent as the web page interactive agent to complete reinforcement learning.
[0098] It should be noted that in this invention, S1 is an offline preparation step executed once before training, and S2 constitutes the main process that is executed cyclically within each training batch. Among them, the Gaussian adaptive cueing guidance mechanism, joint loss update, and refresh of the mean, variance, and global baseline scalar corresponding to each difficulty cluster in S2 are the core innovations of this invention. These three are connected in series through the same batch of trajectories, enabling the guidance depth scheduling and policy optimization to form a closed loop without increasing the trajectory budget.
[0099] To better demonstrate the specific implementation and technical effects of the present invention, the agent reinforcement learning method based on Gaussian adaptive prompting guided by steps S1 to S3 of the above preferred implementation is applied to a specific example below.
[0100] Example
[0101] The specific implementation process of the Gaussian adaptive prompting-guided agent reinforcement learning method used in this embodiment is as described above and will not be repeated here.
[0102] It should be noted that the method of this invention is applicable not only to e-commerce webpage navigation tasks, but also to long-range tasks such as embodied control and scientific experiments that require dozens of consecutive decision-making steps. Long-range tasks (also known as long-horizon tasks) refer to complex tasks that require an agent to perform multiple consecutive decision-making actions, go through multiple stages to achieve a preset global goal, and only return a binary success / failure reward upon task termination. Examples include "picking up an item—heating—placing it" in embodied control and "searching—filtering—placing an order" in web shopping. Therefore, this embodiment uses two sizes of instruction-based large language models (approximately 1.5B parameters and approximately 7B parameters) to conduct comprehensive validation on two long-horizon interaction benchmark datasets. The first interaction benchmark is a long-range embodied task benchmark, which is a text-based embodied reasoning environment that includes six categories of household chores, such as retrieving items from the home, cleaning, heating, refrigerating, and double retrieval. These chores are further divided into short-range, medium-range, and long-range categories based on the length of the expert trajectory for each task. The second interaction benchmark is a long-range online shopping task benchmark that simulates an e-commerce shopping environment. The agent needs to perform operations such as searching, filtering, clicking, and placing orders according to natural language shopping norms to purchase products that match the descriptions. The reward is returned when the purchase is completed in the final state.
[0103] On the two long-view interaction benchmarks mentioned above, this embodiment compares the method of the present invention with the strongest hint-free baseline (i.e., without retaining any expert prefixes) and the strongest hint-based scheduling baseline. All methods use the same training configuration: the optimizer is AdamW, and the peak learning rate is... Cosine scheduling with a 10% warmup is used; the pruning ratio is optimized using a group-relative strategy. KL penalty coefficient Each iteration samples 16 tasks, with 8 trajectories per task; bfloat16 precision is used. This invention features a unique Gaussian scheduling hyperparameter. , , , , , , , , The model is fixed and unadjusted across all benchmarks. The long-range task benchmark is trained with 200 gradient steps, and the long-range web shopping benchmark is trained with 150 gradient steps. The invention, as shown in Tables 1 and 2, is implemented based on an instruction-based large language model with approximately 1.5B parameters.
[0104] Table 1. Overall success rate of various methods on a specific long-range mission baseline.
[0105]
[0106] As shown in Table 1, this invention achieves an overall success rate of 95.3% on a specific long-range task benchmark, improving upon the strongest hint-based scheduling baseline by 1.5 percentage points and the strongest hint-free baseline by 3.9 percentage points. Notably, the strategy of this invention outperforms a strong hint-free baseline with a scale of 7B at a scale of 1.5B, indicating that the performance gain originates from the training method itself rather than the model capacity. Regarding training efficiency, the wall clock time for each gradient step of this invention is approximately 88 seconds, about 1 / 4.83 of the exhaustive enumeration probe method and 1 / 3.24 of the binary search probe method, verifying the low overhead of its zero-probe design under the same master sampling budget.
[0107] Table 2. Results of various methods on a benchmark for a long-term task of online shopping.
[0108]
[0109] As shown in Table 2, the present invention achieved a reward score of 92.3 and an order success rate of 78.9% on a long-term web shopping task benchmark, which is 6.2 percentage points higher than the order success rate of the strongest hint-free baseline. Both benchmarks cover two types of long-view tasks: embodied control and web navigation, further validating the versatility of the method of the present invention.
[0110] Table 3. Validation of 7B Model Scaling
[0111]
[0112] Furthermore, this embodiment also performs model scaling verification based on an instruction-based large language model with approximately 7B parameters on the two aforementioned long-viewpoint interaction benchmarks. The results are shown in Table 3. As can be seen from Table 3, after scaling the basic model to approximately 7B, the present invention maintains optimal performance on both benchmarks, achieving success rates of 98.4% and 84.4% respectively. This represents an improvement of 2.3 and 4.6 percentage points compared to the strongest baseline, verifying the scalability of the model in this invention.
[0113] To further verify the effectiveness of the core process of this invention, based on a large language model with approximately 1.5B parameters, this embodiment conducted ablation experiments as shown in Table 4 on a specific long-range task benchmark. The values in Table 4 do not constitute a limitation on the scope of protection of this invention.
[0114] Table 4. Ablation Experiment Results
[0115]
[0116] As shown in Table 4, the ablation results indicate that: (a) characterizing the guiding depth using a Gaussian distribution shows a significant gain compared to the deterministic version using only the distribution center and the uniform distribution with variance matching, verifying the effectiveness of the structural assumption that "information bands are neighborhoods rather than single points"; (b) cluster correlation center correction and clustering by difficulty are both indispensable, and removing them significantly reduces the overall success rate; (c) adaptive broadening has a particularly significant impact on the long-range task family, and removing it causes the success rate of the long-range task family to plummet from 94.7% to 78.3%; (d) both components of the joint loss are indispensable—removing the auxiliary loss reduces the overall success rate by 8.6 percentage points, while retaining only the auxiliary loss (degenerating into the sampling prefix SFT) fails to learn the post-prefix stage strategy, resulting in an overall success rate of only 26.6%. These results collectively verify the necessity and effectiveness of each component of this invention.
[0117] It should also be noted that the Gaussian adaptive prompting-guided agent reinforcement learning method in the above embodiments can essentially be executed by a computer program or module. Therefore, similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a Gaussian adaptive prompting-guided agent reinforcement learning system corresponding to the Gaussian adaptive prompting-guided agent reinforcement learning method provided in the above embodiments, such as... Figure 4 As shown, it includes:
[0118] The data acquisition module is used to acquire user command text;
[0119] The task execution module is used to input user command text into a web page interactive agent trained according to the Gaussian adaptive prompting-guided agent reinforcement learning method described in the above embodiments. The web page interactive agent continuously interacts with the target e-commerce web page environment to complete the global goal.
[0120] It is understood that the agent reinforcement learning method based on Gaussian adaptive prompting described in S1-S3 above can essentially be implemented by a computer program. Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer program product corresponding to the agent reinforcement learning method based on Gaussian adaptive prompting provided in the above embodiments, which includes a computer program / instructions. When executed by a processor, the computer program / instructions can implement the agent reinforcement learning method based on Gaussian adaptive prompting as described in the above embodiments.
[0121] Similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer electronic device corresponding to the Gaussian adaptive prompting-guided agent reinforcement learning method provided in the above embodiments, which includes a memory and a processor;
[0122] The memory is used to store computer programs;
[0123] The processor is configured to implement the Gaussian adaptive prompting-guided agent reinforcement learning method in the above embodiments when executing the computer program.
[0124] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0125] Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer-readable storage medium corresponding to the Gaussian adaptive prompting-guided agent reinforcement learning method provided in the above embodiments. The storage medium stores a computer program, which, when executed by a processor, can implement the Gaussian adaptive prompting-guided agent reinforcement learning method in the above embodiments.
[0126] Specifically, in the computer-readable storage medium of the above three embodiments, the stored computer program is executed by a processor, which can perform the aforementioned steps S1 to S3.
[0127] It is understood that the aforementioned storage media may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Furthermore, the storage media may also be various media capable of storing program code, such as USB flash drives, external hard drives, magnetic disks, or optical discs.
[0128] It is understood that the processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0129] It should also be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the embodiments provided in this application, the division of steps or modules in the system and method is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules or steps may be combined or integrated together, and a module or step may also be split.
[0130] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall within the protection scope of the present invention.
Claims
1. A Gaussian adaptive prompting-guided agent reinforcement learning method, characterized in that, Includes the following steps: S1: Before training begins, the training set is first divided offline into multiple difficulty clusters according to the length of the expert trajectory. This ensures that expert trajectories with similar difficulty levels in the e-commerce webpage navigation task belong to the same difficulty cluster, and that each difficulty cluster remains unchanged throughout the entire training process of the agent. Then, the training set is divided into several batches for agent training. S2: When training the agent using the current batch, the prefix post-state of each expert trajectory in the current batch is obtained through the Gaussian adaptive cueing guidance mechanism. Starting from the prefix post-state, the agent interacts with the e-commerce webpage environment in multiple steps. When the e-commerce webpage navigation task is completed or the maximum number of interaction steps is reached, a webpage interaction trajectory is formed. After the agent independently samples multiple webpage interaction trajectories, the joint loss formed by the weighted combination of the group relative strategy optimization loss and the auxiliary teacher-forced loss is used to update the agent parameters. After the update, the mean, variance, and global baseline scalar of each difficulty cluster are simultaneously refreshed based on the experience success rate of each expert trajectory for the next batch of training. S3: Repeat S2 iteratively until the preset maximum number of iterations is reached, and use the optimized agent as the web page interactive agent to complete reinforcement learning.
2. The agent reinforcement learning method based on Gaussian adaptive prompting as described in claim 1, characterized in that, In S2, the prefixed state obtained through the Gaussian adaptive cueing mechanism is specifically as follows: S21: Read a global baseline scalar and the mean and variance of the task experience success rate within each difficulty cluster from the scheduler; then, synthesize the center and broadening of the truncated Gaussian distribution specific to each expert trajectory in the current batch online; S22: For the i-th expert trajectory in the current batch, perform only one sampling from its truncated Gaussian distribution to obtain the guidance depth, and then set the guidance depth in... By truncating the interval, we obtain the guidance ratio of the i-th expert trajectory in the current batch, and then use this guidance ratio... Converted to prefix length And execute the i-th expert trajectory in the e-commerce webpage environment. Each action, after which the prefix state is reached, is completed. .
3. The agent reinforcement learning method based on Gaussian adaptive prompting as described in claim 2, characterized in that, In step S21, for the i-th expert trajectory in the current batch, its corresponding center... With broadening They are respectively: ; ; in, To limit the value to The clipping function within; For global baseline scalar; Adjust the strength coefficient around the center; The target success rate is set in advance; For the kth difficulty cluster The average success rate of internal task experience; Let V be the variance of the success rate of task experience within the k-th difficulty cluster; This is a function to find the maximum value. To broaden the strength coefficient; To broaden the lower limit.
4. The agent reinforcement learning method based on Gaussian adaptive prompting as described in claim 2, characterized in that, In step S22, the prefix length corresponding to the i-th expert trajectory in the current batch Calculate using the following formula: ; in, The function is for finding the minimum value; Let be the length of the i-th expert trajectory; This is the floor function.
5. The agent reinforcement learning method based on Gaussian adaptive prompting as described in claim 4, characterized in that, In step S2, the empirical success rate of the i-th expert trajectory in the current batch is calculated using the following formula: ; in, For the state after the prefix Starting point: the number of webpage interaction trajectories sampled. For the state after the prefix Starting with a binary reward for the j-th webpage interaction trajectory provided by the e-commerce webpage environment, the reward is given when the e-commerce webpage navigation task is successful. The value is 1 when the e-commerce webpage navigation task fails. It is 0.
6. The agent reinforcement learning method based on Gaussian adaptive prompting as described in claim 4, characterized in that, In step S2, the mean, variance, and global baseline scalar for each difficulty cluster are updated based on the experience success rate of each expert trajectory within the current batch. Specifically, this is as follows: First, calculate the average batch success rate. variance of batch success rate : ; ; Subsequently, for each difficulty cluster appearing in the current batch, its corresponding mean and variance are updated using an exponential moving average. For difficulty clusters not appearing in the current batch, their mean and variance remain unchanged. ; ; Finally, the average success rate at the cluster level The sign of the difference between the global baseline scalar and the mean batch success rate is used to perform a fixed-amplitude update: ; ; in, This is the current batch size; The coefficient of the exponential moving average; For the sign function; Update the step size for the global baseline scalar; This is the set of expert trajectories that fall into the kth difficulty cluster in the current batch.
7. A Gaussian adaptive cue-guided agent reinforcement learning system, characterized in that, include: The data acquisition module is used to acquire user command text; The task execution module is used to input user instruction text into a web page interactive agent trained according to the Gaussian adaptive prompting-guided agent reinforcement learning method as described in any one of claims 1 to 6. The web page interactive agent continuously interacts with the target e-commerce web page environment to complete the global objective.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it can implement the agent reinforcement learning method based on Gaussian adaptive prompting as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the agent reinforcement learning method based on Gaussian adaptive prompting as described in any one of claims 1 to 6.
10. A computer electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to implement, when executing the computer program, the agent reinforcement learning method based on Gaussian adaptive prompting as described in any one of claims 1 to 6.
