3U CubeSat · attitude on SO(3)
BlueROV2 · pose on SE(3)

Under review

From where does a trained RL controller still reach its goal?

Learning Maximal Lyapunov Functions for Deep Reinforcement Learning-based Controllers on Matrix Lie Groups

Hamza Tariq1Matthieu Barreau2Adeel Akhtar1

1New Jersey Institute of Technology, Newark, NJ, USA  ·  2Digital Futures and KTH Royal Institute of Technology, Stockholm, Sweden

Paper Code

In short. We train deep RL controllers that steer a rotation or a rigid-body pose to any goal by working directly on the geometry of the group, so one trained policy serves every goal. For such a controller we then learn the cost it accumulates on its way to the goal and read off a set of starting states from which it reaches the goal. When an actuator turns out to be weaker, stronger or misaligned, we recompute that set for the same controller in hours, without retraining it.

The problem

Learned controllers work. Nobody can say from where.

◎

No region of attraction

Training an RL policy maximises a return. It does not tell you which initial states the closed loop actually brings to the goal.

⟲

Hardware drifts

A reaction wheel is mounted a few degrees off, a thruster delivers 25 percent less than commanded. The same policy now runs a different closed loop.

≈

Simulation only samples

Rolling the policy out shows convergence at the states you tried. A region checked before the fault can still look fine on samples while its Lyapunov conditions fail.

Part one · the controller

Deep RL that steers on the group itself.

Orientations and poses do not live in a vector space: they form matrix Lie groups such as SO(3) and SE(3). Treating them as vectors brings singularities and double covers, and a policy that takes the state and the goal separately must learn every goal anew.

  • Observe the error, not the state. The policy sees only the error between the current element and the goal.
  • Act in the tangent space. It commands a bounded body velocity , applied through the exponential map, , so every step stays on the group.
  • One closed loop for every goal. By left invariance the error evolves the same way whatever the goal, so the policy is trained once and one region of attraction serves all goals.
  • Any matrix Lie group, any algorithm. The same formulation is trained with PPO, TRPO, SAC and TD3 on SO(2), SO(3), SE(2) and SE(3).
world frame · four goals
error frame · one trajectory
Four planar rigid bodies on SE(2), each with its own goal but the same error. In the world they take four different paths; in error coordinates the paths coincide. Illustration with a simple geometric policy, not a trained network.

Build intuition

Bend the actuator. Watch the region of attraction move.

A two-dimensional toy closed loop with a saturated controller. The colour is the cost the controller accumulates before it reaches the goal: finite exactly on the region of attraction, infinite outside. That accumulated cost is a maximal Lyapunov function. Change the actuator and compare the region you certified before (dashed) with the one that holds now. Click anywhere to launch a trajectory.

accumulated cost (log scale) region now region before the fault old region, now fails to converge
–area of the region now
–of the old region now fails to converge

Illustration only: a planar system chosen for clarity, not one of the systems in the paper.

Part two · the region

Let the policy's own cost be the certificate.

1

Start from the error loop

Part one gives a single closed loop on the error. Subtracting the network output at the goal makes the goal a fixed point, and a test on the linearisation keeps the loops where it is locally exponentially stable.

2

Learn the accumulated cost from single steps

The undiscounted sum of squared distances to the goal is a maximal Lyapunov function. It obeys a one-step equation, so a network learns it from single transitions: no long rollouts, no partial differential equation. Near the goal, the exact quadratic term from the linearisation takes over.

3

Recompute after a fault, keep the policy

When a gain error or misalignment is identified, the closed loop changes but the policy does not. The function and its level are recomputed for the new loop within hours, and tell you whether the deployed controller still covers the states you care about.

What is guaranteed. Conditions under which a sublevel set lies inside the region of attraction are proved for every matrix Lie group. On SO(2) the reported regions are verified by interval arithmetic; on SO(3), SE(2) and SE(3) they are checked on samples and by an adversarial search.

Results

Larger regions, on every closed loop with an actuator error.

0trained policies, 4 RL algorithms, 4 Lie groups
0of 55 faulty closed loops: larger than both quadratic baselines
0of 55: larger than a neural Lyapunov baseline
0percent of the reference region recovered (median)

Explore all 55 closed loops with an actuator error

Each column is one trained policy with one actuator error. Height: the region's share of the reference region computed from the accumulated cost by simulation.

From kinematics to vehicles

Two vehicles, one question: does anything leave the region?

The regions assume each commanded step is carried out exactly. So we run the trained policies on simulated vehicles in MuJoCo, through low-level controllers that track each step, from initial errors drawn inside the estimated regions.

3U CubeSat, attitude on SO(3)

  • 0 / 200 episodes leave the region
  • also with initial body rates and a halved period

BlueROV2, pose on SE(3)

  • 0 / 200 episodes leave the region
  • 28 actuator-error loops: none leaves the recomputed region; one leaves the old region at 40°

Why it matters

A region of attraction that follows the hardware.

Space

A calibration pass shows a reaction wheel tilted by a few degrees. Recompute the attitude envelope of the learned controller on the ground and decide whether to upload a new policy.

Subsea

A thruster loses effectiveness. Know from which poses the vehicle still docks, before sending it back down.

Research

A maximal Lyapunov function learned from one-step data, on any matrix Lie group, for a policy trained by any RL algorithm.

Reproduce

Every table and figure from one script.

git clone https://github.com/gradslab/maxlyap_lie_rl.git && cd maxlyap_lie_rl
bash reproduce.sh setup      # two virtual environments
bash reproduce.sh tables     # every table, figure and number of the paper, checked against the paper
bash reproduce.sh all        # everything from scratch: policies, functions, searches, vehicles

Cite

@unpublished{tariq2026maximal,
  title  = {Learning Maximal {L}yapunov Functions for Deep Reinforcement
            Learning-based Controllers on Matrix {L}ie Groups},
  author = {Hamza Tariq and Matthieu Barreau and Adeel Akhtar},
  note   = {Under review},
  year   = {2026}
}