SD-DPC: Sparse Dictionary Differentiable Predictive Control

1Department of Mechanical Engineering, Concordia University
2Department of Civil and Systems Engineering, Johns Hopkins University
Preprint, 2026  ·  Submitted to the American Control Conference (ACC) 2027
SD-DPC pipeline: rollout-based sparse identification followed by differentiable predictive control policy learning with pruning and debiasing
SD-DPC pipeline. A sparse prediction model is identified from trajectory data, and a sparse dictionary policy is then trained by differentiating a constrained finite-horizon predictive-control objective through that model.

Abstract

We present sparse dictionary differentiable predictive control (SD-DPC), a framework for learning sparse, interpretable feedback policies for nonlinear systems from data. A prediction model is first identified by rollout-based sparse identification of nonlinear dynamics (SINDy), building on gradient-based and multistep formulations.

The policy is then parameterized as a sparse combination of dictionary functions and trained by differentiating a constrained finite-horizon predictive-control objective through this model, so that its terms are selected by closed-loop performance rather than by imitating a previously trained controller. The result is an explicit feedback law with only a handful of terms.

Across three benchmark control problems, SD-DPC satisfies the constraints in almost all test scenarios, outperforms a policy distilled onto the same terms by up to an order of magnitude, and requires orders of magnitude less memory and online computation than an optimization benchmark, while admitting explicit sensitivity bounds.

Methodology

SD-DPC proceeds in two stages. Both are instances of the same sequentially thresholded gradient descent, applied to different losses: coefficients are updated by a first-order method with a subgradient for the \(\ell_1\) term, pruned entrywise every \(n_p\) epochs, and finally refitted on the retained set without the penalty to remove its shrinkage bias.

Sparse identification from rollout error

The dynamics are written as \(\dot x \approx \Theta(x,u)\,\Xi\) over a library of candidate functions, and the coefficients are fit from multistep rollout error rather than from state derivatives, so numerical differentiation never enters the objective:

$$\min_{\Xi}\ \frac{1}{m_{\mathrm{id}}}\sum_{j}\Big(Q_1\|x_1^j-\hat x_1^j\|_2^2 +Q_N\!\!\sum_{k=2}^{N_{\mathrm{id}}}\!\|x_k^j-\hat x_k^j\|_2^2\Big)+\lambda\|\Xi\|_1 ,$$ $$x_{k+1}^j=\mathrm{ODESolve}\big(\hat f,\ x_k^j,\ \hat u_k^j,\ \Delta t\big).$$

With a one-step horizon and an explicit Euler step this reduces to the \(\ell_1\)-regularized SINDy regression with forward-difference derivatives; the multistep terms penalize the error accumulated along the rollout.

Sparse dictionary policy

The feedback law uses a second library over the policy input \(z_t=[x_t\ \psi_t]\) and is projected onto the admissible input set, so input constraints hold by construction and each channel retains its own subset of terms:

$$u_t=\pi_{\Xi_\pi}(z_t)=\Pi_{\mathcal U}\big(\Theta_\pi(z_t)\,\Xi_\pi\big).$$

The forward pass evaluates this projection exactly, while the backward pass uses a banded, leaky surrogate derivative. A coefficient feeding a saturated channel therefore still receives gradient information, without being credited with a sensitivity the plant does not have.

Policy learning

The coefficients are obtained by differentiating a constrained predictive-control objective through closed-loop rollouts of the identified model, over sampled initial conditions and reference realizations:

$$\min_{\Xi_{\pi}}\ \frac{1}{m}\sum_{j=1}^{m}\Big(\sum_{t=1}^{N} \ell_{\mathrm{DPC}}(x_t,u_{t-1},\psi_t)+\ell_N(x_N,\psi_N)\Big)+\lambda_\pi\|\Xi_\pi\|_1 ,$$ $$x_{t+1}=F_{\Xi}(x_t,u_t),\qquad u_t=\pi_{\Xi_\pi}(z_t).$$

The stage loss collects the tracking objective, control regularization, and differentiable penalties on state-constraint violation. Because both stages are finite expansions over known libraries, the training procedure and the learned closed loop admit the following statements.

Algorithm 1 Sequentially thresholded gradient descent with debiasing

Require: \(\Theta\): library of \(p\) terms; \(\ell\): loss (a.e. differentiable); \(\Xi\in\mathbb R^{p\times n}\): coefficients, \(\Xi_{ij}\) = term \(i\), channel \(j\); \(\tau\): threshold; \(n_p\): prune interval; \(n_e\): epochs; \(M\): patience; \(K\): debias epochs. Applied to the identification loss for \(\Xi\) (\(n=n_x\)) and to the policy loss for \(\Xi_\pi\) (\(n=n_u\), \((\lambda,\tau)\to(\lambda_\pi,\tau_\pi)\)) with \(\partial\Pi_{\mathcal U}=\Gamma^{\epsilon}\).

  1. \(\mathcal S_{\mathrm{prev}}\leftarrow\) all entries of \(\Xi\); \(s\leftarrow 0\)
  2. for \(e=1,\dots,n_e\) do
  3. Update \(\Xi_{\mathcal S_{\mathrm{prev}}}\) by minimizing \(\ell+\lambda\|\Xi\|_1\)
  4. if \(e \bmod n_p = 0\) then
  5. \(\mathcal S\leftarrow\{(i,j):|\Xi_{ij}|\ge\tau\}\) per channel
  6. if \(\mathcal S\neq\mathcal S_{\mathrm{prev}}\) then
  7. \(\Xi_{ij}\leftarrow 0\) for all \((i,j)\notin\mathcal S\)
  8. Drop from \(\Theta\) the terms removed from every channel
  9. Reinitialize the optimizer on the reduced set
  10. \(\mathcal S_{\mathrm{prev}}\leftarrow\mathcal S\); \(s\leftarrow 0\)
  11. else
  12. \(s\leftarrow s+1\); if \(s\ge M\) then break
  13. end if
  14. end if
  15. end for
  16. Save the biased sparse coefficients \(\Xi^{\mathrm{bias}}\leftarrow\Xi\)
  17. Warm-start \(\Xi_{\mathcal S}\) from \(\Xi^{\mathrm{bias}}\) and reinitialize the optimizer
  18. for \(e=1,\dots,K\) do
  19. Update only \(\Xi_{\mathcal S}\) by minimizing \(\ell\) with \(\lambda=0\) fixed retained set
  20. end for
  21. return debiased sparse coefficient matrix \(\Xi\)

Assumption 1

Compact sets, Lipschitz library

States and features lie in compact sets on which each library function \(\theta_{\pi,i}\) is \(L_i\)-Lipschitz, the library is bounded by \(B_\Theta\), and the prediction map is \(L_x\)-Lipschitz in the state and \(L_u\)-Lipschitz in the input.

Proposition 1

Finite support stabilization

A pruned coefficient is never retained again, so the retained set changes at most \(pn\) times and the thresholding loop terminates after at most \(n_pM(pn+1)\) epochs, for any loss and any epoch budget.

Proposition 2

Pruning cost

Zeroing \(q\) entries below \(\tau\) with stationarity residual \(\eta\) and \(\beta\)-Lipschitz \(\nabla\ell\) raises the objective by at most \(\eta\tau\sqrt q+\tfrac{\beta}{2}q\tau^2\), which is why \(\lambda\) and \(\tau\) are tuned jointly.

Proposition 3

Sensitivity and perturbation

The policy is \(L_\pi\)-Lipschitz with \(L_\pi=\big(\sum_j(\sum_{i\in\mathcal S_j}|\Xi_{\pi,ij}|L_i)^2\big)^{1/2}\); pruning \(q\) coefficients below \(\tau_\pi\) moves the action by at most \(B_\Theta\tau_\pi\sqrt q\); and a policy error \(\varepsilon_\pi\) with model error \(\delta\) moves the trajectory by at most \(e_t=(\delta+L_u\varepsilon_\pi)\sum_{s=0}^{t-1}a^s\), \(a=L_x+L_uL_\pi\). A constraint \(h\) with margin \(h\ge L_he_t\) on one trajectory therefore holds on the other.

Every constant is explicit: \(L_i=\omega\) for \(\sin\omega x_k\) and \(\cos\omega x_k\), \(L_i=0\) for terms in \(\psi\) alone, and otherwise the largest gradient norm of \(\theta_{\pi,i}\) on the box, so the whole certificate follows from the two sparse coefficient matrices and the library — whereas for deep neural policies such bounds require products of layer norms or semidefinite relaxations.

Case studies

Three systems are considered. In each case the policy is trained on the identified model and then evaluated on the true plant, so the reported results include model mismatch.

Two-tank system. A pump feeds an upper tank that drains by gravity into a lower one. The states are the two liquid levels and the inputs are the pump command and the valve split,

$$\dot x_1=c_1(1-u_2)u_1-c_2\sqrt{x_1},\qquad \dot x_2=c_1u_2u_1+c_2\sqrt{x_1}-c_2\sqrt{x_2}.$$

The task is to track time-varying level references with levels in \([0,1]\) and inputs in \([0,1]^2\), with the level bounds entering the loss as hinge penalties.

Forced Van der Pol oscillator. The uncontrolled trajectories converge to an attracting limit cycle surrounding an unstable origin,

$$\dot x_1=x_2,\qquad \dot x_2=\mu(1-x_1^2)x_2-x_1+u,\qquad \mu=1.$$

The task is to regulate the state to the origin under \(|u|\le5\) and \(|x_i|\le5\), with initial conditions sampled both on and off the limit cycle.

Two-dimensional integrator with obstacle avoidance. The dynamics \(x_{t+1}=x_t+u_t\) are linear and decoupled, so the difficulty lies entirely in a nonlinear state constraint,

$$h_{\mathrm{obs}}(x)=\|x-x^o\|^2-(p_o/2)^2\ \ge\ 0 ,$$

a circle of radius 1.5 centered at the origin. The task is to reach a terminal setpoint from initial conditions placed so that the direct path is blocked. The obstacle enters the loss through a one-sided hinge, and a terminal term evaluating the policy at the target is required for the reaching task to settle.

Baselines

SD-DPC is compared against three baselines. IPOPT is an optimization benchmark solved per scenario with exact model knowledge and the same costs, so it serves as a performance reference rather than a competitor. NN-DPC is a deep policy with two hidden layers of 32 ReLU units, trained by the same closed-loop objective on the same identified model. NN-Distilled regresses a sparse policy onto the actions of the trained NN-DPC policy, restricted to the terms SD-DPC retained, so the two differ only in how the coefficients on a common support are obtained.

Results

Identified models

On held-out trajectories, the \(N=50\) step rollout mean-squared errors of the identified models are \(7.64\times10^{-10}\), \(3.30\times10^{-8}\) and \(4.71\times10^{-7}\) for the two-tank, Van der Pol and 2-D integrator systems, with a maximum absolute state error below \(1.37\times10^{-3}\).

Held-out rollouts of the identified sparse dynamics for the two-tank, Van der Pol and 2-D integrator systems
Held-out rollouts of the identified models against the true systems.

Sparsity selection

The retained terms depend jointly on the \(\ell_1\) weight \(\lambda_\pi\) and the pruning threshold \(\tau_\pi\). We select the sparsest policy whose performance on a separate set of validation scenarios is not degraded relative to the dense end of the sweep. The price of sparsity is system dependent: for the Van der Pol oscillator the loss is flat across the sweep, whereas for the two-tank system it degrades once \(\lambda_\pi\) is pushed beyond the selected point.

Policy sparsity versus the l1 weight, with validation loss encoded by color and the selected policies circled
Policy sparsity versus \(\lambda_\pi\). Marker shape denotes the pruning threshold \(\tau_\pi\), color shows the validation loss used for selection, and black circles indicate the selected policies.

Policy training

The figure below follows sparse policy learning for the Van der Pol case. Press play, or drag the slider through training, to see the closed-loop state and control trajectories, the learned policy landscape, the coefficient row and the training and validation loss as sequential thresholding removes dictionary terms. Pruned terms remain visible with coefficients fixed at zero.

In the loss panel, the red dash-dotted lines P1–P6 mark the pruning events, one every \(500\) epochs. At each one, every coefficient whose magnitude falls below the threshold \(\tau_\pi\) is set to zero and locked out, so the retained count steps down \(14 \to 10 \to 4 \to 3\) and then holds. The shaded band from epoch \(3001\) is the debiasing phase: once the support has survived three consecutive prunes unchanged, training continues on those three terms alone, letting their values relax free of the \(\ell_1\) penalty that selected them. The recorded epochs are not uniformly spaced — the opening epochs and the neighbourhood of each prune are sampled more densely.

The bottom panel tracks the sensitivity certificate of Proposition 3 alongside the largest gradient \(\|\partial_x\pi\|\) measured on a dense grid over the same box. Both are read off the retained coefficients at that epoch, so sparsification is visible as a certificate that tightens: the dense policy reaches \(L_\pi\approx140\) before the first prune and settles near \(16\) on three terms, within a factor of about \(1.3\) of the measured maximum on this box.

Closed-loop states and control

Policy landscape \(u(x_1,x_2)\)

Coefficients

Training and validation loss

Sensitivity certificate \(L_\pi\) (Proposition 3)

solid \(x_1\), dashed \(x_2\), one colour per initial condition actuator limits
Your policy

Type or drag any coefficient of \(u = \sum_i \xi_i\,\theta_i(x)\). The trajectories and the landscape follow immediately.

Everything is recomputed in the browser from the recorded coefficients at the selected epoch. Switching to Try it yourself hands you the coefficients: edit any \(\xi_i\), or change the plant damping \(\mu\), the actuator limit \(u_{\max}\), and the number and spread of initial conditions, and the trajectories and the policy landscape follow immediately.

Closed-loop evaluation

All controllers are evaluated on the true plants over 500 held-out scenarios. SD-DPC satisfies the constraints in almost every scenario, evaluates in 17 µs per control step and occupies under 0.1 kB, roughly two orders of magnitude less memory than NN-DPC and far below the 18–26 MiB allocated by each IPOPT solve.

Closed-loop trajectories of SD-DPC, NN-DPC, NN-Distilled and the IPOPT benchmark for the three case studies, with the retained SD-DPC coefficients
Closed-loop trajectories of SD-DPC, NN-DPC, NN-Distilled and the IPOPT benchmark, with the retained SD-DPC policy coefficients, for (a) the two-tank system, (b) the forced Van der Pol oscillator, and (c) the 2-D integrator with obstacle avoidance.
Method Task loss [10−3] Control effort Time [µs] / memory Violations [%] / depth
Two-tank
IPOPT8.8×10−6—8444 / 26 MiB0.0 / —
NN-DPC0.144 ± 0.013—30 / 5.01 kB0.0 / —
SD-DPC0.012 ± 0.006—17 / 0.047 kB0.0 / —
NN-Distilled0.209 ± 0.039—17 / 0.047 kB0.0 / —
Van der Pol
IPOPT4.6×10−24—301 / 19 MiB0.0 / —
NN-DPC41.0 ± 124.4—29 / 5.01 kB0.0 / —
SD-DPC49.9 ± 126.4—17 / 0.023 kB0.0 / —
NN-Distilled96.8 ± 183.8—17 / 0.023 kB0.0 / —
2-D integrator
IPOPT0.000 ± 0.00012.00 ± 1.181841 / 18 MiB0.0 / —
NN-DPC0.298 ± 0.56012.00 ± 1.1628 / 5.01 kB0.0 / —
SD-DPC4.75 ± 4.7912.07 ± 1.1217 / 0.094 kB0.2 / 0.01
NN-Distilled62.6 ± 58.012.07 ± 1.0317 / 0.094 kB60.8 / 1.61

Mean ± standard deviation over 500 held-out test scenarios simulated on the true plant; IPOPT losses are numerically zero and given as means. Horizons are 1000, 50 and 100 steps; task loss is the MSE over the final 100 steps of each 250-step reference segment, the final 10 steps, and the terminal state, respectively. Control effort is \(\sum_t\|u_t\|_1\). Time is per control step; for IPOPT it is the solve time divided by \(N\). Memory is the parameter storage for the learned policies and the resident memory added by each solve for IPOPT. Violations give the percentage of scenarios with any state-constraint violation and the maximum violation depth. NN-Distilled uses the terms retained by SD-DPC, fitted by unregularized least squares.

Learned policies

For the two-tank system, SD-DPC retains six terms across the two input channels and tracks each reference segment with a loss about twelve times lower than NN-DPC. The distilled policy on the same six terms leaves a steady offset and about seventeen times the error. The raw channel outputs, with \(u=\Pi_{[0,1]^2}(v)\) and \(r\) the level reference, are

$$\begin{aligned} v_1 &= 0.6198\,r + 1.4659\cos 2x_1 + 2.1415\cos 2x_2 - 3.4944\cos 2r,\\ v_2 &= -4.2401\cos 2x_1 + 4.2429\cos 2x_2 . \end{aligned}$$

The pump command combines a reference-dependent feedforward with feedback on both levels, while the two nearly equal valve coefficients make the valve open only when the upper tank is fuller than the lower one.

For the Van der Pol oscillator, all controllers stabilize the origin and satisfy the constraints in every scenario. SD-DPC retains three terms, with a loss comparable to NN-DPC and about half that of the distilled policy:

$$u=\Pi_{[-5,5]}\big(\kappa_1x_1+\kappa_2x_2+\kappa_3x_1^2x_2\big),\qquad \kappa=(-0.9873,\ -2.8860,\ 0.2716).$$

Because the model and the policy are finite expansions over analytic libraries, the closed loop is available in closed form. For the unsaturated loop, \(V=\tfrac12(1-\kappa_1)x_1^2+\tfrac12x_2^2\) gives \(\dot V=(\mu+\kappa_2)x_2^2-(\mu-\kappa_3)x_1^2x_2^2\le0\) whenever \(\kappa_1<1\), \(\kappa_2<-\mu\) and \(\kappa_3\le\mu\), conditions satisfied by the learned coefficients, so the origin is globally asymptotically stable.

For the 2-D integrator, SD-DPC retains twelve terms, steers around the obstacle and reaches the setpoint from every sampled initial condition, with cumulative control effort within 0.6% of the IPOPT minimum. It clears the obstacle in almost every scenario, grazing it in 0.2% of them with a maximum violation depth of 0.01. The distilled policy on the same terms violates the obstacle constraint in 60.8% of the scenarios. Its coefficients are regressed onto the teacher's actions without the obstacle penalty: the imitation error is at most 0.08 on the states visited by the teacher, where the regression data lie, but reaches 0.35 on those visited by the student, while the near-optimal teacher clears the obstacle by only 0.06, leaving no margin to absorb it.

Sensitivity bounds

Weighting each retained coefficient by the slope of its library function certifies \(L_\pi\le18.4\), \(16.0\) and \(0.32\) for the three systems, whereas the largest \(\|\partial_x\pi\|\) computed by automatic differentiation on a dense grid is \(12.0\), \(9.4\) and \(0.19\). The certificate is therefore conservative by a factor of at most 1.7, and the pruning bound held at every prune.

Conclusions

SD-DPC represents both the prediction model and the feedback policy as sparse combinations of candidate functions, learned by the same thresholded gradient-descent procedure, so that the policy terms are chosen by the constrained closed-loop objective rather than by imitating a pretrained controller. Across three case studies the learned policies retained only a few terms, satisfied the constraints in almost all test scenarios, and reduced the task loss of a policy distilled onto the same terms by up to an order of magnitude, while the distilled policy violated the obstacle constraint.

The closed-form policies require about two orders of magnitude less memory than deep neural policies and far less memory and evaluation time than the optimization-based benchmark, and they admit explicit sensitivity bounds and, in specific cases, direct stability analysis. Constraint satisfaction is currently promoted through penalty terms and verified empirically. Future work will exploit the symbolic structure for stronger guarantees: hard feasibility through safety filters, region-of-attraction certification, robustness bounds under identification error, and conditions under which sparsification preserves stability and feasibility, along with noisy data and library mismatch, task-informed libraries, and online adaptation of the retained coefficients after deployment.

Code

The implementation uses Python 3.10, PyTorch 2.6 and Neuromancer 1.5.3, with CasADi for the optimization benchmark. Paper configs, publication checkpoints and tutorial notebooks are included for each case.

git clone https://github.com/SOLARIS-JHU/SD-DPC.git && cd SD-DPC
python3.10 -m venv .venv && source .venv/bin/activate && pip install -e .

CASE=TwoTank                             # or VanDerPol, DoubleIntegrator
python scripts/$CASE/system_id.py        # sparse dynamics + debias refit
python scripts/$CASE/train_sd_dpc.py     # sparse dictionary policy
python scripts/$CASE/train_nn_dpc.py     # neural DPC baseline
python scripts/$CASE/evaluation.py       # evaluate on the true plant

This research is supported by the U.S. Department of Energy, Office of Science, ASCR program under the SciDAC Institute “LEADS: LEarning-Accelerated Domain Science”.

BibTeX

@article{garmroodi2026sd,
  title   = {SD-DPC: Sparse Dictionary Differentiable Predictive Control},
  author  = {Garmroodi, Ali Reza Daneshvar and Drgo{\v{n}}a, Jan},
  journal = {arXiv preprint arXiv:2610.02466},
  year    = {2026}
}