A riemannian manifold-based agent real-time decision method and system, and a medium
Patent Information
- Application Number
- CN202610755942.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2046-05-29
AI Technical Summary
[0004]本申请实施例提供了一种基于黎曼流形的智能体实时决策方法、系统及介质,用以解决如下技术问题:现有大语言模型决策方法将注意力矩阵作为欧氏向量处理且将行为关系图嵌入欧氏空间所导致的语义信息失真、层级拓扑失真,以及由此引发的智能决策系统跨场景部署时计算资源消耗过大、决策延迟过高、决策依据难以审计追溯的问题
本申请实施例所提供的方法应用于由数据采集模块、大语言模型推理模块、几何表征模块及动作执行模块构成的智能决策系统中,通过对计算机内运行的大语言模型所产生的注意力矩阵进行流形几何处理、并将由环境观测设备所采集的环境观测数据驱动的决策流程与外部执行机构相联动,相比现有的将注意力矩阵视为普通欧氏向量的方案,可以利用SPD流形的仿射不变度量,使得对输入的线性变换具有内在不变性,从而能够提取出鲁棒的语义特征,避免现有技术中的欧氏投影带来的信息失真,提升注意力特征表达质量;将辅助决策的行为转换图嵌入双曲黎曼空间,使得行为层级拓扑结构以多项式级参数量精确保留在双曲空间中,相比欧氏空间嵌入显著降低了存储开销、并支持多层次策略推理;跨流形对齐在严格的等距约束下进行,保证对齐映射不破坏任一流形的内在几何结构,从而显著提升跨场景泛化能力,减少模型在新场景部署时所需的重新训练计算资源;在推理阶段,通过在公共度量空间中计算查询向量与已存储动作节点表示之间的几何距离来检索决策动作,将决策过程从大语言模型的高代价自回归生成转化为低代价的向量距离比较,从而显著降低单次决策的计算延迟与硬件资源占用,便于在边缘计算设备或资源受限的工业控制系统中部署运行;同时,距离值本身可以作为决策置信度的可量化指标输出,使得动作执行模块所输出的控制指令具有可追溯、可审计的数学依据,提升了智能决策系统的可解释性与可靠性。
Smart Images

Figure CN122311474B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a real-time decision-making method, system and medium for intelligent agents based on Riemannian manifolds. Background Technology
[0002] Existing large-scale intelligent decision-making methods typically employ the following framework: First, environmental observations (such as sensor data, images, or structured states) are transformed into natural language prompts and input into a Large Language Model (LLM). Second, the LLM outputs decision suggestions or action descriptions in natural language form through an autoregressive generation mechanism. Finally, the text output is parsed into executable action instructions through rule mapping or a classifier, and policy optimization and updates are performed using a reinforcement learning framework. Typical representative methods include: the ReAct (Reasoning+Acting) framework based on prompt engineering, which directly uses chain-of-thought to guide LLM reasoning and output actions; the DecisionTransformer based on sequence modeling, which inputs state-action-reward trajectories in sequence form into the Transformer for supervised imitation learning; and LLM reinforcement learning methods combined with proximal policy optimization (PPO), which map the tokens output by the LLM to choices in a discrete action space.
[0003] However, existing large language model decision-making methods treat the attention matrix as a regular Euclidean vector; embedding the behavior relationship graph into a flat Euclidean space leads to exponential hierarchical topological distortion; and cross-modal alignment mapping may destroy the intrinsic structure of their respective spaces, ultimately resulting in weak decision generalization ability and poor interpretability. Summary of the Invention
[0004] This application provides a real-time decision-making method, system, and medium for intelligent agents based on Riemannian manifolds to solve the following technical problems: existing large language model decision-making methods treat the attention matrix as an Euclidean vector and embed the behavior relationship graph into Euclidean space, resulting in semantic information distortion, hierarchical topology distortion, and the resulting problems of excessive computational resource consumption, high decision delay, and difficulty in auditing and tracing the decision basis when deploying intelligent decision-making systems across scenarios.
[0005] In a first aspect, embodiments of this application provide a real-time decision-making method for intelligent agents based on Riemannian manifolds. The method is executed by an intelligent decision-making system, which includes a data acquisition module, a large language model inference module, a geometric representation module, and an action execution module. The method includes: the data acquisition module acquiring a historical trajectory dataset generated by the interaction between the intelligent agent and the environment; the historical trajectory dataset including environmental observation data collected by an environmental observation device, action signals output by the intelligent agent to an actuator, subsequent environmental observation data collected by the environmental observation device after the actuator's action, and corresponding real-time feedback signals; constructing a behavior transition graph based on the historical trajectory dataset, and storing the behavior transition graph in the storage module of the intelligent decision-making system; The geometric representation module maps the attention matrix generated by the large language model that the large language model reasoning module runs in the decision-making task to a symmetric positive definite matrix manifold for representation. The geometric representation module embeds the behavior transformation graph into hyperbolic Riemann space for representation; By optimizing the objective loss function, a geometric alignment mapping from the symmetric positive definite matrix manifold and the hyperbolic Riemannian space to the common metric space is learned. The objective loss function includes an isometric constraint term, which is used to make the distance in the common metric space similar to the geodesic distance on the symmetric positive definite matrix manifold and the hyperbolic Riemannian space. The parameters of the learned geometric alignment mapping are stored in the storage module. During the inference phase, the data acquisition module acquires the current environmental observation data collected in real time by the environmental observation device. The large language model inference module inputs the current environmental observation data into the large language model to obtain the attention representation corresponding to the current environmental observation data. The geometric representation module maps the attention representation to the common metric space based on the geometric alignment mapping to obtain the query vector. In the public metric space, calculate the geometric distance between the query vector and the corresponding representation of each action node in the behavior transformation graph in the public metric space; The actions corresponding to the action nodes in the behavior transformation graph whose geometric distance to the query vector is less than a preset threshold are output as control commands through the action execution module to the execution mechanism, so as to drive the execution mechanism to perform the action and change the environmental state.
[0006] Secondly, embodiments of this application also provide a real-time decision-making system for intelligent agents based on Riemannian manifolds, the system comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute a real-time decision-making method for intelligent agents based on Riemannian manifolds as described in the first aspect above.
[0007] Thirdly, embodiments of this application also provide a computer storage medium storing computer-executable instructions, which, when executed, implement a real-time decision-making method for intelligent agents based on Riemannian manifolds as described in the first aspect above.
[0008] The real-time decision-making method, system, and medium for intelligent agents based on Riemannian manifolds provided in this application have the following beneficial effects: The method provided in this application is applied to an intelligent decision-making system consisting of a data acquisition module, a large language model inference module, a geometric representation module, and an action execution module. It performs manifold geometric processing on the attention matrix generated by the large language model running within the computer and links the decision-making process driven by environmental observation data collected by environmental observation equipment with external execution mechanisms. Compared to existing schemes that treat the attention matrix as a regular Euclidean vector, this method utilizes the affine invariance metric of the SPD manifold to ensure inherent invariance to linear transformations of the input, thereby extracting robust semantic features and avoiding information distortion caused by Euclidean projection in existing technologies, thus improving the quality of attention feature representation. Furthermore, embedding the behavior transformation graph for decision support into a hyperbolic Riemannian space allows the hierarchical topology of the behavior to be precisely preserved in the hyperbolic space with polynomial-level parameters, significantly reducing storage requirements compared to Euclidean space embedding. It reduces overhead and supports multi-level policy reasoning; cross-manifold alignment is performed under strict equidistance constraints, ensuring that the alignment mapping does not destroy the intrinsic geometry of any manifold, thereby significantly improving cross-scenario generalization ability and reducing the computational resources required for retraining when deploying the model in new scenarios; during the inference phase, the decision action is retrieved by calculating the geometric distance between the query vector and the stored action node representation in a common metric space, transforming the decision-making process from high-cost autoregressive generation of large language models to low-cost vector distance comparison, thereby significantly reducing the computational latency and hardware resource consumption of a single decision, facilitating deployment and operation in edge computing devices or resource-constrained industrial control systems; at the same time, the distance value itself can be used as a quantifiable indicator of decision confidence, making the control commands output by the action execution module have a traceable and auditable mathematical basis, improving the interpretability and reliability of the intelligent decision-making system. Attached Figure Description
[0009] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a real-time decision-making method for intelligent agents based on Riemannian manifolds, provided for embodiments of this application; Figure 2 This is a schematic diagram of the structure of a real-time decision-making system for intelligent agents based on Riemannian manifolds, provided as an embodiment of this application. Detailed Implementation
[0010] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0011] This application provides a real-time decision-making method for intelligent agents based on Riemannian manifolds. The technical solution proposed in this application will be described in detail below with reference to the accompanying drawings.
[0012] Figure 1 This application provides a flowchart of a real-time decision-making method for intelligent agents based on Riemannian manifolds. The method can be executed by an intelligent decision-making system, which includes a data acquisition module, a large language model inference module, a geometric representation module, and an action execution module. Figure 1 As shown in the figure, the real-time decision-making method for intelligent agents based on Riemannian manifolds provided in this application embodiment specifically includes the following steps: Step 101: The data acquisition module of the intelligent decision-making system acquires the historical trajectory dataset generated by the interaction between the intelligent agent and the environment, constructs a behavior transformation map based on the historical trajectory dataset, and stores the behavior transformation map in the storage module of the intelligent decision-making system.
[0013] In reinforcement learning or decision-making AI terminology, anything capable of perceiving the state of its environment and taking action is called an intelligent agent. In this embodiment, an intelligent agent refers to a complete decision-making system, which may include a large language model. A large language model is a generalized, universal semantic understander capable of handling unseen states. The environment is the task world that the intelligent agent faces. For example, in a customer service dialogue system, the environment is the text entered by the user and the dialogue history. Interaction refers to the process by which the intelligent agent tries or operates within the environment.
[0014] In practical applications, behavior transformation graphs can be constructed based on historical trajectory datasets of agent-environment interactions. This transforms discrete, unstructured historical experience into structured knowledge representations that can be processed by geometric models, and provides a basis for system decision-making.
[0015] Step 102: The geometric representation module of the intelligent decision-making system maps the attention matrix generated by the large language model generated by the large language model reasoning module in the decision-making task to a symmetric positive definite matrix manifold for representation.
[0016] Choosing a symmetric positive definite matrix (SPD) manifold to model the LLM attention matrix has the following mathematical inevitability and engineering advantages: (1) Matching of intrinsic geometric structure: attention weight matrix of each layer of Transformer After symmetrization, it is essentially a positive semi-definite matrix. After adding a small regularization term, it becomes a positive definite matrix, which naturally belongs to the elements of the SPD(n) manifold. Forcibly projecting it into Euclidean space will destroy the positive definiteness constraint of the matrix and lose the essential structural relationship between the matrices. (2) The practical significance of affine invariance: The affine invariant metric on the SPD manifold satisfies This holds true for any invertible matrix P. This means that performing any linear transformation on the input (such as normalization or coordinate rotation) will not change the essential distance between attention patterns, thus ensuring the consistency of the model under different input scales and coordinate systems and enhancing cross-domain generalization ability. (3) Limitations of Euclidean distance: Euclidean distance is sensitive to the absolute size of matrix elements and cannot distinguish between "overall matrix enlargement" and "change in attention pattern"; while the geodesic distance on the SPD manifold is determined only by the ratio of the eigenvalues of the matrix, which can accurately capture the essential difference in attention distribution, rather than the difference in dimensions.
[0017] Step 103: The geometric representation module embeds the behavior transformation graph into hyperbolic Riemann space for representation.
[0018] Embedding the behavior transformation graph that assists in decision-making into a hyperbolic Riemann space can faithfully preserve the hierarchical topology of the graph, which is beneficial for accurate matching in the later stage.
[0019] Step 104: The geometric representation module learns the geometric alignment mapping from the symmetric positive definite matrix manifold to the hyperbolic Riemann space and the common metric space by optimizing the target loss function.
[0020] The objective function includes an isometric constraint, which requires that the distance in the common metric space be similar to the geodesic distance on the symmetric positive definite matrix manifold and the hyperbolic Riemann space.
[0021] Through the steps described above, under strict geometric constraints, we can learn how to map the "understanding" of LLM to the "structure" of the behavior transformation graph, ensuring that the mapping process does not distort the original information of either side. The aforementioned isometric constraint mandates that the distance between two points in the mapped common space must be approximately equal to their authentic geodesic distance in the original SPD manifold or hyperbolic space. This results in a common metric space that preserves the geometric structure. For example, in this space, the LLM's understanding of "cold" can naturally be close to the node "turn on the heating" in the knowledge base, and the distance between them has a clear geometric meaning.
[0022] In practical applications, the aforementioned isometric constraint forces the system to maintain the geometric relationships within the original manifold during the alignment process. Thus, even for reasonable semantic representations generated by large language models that never appeared during training, the mapping can correctly project them onto their corresponding positions in the common metric space based on their geometric relationships with known semantic points, thereby associating them with appropriate behaviors. This achieves robust and generalizable alignment from the open semantic space to the closed behavioral space, surpassing simple data fitting.
[0023] Step 105: In the inference phase, the data acquisition module acquires the current environmental observation data collected in real time by the environmental observation equipment. The large language model inference module inputs the current environmental observation data into the large language model to obtain the attention representation corresponding to the current environmental observation data. The geometric representation module maps the attention representation to the common metric space based on the geometric alignment mapping to obtain the query vector.
[0024] Step 106: In the public metric space, calculate the geometric distance between the query vector and the corresponding representation of each action node in the behavior transformation graph in the public metric space.
[0025] Step 107: The actions corresponding to the action nodes in the behavior transformation graph whose geometric distance to the query vector is less than a preset threshold are output as control commands through the action execution module to the execution mechanism, so as to drive the execution mechanism to execute the action and change the environmental state.
[0026] In this embodiment, the current state of the input large language model can be used to obtain an attention representation through a two-manifold representation step, then a query vector can be obtained through geometric alignment mapping, and the geometric distance between the query vector and the corresponding representations of each action node in the behavior transition graph in the common metric space can be calculated. Based on the geometric distance, the action node is retrieved from the behavior transition graph as the current decision output. In practical applications, the action node with a geometric distance below a preset threshold can be the closest action node (minimum geometric distance) as the decision, or other factors can be considered to select the action node with a relatively small geometric distance as the decision; no specific restrictions are imposed. In practical applications, the distance value itself and the distance ranking of all candidates can be directly used as the basis for the confidence and interpretability of the decision.
[0027] In this embodiment, the decision result is strictly limited to predefined action nodes, so that each decision can be traced back to a specific item in the behavior transition graph and its associated historical experience or rules, thereby providing interpretability at the business level and meeting the high reliability requirement that decisions must be based on evidence.
[0028] In one possible implementation, constructing the behavior transition graph based on the historical trajectory dataset includes: The data acquisition module acquires a set of historical decision-making trajectories of the agent's interaction with the environment. Traverse the historical decision trajectory set, and node the states and actions in the historical decision trajectory set to construct a set of state nodes and a set of action nodes; Based on the set of state nodes and the set of action nodes, directed edges are established according to a preset interaction order to construct a behavior transition graph. The edge weights in the behavior transition graph are obtained by normalizing the frequency of the corresponding transition events in the historical decision trajectory set. The node feature matrix of the behavior transition graph is composed of the semantic embedding vector corresponding to each node.
[0029] In practical applications, the Behavior Transition Graph (BTG) is constructed using historical trajectory datasets collected from the interactions between the agent and its environment. For input, where Let t be the environment state (State) at time t. Actions performed by the agent. The next state after the transition. The reward is immediate. The specific construction process is as follows: First, all states and actions appearing in the historical trajectory are nodeized and added to the state node set S and action node set A, respectively. Then, directed edges are established according to the interaction order of "state → action → next state," forming a bipartite graph structure. The edge weights are obtained by normalizing the frequency of the corresponding transition event in the dataset, reflecting the prior probability of the transition. The node feature matrix X consists of the semantic embedding vector corresponding to each node (state nodes are the output of the state encoder, and action nodes are the action identifier embedding).
[0030] Constructing a directed weighted graph ,in (State Node) (Action node) For the transformation edge, This is the node feature matrix. Edge weights are defined as normalized historical transition frequencies.
[0031] In one possible implementation, mapping the attention matrix generated by the large language model in the decision task to a symmetric positive definite matrix manifold for representation includes: Obtain the attention matrix generated by the large language model in the decision-making task; The attention matrix is symmetricized and regularized to map it onto a symmetric positive definite matrix manifold.
[0032] In practical applications, a symmetric positive definite matrix manifold is defined as:
[0033] Its affine invariant Riemannian metric (inner product) on the tangent space is:
[0034] The corresponding affine invariant geodesic distance is:
[0035] in for The eigenvalues. In engineering implementations, the Log-Euclidean metric is used as an approximation (more computationally efficient):
[0036] The Log-Euclidean metric described above transforms the nonlinear Riemannian geodesic distance into a linear operation in the tangent space by first mapping the two SPD matrices to the tangent space using the matrix logarithms, and then calculating the Frobenius norm difference. Compared to the affine-invariant geodesic distance, the Log-Euclidean metric reduces computational complexity from... The generalized eigenvalue decomposition is reduced to two independent matrix logarithmic operations, making it suitable for large-scale batch computing scenarios. Both methods have high approximate accuracy when the condition number (ratio of the largest to smallest eigenvalue) of the SPD matrix is small, and the engineering error is acceptable for the attention matrix (where eigenvalues are concentrated).
[0037] In practical applications, when mapping the attention matrix to the SPD manifold, the attention matrix of the l-th layer... Perform symmetry and regularization:
[0038]
[0039] The symmetry operation uses the mean of the attention matrix and its transpose as a new matrix, eliminating the slight asymmetry introduced by the softmax nonlinearity in multi-head attention and ensuring the matrix satisfies the symmetry requirements of the SPD manifold. The regularization operation adds... ( (where I is the identity matrix) pushes the symmetric positive semi-definite matrix into the strictly positive definite region, avoiding matrix singularity that causes matrix inversion failure in logarithmic mapping, and numerically restricts the matrix condition number, improving the convergence stability of Karcher flow iteration.
[0040] In practical applications, the basic operations on the SPD manifold form the mathematical foundation for operations on the manifold. Their geometric meanings are as follows: The Exponential Map maps the tangent vector U in the tangent space at a point S on the SPD manifold to another point on the manifold, corresponding to the geodesic endpoint reached per unit time by traveling along the direction of tangent vector U from S. This achieves the "expansion" operation from the tangent space (linear space) to the manifold (nonlinear space). The Logarithmic Map is the inverse operation of the Exponential Map, "folding" the relationship between two points S and T on the manifold into a tangent vector in the tangent space at S. The magnitude of the tangent vector is equal to the geodesic distance between S and T, and its direction points to the shortest geodesic path from S to T, achieving local linearization of the manifold to the tangent space. Parallel transport moves tangent vectors along geodesics from the tangent space of one base point to the tangent space of another base point while maintaining the Riemann inner product (i.e., distance-preserving transport). This allows tangent vectors from different base points to be compared within a unified framework, which is the geometric basis for achieving cross-manifold feature alignment.
[0041] Exponential mapping (tangent vector → point on manifold):
[0042] Logarithmic mapping (point on a manifold → tangent vector):
[0043] Parallel movement along the geodesic from S to T (transport tangent vector U):
[0044] In one possible implementation, after the characterization by mapping to a symmetric positive definite matrix manifold, the method further includes: On the symmetric positive definite matrix manifold, the manifold representations of the attention matrices of multiple layers are aggregated by computing the Fréchet mean weighted by attention entropy to form a unified semantic geometric representation.
[0045] In the above embodiments, the Fréchet mean can be used instead of the arithmetic mean to achieve the correct aggregation of multi-layer attention representations on the manifold.
[0046] The purpose of using Fréchet mean to aggregate multi-layer attention is to perform weighted fusion of the attention SPD matrices {S^(l)}_{l=1}^L extracted from each layer (L layers in total) of the LLM on the SPD manifold to obtain a single comprehensive attention representation S_LLM. The specific process is as follows: First, the information entropy of the attention matrix of each layer is calculated. Layers with low entropy values indicate concentrated attention distribution (focused on key positions) and contain richer structural information; layers with high entropy values have scattered attention and low information content. Based on this, the weights {alpha_l} of each layer are calculated by inverting and then normalizing with softmax, so that low-entropy layers receive higher weights. Then, the weighted Fréchet mean is used instead of the Euclidean weighted mean. In Euclidean space, the weighted mean is directly summed by weighting the matrix elements; however, applying Euclidean weights to the SPD matrix would destroy positive definiteness and would not conform to the geometry of the manifold. The Fréchet mean is defined as the point on the manifold that minimizes the sum of weighted squared geodesic distances. It is a natural generalization of the Euclidean mean to the Riemannian manifold, ensuring that the result is still a valid SPD matrix. This allows for the effective fusion of attention semantics at different levels of LLM (shallow layers capture local syntax, deep layers capture global semantics), adaptively highlighting information-rich layers through entropy weighting. Furthermore, the Fréchet mean is performed on the SPD manifold, ensuring that the fusion result satisfies positive definiteness constraints and does not introduce geometric distortion, providing a high-quality SPD representation foundation for subsequent cross-manifold alignment.
[0047] On Riemannian manifolds, the arithmetic mean must be replaced by the Fréchet mean, which is defined as:
[0048] The weights of each layer are calculated based on attention entropy:
[0049]
[0050] The Fréchet mean was obtained iteratively using Karcher flow:
[0051] Typically, it converges after 10 to 20 iterations, eventually yielding a unified SPD manifold attention representation S_LLM ∈ SPD(n).
[0052] In one possible implementation, embedding the behavior transformation graph into a hyperbolic Riemannian space for representation includes: The behavior transition graph is hyperbolic embedded using a Poincaré sphere model, wherein each action node in the behavior transition graph is mapped to a point inside the Poincaré sphere model, and the hyperbolic geodesic distance between connected action nodes in the behavior transition graph in hyperbolic space is less than that between unconnected nodes.
[0053] In practical applications, among various hyperbolic space models (including hyperboloid models, Klein models, Poincaré half-plane models, etc.), the advantages of choosing the Poincaré ball model are: (1) Numerical stability: The Poincaré ball maps the entire infinite hyperbolic space to the interior of a Euclidean sphere with a radius of 1. All embedding vector norms are strictly less than 1, naturally possessing bounded representation, which facilitates numerical implementation and gradient clipping; in the hyperboloid model, coordinate values grow exponentially with embedding depth, which is prone to numerical overflow. (2) Differentiability support: Möbius addition and exponential / logarithmic mapping on the Poincaré ball have closed analytic forms, which can be directly implemented in the deep learning framework for automatic differentiation, supporting end-to-end training. (3) Hierarchical embedding effect: The negative curvature of the Poincaré sphere enables it to express a tree-like hierarchical structure in an exponential growth manner—the further away from the origin, the lower (more specific) the node level, and the higher (more abstract) the node level near the origin. This naturally corresponds to the hierarchical relationship of "high-level strategy → low-level action" in the behavior transformation diagram, and the embedding distortion is much lower than that of Euclidean space.
[0054] In practical applications, hyperbolic space adopts the Poincaré sphere model. The Riemann metric is:
[0055] Geodetic distance:
[0056] Hyperbolic space has constant negative cross-sectional curvature It can express exponentially growing hierarchical structures with polynomial parameters, making it naturally suitable for embedding behavioral transformation graphs with strategy hierarchies.
[0057] Möbius addition is a generalized vector addition operation in the Poincaré sphere of hyperbolic space, extending vector addition in Euclidean space to hyperbolic manifolds with constant negative curvature. Its geometric meaning is: given two points x and y in hyperbolic space, Möbius addition... Giving the equivalent position of y with x as the "origin" is a fundamental tool for defining hyperbolic translation transformations. The hyperbolic exponential map maps the direction vector in the tangent space to its actual position on the Poincaré sphere, which is used to project the output (tangent vector) of a Euclidean neural network into a valid hyperbolic point; the hyperbolic logarithmic map performs the inverse operation, pulling the hyperbolic point back into the tangent space, so that the hyperbolic point can participate in linear calculations (such as loss function calculation).
[0058] In practical applications, the formula for calculating Möbius addition (vector addition in hyperbolic space) is as follows:
[0059] In practical applications, the formula for calculating the hyperbolic exponential mapping (tangent vector → hyperbolic point) is as follows:
[0060] In practical applications, the formula for calculating the hyperbolic logarithmic mapping (hyperbolic point → tangent vector) is as follows:
[0061] In one possible implementation, the training process of using the Poincaré sphere model to perform hyperbolic embedding on the behavior transition graph is as follows: The node pairs in the behavior transition graph are used as training samples, wherein the positive sample pairs in the training samples are node pairs in the behavior transition graph that are connected by edges, and the negative sample set in the training samples is obtained by randomly sampling node pairs that are not connected by edges. In the hyperbolic Riemann space represented by the Poincaré sphere model, calculate the hyperbolic geodesic distance between the two nodes in each positive sample pair, and calculate the hyperbolic geodesic distance between the node and the negative sample in the negative sample set; By using the ranking loss, the hyperbolic distance of the positive sample pairs is driven to be less than that of the negative sample pairs, causing adjacent nodes in the behavior transformation graph to cluster in the hyperbolic space and irrelevant nodes to separate from each other. The ranking loss is minimized using the Riemann stochastic gradient descent algorithm to update the hyperbolic embedding vectors of all nodes.
[0062] In practical applications, the training process of hyperbolic embedding is as follows: Node pairs (u, v) in the behavior transition graph G are used as training samples. Positive sample pairs are node pairs connected by edges in the graph, while negative sample pairs are obtained by randomly sampling node pairs without edges. For each positive sample pair, its hyperbolic geodesic distance in the Poincaré sphere is calculated; for each set of negative samples, the corresponding negative sample distance is calculated. The Poincaré embedding loss, through a softmax-based ranking loss, drives the hyperbolic distance of positive sample pairs to be less than that of negative sample pairs, causing adjacent nodes (state-action pairs with transition relationships) to cluster in the hyperbolic space, while irrelevant nodes are separated. That is, in the embedding space, the distance between any node u and its positive sample neighbor v is less than the distance between u and all its negative samples v'.
[0063] In practical applications, gradient updates employ Riemannian Stochastic Gradient Descent (RSGD): first, the Euclidean gradient is calculated, multiplied by a Riemannian metric scaling factor to convert it to a Riemannian gradient, then the embedding is updated along the negative gradient direction, and projection is used to ensure that the updated point remains within the Poincaré sphere (i.e., satisfies...). ).
[0064] Using the Poincaré embedding loss, connected nodes are brought closer together in hyperbolic space:
[0065] Gradient updates employ Riemann stochastic gradient descent (RSGD):
[0066] The hyperbolic embedding vectors described above are the "coordinate addresses" of each node (state or action) in the behavior transition graph within the hyperbolic Riemannian space (Poincaré sphere). The training process described above (through optimization of the loss function) ensures that if two nodes in the graph are connected by an edge ((u, v) ∈ E), then the hyperbolic distance between their embedding vectors h_u and h_v will be relatively small. Conversely, unconnected nodes will have a larger distance. Therefore, the connectivity information of the graph is encoded into the relative positional relationships of the vectors.
[0067] In one possible implementation, the geometric alignment mapping includes: a first alignment parameter matrix and a second alignment parameter matrix, wherein the first alignment parameter matrix is used to project the representation from the symmetric positive definite matrix manifold to the common metric space, and the second alignment parameter matrix is used to project the representation from the hyperbolic Riemann space to the common metric space; The step of learning the geometric alignment mapping from the symmetric positive definite matrix manifold and the hyperbolic Riemannian space to the common metric space by optimizing the objective loss function includes: Obtain a training sample set, wherein the samples in the training sample set include paired representations located in a symmetric positive definite matrix manifold and a hyperbolic Riemann space, respectively; Construct a target loss function, wherein the target loss function is used to jointly optimize the first alignment parameter matrix and the second alignment parameter matrix, the parameter matrices of the first alignment parameter matrix and the second alignment parameter matrix are constrained on the Stiefel manifold to ensure that the mapping is orthogonal; Using the training sample set, the target loss function is optimized to learn the first alignment parameter matrix and the second alignment parameter matrix, so that the common metric space can simultaneously maintain the geometric structure of the symmetric positive definite matrix manifold and the geometric structure of the hyperbolic Riemann space.
[0068] In practical applications, the core process of Riemannian manifold alignment is as follows: Tangent Space Expansion: Since the SPD manifold and the hyperbolic manifold are different types of Riemannian manifolds, linear operations cannot be directly performed between the manifolds. Therefore, we first select the base point of each manifold (S_base of the SPD manifold, origin o of the hyperbolic manifold), and use the logarithmic map to expand the points on each manifold into tangent vectors in the tangent space of the base point, thus achieving local linearization.
[0069] Common space projection: Vectors in the two tangent spaces are projected onto a common metric space of the same dimension D through learnable linear layers (first alignment parameter matrix W_L and second alignment parameter matrix W_G), allowing direct comparison of the representations of the two manifolds. The parameter matrices are constrained on the Stiefel manifold to ensure orthogonality of the mapping and prevent dimensionality collapse.
[0070] Geometric Alignment Training: The alignment loss consists of three parts: the cross-manifold alignment term drives the minimization of the distance between corresponding sample pairs (state and its triggering action) in the common metric space; the SPD isometric constraint and the hyperbolic isometric constraint ensure that the distance in the common metric space approximates the geodesic distance of each manifold, preventing the alignment mapping from destroying the geometry inside the manifold.
[0071] In this way, a geometrically consistent public representation space can be established, in which the semantic attention features of LLM and the hierarchical behavioral features of the decision graph are aligned under strict Riemannian geometric constraints, providing a mathematically guaranteed public metric space for subsequent action retrieval.
[0072] Expanding the tangent space using the fundamental points of each manifold yields comparable vector representations:
[0073]
[0074] Then, it is mapped to a common dimension D through a learnable linear layer (the parameter matrix is constrained on the Stiefel manifold):
[0075]
[0076] In practical applications, the total alignment loss consists of three parts, which respectively achieve cross-manifold alignment and preservation of their respective structures:
[0077] Cross-manifold alignment term (corresponding to positive samples in point pair C):
[0078] SPD manifold structure preservation term (equidistant constraint, making common spatial distances approximate geodesic distances):
[0079] Hyperbolic manifold structure preservation term (preserving the hierarchical topology of the graph):
[0080] In practical applications, the first alignment parameter matrix W_L and the second alignment parameter matrix W_G are constrained to the Stiefel manifold:
[0081] Riemann gradient (projecting the Euclidean gradient onto the tangent space):
[0082] in, Parameter updates are maintained on the manifold through QR decomposition and shrinkback.
[0083] The formula for the total training loss is as follows:
[0084] The contrast loss is defined as follows:
[0085] In one possible implementation, during the inference phase, after mapping the attention matrix representation to a common metric space via logarithmic mapping and linear projection, the optimal action can be retrieved based on geodesic distance.
[0086] In practical applications, the specific reasoning process is as follows: For the current environment state s, it is converted into a text description by a state encoder, input into the pre-trained LLM fine-tuned by LoRA, and the attention matrices of each layer are extracted. After symmetrization and regularization, it is mapped to an SPD matrix. Then, the entropy-weighted Fréchet mean is calculated using Karcher flow to obtain the comprehensive SPD representation of the current state, which is the attention representation S_LLM.
[0087] Then, a logarithmic mapping (to the tangent space of the base point S_base) is performed on S_LLM. After vectorization, the vectorized vector is linearly projected onto the first alignment parameter matrix W_L to obtain the query vector z in the common metric space. Similarly, the hyperbolic embedding vectors {h_a} of all candidate action nodes in the action transformation graph are projected onto the common space through a logarithmic mapping and W_G, and the query vector z is calculated in relation to each action representation. The Euclidean distance (a geodesic distance that approximates the original manifold in the common space) is used to retrieve the action a* with the smallest distance as the current decision output. This process geometrically unifies semantic understanding (LLM attention) and behavioral knowledge (graph embedding), giving decision retrieval an explicit Riemannian geometric interpretation: selecting the action with the smallest geodesic distance to the current semantic state, i.e., the geometrically "best match" decision.
[0088]
[0089]
[0090] For precise hyperbolic geodesic distances, you can directly search in hyperbolic space:
[0091] In one possible implementation, after outputting the actions corresponding to the action nodes in the behavior transformation graph whose geometric distance to the query vector is less than a preset threshold as control commands, the method further includes: In response to the detection of a new node in the behavior transition graph, the coordinates of the new node in the hyperbolic Riemann space are initialized by calculating the Fréchet mean of the neighboring node representations of the new node.
[0092] In practical applications, whenever an agent performs an action a* and reaches a new state s next If s next For a new node (appearing for the first time) in the behavior transition graph G, its hyperbolic embedding vector is initialized by calculating the hyperbolic Fréchet mean using the hyperbolic coordinates of its neighboring nodes (i.e., the action nodes that triggered the transition and the state nodes from which the transition originated) in the Poincaré sphere. This method estimates the hierarchical position of the new node using the geometric positions of its neighboring nodes, converges faster than random initialization, and the initial position is geometrically consistent with that of its neighboring nodes. In practical applications, as the system runs, new interactive data accumulates continuously, and the data distribution may shift. Therefore, the base point S of the SPD manifold... base The global Fréchet mean of all accumulated SPD matrices is recalculated periodically (e.g., after every K rounds of interaction) to ensure that the reference point of the tangent space expansion is always located at the "center" of the current data distribution, guaranteeing the local linearization accuracy of the logarithmic mapping. This online update mechanism enables the system to continuously adapt to new environments without requiring a complete retraining, achieving lightweight incremental learning.
[0093] The hyperbolic coordinates of the new node are initialized using the hyperbolic Fréchet mean of the neighboring nodes:
[0094] The SPD manifold base point is periodically updated by recalculating the global Fréchet mean to accommodate data distribution shifts.
[0095] To provide a more detailed explanation of the Riemannian-based agent real-time decision-making method in the embodiments of this application, the following supplementary descriptions are also provided in the embodiments of this application: Training phase description: The data required for training is a historical trajectory dataset collected from the interaction between the agent and the target environment. This includes a sequence of four tuples: state observation, action execution, successor state, and immediate reward. Training is divided into two phases: (1) Pre-training phase, where the hyperbolic embedding parameters of the behavior transition map are trained using trajectory data in D through the Poincaré embedding loss. At the same time, the alignment parameters W_L and W_G on the Stiefel manifold are initialized; (2) In the joint optimization stage, the main parameters of the LLM are frozen, and only a small number of adapter parameters theta are fine-tuned through LoRA (Low-Rank Adaptation). At the same time, the alignment parameters are jointly optimized to minimize the total loss, including task loss (decision accuracy), Riemann alignment loss (geometric consistency), contrast loss and hyperbolic regularization loss. After training, the fine-tuned large model theta*, the optimal alignment parameters W_L* and W_G* and the optimized graph embedding G* are obtained, and the system can enter the inference stage: after each environmental interaction, the optimal action is retrieved and continuous adaptation is achieved by updating the graph embedding online.
[0096] For example, the training data can be a customer service Q&A logic graph of a heating company, with more than 4,000 nodes and more than 50,000 relationships. The large model is the Qwen-2.5 8B model. By training the Qwen large model through Riemannian manifold alignment, an intelligent customer service large model with efficient reasoning and interpretability is obtained.
[0097] Input: Pre-trained large LLM model, environment (Env), historical trajectory (D) Output: Fine-tuned model θ*, alignment parameters W_L*, W_G*, graph G* / / Initialization phase 1. G <- BuildBehaviorGraph(D) 2. {h_v}<- HyperbolicEmbed(G) / / Poincare ball embedding 3. W_L ∈ St(n²,D), W_G ∈ St(d,D) / / Stiefel manifold initialization / / Training phase 4. for epoch = 1 to E do 5. for batch (s, a, s_next, r) in D do 6. {A^(l)}<- LLM.extract_attention(StateEncoder(s)) 7. for l = 1 to L do 8. W^(l)<- Symmetrize(A^(l)) 9. S^(l) <- W^(l) + eps*I / / Map to SPD(n) 10. end for 11. {α_l} <- softmax(-Entropy({A^(l)})) 12. S_LLM <- KarcherFlow({S^(l)}, {α_l}) / / Fréchet mean 13. u <- Log_{S_base}(S_LLM) / / Logarithmic mapping 14. z_LLM <- W_L · vec(u) / / 15. v_a <- log_o(h_a) / / 16. z_G <- W_G · v_a / / 17. L_cross <- ||z_LLM - z_G||² / / 18. L_pres_LLM <- StructPres_SPD(...) / / 19. L_pres_G <- StructPres_Hyp(...) / / 20. L_Riem <- L_cross + α·L_pres_LLM + β·L_pres_G 21. L_total <- L_task + λ1·L_Riem + λ2·L_contrast + λ3·L_hyp 22. grad_L <- RiemannGrad(W_L, L_total) / / 23. grad_G <- RiemannGrad(W_G, L_total) 24. W_L <- QR(W_L - η·grad_L).Q / / 25. W_G <- QR(W_G - η·grad_G).Q 26. θ <- AdamW( _θ L_total) / / LoRA parameter 27. end for 28. end for / / Inference stage 29. while not done do 30. S_LLM <- KarcherFlow({S^(l)}, {α_l}) 31. z<- W_L · vec(Log_{S_base}(S_LLM)) / / 32. a*<- argmin_a ||z - W_G·log_o(h_a)||2 33. s_next, r<- Env.step(Decode(a*)) 34. G, {h}<- RiemannOnlineUpdate(G, {h}, s, a*, s_next) 35. end while In practical applications, the efficient calculation of SPD manifold matrix functions (logS and expS) is crucial to the real-time performance of this system. The specific calculation process is as follows: For the SPD matrix S in SPD(n), first perform eigendecomposition S = Q*Lambda*Q^T, where Q is the orthogonal eigenvector matrix, and Lambda = diag(lambda_1,...,lambda_n) is the diagonal matrix of positive eigenvalues (positive definiteness guarantees lambda_i>0); then take the logarithm (matrix logarithm) or exponent (matrix exponent) of the diagonal elements respectively, and then perform similarity transformation to restore them through Q. The effects of this method are as follows: (1) The computational complexity is O(n^3), and the truncated attention matrix (taking the attention sub-matrix of the first n<= 64 tokens) can be completed in milliseconds, which meets the real-time decision-making requirements; (2) The eigendecomposition also provides matrix positive definiteness verification (all eigenvalues are positive), which is convenient for debugging and monitoring; (3) Batch matrix operations can be accelerated by GPU, which further improves the throughput. The calculation of parallel shifts involves matrix square root operations, which are obtained through Schur decomposition, and the numerical stability is better than that of the direct iteration method.
[0098] Matrix logarithms / exponentials are achieved through eigenvalue decomposition, let... ,but:
[0099]
[0100] The computational complexity is O(n³), and truncated attention (n ≤ 64) can be performed in real time. The square root of the matrix in the parallel shift is obtained through Schur decomposition.
[0101] In practical applications, the Poincaré sphere model requires ||x|| < 1, and gradient clipping is performed during numerical implementation:
[0102] Using the gradient norm as a stopping criterion:
[0103] It typically converges after 10-20 iterations, δ = 10 -6 .
[0104] The above solution will be further explained and illustrated through the following examples. Example 1 is a decision-making process for a certain intelligent customer service system.
[0105] State: Dialogue history (sequence length n = 128), Action space: 12 types of policies (3-level hierarchical structure); Hyperbolic embedding dimension: d = 4; Interpretability: The distance from a node to the origin reflects the depth of the strategy hierarchy; the affine invariance of the SPD metric guarantees generalization across language styles.
[0106] The complete implementation process is as follows: (1) Task setting: The system needs to select the optimal response action from service strategies such as account opening and heating failure based on the user's dialogue history. The strategy presents a 3-level hierarchical structure (Level 1: Problem category judgment; Level 2: Handling direction; Level 3: Specific wording selection). (2) Data preparation: Customer service problem solving network of more than 4,000 nodes of a heating company. (3) Hyperbolic embedding effect verification: After training, the hyperbolic embedding vector of the strategy node is visualized on a 2D Poincaré disk. (4) Interpretability analysis: For any user input, the decision confidence ranking can be output by calculating the geodesic distance between the LLM attention SPD matrix and each policy node. Customer service agents can intuitively see "which policy best matches the current dialogue and how big the distance difference is", thus understanding the decision basis of AI recommendation. The affine invariance of the SPD metric ensures that when the same user makes the same request in Chinese, English and dialect texts, the geodesic distance between the attention SPD matrices remains consistent. The cross-language style generalization ability is significantly better than the Euclidean baseline (the policy matching accuracy is improved from 71.8% to 83.4%). (5) Online update effect: After the system is deployed, when a new service scenario is encountered (such as the addition of the "Return and Exchange Policy 2.0" policy), the incremental update can be completed by adding new policy nodes online. Only 100 dialogue samples containing the new policy are needed, without full retraining. The new policy response accuracy reaches more than 90%.
[0107] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide a real-time decision-making system for intelligent agents, the structure of which is as follows: Figure 2 As shown.
[0108] Figure 2This is a schematic diagram of the internal structure of a real-time decision-making system for intelligent agents based on Riemannian manifolds, provided as an embodiment of this application. Figure 2 As shown, the system includes: At least one processor 201; And a memory 202 that is communicatively connected to at least one processor; The memory 202 stores instructions that can be executed by at least one processor. The instructions are executed by at least one processor 201 so that at least one processor 201 can: execute the above-described real-time decision-making method for intelligent agents based on Riemannian manifolds.
[0109] In one possible implementation, the processor is capable of: constructing a behavior transition graph based on a historical trajectory dataset of agent-environment interactions; mapping the attention matrix generated by the large language model corresponding to the agent in the decision-making task to a symmetric positive definite matrix manifold for representation; embedding the behavior transition graph into a hyperbolic Riemannian space for representation; learning a geometric alignment mapping from the symmetric positive definite matrix manifold and the hyperbolic Riemannian space to a common metric space by optimizing a target loss function, wherein the target function includes the isometric constraint, which is used to keep the distance in the common metric space close to the geodesic distance on the symmetric positive definite matrix manifold and the hyperbolic Riemannian space; during the inference phase, inputting the current state into the large language model to obtain the attention representation corresponding to the current state, and mapping the attention representation to the common metric space based on the geometric alignment mapping to obtain a query vector; calculating the geometric distance between the query vector and the corresponding representation of each action node in the behavior transition graph in the common metric space; and taking the action node whose geometric distance to the query vector is lower than a preset threshold as the current decision output.
[0110] Some embodiments of this application provide corresponding to Figure 1 A non-volatile computer storage medium stores computer-executable instructions, which are configured to execute the aforementioned real-time decision-making method for intelligent agents based on Riemannian manifolds.
[0111] In one possible implementation, the computer-executable instructions are configured to execute: the data acquisition module acquires a historical trajectory dataset generated by the interaction between the agent and the environment, the historical trajectory dataset including environmental observation data collected by environmental observation equipment, action signals output by the agent to the actuator, subsequent environmental observation data collected by the environmental observation equipment after the actuator's action, and corresponding real-time feedback signals; based on the historical trajectory dataset, a behavior transition graph is constructed, and the behavior transition graph is stored in the storage module of the intelligent decision-making system; The geometric representation module maps the attention matrix generated by the large language model that the large language model reasoning module runs in the decision-making task to a symmetric positive definite matrix manifold for representation. The geometric representation module embeds the behavior transformation graph into hyperbolic Riemann space for representation; By optimizing the objective loss function, a geometric alignment mapping from the symmetric positive definite matrix manifold and the hyperbolic Riemannian space to the common metric space is learned. The objective loss function includes an isometric constraint term, which is used to make the distance in the common metric space similar to the geodesic distance on the symmetric positive definite matrix manifold and the hyperbolic Riemannian space. The parameters of the learned geometric alignment mapping are stored in the storage module. During the inference phase, the data acquisition module acquires the current environmental observation data collected in real time by the environmental observation device. The large language model inference module inputs the current environmental observation data into the large language model to obtain the attention representation corresponding to the current environmental observation data. The geometric representation module maps the attention representation to the common metric space based on the geometric alignment mapping to obtain the query vector. In the public metric space, calculate the geometric distance between the query vector and the corresponding representation of each action node in the behavior transformation graph in the public metric space; The actions corresponding to the action nodes in the behavior transformation graph whose geometric distance to the query vector is less than a preset threshold are output as control commands through the action execution module to the execution mechanism, so as to drive the execution mechanism to perform the action and change the environmental state.
[0112] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for IoT devices and media are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0113] The systems, media, and methods provided in this application are one-to-one correspondences. Therefore, the systems and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be repeated here.
[0114] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0115] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0116] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0117] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0118] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0119] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0120] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0121] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0122] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A real-time decision-making method for intelligent agents based on Riemannian manifolds, characterized in that, The method is executed by an intelligent decision-making system, which includes a data acquisition module, a large language model inference module, a geometric representation module, and an action execution module. The intelligent decision-making system is applied to customer service Q&A scenarios in heating companies. The method includes: The data acquisition module acquires historical trajectory datasets generated by the interaction between the agent and the environment. Based on the historical trajectory datasets, it constructs a behavior transition graph and stores the behavior transition graphs in the storage module of the intelligent decision-making system. The historical trajectory datasets include environmental observation data collected by environmental observation equipment, action signals output by the agent to the actuator, subsequent environmental observation data collected by the environmental observation equipment after the actuator's action, and corresponding real-time feedback signals. The environment consists of user-input text and dialogue history. The geometric representation module maps the attention matrix generated by the large language model that the large language model reasoning module runs in the decision-making task to a symmetric positive definite matrix manifold for representation. The geometric representation module embeds the behavior transformation graph into hyperbolic Riemann space for representation; By optimizing the objective loss function, a geometric alignment mapping from the symmetric positive definite matrix manifold and the hyperbolic Riemannian space to the common metric space is learned. The objective loss function includes an isometric constraint term, which is used to make the distance in the common metric space similar to the geodesic distance on the symmetric positive definite matrix manifold and the hyperbolic Riemannian space. The parameters of the learned geometric alignment mapping are stored in the storage module. During the inference phase, the data acquisition module acquires the current environmental observation data collected in real time by the environmental observation device. The large language model inference module inputs the current environmental observation data into the large language model to obtain the attention representation corresponding to the current environmental observation data. The geometric representation module maps the attention representation to the common metric space based on the geometric alignment mapping to obtain the query vector. In the public metric space, calculate the geometric distance between the query vector and the corresponding representation of each action node in the behavior transformation graph in the public metric space; The actions corresponding to the action nodes in the behavior transformation graph whose geometric distance to the query vector is less than a preset threshold are output as control commands through the action execution module to the execution mechanism, so as to drive the execution mechanism to perform the action and change the environmental state.
2. The method according to claim 1, characterized in that, The step of constructing a behavior transition map based on the historical trajectory dataset includes: The data acquisition module acquires a set of historical decision-making trajectories of the agent's interaction with the environment. Traverse the historical decision trajectory set, and node the states and actions in the historical decision trajectory set to construct a set of state nodes and a set of action nodes; Based on the set of state nodes and the set of action nodes, directed edges are established according to a preset interaction order to construct a behavior transition graph. The edge weights of the behavior transition graph are obtained by normalizing the frequency of the corresponding transition events in the historical decision trajectory set. The node feature matrix of the behavior transition graph is composed of the semantic embedding vector corresponding to each node.
3. The method according to claim 1, characterized in that, The step of mapping the attention matrix generated by the large language model in the decision-making task to a symmetric positive definite matrix manifold for representation includes: Obtain the attention matrix generated by the large language model in the decision-making task; The attention matrix is symmetricized and regularized to map it onto a symmetric positive definite matrix manifold.
4. The method according to claim 3, characterized in that, After characterization by mapping to a symmetric positive definite matrix manifold, the method further includes: On the symmetric positive definite matrix manifold, the manifold representations of the attention matrices of multiple layers are aggregated by computing the Fréchet mean weighted by attention entropy to form a unified semantic geometric representation.
5. The method according to claim 1, characterized in that, The step of embedding the behavior transformation graph into a hyperbolic Riemannian space for representation includes: The behavior transition graph is hyperbolic embedded using a Poincaré sphere model, wherein each action node in the behavior transition graph is mapped to a point inside the Poincaré sphere model, and the hyperbolic geodesic distance between connected action nodes in the behavior transition graph in hyperbolic space is less than that between unconnected nodes.
6. The method according to claim 5, characterized in that, The training process of hyperbolic embedding of the behavior transition graph using the Poincaré sphere model is as follows: The node pairs in the behavior transition graph are used as training samples, wherein the positive sample pairs in the training samples are node pairs in the behavior transition graph that are connected by edges, and the negative sample set in the training samples is obtained by randomly sampling node pairs that are not connected by edges. In the hyperbolic Riemann space represented by the Poincaré sphere model, calculate the hyperbolic geodesic distance between the two nodes in each positive sample pair, and calculate the hyperbolic geodesic distance between the node and the negative sample in the negative sample set; By using the ranking loss, the hyperbolic distance of the positive sample pairs is driven to be less than that of the negative sample pairs, causing adjacent nodes in the behavior transformation graph to cluster in the hyperbolic space and irrelevant nodes to separate from each other. The sorting loss is minimized using the Riemann stochastic gradient descent algorithm to update the hyperbolic embedding vectors of all nodes.
7. The method according to claim 1, characterized in that, The geometric alignment mapping includes a first alignment parameter matrix and a second alignment parameter matrix, wherein the first alignment parameter matrix is used to project the representation from the symmetric positive definite matrix manifold to the common metric space, and the second alignment parameter matrix is used to project the representation from the hyperbolic Riemann space to the common metric space. The step of learning the geometric alignment mapping from the symmetric positive definite matrix manifold and the hyperbolic Riemannian space to the common metric space by optimizing the objective loss function includes: Obtain a training sample set, wherein the samples in the training sample set include paired representations located in a symmetric positive definite matrix manifold and a hyperbolic Riemann space, respectively; Construct a target loss function, wherein the target loss function is used to jointly optimize the first alignment parameter matrix and the second alignment parameter matrix, the parameter matrices of the first alignment parameter matrix and the second alignment parameter matrix are constrained on the Stiefel manifold to ensure that the mapping is orthogonal; Using the training sample set, the target loss function is optimized to learn the first alignment parameter matrix and the second alignment parameter matrix, so that the common metric space can simultaneously maintain the geometric structure of the symmetric positive definite matrix manifold and the geometric structure of the hyperbolic Riemann space.
8. The method according to claim 4, characterized in that, After outputting the actions corresponding to the action nodes in the behavior transformation graph whose geometric distance to the query vector is less than a preset threshold as control commands, the method further includes: In response to the detection of a new node in the behavior transition graph, the coordinates of the new node in the hyperbolic Riemann space are initialized by calculating the Fréchet mean of the neighboring node representations of the new node.
9. A real-time decision-making system for intelligent agents based on Riemannian manifolds, characterized in that, The system includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a real-time decision-making method for an intelligent agent as described in any one of claims 1-8.
10. A computer storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, they implement a real-time decision-making method for intelligent agents based on Riemannian manifolds as described in any one of claims 1-8.
Citation Information
Patent Citations
Construction scene dynamic obstacle avoidance method and system based on multi-source image fusion
CN121527709A
Large model navigation method guided by historical topological graph based on manifold perception
CN121540154A