---
title: Support-Preserving Action Rectification (SPAR)
url: https://www.emergentmind.com/topics/support-preserving-action-rectification-spar
type: topic
---

# Support-Preserving Action Rectification (SPAR)

Support-Preserving Action Rectification (SPAR) is an offline reinforcement learning framework that formulates policy improvement as **local residual rectification** around a frozen pure behavior cloning policy, rather than as unconstrained global optimization. In the SPAR formulation, a behavior-cloned anchor provides the global approximation to the dataset action manifold, while a residual policy learns only local corrections; improvement is then driven by conservative value estimates and, in the generative variant, by latent-sampling weighted regression rather than direct value-gradient ascent. The central objective is to improve return without driving the policy off the dataset support, where critic extrapolation becomes unreliable [2605.27877].

## 1. Problem setting and motivation

SPAR is defined in the standard offline RL setting over a discounted MDP
\[
\mathcal{M} = (\mathcal{S}, \mathcal{A}, P, r, \gamma),
\]
with a fixed dataset
\[
D = \{(s, a, r, s', d)\}_{i=1}^N
\]
collected by an unknown behavior policy \(\beta(a \mid s)\). No further interaction with the environment is allowed. The target is to learn a policy \(\pi(a \mid s)\) with higher return than the behavior policy while avoiding departures from the dataset support that would render value estimates unreliable [2605.27877].

For a fixed state \(s\), the support of the dataset is
\[
\operatorname{supp}(\beta(\cdot \mid s)) = \{a : \beta(a \mid s) > 0\}.
\]
The paper uses the broader term **data manifold** for the covered state-action region and its local neighborhoods where the critic is reasonably trained. In offline RL, this geometric constraint is fundamental because Q-values outside support are extrapolations; a policy that moves substantially off-manifold can exploit critic error and fail at deployment.

The method is motivated by a tension between two standard offline policy-improvement paradigms. In-support weighted regression methods such as AWR, AWAC, IQL, IDQL, and diffusion/flow-based in-sample methods are stable because they remain near the data support, but they exhibit a **maximum-likelihood bias**: high-density behavior actions dominate, while rare high-value tail actions can be underweighted or ignored. Gradient-based policy-improvement methods such as the CQL actor, TD3+BC actor, PLAS, Diffusion-QL, and flow actor-critic directly maximize a learned critic, but in the offline regime their gradients often have a large component normal to the data manifold, pushing the actor toward OOD regions and inducing instability. SPAR is introduced to resolve this **fitting–improvement conflict** by constraining improvement to a local residual space.

A common misconception is that support preservation is equivalent to pure imitation. SPAR explicitly rejects that equivalence: the critique of in-sample weighted regression is precisely that it can become overly conservative and suppress high-value actions in the distribution tail. Support preservation, in the SPAR sense, is therefore not global policy stasis; it is controlled local improvement within a support-aware neighborhood.

## 2. Anchored residual formulation

The SPAR policy is constructed around a frozen behavior-cloning anchor. First, a **pure BC policy** \(\pi_{\text{base}}\) is trained on the dataset and then frozen. A residual policy outputs a local correction \(\Delta a\), and the final action is
\[
a_{\text{SPAR}}(s) = a_{\text{base}}(s) + G\big(\Delta a_{\theta}(s, a_{\text{base}}(s))\big),
\]
where \(a_{\text{base}}(s) = \pi_{\text{base}}(s)\) and \(G(\cdot)\) is an inference-time gate that may zero out the residual if critic-based improvement is not sufficiently reliable [2605.27877].

Locality is defined explicitly in action space around \(a_{\text{base}}(s)\). Let the empirical \((1-p)\)-quantile of residual magnitudes be
\[
\hat\delta_p \triangleq \inf\{\delta > 0 : \Pr_{(s,a)\sim D}(\|a - a_{\text{base}}(s)\|_2 \le \delta) \ge 1-p\}.
\]
SPAR then restricts the residual search region to
\[
\mathcal{A}_{\text{res}} = \{ \Delta a \in \mathbb{R}^d : \|\Delta a\|_2 \le \hat\delta_p \},
\]
with effective diameter \(D_{\text{res}} = 2\hat\delta_p\). This contracts the search space from the full action space \(\mathcal{A}\) to a local neighborhood around the BC anchor.

Stage I establishes the anchor and the conservative value model. The base policy is trained with pure MSE,
\[
L_{\text{BC}} = \mathbb{E}_{(s,a)\sim D}\left[\|\pi_{\text{base}}(s) - a\|^2\right].
\]
An ensemble of critics and a value network is trained using in-sample expectile regression in the IQL style, with expectile \(\tau = 0.5\) generally and \(\tau = 0.9\) for sparse AntMaze. From the critic ensemble, SPAR constructs a lower-confidence-bound critic,
\[
Q_{\text{rob}}(s, a) = \mu_Q(s,a) - \lambda_u \sigma_Q(s,a),
\]
where \(\mu_Q\) and \(\sigma_Q\) are the ensemble mean and standard deviation and \(\lambda_u\) is an uncertainty penalty. Both \(\pi_{\text{base}}\) and \(Q_{\text{rob}}\) are then frozen.

SPAR has two residual parameterizations. **SPAR-MLP** uses a deterministic residual regressor and is intended for unimodal residual geometry. **SPAR-PROJ** uses a CVAE residual model and is intended for multimodal or geometrically complex residuals. The paper’s implementation guidance states that SPAR-PROJ is a robust default when in doubt, whereas SPAR-MLP is a lightweight specialization when residuals are clearly unimodal.

The inference-time gate is part of the support-preserving design. For a state \(s\), SPAR computes the base action and its conservative value \(Q_{\text{base}} = Q_{\text{rob}}(s,a_{\text{base}})\), generates candidate residual actions, and computes for each candidate \(a_k\) the absolute and relative improvement,
\[
\Delta Q_k = Q_{\text{rob}}(s,a_k) - Q_{\text{base}}, \qquad
R_k = \frac{\Delta Q_k}{|Q_{\text{base}}|+\epsilon}.
\]
The best candidate is accepted only if
\[
\Delta Q_{k^\star} > \eta_{\text{abs}}
\quad\text{and}\quad
R_{k^\star} > \eta_{\text{rel}},
\]
with default thresholds \(\eta_{\text{abs}} = 10^{-4}\) and \(\eta_{\text{rel}} = 0.01\). Otherwise the policy falls back to \(a_{\text{base}}\). This makes the final rectification conditional rather than unconditional.

## 3. Residual objectives and Latent Self-Imitation

Residual learning in Stage II combines a fitting term and an improvement term:
\[
L_{\text{total}}(\theta) = L_{\text{fit}}(\theta) + \lambda_g L_{\text{guide}}(\theta).
\]
Both are weighted by a normalized advantage computed relative to the base policy,
\[
A(s,a) = \frac{Q_{\text{rob}}(s,a) - Q_{\text{rob}}(s,a_{\text{base}})}{\sigma_Q(s)}.
\]
The base magnitude is either exponential,
\[
w_{\text{base}} = \exp(A/T),
\]
or uniform \(w_{\text{base}} = 1\). Hard filtering uses
\[
w_{\text{hard}} = w_{\text{base}} \cdot \mathbf{1}\{A>0\},
\]
whereas soft filtering uses \(w_{\text{soft}} = w_{\text{base}}\) [2605.27877].

For **SPAR-MLP**, the residual is a deterministic network
\[
\Delta a_\theta = T_{\text{res}}(s, a_{\text{base}}) \in \mathbb{R}^d.
\]
The fitting loss is
\[
L_{\text{fit}} =
\mathbb{E}_{(s,a)\sim D}
\left[
w(s,a)\,
\big\|
T_{\text{res}}(s, a_{\text{base}})
-
(a-a_{\text{base}})
\big\|^2
\right].
\]
The synthesized action is
\[
a_{\text{synth}} = a_{\text{base}} + T_{\text{res}}(s,a_{\text{base}}),
\]
and the improvement loss is
\[
L_{\text{guide}} =
-
\mathbb{E}_{s\sim D}\left[Q_{\text{rob}}(s,a_{\text{synth}})\right].
\]
This remains a local value-guided update because the actor is optimized only in residual space.

For **SPAR-PROJ**, the residual is generated by a CVAE with encoder \(q_\omega(z \mid s,\Delta a)\) and decoder \(T_{\text{res}}(s,a_{\text{base}},z)\). The fitting objective is a weighted ELBO,
\[
\begin{aligned}
L_{\text{fit}}^{\text{CVAE}}
&=
\mathbb{E}_{(s,a)\sim D,\, z\sim q_\omega(\cdot\mid s,\Delta a)}
\Big[
w(s,a)\,
\big\|T_{\text{res}}(s, a_{\text{base}}, z) - (a-a_{\text{base}})\big\|^2
\Big] \\
&\quad + \beta \cdot \mathrm{KL}\big(q_\omega(z\mid s,\Delta a)\,\|\,p(z)\big).
\end{aligned}
\]
The KL term is left unweighted to avoid over-regularizing high-advantage samples.

The central innovation in SPAR-PROJ is **Latent Self-Imitation (LSI)**. Instead of backpropagating \(\nabla_a Q_{\text{rob}}\) through the residual generator, LSI samples candidate latent codes \(z_k \sim p(z)\), decodes residuals with a target decoder \(T'_{\text{res}}\),
\[
\Delta a_k = T'_{\text{res}}(s, a_{\text{base}}, z_k),
\qquad
a_k = a_{\text{base}} + \Delta a_k,
\]
computes normalized advantages
\[
A_k =
\frac{Q_{\text{rob}}(s,a_k) - Q_{\text{rob}}(s,a_{\text{base}})}{\sigma_Q(s)},
\]
and uses soft exponential weights
\[
w_k = \frac{\exp(A_k/T)}{\sum_{j=1}^K \exp(A_j/T)}.
\]
The guidance loss is then a stop-gradient weighted regression,
\[
L_{\text{guide}}(\theta)
=
\mathbb{E}_{s\sim D}
\Bigg[
\sum_{k=1}^K
w_k\,
\big\|
T_{\text{res}}(s, a_{\text{base}}, z_k;\theta) - \Delta a_k
\big\|^2
\Bigg].
\]

The significance of LSI is geometric. The critic supplies **Q-values but not Q-gradients** to the generator. Improvement is implemented by regressing toward value-weighted samples already lying on the learned residual manifold. This is the mechanism by which SPAR-PROJ is designed to remove the fitting-improvement gradient conflict that arises when direct value gradients distort the representation used for support-preserving fitting.

## 4. Theoretical properties

The theoretical analysis in SPAR addresses two distinct issues: statistical search-space contraction and geometric drift suppression [2605.27877].

The contraction claim begins from the observation that residualization reduces the actor’s optimization domain from the full action set \(\mathcal{A}\) to the residual ball \(\mathcal{A}_{\text{res}}\). Under the assumptions that \(Q(s,\cdot)\) is \(L\)-Lipschitz in action and value estimates are \(\sigma\)-sub-Gaussian, the paper gives the informal bound
\[
N(\epsilon, \mathcal{A})
=
\tilde{O}\Big(
\frac{\sigma^2}{\epsilon^2}
\,N\big(\mathcal{A}, \tfrac{\epsilon}{2L}\big)
\,\log D_{\mathcal{A}}
\Big),
\]
where \(N(\mathcal{A},r)\) is the covering number of \(\mathcal{A}\) at scale \(r\). On simple convex domains, \(N(\mathcal{A},r)\approx (1+D_{\mathcal{A}}/r)^d\). Since \(D_{\text{res}} \ll D_{\mathcal{A}}\) empirically, restricting search to \(\mathcal{A}_{\text{res}}\) yields a polynomial-logarithmic reduction in sample complexity for action optimization.

This contraction introduces a localization bias,
\[
\epsilon_{\text{app}}(s;\hat\delta_p)
=
\max_{\|a-a_{\text{base}}\|\le \hat\delta_p} Q(s,a)
-
\max_{a\in\mathcal{A}} Q(s,a),
\]
which the paper decomposes into coverage and localization parts. Under Lipschitz continuity, if
\[
a^\star(s) \in \arg\max_{a\in \operatorname{supp}(\beta(\cdot\mid s))} Q(s,a),
\]
then
\[
\epsilon_{\text{loc}}(s;\hat\delta_p)
\le
L \big[\|a^\star(s) - a_{\text{base}}(s)\|_2^2 - \hat\delta_p\big]_+.
\]
The intended implication is that if high-value in-support actions lie within the residual ball around the BC anchor, the bias is small while the gain in reliability can be substantial.

The second theoretical contribution concerns **manifold-normal drift**. Let \(\mathcal{M}_s\) be a \(C^2\) residual manifold with tangent space \(T_x\mathcal{M}_s\) at \(x\in\mathcal{M}_s\). Any update vector \(v\) decomposes as
\[
v = v_{\parallel} + v_{\perp},
\qquad
v_{\parallel}\in T_x\mathcal{M}_s,\;
v_{\perp}\perp T_x\mathcal{M}_s.
\]
For a gradient step \(x^+ = x + \eta v\), the distance to the manifold obeys
\[
d(x^+, \mathcal{M}_s) = \|v_\perp\|\eta + o(\eta) = \Theta(\eta\|v\|),
\]
so ordinary value-gradient ascent exhibits linear off-manifold drift.

LSI alters this geometry. Given sampled residuals \(\Delta a_k \in \mathcal{M}_s\) and weights \(w_k\) with \(\sum_k w_k = 1\), the minimizer of
\[
L(\Delta a) = \sum_k w_k \|\Delta a - \Delta a_k\|^2
\]
is
\[
\Delta a^\star(s) = \sum_{k=1}^K w_k \Delta a_k.
\]
For the two-point case, if
\[
x_\alpha = (1-\alpha)x + \alpha y,\qquad \alpha\in[0,1],
\]
the maximum distance of the chord to the manifold satisfies
\[
\sup_{\alpha\in[0,1]} d(x_\alpha,\mathcal{M}_s)
=
O(\|y-x\|^2).
\]
Accordingly, LSI updates remain within a thin tube around \(\mathcal{M}_s\) with quadratic deviation in chord length, whereas direct gradient ascent has first-order drift. This is the paper’s principal geometric justification for replacing critic backpropagation with latent-sampling weighted regression.

These guarantees are explicitly local. They depend on the residual manifold being sufficiently smooth, latent sampling remaining in the region where the learned residual model approximates the true residual distribution, and the conservative critic being reasonable in the local neighborhood defined by the anchor.

## 5. Empirical performance and ablations

SPAR is evaluated on the CORL version of D4RL across MuJoCo locomotion, AntMaze navigation, and Adroit manipulation. The base policy is always a simple BC model; the reported question is whether large gains can be extracted solely through residual rectification [2605.27877].

The benchmark suite includes HalfCheetah, Hopper, and Walker2d in medium-replay and medium-expert settings; AntMaze umaze-diverse and large-diverse; and Adroit Pen-Cloned and Pen-Human. Baselines span gradient-based policy-improvement methods such as BCQ, TD3+BC, CQL, PLAS, and Diff-QL, and in-support learning methods such as AWAC, IQL, IDQL, LAPO, EQL, CQL-AW, and recent diffusion/flow-based methods.

Selected normalized D4RL results illustrate the regime dependence of the two SPAR variants. On **Hopper-medium-replay**, the base BC policy is approximately \(53.3\), IQL is approximately \(94.7\), Diff-QL is approximately \(83.2\), and **SPAR-MLP** reaches
\[
101.9 \pm 0.4.
\]
On **HalfCheetah-medium-replay**, the base is approximately \(40.5\), Diff-QL approximately \(47.8\), and SPAR-MLP achieves
\[
50.9 \pm 0.6.
\]
On multimodal medium-expert tasks, **SPAR-PROJ** is the stronger variant: **Hopper-medium-expert**
\[
108.7 \pm 1.9,
\]
and **Walker2d-medium-expert**
\[
113.4 \pm 0.8.
\]
The same pattern appears in narrow or multimodal domains. On **Pen-Cloned**, the base is approximately \(50.4\), many advantage-weighted or constrained baselines are roughly \(60\text{–}70\), and **SPAR-PROJ** reaches
\[
76.2 \pm 3.5.
\]
On **Pen-Human**, SPAR-PROJ obtains
\[
62.7 \pm 2.2.
\]
On **AntMaze large-diverse**, where many methods are reported in the approximate \(10\text{–}60\) range, **SPAR-PROJ** achieves
\[
71.0 \pm 7.4.
\]

The ablation results clarify the mechanism. Performing self-imitation in the full action space rather than in SPAR’s anchored residual space leads to collapse on harder tasks; residual anchoring is therefore not a cosmetic detail but a structural requirement. Removing LSI or removing the Stage III gate reduces robustness and performance. Gradient-guided residuals, denoted SPAR-PLAS, still exhibit support drift and lower scores.

Support diagnostics on **Pen-Cloned** are particularly direct. The 95th percentile kNN support-distance ratio is approximately \(0.98\) for SPAR-PROJ, indicating that actions stay within the dataset boundary, whereas the gradient-guided flow residual baseline reports approximately \(6.32\), indicating substantial support drift. The paper also measures gradient-conflict metrics: SPAR-MLP and SPAR-PLAS show large positive directional disagreement and fitting degradation after a value-guidance update, whereas SPAR-PROJ reduces these metrics by several orders of magnitude.

The weighting and pessimism ablations show strong task dependence. Hard filtering performs well on dense MuJoCo tasks, while soft filtering is critical on sparse AntMaze and narrow Pen tasks because it preserves connectivity and bridging transitions. A temperature around \(T \approx 0.3\) often balances focus and connectivity. Removing the uncertainty penalty by setting \(\lambda_u = 0\) can dramatically degrade performance on Pen-Cloned and AntMaze-large-diverse; the Pen-Cloned score cited in the paper drops from \(76.2\) to \(39.2\). Excessive pessimism also harms performance, particularly in AntMaze.

Implementation details are correspondingly pragmatic. The reported default design uses actor and residual MLPs with 2–3 hidden layers of 256 units and ReLU activations; CVAE encoder and decoder networks with 3 hidden layers of 256 units, latent dimension \(d_z \approx 8\text{–}16\), and KL weight \(\beta \approx 0.5\); and a critic ensemble of 5 Q-networks. Optimization uses Adam with learning rate \(3\times 10^{-4}\), global gradient clipping at norm \(1.0\), and Polyak averaging with \(\tau_{\text{target}} = 0.005\). Stage I and Stage II each run for roughly \(1\) million gradient steps.

## 6. Related formulations, limitations, and broader interpretation

SPAR is a specific offline RL method, but the support-preservation principle has close analogues in other RL settings. In RLVR for language-model reasoning, **Anchored Policy Optimization (APO)** is presented as a concrete instantiation of a **Support-Preserving Action Rectification-type method**. APO replaces global KL **Shape Matching** with **Support Coverage**, defining a Safe Manifold from the reference model’s top-\(K\) support and using a push-pull rectifier on negative-advantage tokens to suppress the current error while restoring mass on the anchor set; the pull term is shown to be gradient-aligned with maximizing support coverage [2602.05717]. In sparse-reward RL with intrinsic motivation, **Action-Dependent Optimality Preserving Shaping (ADOPS)** converts arbitrary intrinsic rewards into an action-dependent shaping term that preserves the support of extrinsically optimal actions, even though it does not preserve the ordering among suboptimal actions and does not require PBRS-style action-independence of cumulative shaping returns [2505.12611].

These adjacent formulations help delimit what SPAR is and is not. It is not merely conservative behavior cloning, because it explicitly seeks local policy improvement. It is not unrestricted actor optimization, because both the residual parameterization and the gate are designed to prevent off-support drift. And it is not equivalent to generic reward shaping, because its rectification acts in action space around a frozen BC anchor rather than by transforming the reward function.

The limitations are correspondingly structural. SPAR depends on the quality of the base policy: if \(\pi_{\text{base}}\) is very poor or misaligned, the residual neighborhood may not contain good actions, and localization bias can become large. It depends on the conservative critic \(Q_{\text{rob}}\): if the critic is badly misestimated even within the residual neighborhood, weighting and gating can become misleading. SPAR-PROJ is more expensive at inference than SPAR-MLP because it requires multiple latent samples and critic evaluations, although the paper notes that it remains cheaper than diffusion models. Finally, the theoretical guarantees are local—they quantify search-space contraction and local drift suppression, not full offline RL performance guarantees under arbitrary distribution shift.

Taken together, these points position SPAR as a geometric and statistical answer to a specific offline RL pathology. Its defining claim is that support preservation need not imply over-conservatism if policy improvement is reformulated as local residual rectification around a frozen support-faithful anchor.

Source: https://www.emergentmind.com/topics/support-preserving-action-rectification-spar