Elio Saade
Note

Approximate Equivariance in Reinforcement Learning

Overview

Exactly equivariant agents assume that transforming a state and action by a symmetry leaves the reward and transition dynamics unchanged. This assumption can improve sample efficiency because the agent shares what it learns between symmetric situations. However, exact equivariance can be too restrictive especially in real-world scenarios when the environment contains symmetry-breaking factors, such as asymmetric gravity, differences in actuator response, etc...
The paper proposes using approximate equivariance as a middle ground between exactly equivariant and unconstrained RL agents. The network retains a strong symmetry bias but can learn deviations from it when the data indicates that transformed situations are not identical.

Approximate Equivariance in MDPs

For a group GG acting on the input space X\mathcal{X} and output space Y\mathcal{Y}, the equivariance error of a function f:X→Yf:\mathcal{X}\rightarrow\mathcal{Y} for a transformation g∈Gg\in G and input x∈Xx\in\mathcal{X} is

ee(f,g,x)=∥f(g(x))−g(f(x))∥.ee(f,g,x)=\left\lVert f(g(x))-g (f(x))\right\rVert.

This measures the difference between transforming the input before applying ff and applying ff before transforming its output. An exactly equivariant function has zero equivariance error for every input and every group transformation.

The ε\varepsilon-stabilizer contains the transformations whose equivariance error is bounded by ε\varepsilon for all inputs:

Stab⁡ε(f,G)={g∈G∣ee(f,g,x)≤ε, ∀x∈X}.\operatorname{Stab}_{\varepsilon}(f,G) =\left\{g\in G\mid ee(f,g,x)\leq\varepsilon,\ \forall x\in\mathcal{X}\right\}.

The function is approximately GG-equivariant when

Stab⁡ε(f,G)=G.\operatorname{Stab}_{\varepsilon}(f,G)=G.

Therefore, every transformation in the group must satisfy the equivariance relation up to a bounded error. This differs from partial equivariance, where only a subset of the group satisfies the bound.

The paper extends this definition to an infinite-horizon discounted MDP M=(S,A,P,R,γ)\mathcal{M}=(\mathcal{S},\mathcal{A},P,R,\gamma). A group GG acts on both states and actions, mapping (s,a)(s,a) to (gs,ga)(gs,ga). The MDP is (G,ϵR,ϵP)(G,\epsilon_R,\epsilon_P)-invariant if its reward and transition functions satisfy

∣R(gs,ga)−R(s,a)∣≤ϵR\left|R(gs,ga)-R(s,a)\right|\leq\epsilon_R

and

dF(P(gs′∣gs,ga),P(s′∣s,a))≤ϵPd_{\mathscr{F}}\left(P(gs'\mid gs,ga),P(s'\mid s,a)\right)\leq\epsilon_P

for every g∈Gg\in G. The first condition says that symmetric state-action pairs have approximately equal rewards. The second says that their next-state distributions are approximately transformed versions of one another. The distance dFd_{\mathscr{F}} is an integral probability metric; i.e. a measure of distance between probability distributions.

The main theoretical result shows that approximate symmetry of the MDP produces approximate invariance of its optimal value functions. If rewards are bounded and 0≤γ<10\leq\gamma<1, then

∣Q∗(s,a)−Q∗(gs,ga)∣≤α\left|Q^*(s,a)-Q^*(gs,ga)\right|\leq\alpha

and

∣V∗(s)−V∗(gs)∣≤α,\left|V^*(s)-V^*(gs)\right|\leq\alpha,

where

α=ϵR+γρF(V∗)ϵP1−γ.\alpha=\frac{\epsilon_R+\gamma\rho_{\mathscr{F}}(V^*)\epsilon_P}{1-\gamma}.

Approximately Equivariant Actor-Critic

The main change from exactly equivariant RL is to replace the exactly equivariant group or steerable convolution layers in the encoder, actor, and critic with relaxed group convolutions.
An exact group convolution is defined as

(f⋆ψ)(g)=∑h∈Gψ(g−1h)f(h).(f\star\psi)(g)=\sum_{h\in G}\psi(g^{-1}h)f(h).

Because the kernel depends only on the relative group element g−1hg^{-1}h, the same weights are shared across symmetry-related inputs, which enforces exact equivariance. A relaxed group convolution instead uses LL exactly equivariant kernels and transformation-dependent relaxed weights:

(f⋆~ψ)(g)=∑h∈Gf(h)∑l=1Lwl(h)ψl(g−1h).(f\widetilde{\star}\psi)(g) =\sum_{h\in G}f(h)\sum_{l=1}^{L}w^l(h)\psi^l(g^{-1}h).

Each kernel ψl\psi^l retains the equivariant structure, while the weights wl(h)w^l(h) are allowed to depend on the specific group element hh. This breaks strict weight sharing and allows the layer to learn different responses for symmetry-related inputs. If the relaxed weights remain equal across group elements, the layer behaves like an exactly equivariant layer; differences between them represent learned symmetry breaking.

The agent is organized as follows:

  • the encoder EE is approximately equivariant and maps the observation to a latent state zz
  • the latent state transforms according to copies of the regular representation of GG, which permutes its group-indexed channels when the input is transformed
  • the policy π\pi is approximately equivariant, so transforming the state approximately produces the corresponding transformed action
  • the action transformation is specified separately for each environment because different action components can respond differently to rotations or reflections
  • the critic is approximately invariant and produces a scalar Q(s,a)Q(s,a) that should remain approximately unchanged when both the state and action are transformed

Approximate_Equivariance_Network.png

Connections

Direct relationships to this note.