World model state feature representation method based on heteroscedastic gaussian prior
By using a world model state feature representation method with heteroscedastic Gaussian prior, the problems of homoscedasticity assumption and loss of attention distribution uncertainty in the world model are solved. Adaptive feature representation and causal alignment are achieved, which improves the robustness and accuracy of alum floc image prediction in waterworks.
Patent Information
- Application Number
- CN202611436608.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-11-27
AI Technical Summary
Existing world models assume homoscedasticity and isotropy in predicting floc images from waterworks, ignore the differences in the reliability of feature dimensions, and multi-head attention only outputs enhanced features, losing the uncertainty of attention distribution. The prediction error lacks causal alignment with the latent space variance and lacks explicit modeling of cognitive uncertainty, resulting in reduced robustness of time series prediction and planning.
A world model state feature representation method with heteroscedastic Gaussian prior is adopted. Dynamic attention weights are calculated through a multi-head attention mechanism network to generate a heteroscedastic guiding factor, construct a causal regularization term, use the heteroscedastic guiding factor for attention guidance, and combine a regularization penalty function and a high-dimensional regularization penalty function to construct a total loss function to achieve dimensional adaptive feature representation.
The robustness and accuracy of the world model in predicting flocculent material in waterworks have been improved. By dynamically adjusting the variance of the feature dimensions, the model enhances its ability to reflect the non-stationary noise characteristics of industrial process data, suppresses feature collapse, and improves the reliability of planning.
Smart Images

Figure CN123178934A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method for representing the state features of a world model based on heteroscedastic Gaussian priors. Background Technology
[0002] World models are a core technical framework in the field of artificial intelligence used to simulate environmental dynamics and predict future states. They construct internal representations of the system through training with multimodal data. In recent years, world models represented by DreamerV3, TD-MPC2, and JEPA have made breakthrough progress in complex decision-making tasks. These world models typically employ variational autoencoders (VAEs) or self-supervised representation learning frameworks to map high-dimensional observation data into compact implicit feature vectors for forward prediction and planning by temporal networks. However, when applying world models to predict flocculent images after chemical dosing in water treatment plants, these methods face practical problems:
[0003] 1. Latent space priors or posteriors typically assume homoscedasticity and isotropy. That is, different samples and different feature dimensions are assumed to have the same or a fixed scale of uncertainty. However, in the real world, the reliability of different state dimensions varies greatly. In the floc images of alum flocs in a water treatment plant, some feature dimensions correspond to clear and stable visual patterns, while others are affected by factors such as lighting, turbidity, and bubbles, resulting in significantly different reliability.
[0004] 2. Attention mechanisms only perform weighted aggregation, discarding the uncertainty information of the attention distribution. Existing multi-head attention typically only outputs attention-enhancing features, without further utilizing whether the attention weight distribution is "peaked" or "flat".
[0005] 3. Lack of causal alignment between prediction error and latent space variance. In regions with large prediction errors, existing methods typically use variance derived from fixed priors or a global variance head, failing to adaptively adjust based on prediction errors. Consequently, regions with large errors may still output low-variance features, leading to unreliable and misleading plans.
[0006] 4. Lack of awareness of cognitive uncertainty affects the robustness of time-series prediction and planning. In complex decision-making tasks, state features need to express not only "what" but also "how certain" they are. Existing methods lack explicit modeling of cognitive uncertainty, making planning susceptible to interference from unreliable feature dimensions. Summary of the Invention
[0007] The purpose of this invention is to address the problems of existing world models that assume homoscedasticity and isotropy in the latent space, neglecting the reliability differences of feature dimensions; multi-head attention only outputs enhanced features, losing the uncertainty of attention distribution; prediction error and latent space variance cannot be causally aligned, and variance cannot be adaptively adjusted; and the lack of explicit modeling of cognitive uncertainty reduces the robustness of time series prediction and planning. This invention provides a method for representing the state features of a world model based on heteroscedastic Gaussian priors.
[0008] To achieve the above-mentioned objectives, the embodiments of the present invention provide the following technical solutions:
[0009] The method for representing the state features of a world model based on heteroscedastic Gaussian prior includes the following steps:
[0010] Step 1: Collect real-time observation data from the waterworks and extract initial feature embedding vectors through the encoder network;
[0011] Step 2: Input the initial feature embedding vector into the multi-head attention mechanism network, calculate the attention weights, and generate attention-enhanced feature representations and heteroscedasticity guiding factors; backpropagate the prediction error of the world model to the network that generates the heteroscedasticity guiding factors to construct causal regularization terms;
[0012] Step 3: Input the attention-enhanced feature representations into the mean prediction head network and the variance prediction head network respectively, and use the heteroscedasticity guiding factor to guide attention to obtain the mean vector and the log-variance vector.
[0013] Step 4: Reparameterize the mean vector and log-variance vector to obtain the implicit feature representation;
[0014] Step 5: Define the target spectrum benchmark and construct an empirical feature function representing the implicit features; construct a regularization penalty function based on the target spectrum benchmark and the empirical feature function; perform random projection on the regularization penalty function to construct a high-dimensional regularization penalty function;
[0015] Step 6: Construct a variance constraint term based on the heteroscedasticity guiding factor; construct the total loss function based on the causal regularization term, the high-dimensional regularization penalty function, the variance constraint term, and the task objective loss function.
[0016] Furthermore, step 1 specifically includes:
[0017] Images of *Hemiberlesia lataniae* flowers were collected as observation data; the collected observation data were then input into an encoder network to extract initial feature embedding vectors. ,in Let B be the set of real numbers, T be the batch size, T be the time series length, and D be the feature dimension.
[0018] Furthermore, step 2 specifically includes the following steps:
[0019] Step 2-1: Perform linear projection on the initial feature embedding vector H to obtain the query matrix Q, key matrix K and value matrix V. Calculate the dot product between the query matrix Q and the key matrix K to obtain the attention score matrix S.
[0020] Step 2-2: Apply the Softmax function to the attention score matrix S to obtain the attention weight matrix A; use the attention weight matrix A to perform a weighted summation on the value matrix V to obtain the attention-enhanced feature representation. ;
[0021] Steps 2-3: Calculate the entropy or variance statistic for the attention weight matrix A, and input the entropy or variance statistic into the mapping network to generate the heteroscedasticity guiding factor vector. :
[0022]
[0023] in, Let d be the heteroscedasticity guiding factor corresponding to the d-th feature dimension; d = 1, 2, ..., D, where D is the feature dimension; D-dimensional Constructing the heteroscedasticity guiding factor vector ;
[0024] Steps 2-4 involve backpropagating the prediction error between the world model's predicted values and the actual values to the network that generates the heteroscedasticity guiding factor, thereby constructing a causal regularization term.
[0025] Furthermore, steps 2-4 specifically include:
[0026] After inputting the alum flower image at time t into the encoder network in step 1, the initial feature embedding vector H at time t is obtained. t Then embed the initial feature vector H at that moment. t The dosage P at the time corresponding to the image of alum flowers t Input the world model, and the world model outputs the predicted initial feature embedding vector H at time t+1. t+1 After acquiring a real image of alum flowers at time t+1 and inputting it into the encoder network, the initial feature embedding vector H at time t+1 is obtained. t+1 Embed the initial feature predicted at time t into the vector H. t+1 `and the true initial feature embedding vector H at time t+1` t+1 Error comparison is performed to obtain the prediction error Err. pred ;
[0027] The prediction error Err of the world model pred Backpropagation to generate heteroscedasticity guiding factor vector The mapping network is constructed by using divergence to build causal regularization terms. :
[0028]
[0029] Where KL represents divergence; Softmax represents the Softmax activation function.
[0030] Furthermore, step 3 specifically includes:
[0031] Representing attention enhancement features Input the mean prediction head network and the variance prediction head network respectively to obtain the basic mean vector. and the fundamental log-variance vector :
[0032]
[0033]
[0034] in, This represents the mean prediction head network; This represents the variance prediction head network;
[0035] Using heteroscedasticity guiding factor vector Attention guidance on the fundamental mean vector and the fundamental log-variance vector:
[0036]
[0037]
[0038] in, It is the mean vector; It is the logarithmic variance vector; represents the Hadamard product; Clip represents the truncation function.
[0039] Furthermore, step 4 specifically includes:
[0040] Mean vector after attention guidance Sum of logarithmic variance vector The implicit feature representation Z is obtained by using reparameterized sampling:
[0041]
[0042] in, Standard deviation, ; Represents a standard Gaussian noise vector; It is a standard Gaussian distribution, and I is the covariance matrix;
[0043] The implicit feature representation Z obtained from sampling follows an anisotropic Gaussian distribution q(Z|X):
[0044]
[0045] Where, diag represents the vector extracted from the diagonal matrix; Let d represent the variance of the d-th feature dimension, where d = 1, 2, ..., D, and D is the feature dimension.
[0046] Furthermore, step 5 specifically includes the following steps:
[0047] Step 5-1: Define the target spectrum benchmark as a standard one-dimensional Gaussian distribution. Characteristic functions:
[0048]
[0049] in, As the target spectrum benchmark; Indicates angular frequency;
[0050] Step 5-2, for the discrete sample set Z={z1,z2,...,z...} of the implicit feature representation Z... B}, construct its empirical feature function :
[0051]
[0052] Among them, z b Let b represent the implicit feature representation of the b-th batch, where b = 1, 2, ..., B, and B is the batch size. Represents the imaginary unit;
[0053] Step 5-3: Construct a regularization penalty function based on the target spectrum benchmark and empirical feature functions. :
[0054]
[0055] Where [0,C] is the frequency domain truncation interval; Here, C is the weighting function; C is the lower limit of the frequency cutoff.
[0056] Step 5-4, for Randomly generate P unit projection directions Calculate high-dimensional implicit features Construct a high-dimensional regularization penalty function :
[0057]
[0058] Among them, a pZ represents the p-th unit projection direction, where p = 1, 2, ..., P, and P is the number of projection directions; (p) Let Z be a high-dimensional implicit feature of Z in the p-th projection direction.
[0059] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0060] (1) This invention dynamically calculates dot product attention weights through a multi-head attention mechanism network, uses the weights for adaptive weighting, and uses a mapping network to enable each feature dimension to obtain dynamic and interrelated heteroscedasticity guidance factors based on the input content. At the same time, this invention introduces a regularization penalty function based on feature function spectrum matching to ensure that the overall feature distribution after weighting still strictly conforms to the standard Gaussian prior, thereby maximizing the differentiation of feature expression and context awareness while maintaining the regularity of the global manifold.
[0061] (2) The regularization penalty function aims to constrain the feature learning process of the world model to ensure that it stably outputs latent space state features in temporal inference, thereby fundamentally suppressing the feature collapse phenomenon caused by overfitting or feature degradation of the world model. At the same time, by introducing the Gaussian prior of the heteroscedasticity guiding factor, the regularization penalty function also endows the feature space with a dimension-adaptive heteroscedasticity structure, so that each feature dimension maintains heteroscedasticity statistically, thereby more realistically reflecting the non-stationary noise characteristics of industrial process data that change with operating conditions. Attached Figure Description
[0062] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 This is a flowchart of the method of the present invention;
[0064] Figure 2 A flowchart for world model predictions. Detailed Implementation
[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. 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.
[0066] It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, the terms "first," "second," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance, or suggesting any such actual relationship or order between these entities or operations. Additionally, the terms "connected," "linked," etc., can refer to a direct connection between elements, components, modules, etc., or an indirect connection via other elements, components, modules, etc.
[0067] Example 1:
[0068] This invention is achieved through the following technical solutions, such as... Figure 1 As shown, the method for representing the state features of a world model based on heteroscedastic Gaussian priors includes the following steps:
[0069] Step 1: Collect real-time observation data from the waterworks and extract the initial feature embedding vector H through the encoder network.
[0070] The observation data can be data of any modality, including hemlock images, turbidity, pH value, or temperature. In this embodiment, hemlock images are collected as the observation data.
[0071] The collected observation data is input into the encoder network to extract the initial feature embedding vector. ,in Let B be the set of real numbers, T be the batch size, T be the time series length, and D be the feature dimension (for example, if the dimension of the vector H obtained after the image of alum flower passes through the encoder network is 768*1 or 1024*1, then D=768 or D=1024).
[0072] Step 2: Input the initial feature embedding vector H into the multi-head attention mechanism network, calculate the attention weights, and generate attention-enhanced feature representations and heteroscedasticity guiding factors; backpropagate the prediction error of the world model to the network that generates the heteroscedasticity guiding factors to construct causal regularization terms.
[0073] Step 2 specifically includes the following steps:
[0074] Step 2-1: Perform a linear projection on the initial feature embedding vector H to obtain the attention score matrix S.
[0075] The initial feature embedding vector H is passed through three learnable linear projection matrices of a multi-head attention network. , , This yields the query matrix Q, the key matrix K, and the value matrix V:
[0076]
[0077]
[0078]
[0079] Among them, W Q To query the linear projection matrix; W K W is the linear projection matrix of the bond; V It is a linear projection matrix.
[0080] Calculate the dot product between the query matrix Q and the key matrix K to obtain the attention score matrix S:
[0081]
[0082] Where, d k Let be the dimension of the key matrix; This is a scaling factor used to prevent gradient saturation caused by excessively large dot product values; This is the matrix transpose. The rows of the attention score matrix S represent queries, and the columns represent keys.
[0083] Step 2-2: Generate attention weight matrix A based on attention score matrix S, and generate attention-enhanced feature representation based on attention weight matrix A. .
[0084] Applying the Softmax function row-wise to the attention score matrix S yields the attention weight matrix A:
[0085]
[0086] Where Softmax represents the Softmax function; S ij This represents the element in the i-th row and j-th column of the attention score matrix S; S ikThis represents the element in the i-th row and k-th column of the attention score matrix S; i represents the query index, i=1,2,...,T; j and k both represent the key index, j,k=1,2,...,T, where T is the time series length.
[0087] The attention-enhanced feature representation is obtained by weighting and summing the value matrix V using the attention weight matrix A. :
[0088]
[0089] Existing technologies assume that different samples and different feature dimensions have the same or fixed uncertainty scale by default. However, in the real world, the reliability of different state dimensions varies greatly. Therefore, the weighted summation operation in this scheme enables the feature representation of each time step or each dimension to adaptively aggregate contextual information from other dimensions or time steps, with attention weight A. ij The correlation strength between the query at time step i and the key at time step j is explicitly characterized.
[0090] Steps 2-3: Calculate the entropy or variance statistics for the attention weight matrix A, and then generate the heteroscedasticity guiding factor through the mapping network.
[0091] The core improvement of this invention compared to existing technologies lies in that it no longer simply averages the attention weights, but instead extracts the inherent determinism of the attention weight distribution. For each query i, its attention weight distribution A is calculated. i,: Entropy E i or variance statistic Var i :
[0092]
[0093]
[0094] Among them, A ij Let be the attention weight in the i-th row and j-th column of the attention weight matrix A; Let be the mean of the attention weights in the i-th row of the attention weight matrix A.
[0095] The entropy or variance statistics are aggregated and then input into a lightweight mapping network. (Such as a single-layer MLP with a Sigmoid activation function), this mapping network generates a heteroscedasticity guiding factor vector along the feature dimension. :
[0096]
[0097] in, Let be the heteroscedasticity guiding factor corresponding to the d-th feature dimension; since d=1,2,...,D, the D-dimensional Constructing the heteroscedasticity guiding factor vector .
[0098] Existing attention mechanisms only perform weighted aggregation, discarding the uncertainty information of the attention distribution. Furthermore, multi-head attention typically only outputs attention-enhancing features, without further utilizing whether the attention weight distribution is "peaked" or "flat." Peaked attention indicates that the world model is highly confident in certain key-value relationships; flat attention indicates that the world model's judgment of relationships is ambiguous. However, existing methods often assign the same latent space variance to both, leading to overconfident encoding of ambiguous regions.
[0099] To address this issue, the significance of calculating the heteroscedasticity guiding factor per feature dimension in this scheme is as follows: Peak attention (low entropy or low variance statistics) represents a high degree of confidence in specific key-value relationships by the world model, and a lightweight mapping network should be assigned a smaller heteroscedasticity guiding factor; flat attention (high entropy or high variance statistics) represents ambiguity in specific key-value relationships by the model, and a lightweight mapping network should be assigned a larger heteroscedasticity guiding factor. This mechanism ensures that the heteroscedasticity guiding factor strictly adheres to the principle of epistemic uncertainty.
[0100] Steps 2-4 involve backpropagating the prediction error between the world model's predicted values and the actual values to the network that generates the heteroscedasticity guiding factor, thereby constructing a causal regularization term.
[0101] like Figure 2 As shown, after inputting the alum flower image at time t into the encoder network in step 1, the initial feature embedding vector H at time t is obtained. t Then embed the initial feature vector H at that moment. t The dosage P at the time corresponding to the image of alum flowers t Input the world model, and the world model outputs the predicted initial feature embedding vector H at time t+1. t+1 After acquiring a real image of alum flowers at time t+1 and inputting it into the encoder network, the initial feature embedding vector H at time t+1 is obtained. t+1 Embed the initial feature predicted at time t into the vector H. t+1 `and the true initial feature embedding vector H at time t+1` t+1 Error comparison is performed to obtain the prediction error Err. pred .
[0102] The prediction error Err of the world model pred Backpropagation to generate heteroscedasticity guiding factor vector The mapping network is constructed by using divergence to build causal regularization terms. :
[0103]
[0104] Where KL represents divergence; Softmax represents the Softmax activation function.
[0105] Existing world models lack causal alignment between prediction errors and latent space variance. In regions with large prediction errors, world models should ideally increase variance and decrease confidence. However, the variance in existing methods is typically given by fixed priors or a global variance head, failing to adaptively adjust based on prediction errors. Consequently, regions with large errors may still output low-variance features, leading to unreliable and misleading plans. Therefore, this proposal forces regions with high prediction errors to adaptively increase variance, forming a causally aligned uncertainty-aware latent space.
[0106] Step 3: Input the attention-enhanced feature representations into the mean prediction head network and the variance prediction head network respectively, and use the heteroscedasticity guide factor to guide attention to obtain the mean vector and the log-variance vector.
[0107] Represent the attention enhancement feature The inputs are fed into the mean prediction head network and the variance prediction head network, respectively, to obtain the basic mean vector. and the fundamental log-variance vector :
[0108]
[0109]
[0110] in, This represents the mean prediction head network; This represents the variance prediction head network.
[0111] Using heteroscedasticity guiding factor vector Attention is guided on the basic mean vector and the basic log-variance vector to achieve dimension-wise adaptive scaling:
[0112]
[0113]
[0114] in, It is the mean vector; It is the logarithmic variance vector; represents the Hadamard product; Clip represents the truncation function.
[0115] Existing techniques typically assume homoscedasticity and isotropy in their latent space priors or posteriors, meaning that different samples and different feature dimensions are assumed to have the same or a fixed scale of uncertainty. However, in the real world, the reliability of different state dimensions varies greatly. Therefore, this scheme uses a mean vector... Sum of logarithmic variance vector Each dimension is influenced by the heteroscedasticity guiding factor. The derived independent dynamic control realizes the attention-guided dimensionally heteroscedastic property—different samples and different feature dimensions obtain different variance scales because of their different correlation strengths in attention calculation.
[0116] Step 4: Reparameterize the mean vector and log-variance vector to obtain the implicit feature representation.
[0117] Mean vector after attention guidance Sum of logarithmic variance vector The implicit feature representation Z is obtained by using reparameterized sampling:
[0118]
[0119] in, Standard deviation, ; This represents a standard Gaussian noise vector, i.e., a random variable that follows a standard Gaussian distribution. Let I be a standard Gaussian distribution, and let I be the covariance matrix.
[0120] The implicit feature representation Z obtained from sampling follows an anisotropic Gaussian distribution q(Z|X):
[0121]
[0122] Where, diag represents the vector extracted from the diagonal matrix; Let represent the variance of the d-th feature dimension, where d = 1, 2, ..., D, and D is the feature dimension. This ensures that each dimension of the implicit feature representation Z has an independent variance value that is dynamically adjusted by attention.
[0123] In existing technologies, the implicit features of world models typically take two forms:
[0124] 1. Deterministic Embedded Vector. The encoder directly outputs a vector as a state feature. This method cannot express "how reliable the state is," as uncertainty information is lost.
[0125] 2. Homoscedastic or fixed-variance Gaussian latent variables. Although some VAE-like methods output the mean and variance, the variance is often globally shared, has a fixed scale, or is not dynamically coupled with attention uncertainty and prediction error. This makes it impossible to achieve "different variance scales for different samples and different feature dimensions".
[0126] If we only obtain the mean vector and log-variance vector without further constructing an implicit feature representation, they are merely auxiliary outputs and cannot inject uncertainty into the subsequent world model. Therefore, this invention constructs an implicit feature representation from the mean vector and log-variance vector through reparameterized sampling. The implicit feature representation obtained by sampling follows an anisotropic Gaussian distribution, which has the following advantages:
[0127] 1. Implements differentiable probability sampling, supporting end-to-end training. Reparameterization techniques transfer randomness to... This allows the gradient to pass through the sampling process, enabling the encoder network, multi-head attention mechanism network, mean prediction head network, variance prediction head network, and the backbone network of the world model to be jointly updated.
[0128] 2. Achieve dimensional heteroscedasticity factor expression. Each feature dimension has independent variance, which is dynamically controlled by the heteroscedasticity guiding factor. Different samples and different dimensions can have different variance scales, and the expressive power is significantly stronger than that of isotropic Gaussians.
[0129] 3. Inject uncertainty into the state representation of the world model. Implicit features are no longer just point estimates, but distributions. Subsequent time series forecasting and planning can use variance information to determine which dimensions are reliable and which are unreliable.
[0130] 4. It forms a closed loop with attention uncertainty. The more peaked the attention, the smaller the variance; the flatter the attention, the larger the variance. The larger the prediction error, the more the causal regularization term will push the variance to increase. Thus, the latent space variance is not a static parameter, but a dynamic quantity jointly determined by attention and prediction error.
[0131] 5. Combined with spectral regularization, this prevents the heteroscedastic posterior from deviating from the standard Gaussian prior. Although the variances of each feature dimension are different, step 5 forces the overall distribution to remain close to the standard Gaussian prior through feature function spectral matching, thus balancing expressive power and training stability.
[0132] Therefore, constructing an implicit feature representation from the mean vector and the log-variance vector is essentially upgrading the "state feature" from a deterministic vector to an attention-guided, dimensionally heteroscedastic, differentiable probabilistic state representation.
[0133] Step 5: Define the target spectrum benchmark and construct an empirical feature function for implicit feature representation; construct a regularization penalty function based on the target spectrum benchmark and empirical feature function; perform random projection on the regularization penalty function to construct a high-dimensional regularization penalty function.
[0134] To ensure that despite the dynamic heteroscedasticity of each dimension, the overall distribution of the implicit feature representation Z still strictly conforms to the standard Gaussian prior. This step introduces a regularization penalty function based on feature function spectrum matching.
[0135] Step 5 specifically includes the following steps:
[0136] Step 5-1: Define the target spectrum benchmark.
[0137] The target spectrum is defined as a standard one-dimensional Gaussian distribution. Characteristic functions:
[0138]
[0139] in, As the target spectrum benchmark; It represents angular frequency.
[0140] Under heteroscedastic posterior conditions, defining a computable and comparable standard Gaussian prior is challenging. Directly comparing high-dimensional probability density functions typically requires calculating normalization constants, which is computationally complex and numerically unstable. Therefore, the distribution matching problem needs to be transformed into the frequency domain, using the eigenfunction as the target spectral benchmark. This provides an analytical, simple target spectrum that does not require a normalization constant. Subsequently, matching the empirical eigenfunction, represented by the implicit features, with this target spectral benchmark can constrain the distribution of Z to approximate a standard Gaussian. Step 5-1 provides a clear objective for subsequent spectral matching regularization.
[0141] Step 5-2: Construct an empirical feature function that represents implicit features.
[0142] For a discrete sample set Z = {z1, z2, ..., zn} with implicit feature representation Z, B}, its empirical characteristic function for:
[0143]
[0144] Among them, z b Let b represent the implicit feature representation of the b-th batch, where b = 1, 2, ..., B, and B is the batch size. It represents the imaginary unit.
[0145] In actual training, the true distribution of the implicit feature representation Z is unknown, and there is only a finite batch of discrete samples Z={z1,z2,...,z...}B Since the true feature function cannot be directly obtained, a differentiable and trainable empirical feature function needs to be estimated from the samples. Estimating the distribution spectrum without parameters using the sample mean is computationally simple and allows for end-to-end backpropagation. Step 5-2 transforms "distribution matching" into "matching the empirical feature function with the target spectrum benchmark," avoiding direct density estimation and making it suitable for batch training.
[0146] Step 5-3: Construct a regularization penalty function based on the target spectrum benchmark and empirical feature functions.
[0147] Define the regularization penalty function for:
[0148]
[0149] Where [0,C] is the frequency domain truncation interval; This is equivalent to a weighting function (embedded low-pass filter); C is the lower limit of frequency cutoff, and in this embodiment, C=3.
[0150] Measuring the difference between the empirical feature function and the target spectral benchmark is challenging. Direct matching across the entire frequency band is problematic because the high-frequency portion is highly sensitive to a limited number of samples, easily introducing noise and causing instability in the regularization term. Therefore, a stable, computationally achievable regularization penalty function that focuses on the dominant distribution shape is needed. By using frequency domain truncation and weighted integration, the dominant distribution shape in the low-frequency band is constrained, suppressing the interference of high-frequency noise on a limited batch of samples. This penalty function forces the distribution of Z to approximate the standard Gaussian prior while maintaining computational stability and trainability, thus addressing the issue of "heteroscedastic posteriors potentially deviating from the standard Gaussian prior."
[0151] Step 5-4: Perform random projections of the regularization penalty function in multiple directions to obtain a high-dimensional regularization penalty function.
[0152] For Z, P unit projection directions are randomly generated. Calculate high-dimensional implicit features Construct a high-dimensional regularization penalty function :
[0153]
[0154] Among them, a p Z represents the p-th unit projection direction, where p = 1, 2, ..., P, and P is the number of projection directions; (p) Let Z be a high-dimensional implicit feature of Z in the p-th projection direction.
[0155] High-dimensional implicit feature Z (p)The joint distribution matching suffers from the curse of dimensionality, making direct computation of feature functions in high-dimensional space impractical; dimensional-wise matching alone cannot guarantee that the high-dimensional joint distribution approaches a standard Gaussian. Therefore, a scalable and computationally efficient method is needed to constrain the high-dimensional overall distribution. Through random projection, the high-dimensional joint distribution matching is decomposed into spectral matching on multiple one-dimensional projections. According to the Cramér-Wold theorem and its approximation, if the projection distribution of Z in all directions approaches a standard Gaussian, then its high-dimensional joint distribution also approaches a standard Gaussian. Step 5-4 has manageable computational cost, is suitable for batch training, and can ensure that the overall covariance structure and manifold structure do not deviate from the standard Gaussian prior even with heteroscedasticity in all dimensions. The significance of this high-dimensional regularization penalty function is: by forcing the spectrum of Z in all random projection directions to be consistent with the standard Gaussian distribution, it ensures that the overall joint distribution of the high-dimensional feature vectors approaches a standard Gaussian distribution. Even if the dimensions have different variances. The high-dimensional regularization penalty function still ensures, through full-segment spectrum matching constraints, that the weighted sum of the diagonal elements of the covariance matrix I and the overall manifold structure do not deviate from the standard Gaussian prior.
[0156] Step 6: Construct a variance constraint term based on the heteroscedasticity guiding factor; construct the total loss function based on the causal regularization term, the high-dimensional regularization penalty function, the variance constraint term, and the task objective loss function.
[0157] Steps 2-4 describe how the world model can obtain the initial feature embedding vector H at time t+1, which is the prediction of time t+1. t+1 At time t+1, the true initial feature embedding vector H at time t+1 can be obtained. t+1 , will H t+1 `and H t+1 Calculate the absolute L2 norm and construct the task objective loss function. .
[0158] The high-dimensional regularization penalty function constructed in step 5 Task objective loss function of the world model We construct the total loss function by weighted summation and introducing a variance constraint term.
[0159] Step 6 specifically includes the following steps:
[0160] Step 6-1: Construct variance constraint terms based on heteroscedasticity guiding factors.
[0161] To prevent the heteroscedastic guiding factor of attention-guided variables from deviating excessively from the standard Gaussian scale, a variance constraint term is added. :
[0162]
[0163] in, This is the budget weighting coefficient.
[0164] Step 6-2: Construct the total loss function based on the task objective loss function, the high-dimensional regularization penalty function, the variance constraint term, and the causal regularization term.
[0165] The final end-to-end joint total loss function of the entire trainable system, including the encoder network, multi-head attention mechanism network, mean prediction head network, variance prediction head network, and world model backbone network, is... for:
[0166]
[0167] in, This represents the weighting coefficient, used to control the high-dimensional regularization penalty function, with a value range of 0-1.
[0168] Using the backpropagation algorithm, the encoder network and the multi-head attention mechanism network (including W) are updated end-to-end. Q W K W V All parameters of the mean prediction head network, variance prediction head network, and world model backbone network.
[0169] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for representing the state features of a world model based on heteroscedastic Gaussian priors, characterized in that, Includes the following steps: Step 1: Collect real-time observation data from the waterworks and extract initial feature embedding vectors through the encoder network; Step 2: Input the initial feature embedding vector into the multi-head attention mechanism network, calculate the attention weights, and generate attention-enhanced feature representations and heteroscedasticity guiding factors; The prediction error of the world model is backpropagated to the network that generates the heteroscedasticity guiding factor to construct a causal regularization term; Step 3: Input the attention-enhanced feature representations into the mean prediction head network and the variance prediction head network respectively, and use the heteroscedasticity guiding factor to guide attention to obtain the mean vector and the log-variance vector. Step 4: Reparameterize the mean vector and log-variance vector to obtain the implicit feature representation; Step 5: Define the target spectrum benchmark and construct an empirical feature function representing the implicit features; construct a regularization penalty function based on the target spectrum benchmark and the empirical feature function; perform random projection on the regularization penalty function to construct a high-dimensional regularization penalty function; Step 6: Construct a variance constraint term based on the heteroscedasticity guiding factor; construct the total loss function based on the causal regularization term, the high-dimensional regularization penalty function, the variance constraint term, and the task objective loss function.
2. The method for representing the state features of a world model based on heteroscedastic Gaussian priors according to claim 1, characterized in that, Step 1 specifically involves: Images of *Hemiberlesia lataniae* flowers were collected as observation data; the collected observation data were then input into an encoder network to extract initial feature embedding vectors. ,in Let B be the set of real numbers, T be the batch size, T be the time series length, and D be the feature dimension.
3. The method for representing the state features of a world model based on heteroscedastic Gaussian priors according to claim 1, characterized in that, Step 2 specifically includes the following steps: Step 2-1: Perform linear projection on the initial feature embedding vector H to obtain the query matrix Q, key matrix K and value matrix V. Calculate the dot product between the query matrix Q and the key matrix K to obtain the attention score matrix S. Step 2-2: Apply the Softmax function to the attention score matrix S to obtain the attention weight matrix A; use the attention weight matrix A to perform a weighted summation on the value matrix V to obtain the attention-enhanced feature representation. ; Steps 2-3: Calculate the entropy or variance statistic for the attention weight matrix A, and input the entropy or variance statistic into the mapping network to generate the heteroscedasticity guiding factor vector. : in, Let d be the heteroscedasticity guiding factor corresponding to the d-th feature dimension; d = 1, 2, ..., D, where D is the feature dimension; D-dimensional Constructing the heteroscedasticity guiding factor vector ; Steps 2-4 involve backpropagating the prediction error between the world model's predicted values and the actual values to the network that generates the heteroscedasticity guiding factor, thereby constructing a causal regularization term.
4. The method for representing the state features of a world model based on heteroscedastic Gaussian priors according to claim 3, characterized in that, Steps 2-4 specifically refer to: After inputting the alum flower image at time t into the encoder network in step 1, the initial feature embedding vector H at time t is obtained. t Then embed the initial feature vector H at that moment. t The dosage P at the time corresponding to the image of alum flowers t Input the world model, and the world model outputs the predicted initial feature embedding vector H at time t+1. t+1 After acquiring a real image of alum flowers at time t+1 and inputting it into the encoder network, the initial feature embedding vector H at time t+1 is obtained. t+1 Embed the initial feature predicted at time t into the vector H. t+1 `and the true initial feature embedding vector H at time t+1` t+1 Error comparison is performed to obtain the prediction error Err. pred ; The prediction error Err of the world model pred Backpropagation to generate heteroscedasticity guiding factor vector The mapping network is constructed by using divergence to build causal regularization terms. : Where KL represents divergence; Softmax represents the Softmax activation function.
5. The method for representing the state features of a world model based on heteroscedastic Gaussian priors according to claim 3, characterized in that, Step 3 specifically involves: Representing attention enhancement features Input the mean prediction head network and the variance prediction head network respectively to obtain the basic mean vector. and the fundamental log-variance vector : in, This represents the mean prediction head network; This represents the variance prediction head network; Using heteroscedasticity guiding factor vector Attention guidance on the fundamental mean vector and the fundamental log-variance vector: in, It is the mean vector; It is the logarithmic variance vector; represents the Hadamard product; Clip represents the truncation function.
6. The method for representing the state features of a world model based on heteroscedastic Gaussian priors according to claim 5, characterized in that, Step 4 specifically involves: Mean vector after attention guidance Sum of logarithmic variance vector The implicit feature representation Z is obtained by using reparameterized sampling: in, Standard deviation, ; Represents a standard Gaussian noise vector; It is a standard Gaussian distribution, and I is the covariance matrix; The implicit feature representation Z obtained from sampling follows an anisotropic Gaussian distribution q(Z|X): Where, diag represents the vector extracted from the diagonal matrix; Let d represent the variance of the d-th feature dimension, where d = 1, 2, ..., D, and D is the feature dimension.
7. The method for representing the state features of a world model based on heteroscedastic Gaussian priors according to claim 6, characterized in that, Step 5 specifically includes the following steps: Step 5-1: Define the target spectrum benchmark as a standard one-dimensional Gaussian distribution. Characteristic functions: in, As the target spectrum benchmark; Indicates angular frequency; Step 5-2, for the discrete sample set Z={z1,z2,...,z...} of the implicit feature representation Z... B }, construct its empirical feature function : Among them, z b Let b represent the implicit feature representation of the b-th batch, where b = 1, 2, ..., B, and B is the batch size. Represents the imaginary unit; Step 5-3: Construct a regularization penalty function based on the target spectrum benchmark and empirical feature functions. : Where [0,C] is the frequency domain truncation interval; Here, C is the weighting function; C is the lower limit of the frequency cutoff. Step 5-4, for Randomly generate P unit projection directions Calculate high-dimensional implicit features Construct a high-dimensional regularization penalty function : Among them, a p Z represents the p-th unit projection direction, where p = 1, 2, ..., P, and P is the number of projection directions; (p) Let Z be a high-dimensional implicit feature of Z in the p-th projection direction.
