Unsupervised reinforcement learning method and system based on world model extension

The unsupervised reinforcement learning method, which extends the world model, solves the problem of skill learning and dynamic adaptation to the environment, improves the generalization ability and learning efficiency of skills, and is applicable to fields such as robot control and autonomous driving.

CN121031701APending Publication Date: 2025-11-28BEIJING JIAOTONG UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510983526.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing unsupervised reinforcement learning methods have shortcomings in terms of skill learning and dynamic adaptation to the environment, resulting in poor skill generalization and unstable performance of learned skills in complex environments, making them difficult to apply effectively in real-world tasks.

Method used

We employ an unsupervised reinforcement learning approach based on world model extensions. By integrating model architecture and differentiated prior training, we construct a dynamic environment prediction system. Combined with an explicit alignment mechanism between state representation changes and skill vectors, we ensure the controllability and stability of skill learning.

Benefits of technology

It enhances the generalization ability and learning efficiency of skills, enabling stable skill application in complex environments, and is applicable to fields such as robot control and autonomous driving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121031701A_ABST
    Figure CN121031701A_ABST
Patent Text Reader

Abstract

The invention provides an unsupervised reinforcement learning method and system based on world model extension, and belongs to the field of computer deep learning. The method comprises the following steps: acquiring a trained expert strategy and environment interaction historical offline data set D; a world model neural network is constructed, and training is carried out based on D; constructing an unsupervised reinforcement learning model, and setting an initial current prediction state; inputting the current prediction state and the skill vector z into the strategy network to obtain an action; inputting the current prediction state and action into a mature world model neural network to obtain a next prediction state; after complete track data is obtained, storing the track data into a playback buffer area; randomly sampling part of trajectory data, and training the unsupervised reinforcement learning model; and inputting the current environment state and the skill vector z of the intelligent agent into the mature unsupervised reinforcement learning model, outputting action parameters, and controlling the intelligent agent to execute corresponding actions. According to the invention, the generalization ability and learning efficiency of unsupervised reinforcement learning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of computer deep learning, and relates to an unsupervised reinforcement learning method and system based on world model expansion. BACKGROUND

[0002] As a method of learning optimal decisions through interaction with the environment, reinforcement learning has shown great potential in many fields. However, traditional reinforcement learning algorithms usually require a large amount of online interaction data, which often faces the problem of low sample efficiency in practical applications. In particular, in complex environments, the agent needs to spend a lot of time exploring to learn effective strategies, which greatly limits the practical application range of reinforcement learning. In order to overcome this limitation, in recent years researchers have begun to focus on how to use offline data for pre-training, thereby significantly improving the sample efficiency of reinforcement learning. In this context, unsupervised reinforcement learning has gradually become a research hotspot, and its core idea is to learn general skills or representations from offline data without relying on external reward signals, providing a good initialization for subsequent online tasks.

[0003] The key advantage of unsupervised reinforcement learning is the ability to autonomously discover useful behavior patterns from historical data without the need for human-designed reward functions. This approach is particularly suitable for real-world task scenarios where reward signals are sparse or difficult to define. Through unsupervised pre-training, the agent can learn a series of basic skills and internal representations of environmental dynamics, and these prior knowledge can greatly accelerate the learning process of subsequent specific tasks. Among them, skill learning as an important branch of unsupervised reinforcement learning aims to extract reusable basic behavior units from historical experience, and these skills can be flexibly combined like "building blocks" to provide efficient solutions for subsequent tasks. For example, in the field of robot control, the agent can learn various basic motion skills through unsupervised methods, and in actual tasks only need to simply combine these skills to quickly adapt to new demands. In addition, unsupervised learning can also discover solutions strategies that humans may not have thought of, providing new solutions for complex problems.

[0004] In existing technologies, researchers have proposed numerous methods for learning skills through unsupervised reinforcement learning on offline data. Some scholars have pioneered the introduction of skill learning into offline settings using VAEs to efficiently capture behavioral skills from offline data, theoretically proving its superiority over direct learning in the action space. Others, addressing the limited representational limitations of previous methods in recovering the original policy space, have proposed using a flow model to learn an invertible function, mapping latent embeddings to temporally extended actions. Still others have proposed obtaining behavioral priors by learning representations of input-output relationships, enabling faster learning of new tasks without hindering the agent's ability to learn new behaviors. To address the underdeterminacy of previous methods that maximize likelihood for skill learning, researchers have introduced an additional objective, biasing skill learning towards acquiring skills that accelerate new task learning. Furthermore, some researchers have proposed mapping states to a Hilbert space, learning structured representations that preserve environmental structure to capture diverse, optimal, and long-term behaviors from unlabeled offline data. Finally, to enable agents to learn diverse and useful behaviors from unsupervised offline data and perform rapid online learning, researchers have proposed imbuing the dataset with random intentions to encourage the diversity and usefulness of extracted skills.

[0005] However, the skill learning capabilities of these methods are severely limited by the coverage of the training data. When faced with new scenarios that exceed the original data distribution, existing skills often struggle to generalize effectively. Secondly, most methods focus only on the quality of skill reconstruction itself, neglecting the dynamic adaptation relationship between skills and the environment, resulting in unstable performance of learned skills in actual interactions. More importantly, existing methods typically treat skill learning as a static process, failing to establish a mechanism for the dynamic expansion of the skill set as the environment changes, thus leading to poor application performance in complex and open environments. Summary of the Invention

[0006] In view of the above-mentioned defects or deficiencies in the prior art, the present invention aims to provide an unsupervised reinforcement learning method and system based on world model extension. It achieves comprehensive modeling of environmental dynamics through world model integration architecture, ensures high controllability of learned skills by using explicit alignment mechanism between state changes and skill direction, and adopts adaptive constraint strategy to balance exploration efficiency and stability, so as to improve the generalization ability and learning efficiency of skills.

[0007] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:

[0008] In a first aspect, embodiments of the present invention provide an unsupervised reinforcement learning method based on an extended world model, comprising the following steps:

[0009] Step S1: Obtain the historical offline dataset D of the trained expert policy and its interaction with the environment;

[0010] Step S2: Construct the world model neural network;

[0011] Step S3: Based on the historical offline dataset D, train the world model neural network to obtain a mature world model neural network;

[0012] Step S4: Construct an unsupervised reinforcement learning model and set the initial current prediction state;

[0013] Step S5: Input the current predicted state and skill vector z into the policy network of the unsupervised reinforcement learning model to obtain the action;

[0014] Step S6: Input the current predicted state and action into the mature world model neural network to obtain the next predicted state; and determine whether the maximum step size or the termination state has been reached; if not, take the next predicted state as the current predicted state and return to step S5; if yes, obtain the complete trajectory data, store it in the playback buffer, and proceed to step S7.

[0015] Step S7: Randomly sample a portion of trajectory data from the playback buffer to train the unsupervised reinforcement learning model and obtain a mature unsupervised reinforcement learning model.

[0016] Step S8: Input the current environment state and the agent's skill vector z into the mature unsupervised reinforcement learning model, output the agent's action parameters, and control the agent to perform corresponding actions according to the action parameters.

[0017] In a preferred embodiment of the present invention, step S2, which involves constructing a world model neural network, includes:

[0018] An integrated model architecture is adopted to construct a world model neural network; the world model neural network contains n sub-models with identical structures, and each sub-model consists of a main network and a prior network, with the current environment state s as the input to both networks. t and the action a performed by the intelligent agent t The output is the predicted difference Δs between the next state and the current state. t Furthermore, the parameters of the prior network for each sub-model are fixed but different; among them, the current state and actions d and m represent the dimensions of the state and action, respectively.

[0019] In a preferred embodiment of the present invention, the sub-model adopts a multilayer perceptron structure, and the multilayer perceptron structure includes three hidden layers; the integrated model architecture adopts a parallel computing architecture, and the constructed world model neural network supports multiple sub-models to perform state prediction simultaneously.

[0020] As a preferred embodiment of the present invention, step S2 trains the world model neural network based on the historical offline dataset D, which specifically includes:

[0021] According to the environmental states and the actions executed by the agent at different times in the historical offline dataset D, calculate the difference between the next state and the current state at each time, incorporate the difference into the dataset to construct a new dataset D*, and divide D* into a training set, a validation set, and a test set; then train the sub-model main network in the world model neural network based on the training set in D*, and perform validation and testing through the validation set and the test set respectively.

[0022] As a preferred embodiment of the present invention, when training the sub-model main network in the world model neural network based on the training set in D*, the differential prior method is used to train the world model neural network;

[0023] During training, the prior network of each sub-model does not participate in direct training, and its parameters are fixed and different, but the prediction difference of the prior network is obtained according to the input value; the main network of each sub-model participates in direct training, and after updating the main network parameters in each training round, the prediction difference of the main network is obtained according to the input value; the output of the sub-model is the weighted sum of the prediction differences output by the main network and the prior network;

[0024] During training, the composite loss function adopted includes four components: the weighted mean square error loss term is used to minimize the state prediction deviation, the logarithmic variance loss term is used to quantify the prediction uncertainty, the model parameter regularization term prevents overfitting, and the logarithmic variance range constraint term ensures numerical stability.

[0025] As a preferred embodiment of the present invention, the unsupervised reinforcement learning model constructed in step S4 includes at least three components: the state representation network the policy network π and the Q-function network; where

[0026] the state representation network Adopts a multi-layer perceptron MLP structure, including two hidden layers, with the input being the original state and outputs a low-dimensional representation and k << d, and this network uses the ReLU activation function to ensure training stability; the state representation network is used to extract the key features of the state;

[0027] The policy network π adopts an MLP structure, including two hidden layers, with the input being the state representation and the skill vector z, and outputs the mean and variance parameters of the action distribution; in order to constrain the action range, the output layer uses the tanh activation function and adopts the reparameterization technique to implement a differentiable stochastic policy;

[0028] The Q-function network uses an MLP structure and contains two hidden layers, representing the input state. Skill vector z and action a, output state-skill value estimate.

[0029] In a preferred embodiment of the present invention, step S6 inputs the current predicted state and action into a mature world model neural network to obtain the next predicted state. Specifically, this includes: sampling a skill vector z from a preset Gaussian distribution as a strategy guidance signal for the current round; interacting with the world model neural network based on the strategy network π(a|s, z), whereby the strategy network generates action a according to the current predicted state and skill vector z, and the world model neural network receives action a and the current predicted state, outputting the prediction difference Δs. t The current predicted state is added to the difference between the predicted state and the model output to obtain the next predicted state; finally, complete trajectory data τ={…,(s t a t s t+1 ), ...} and store them in the playback buffer pool.

[0030] In a preferred embodiment of the present invention, step S7 trains the unsupervised reinforcement learning model by calculating the loss value of the unsupervised reinforcement learning model based on the data in the replay buffer and updating the parameters; it determines whether the maximum number of training rounds has been reached; if not, it returns to step S5; if it has been reached, the training is completed and a mature unsupervised reinforcement learning model is obtained.

[0031] In a preferred embodiment of the present invention, a state representation network is included during parameter updates. The parameters of the three components—the policy network (π), the Q-function network, and the parameter update process—are updated as follows:

[0032] First, a loss function is learned using state representation. Update State Representation Network

[0033]

[0034] In equation (2), It is a representation of the current state. It represents the next state; the first term aligns the state change with the skill direction, and the second term constrains the magnitude of the state representation change; alignment term. Constraints that ensure state changes align with skill direction To prevent the state representation from changing too much or too little, where ∈ is a preset threshold and λ is a Lagrange multiplier;

[0035] Secondly, the policy network π(a|s,z) and the Q-function network are updated using a flexible actor-critic algorithm; where the reward function is set as an intrinsic reward function based on changes in state representation. Essentially, it is the projection of state representation changes onto the skill direction, and the exploration effect is measured by the dot product of the skill vector and the state change; the cumulative reward of the trajectory adopts the standard discount form R = ∑γ t r t The discount factor γ∈(0.9, 0.99) controls the importance of long-term returns; a policy network π(a|s, z) and two Q-function networks Q are maintained. 1(s,a,z) Q 2(s,a,z) The two Q-function networks are updated by minimizing the Bellman error based on the current reward and the value of the next state; the policy network is updated by policy entropy regularization and maximizing the expected cumulative reward, where the entropy regularization term is controlled by a temperature coefficient.

[0036] Secondly, embodiments of the present invention also provide an unsupervised reinforcement learning system based on a world model extension, the system comprising: a historical data acquisition module, a world model construction module, a world model training module, a learning model construction module, an initialization module, an interactive data generation module, a buffer module, a learning model training module, and a reinforcement learning control module; wherein,

[0037] The historical data acquisition module is used to acquire the historical offline dataset D of the interaction between the trained expert strategy and the environment;

[0038] The world model construction module is used to construct a world model neural network;

[0039] The world model training module is used to train the world model neural network based on the historical offline dataset D, so as to obtain a mature world model neural network.

[0040] The learning model building module is used to build unsupervised reinforcement learning models;

[0041] The initialization module is used to set the initial current prediction state of the unsupervised reinforcement learning model;

[0042] The interactive data generation module is used to input the current predicted state and skill vector z into the policy network of the unsupervised reinforcement learning model to obtain the action; and input the current predicted state and action into the mature world model neural network to obtain the next predicted state; and determine whether the maximum step size or the termination state has been reached; if not, the next predicted state is used as the current predicted state, and the next action and the next predicted state are obtained; if so, the complete trajectory data is obtained and stored in the playback buffer.

[0043] The buffer module is used to set the playback buffer;

[0044] The learning model training module is used to randomly sample a portion of trajectory data from the playback buffer to train the unsupervised reinforcement learning model and obtain a mature unsupervised reinforcement learning model.

[0045] The reinforcement learning control module is used to input the current environmental state and the agent's skill vector z into a mature unsupervised reinforcement learning model, output the agent's action parameters, and control the agent to perform corresponding actions according to the action parameters.

[0046] The technical solutions provided in the embodiments of the present invention have the following beneficial effects:

[0047] The unsupervised reinforcement learning method and system based on world model extension provided in this invention constructs a more robust dynamic environment prediction system by integrating a world model architecture and differentiated prior training. The innovative skill learning framework ensures that learned skills have clear semantic meaning through explicit alignment of state representation changes with skill vectors. A dynamically adjusted constraint mechanism balances exploration efficiency and stability. This invention enhances the generalization ability and controllability of skills while improving learning efficiency. It is suitable for intelligent systems that need to learn interpretable and controllable skills from limited offline data, and has significant application value in fields such as robot operation and autonomous driving.

[0048] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

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

[0050] Figure 1 This is a flowchart of the unsupervised reinforcement learning method based on world model extension as described in an embodiment of the present invention;

[0051] Figure 2 This is a schematic diagram of the world model structure described in an embodiment of the present invention. Detailed Implementation

[0052] In their in-depth research of existing unsupervised reinforcement learning techniques, the inventors of this application discovered three key technical bottlenecks in skill learning and generalization. First, the skill learning process is disconnected from the dynamic characteristics of the environment, leading to significant instability in actual interactions, particularly a sharp decline in performance when facing unseen state spaces. Second, existing methods lack a systematic mechanism to ensure sufficient skill coverage in the state space, often resulting in certain critical regions remaining unexplored. Finally, insufficient modeling of the correlation between skill representation and state changes hinders precise skill control and transfer. These problems are particularly prominent in practical applications such as robot control and autonomous driving, severely restricting the industrial application of unsupervised reinforcement learning techniques.

[0053] Through extensive experimental analysis and theoretical derivation, the inventors recognized that the root cause of these technical bottlenecks lies in the failure of existing methods to effectively integrate dynamic environmental modeling with the skill learning process. Specifically, traditional methods either rely excessively on the static distribution of offline data, resulting in a lack of adaptability in the learned skills; or they lack reliable predictive ability for state transitions in online interactions, leading to low exploration efficiency. Furthermore, existing skill learning objectives often focus only on the statistical characteristics of the skill itself, neglecting the actual state changes that occur after the skill is executed. This disconnect makes it difficult for the learned skills to play their intended role in actual tasks.

[0054] Based on these important findings, this invention proposes an unsupervised reinforcement learning method based on world model extension. The implementation of this invention will be described in detail below with reference to the accompanying drawings and specific embodiments, including key aspects such as world model construction and training, reinforcement learning framework implementation, and core skill learning algorithms.

[0055] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In the description of this invention, the terms "first," "second," "third," "fourth," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0056] like Figure 1 As shown in the embodiment of the present invention, an unsupervised reinforcement learning method based on world model extension aims to solve the problem of insufficient generalization in offline dataset training, and includes the following steps:

[0057] Step S1: Obtain the historical offline dataset D of the trained expert policy and its interaction with the environment.

[0058] In this step, the collected historical offline dataset D is used to train the world model, and the data structure includes the environmental state and agent actions at different times.

[0059] Step S2: Construct the world model neural network.

[0060] In this step, an ensemble model architecture is used to construct a world model neural network; such as Figure 2 As shown, the world model neural network comprises n sub-models with identical structures. To enable each sub-model to fit the dataset distribution in different ways, each sub-model consists of a main network and a prior network, with the current environment state s serving as the input to both networks. t and the action a performed by the intelligent agent t The output is the predicted difference Δs between the next state and the current state. t The parameters of the prior network for each sub-model are fixed and different, and its role is to act as an "anchor point" to guide the main network to update in different directions.

[0061] In this step, the sub-model employs a Multilayer Perceptron (MLP) structure. The integrated model architecture utilizes a parallel computing architecture, and the constructed world model neural network supports multiple sub-models simultaneously predicting states. The value of n is typically set between 5 and 20 depending on the task complexity. The MLP architecture contains three hidden layers with 256, 256, and 128 neurons respectively, and uses the Swish activation function to balance training stability and expressive power. The model's input is the current state. and actions Where d and m represent the dimensions of the state and action, respectively. The model output is the predicted state change, i.e., the prediction difference. The corresponding next state is s t+1 .

[0062] Step S3: Based on the historical offline dataset D, train the world model neural network to obtain a mature world model neural network.

[0063] In this step, training the world model neural network specifically includes: calculating the difference between the next state and the current state at each time step based on the environmental state and agent actions at different times in the historical offline dataset D, merging the difference into the dataset to construct a new dataset D*, and dividing D* into a training set, a validation set, and a test set; then training the sub-model main network in the world model neural network based on the training set in D*, and validating and testing it through the validation set and the test set respectively.

[0064] The world model neural network is trained using a differentiated prior method.

[0065] During training, the prior network of each sub-model does not participate in direct training; its parameters remain fixed and differ, but it makes predictions based on the input values ​​to obtain the prediction difference of the prior network. The main network of each sub-model directly participates in training. After updating the main network parameters in each training epoch, it makes predictions based on the input values ​​to obtain the prediction difference of the main network. The output of the sub-model is a weighted sum of the prediction differences output by the main network and the prior network. Through this weighted summation, the prior network of each sub-model participates in the training process of the main network. During training, the main network needs to adjust its parameters to fit the weighted target, which includes fixed prior predictions. Therefore, the main network is forced to learn dynamic characteristics that complement or adjust the prior network, rather than fitting the data completely freely. In this way, different sub-models will ultimately learn different dynamic characteristics due to their different priors, thus achieving differentiation.

[0066] During training, the composite loss function used comprises four key components: a weighted mean squared error loss term to minimize state prediction bias, a log-variance loss term to quantify prediction uncertainty, a model parameter regularization term to prevent overfitting, and a log-variance range constraint term to ensure numerical stability. The mathematical expression for this loss function L is:

[0067]

[0068] In equation (1), N is the number of models in an ensemble, i represents the i-th ensemble model; B is the batch size, j represents the j-th batch; W is the output dimension, k represents the k-th output dimension; mean i,j,k logvar represents the mean of the predictions in the k-th dimension of the i-th ensemble model in the j-th batch; i,j,k Targets represents the mean, logarithm, and variance of the predictions in the k-th dimension for the i-th ensemble model in the j-th batch. j,k Let λ1 represent the target value in the j-th batch of the i-th ensemble model, where λ1 is the weight decay coefficient and θ is the neural network weight.

[0069] Preferably, the training process is terminated when the model performance does not significantly improve on the validation set for 5 consecutive epochs.

[0070] The detailed calculation process of the composite loss function is as follows: First, calculate the mean and logarithmic variance of the predicted output of each sub-model, where the logarithmic variance represents the logarithmic variance of the prediction uncertainty. Obtain the inverse variance through exponential operations, and then calculate the weighted mean squared error term:

[0071]

[0072] This item adaptively weights the prediction errors of different uncertainties. Meanwhile, the variance loss term is calculated. The model also includes a regularization term, that is, the parameter L2 norm decay λ1||θ|| 2 The final loss is the weighted sum of each item. Preferably, the Adam optimizer is used during the training process, the initial learning rate is set to 3e-4, and the cosine annealing scheduling strategy is adopted. The batch size is set between 256 and 1024 according to the available video memory, and the number of training epochs is usually 100 to 200 epochs.

[0073] Step S4, construct an unsupervised reinforcement learning model and set the initial current prediction state.

[0074] In this step, the constructed unsupervised reinforcement learning model includes three core components: the state representation network the policy network π and the Q-function network. Among them, the state representation network adopts an MLP structure, includes two hidden layers, the input is the original state and outputs a low-dimensional representation and k << d. This network uses the ReLU activation function to ensure training stability. The state representation network is used to extract the key features of the state. The policy network π also adopts an MLP structure, includes two hidden layers, the input is the state representation and the skill vector z, and outputs the mean and variance parameters of the action distribution. To constrain the action range, the output layer uses the tanh activation function and adopts the reparameterization trick to implement a differentiable stochastic policy. The structure of the Q-function network is similar to that of the policy network, and the input state representation skill vector z, action a, and outputs the state-skill value estimate. To improve learning stability, in this embodiment, two target value networks and the corresponding target network update rate τ = 0.005 are maintained. All network parameters are initialized using the Xavier method, the Adam optimizer is selected, the initial learning rate is uniformly set to 3e-4, and the gradient clipping technique (threshold set to 1.0) is adopted to prevent gradient explosion.

[0075] Step S5, input the current prediction state and the skill vector z into the policy network of the unsupervised reinforcement learning model to obtain an action.

[0076] In this step, it is a process of the interaction between the world model neural network and the unsupervised reinforcement learning model to obtain the training data of the unsupervised reinforcement learning model. Among them, when the first interaction is carried out, the current prediction state is the set initial current prediction state. The skill vector z, before the start of each round of interaction, samples a skill vector z from a preset standard Gaussian distribution N(0,1) as a signal to guide the behavior of the agent in the current round. Input the skill vector z into the policy network of the unsupervised reinforcement learning model to obtain the corresponding action.

[0077] Step S6: Input the current predicted state and action into the mature world model neural network to obtain the next predicted state; and determine whether the maximum step size or the termination state has been reached; if not, take the next predicted state as the current predicted state and return to step S5; if yes, obtain the complete trajectory data, store it in the playback buffer, and proceed to step S7.

[0078] This step continues the interaction and training data collection process. From the n sub-models of the trained ensemble world model, one sub-model is randomly selected with equal probability as the simulation environment for the current round of interaction. In the current interaction round, the current predicted state and action are input into the selected sub-model, and the following interaction loop is performed at time steps t = 0, 1, 2, ..., T-1 (T is the preset maximum step size or until the termination state is reached):

[0079] Step S61, State Input and Action Generation: Input the current predicted state s t The skill vector z is input into the policy network π(a|s,z), and the policy network outputs the action a. t .

[0080] Step S62, World Model Prediction: The current predicted state s t and the generated action a t The input is fed into the selected world model sub-model. This sub-model outputs the predicted difference Δs between the predicted next state and the current predicted state. t .

[0081] Step S63, Calculate the next predicted state: Calculate the next predicted state predicted by the world model:

[0082] Step S64, Prediction Uncertainty Assessment: Calculate the uncertainty of the currently selected sub-model for the input (s) t ,a t The uncertainty of the prediction, u t The uncertainty u t The calculation method is as follows: (s) t ,a t Input the data into all n sub-models and calculate the predicted Δs. t The variance of the result, and use this variance as u t This variance reflects the integration discrepancies.

[0083] Step S65, Data Filtering and Storage: Determine Uncertainty u t Is it below the preset confidence threshold δ (δ>0)? If u t If the value is less than δ, the current prediction is considered reliable, and the state transition tuple (s) is set. t ,a t , z) Store in the playback buffer; if u t If the value is greater than or equal to δ, then discard the tuple to avoid low-quality data polluting the training.

[0084] Step S66, State Update: Update the next predicted state The current predicted state s for the next time step t+1 Determine if the maximum step size has been reached. If not, return to step S61. If yes, end the interaction and obtain the filtered, high-quality, complete trajectory data.

[0085] The replay buffer mentioned in this step also manages the replay buffer pool: when the replay buffer pool reaches its capacity limit, a buffer pool management operation is performed, that is, the oldest batch data is removed.

[0086] Step S7: Randomly sample a portion of trajectory data from the playback buffer to train the unsupervised reinforcement learning model and obtain a mature unsupervised reinforcement learning model.

[0087] In this step, the unsupervised reinforcement learning model is trained. The loss value of the unsupervised reinforcement learning model is calculated based on the data in the replay buffer pool, and the parameters are updated. It is determined whether the maximum number of training rounds has been reached. If not, return to step S5. If it has been reached, the training is completed, and a mature unsupervised reinforcement learning model is obtained.

[0088] The parameter update process includes a state representation network. The parameters of the three components, namely the policy network π and the Q-function network, are updated.

[0089] First, a loss function is learned using state representation. Update State Representation Network

[0090]

[0091] In equation (3), It is a representation of the current state. It represents the next state; the first term aligns the state change with the skill direction, and the second term constrains the magnitude of the state representation change; alignment term. Constraints that ensure state changes align with skill direction To prevent excessively large or small changes in state representation, ∈ is a preset threshold (recommended value is 0.1 to 0.3). λ is the Lagrange multiplier, updated using gradient descent.

[0092] Secondly, the flexible actor-critic (SAC) algorithm is used to update the policy network π(a|s,z) and the Q-function network. The reward function is set as an intrinsic reward function based on changes in state representation. Essentially, it's the projection of state representation changes onto the skill direction, and the exploration effect is measured by the dot product of the skill vector and the state change. The cumulative trajectory reward uses the standard discount form R = ∑γ t r t The discount factor γ∈(0.9, 0.99) controls the importance of long-term rewards. This reward design makes the agent inclined to produce state changes consistent with the current skill direction, thereby achieving skill-oriented exploration. A policy network π(a|s, z) and two Q-function networks Q are maintained. 1(s,a,z) Q 2(s,a,z) The two Q-function networks are updated by minimizing the Bellman error based on the current reward and the value of the next state; the policy network is updated by policy entropy regularization and maximizing the expected cumulative reward, where the entropy regularization term is controlled by a temperature coefficient. During training, the temperature coefficient is automatically adjusted to maintain a preset target policy entropy level to preserve the policy's exploratory nature.

[0093] The final trained policy network can generate corresponding goal-oriented actions based on the input skill vector z, achieving diverse skill control.

[0094] Step S8: Input the current environment state and the agent's skill vector z into the mature unsupervised reinforcement learning model, output the agent's action parameters, and control the agent to perform corresponding actions according to the action parameters.

[0095] In this step, the intelligent agent includes the Ant quadruped robot system simulated by Mujoco, an autonomous driving system, etc. Taking the robot as an example, the trained unsupervised reinforcement learning model generates corresponding goal-oriented actions based on the input skill vector z and the current environmental state parameters of the quadruped robot, thereby achieving diverse skill control.

[0096] Based on the same idea, this invention also provides an unsupervised reinforcement learning system based on a world model extension. The system includes: a historical data acquisition module, a world model construction module, a world model training module, a learning model construction module, an initialization module, an interactive data generation module, a buffer module, a learning model training module, and a reinforcement learning control module; wherein...

[0097] The historical data acquisition module is used to acquire the historical offline dataset D of the interaction between the trained expert strategy and the environment;

[0098] The world model construction module is used to construct a world model neural network;

[0099] The world model training module is used to train the world model neural network based on the historical offline dataset D, so as to obtain a mature world model neural network.

[0100] The learning model building module is used to build unsupervised reinforcement learning models;

[0101] The initialization module is used to set the initial current prediction state of the unsupervised reinforcement learning model;

[0102] The interactive data generation module is used to input the current predicted state and skill vector z into the policy network of the unsupervised reinforcement learning model to obtain the action; and input the current predicted state and action into the mature world model neural network to obtain the next predicted state; and determine whether the maximum step size or the termination state has been reached; if not, the next predicted state is used as the current predicted state, and the next action and the next predicted state are obtained; if so, the complete trajectory data is obtained and stored in the playback buffer.

[0103] The buffer module is used to set the playback buffer;

[0104] The learning model training module is used to randomly sample a portion of trajectory data from the playback buffer to train the unsupervised reinforcement learning model and obtain a mature unsupervised reinforcement learning model.

[0105] The reinforcement learning control module is used to input the current environmental state and the agent's skill vector z into a mature unsupervised reinforcement learning model, output the agent's action parameters, and control the agent to perform corresponding actions according to the action parameters.

[0106] In this embodiment, each module is implemented using a processor, with additional memory added as needed for storage. The processor can be, but is not limited to, a microprocessor (MPU), a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components, etc. The memory can include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.

[0107] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0108] It should also be noted that the unsupervised reinforcement learning system based on world model extension described in this embodiment corresponds to the unsupervised reinforcement learning method based on world model extension. The description and limitations of the method also apply to the system, and will not be repeated here.

[0109] As can be seen from the above technical solutions, the unsupervised reinforcement learning method and system based on world model extension provided by the embodiments of the present invention effectively solves key problems in existing technologies such as insufficient skill generalization and poor environmental adaptability. It provides a reliable technical foundation for the practical application of unsupervised reinforcement learning in fields such as robot control and intelligent manufacturing. It is particularly noteworthy that the world model integration architecture and skill learning algorithm of the present invention have good versatility and can be easily transferred to different types of decision-making and control tasks, demonstrating broad application prospects.

[0110] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed, and is not intended to limit the scope of the claimed invention, but merely to illustrate preferred embodiments of the invention. Those skilled in the art should understand that the scope of the invention is not limited to the specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

Claims

1. An unsupervised reinforcement learning method based on an extended world model, characterized in that, Includes the following steps: Step S1: Obtain the historical offline dataset D of the trained expert policy and its interaction with the environment; Step S2: Construct the world model neural network; Step S3: Based on the historical offline dataset D, train the world model neural network to obtain a mature world model neural network; Step S4: Construct an unsupervised reinforcement learning model and set the initial current prediction state; Step S5: Input the current predicted state and skill vector z into the policy network of the unsupervised reinforcement learning model to obtain the action; Step S6: Input the current predicted state and action into the mature world model neural network to obtain the next predicted state; and determine whether the maximum step size or the termination state has been reached; if not, take the next predicted state as the current predicted state and return to step S5; if yes, obtain the complete trajectory data, store it in the playback buffer, and proceed to step S7. Step S7: Randomly sample a portion of trajectory data from the playback buffer to train the unsupervised reinforcement learning model and obtain a mature unsupervised reinforcement learning model. Step S8: Input the current environment state and the agent's skill vector z into the mature unsupervised reinforcement learning model, output the agent's action parameters, and control the agent to perform corresponding actions according to the action parameters.

2. The method according to claim 1, characterized in that, Step S2 involves constructing a world model neural network, including: An integrated model architecture is adopted to construct a world model neural network. The world model neural network contains n sub-models with identical structures, and each sub-model consists of a main network and a prior network. The input of both networks is the current environment state s. t and the action a performed by the intelligent agent t The output is the predicted difference Δs between the next state and the current state. t Furthermore, the parameters of the prior network for each sub-model are fixed but different; among them, the current state and actions d and m represent the dimensions of the state and action, respectively.

3. The method according to claim 2, characterized in that, The sub-model adopts a multilayer perceptron structure, and the multilayer perceptron structure contains three hidden layers; the integrated model architecture adopts a parallel computing architecture, and the constructed world model neural network supports multiple sub-models to perform state prediction simultaneously.

4. The method according to claim 2, characterized in that, Step S2 trains a world model neural network based on the historical offline dataset D, specifically including: Based on the environmental states and agent actions at different times in the historical offline dataset D, the difference between the next state and the current state at each time step is calculated. The difference is then incorporated into the dataset to construct a new dataset D*. D* is divided into a training set, a validation set, and a test set. The main network of the sub-model in the world model neural network is then trained based on the training set in D*, and validated and tested using the validation set and the test set, respectively.

5. The method according to claim 4, characterized in that, The training set based on D* is used to train the sub-model main network in the world model neural network, and a differential prior method is used to train the world model neural network. During training, the prior network of each sub-model does not participate in direct training. Its parameters are fixed and different, but it makes predictions based on the input values ​​to obtain the prediction difference of the prior network. The main network of each sub-model directly participates in training. After updating the parameters of the main network in each training round, it makes predictions based on the input values ​​to obtain the prediction difference of the main network. The output of the sub-model is a weighted sum of the prediction differences output by the main network and the prior network. During training, the composite loss function used consists of four components: a weighted mean squared error loss term to minimize state prediction bias, a log-variance loss term to quantify prediction uncertainty, a model parameter regularization term to prevent overfitting, and a log-variance range constraint term to ensure numerical stability.

6. The method according to claim 1, characterized in that, The unsupervised reinforcement learning model constructed in step S4 includes at least three components: a state representation network. Policy network π and Q-function network; among which, State Representation Network Adopting a multi-layer perceptron (MLP) structure with two hidden layers, the input is the original state Outputting a low-dimensional representation And k << d, this network uses the ReLU activation function to ensure training stability; the state representation network is used to extract the key features of the state; The policy network π adopts an MLP structure, contains two hidden layers, and takes state representations as input. Given a skill vector z, the output layer provides the mean and variance parameters of the action distribution. To constrain the action range, the output layer uses the tanh activation function and employs a reparameterization technique to achieve a differentiable stochastic strategy. The Q-function network uses an MLP structure and contains two hidden layers, representing the input state. Skill vector z and action a, output state-skill value estimate.

7. The method according to claim 6, characterized in that, Step S6 inputs the current predicted state and action into the mature world model neural network to obtain the next predicted state. Specifically, this includes: sampling a skill vector z from a preset Gaussian distribution as the policy guidance signal for the current round; interacting with the world model neural network based on the policy network π(a|s, z), whereby the policy network generates action a based on the current predicted state and skill vector z, and the world model neural network receives action a and the current predicted state, outputting the prediction difference Δs. t The current predicted state is added to the difference between the predicted state and the model output to obtain the next predicted state; finally, complete trajectory data τ={…,(s t ,a t s t+1 ),...} and store them in the playback buffer pool.

8. The method according to claim 6, characterized in that, Step S7 trains the unsupervised reinforcement learning model, calculates the loss value of the unsupervised reinforcement learning model based on the data in the replay buffer pool, and updates the parameters; determines whether the maximum number of training rounds has been reached; if not, returns to step S5. If this is achieved, the training is complete, and a mature unsupervised reinforcement learning model is obtained.

9. The method according to claim 8, characterized in that, When updating parameters, a state representation network is included. Parameter updates for the three components: the policy network π and the Q-function network; The parameter update process includes: First, a loss function is learned using state representation. Update State Representation Network In equation (2), It is a representation of the current state. It represents the next state; the first term aligns the state change with the skill direction, and the second term constrains the magnitude of the state representation change; alignment term. Constraints that ensure state changes align with skill direction To prevent the state representation from changing too much or too little, where ∈ is a preset threshold and λ is a Lagrange multiplier; Secondly, the policy network π(a|s,z) and the Q-function network are updated using a flexible actor-critic algorithm; where the reward function is set as an intrinsic reward function based on changes in state representation. Essentially, it is the projection of state representation changes onto the skill direction, and the exploration effect is measured by the dot product of the skill vector and the state change; the cumulative reward of the trajectory adopts the standard discount form R = ∑γ t r t The discount factor γ∈(0.9, 0.99) controls the importance of long-term returns; a policy network π(a|s, z) and two Q-function networks Q are maintained. 1(s,a,z) Q 2(s,a,z) The two Q-function networks are updated by minimizing the Bellman error based on the current reward and the value of the next state; the policy network is updated by policy entropy regularization and maximizing the expected cumulative reward, where the entropy regularization term is controlled by a temperature coefficient.

10. An unsupervised reinforcement learning system based on an extended world model, characterized in that, The system includes: a historical data acquisition module, a world model construction module, a world model training module, a learning model construction module, an initialization module, an interactive data generation module, a buffer module, a learning model training module, and a reinforcement learning control module; wherein, The historical data acquisition module is used to acquire the historical offline dataset D of the interaction between the trained expert strategy and the environment; The world model construction module is used to construct a world model neural network; The world model training module is used to train the world model neural network based on the historical offline dataset D, so as to obtain a mature world model neural network. The learning model building module is used to build unsupervised reinforcement learning models; The initialization module is used to set the initial current prediction state of the unsupervised reinforcement learning model; The interactive data generation module is used to input the current predicted state and skill vector z into the policy network of the unsupervised reinforcement learning model to obtain the action; and input the current predicted state and action into the mature world model neural network to obtain the next predicted state; and determine whether the maximum step size or the termination state has been reached; if not, the next predicted state is used as the current predicted state, and the next action and the next predicted state are obtained; if so, the complete trajectory data is obtained and stored in the playback buffer. The buffer module is used to set the playback buffer; The learning model training module is used to randomly sample a portion of trajectory data from the playback buffer to train the unsupervised reinforcement learning model and obtain a mature unsupervised reinforcement learning model. The reinforcement learning control module is used to input the current environmental state and the agent's skill vector z into a mature unsupervised reinforcement learning model, output the agent's action parameters, and control the agent to perform corresponding actions according to the action parameters.

Citation Information

Patent Citations

  • Deep reinforcement learning economic dispatching method based on pre-training and knowledge guidance

    CN116468106A

  • Multi-agent reinforcement learning method and device based on skill discovery and distribution

    CN117828477A

  • Intelligent agent strategy model training method combining early supervised learning and later reinforcement learning

    CN118014053A

  • Generative and multi-modal sensing integrated agent learning system

    CN120277628A

  • Method for training end-to-end autonomous driving strategy

    WO2023102962A1