Simple Algorithm
Reinforcement Learning · Fixed Point · 28 min

Trajectory Optimization: iLQR, DDP & Sampling Planners

Iterative linearization, differential dynamic programming, CEM and MPPI.

When the dynamics are nonlinear the Riccati recursion no longer applies, but it can be applied again and again around a guess. This lesson derives the backward pass of differential dynamic programming and of its Gauss–Newton cousin iLQR, explains the regularization and line search that make them reliable, then derives the two sampling planners that dominate learned-model RL, the cross-entropy method and MPPI, from first principles, and ends with when to use which.

What you’ll learn

  • Contrast single shooting, multiple shooting and collocation, and derive the adjoint gradient of single shooting and its conditioning.
  • Derive the DDP backward pass from a second-order expansion of the Q-function, obtain iLQR as its Gauss–Newton approximation, and prove that both solve linear–quadratic problems in one iteration.
  • Explain Levenberg–Marquardt regularization and the line search on the feedforward term.
  • Derive CEM's update as maximum likelihood on elite plans and MPPI's as the mean of a KL-regularized optimal distribution, and compare sampling and gradient planners on learned models.

Shooting, collocation and the gradient through time

Trajectory optimization solves the HH-step problem from one state: minimize J=∑t=0H−1c(xt,ut)+cH(xH)J=\sum_{t=0}^{H-1}c(\mathbf x_t,\mathbf u_t)+c_H(\mathbf x_H) subject to xt+1=f(xt,ut)\mathbf x_{t+1}=f(\mathbf x_t,\mathbf u_t). The methods differ in what they treat as unknowns.

MethodUnknownsDynamics enforced byStrengthWeakness
Single shootingControls u0:H−1\mathbf u_{0:H-1}SimulationFew variables; every iterate is a feasible trajectoryLong products of Jacobians: ill-conditioned for long horizons or unstable dynamics
Multiple shootingControls, plus the state at the start of each segmentSimulation within segments, equality constraints between themBreaks up the long productsA constrained problem
Direct collocationAll states and controlsEquality constraints xt+1=f(xt,ut)\mathbf x_{t+1}=f(\mathbf x_t,\mathbf u_t) at every stepWell conditioned; can start from infeasible guesses; sparseA large nonlinear program, solved by SQP or interior-point methods
DDP, iLQRControls, through local feedback lawsSimulation in the forward passRiccati-like backward pass, cost linear in HHNeeds derivatives; local
DerivationThe adjoint gradient of single shooting
  1. λH=∇cH(xH),λt=∇xc(xt,ut)+fx⊤λt+1\boldsymbol\lambda_H=\nabla c_H(\mathbf x_H),\qquad\boldsymbol\lambda_t=\nabla_{\mathbf x}c(\mathbf x_t,\mathbf u_t)+f_{\mathbf x}^\top\boldsymbol\lambda_{t+1}

    Define λt=∂J≥t/∂xt\boldsymbol\lambda_t=\partial J_{\ge t}/\partial\mathbf x_t, the sensitivity of the remaining cost to the state at step tt. The chain rule gives a backward recursion, the discrete-time adjoint (or costate) equation:

  2. ∇utJ=∇uc(xt,ut)+fu⊤λt+1\nabla_{\mathbf u_t}J=\nabla_{\mathbf u}c(\mathbf x_t,\mathbf u_t)+f_{\mathbf u}^\top\boldsymbol\lambda_{t+1}

    A control affects the cost at its own step and, through xt+1\mathbf x_{t+1}, everything after it:

  3. This is backpropagation through time: one forward simulation and one backward sweep. Unrolling it exposes the conditioning problem. The effect of u0\mathbf u_0 on xH\mathbf x_H is the product of H−1H-1 state Jacobians and one control Jacobian; for linear dynamics it is AH−1BA^{H-1}B, which grows like ρ(A)H−1\rho(A)^{H-1} when the system is unstable, so early controls receive huge gradients and late ones tiny gradients.

Predict before you look

For xt+1=1.5 xt+utx_{t+1}=1.5\,x_t+u_t and H=10H=10, by what factor does ∂x10/∂u0\partial x_{10}/\partial u_0 exceed ∂x10/∂u9\partial x_{10}/\partial u_9?

Show the answer

38.4

∂x10/∂u0=1.59≈38.4\partial x_{10}/\partial u_0=1.5^9\approx38.4, while ∂x10/∂u9=1\partial x_{10}/\partial u_9=1. A gradient step that suits the last control overshoots the first by a factor of 38, and at H=50H=50 the factor is about 4×1084\times10^8. Collocation avoids these products by making every state a variable; DDP avoids them by propagating local feedback laws instead of raw sensitivities.

DDP and iLQR: Riccati around a trajectory

Differential dynamic programming (DDP; Mayne, 1966; Jacobson & Mayne, 1970) improves a nominal trajectory (xˉt,uˉt)(\bar{\mathbf x}_t,\bar{\mathbf u}_t) by doing dynamic programming on a local quadratic model of the problem around it. Write δx\delta\mathbf x and δu\delta\mathbf u for deviations from the nominal, subscripts for derivatives evaluated on it, and V′V' for the cost-to-go one step later.

DerivationThe backward pass
  1. Qx=cx+fx⊤Vx′,Qu=cu+fu⊤Vx′Q_{\mathbf x}=c_{\mathbf x}+f_{\mathbf x}^\top V'_{\mathbf x},\qquad Q_{\mathbf u}=c_{\mathbf u}+f_{\mathbf u}^\top V'_{\mathbf x}

    Expand Qt(δx,δu)=c(xˉ+δx,uˉ+δu)+V′(f(xˉ+δx,uˉ+δu))Q_t(\delta\mathbf x,\delta\mathbf u)=c(\bar{\mathbf x}+\delta\mathbf x,\bar{\mathbf u}+\delta\mathbf u)+V'\big(f(\bar{\mathbf x}+\delta\mathbf x,\bar{\mathbf u}+\delta\mathbf u)\big) to second order. Its first derivatives are

  2. Qxx=cxx+fx⊤Vxx′fx+Vx′⋅fxxQuu=cuu+fu⊤Vxx′fu+Vx′⋅fuuQux=cux+fu⊤Vxx′fx+Vx′⋅fux\begin{aligned}Q_{\mathbf x\mathbf x}&=c_{\mathbf x\mathbf x}+f_{\mathbf x}^\top V'_{\mathbf x\mathbf x}f_{\mathbf x}+V'_{\mathbf x}\cdot f_{\mathbf x\mathbf x}\\Q_{\mathbf u\mathbf u}&=c_{\mathbf u\mathbf u}+f_{\mathbf u}^\top V'_{\mathbf x\mathbf x}f_{\mathbf u}+V'_{\mathbf x}\cdot f_{\mathbf u\mathbf u}\\Q_{\mathbf u\mathbf x}&=c_{\mathbf u\mathbf x}+f_{\mathbf u}^\top V'_{\mathbf x\mathbf x}f_{\mathbf x}+V'_{\mathbf x}\cdot f_{\mathbf u\mathbf x}\end{aligned}

    and its second derivatives, where the dot contracts Vx′V'_{\mathbf x} with a second-derivative tensor of ff:

  3. δu⋆=k+K δx,k=−Quu−1Qu,K=−Quu−1Qux\delta\mathbf u^\star=\mathbf k+K\,\delta\mathbf x,\qquad\mathbf k=-Q_{\mathbf u\mathbf u}^{-1}Q_{\mathbf u},\qquad K=-Q_{\mathbf u\mathbf u}^{-1}Q_{\mathbf u\mathbf x}

    Minimize the quadratic model over δu\delta\mathbf u, assuming Quu≻0Q_{\mathbf u\mathbf u}\succ0. The minimizer is affine in δx\delta\mathbf x: a feedforward term plus a feedback gain.

  4. Vx=Qx−Qux⊤Quu−1Qu,Vxx=Qxx−Qux⊤Quu−1Qux,ΔV=−12 Qu⊤Quu−1QuV_{\mathbf x}=Q_{\mathbf x}-Q_{\mathbf u\mathbf x}^\top Q_{\mathbf u\mathbf u}^{-1}Q_{\mathbf u},\qquad V_{\mathbf x\mathbf x}=Q_{\mathbf x\mathbf x}-Q_{\mathbf u\mathbf x}^\top Q_{\mathbf u\mathbf u}^{-1}Q_{\mathbf u\mathbf x},\qquad\Delta V=-\tfrac12\,Q_{\mathbf u}^\top Q_{\mathbf u\mathbf u}^{-1}Q_{\mathbf u}

    Substitute back to obtain the quadratic model of the cost-to-go at step tt and the decrease it predicts. Start from Vx=∇cHV_{\mathbf x}=\nabla c_H and Vxx=∇2cHV_{\mathbf x\mathbf x}=\nabla^2c_H at the horizon and sweep backward:

  5. u^t=uˉt+α kt+Kt(x^t−xˉt),x^0=xˉ0,x^t+1=f(x^t,u^t)\hat{\mathbf u}_t=\bar{\mathbf u}_t+\alpha\,\mathbf k_t+K_t\big(\hat{\mathbf x}_t-\bar{\mathbf x}_t\big),\qquad\hat{\mathbf x}_0=\bar{\mathbf x}_0,\qquad\hat{\mathbf x}_{t+1}=f(\hat{\mathbf x}_t,\hat{\mathbf u}_t)

    Forward pass. Simulate the true dynamics with the new controls, using the feedback gains to stay near the nominal and a step size α∈(0,1]\alpha\in(0,1] on the feedforward term only:

iLQR (Li & Todorov, 2004) drops the three tensor terms Vx′⋅f(⋅)(⋅)V'_{\mathbf x}\cdot f_{(\cdot)(\cdot)}. That is a Gauss–Newton approximation: each iteration needs only the Jacobians of the dynamics, and QuuQ_{\mathbf u\mathbf u} stays positive definite whenever cuu≻0c_{\mathbf u\mathbf u}\succ0 and Vxx′⪰0V'_{\mathbf x\mathbf x}\succeq0. DDP keeps the tensor terms and converges like Newton's method near a nondegenerate minimum; iLQR converges fast when the dropped terms are small, as with nearly linear dynamics, and can be slower otherwise. With α=0\alpha=0 the forward pass reproduces the nominal trajectory exactly, so a small enough α\alpha always gives a small change.

DerivationProof
  1. With linear dynamics every second derivative of ff vanishes, so the tensor terms are zero and DDP is iLQR. A quadratic equals its second-order expansion, so QtQ_t is the exact cost of the deviation problem, and minimizing it exactly over δu\delta\mathbf u is exact dynamic programming in (δx,δu)(\delta\mathbf x,\delta\mathbf u).

  2. Vxx=2[Q+A⊤Pt+1A−A⊤Pt+1B(R+B⊤Pt+1B)−1B⊤Pt+1A]=2PtV_{\mathbf x\mathbf x}=2\Big[Q+A^\top P_{t+1}A-A^\top P_{t+1}B\big(R+B^\top P_{t+1}B\big)^{-1}B^\top P_{t+1}A\Big]=2P_t

    For the cost x⊤Qx+u⊤Ru\mathbf x^\top Q\mathbf x+\mathbf u^\top R\mathbf u we have cxx=2Qc_{\mathbf x\mathbf x}=2Q, cuu=2Rc_{\mathbf u\mathbf u}=2R and cux=0c_{\mathbf u\mathbf x}=0; writing Vxx′=2Pt+1V'_{\mathbf x\mathbf x}=2P_{t+1}, the curvature update becomes twice the Riccati recursion, and K=−(R+B⊤Pt+1B)−1B⊤Pt+1AK=-(R+B^\top P_{t+1}B)^{-1}B^\top P_{t+1}A is minus the LQR gain:

  3. The forward pass with α=1\alpha=1 applies the exact optimal affine policy of the deviation problem to the true linear dynamics, so the resulting trajectory is optimal whatever the nominal was. ■\blacksquare

python
import numpy as np

def ilqr_backward(fx, fu, cx, cu, cxx, cuu, cux, Vx, Vxx, mu=0.0):
    """iLQR backward pass along a nominal trajectory of length H. fx[t], fu[t]: dynamics Jacobians;
    c*: cost derivatives; Vx, Vxx: terminal-cost gradient and Hessian; mu: regularization."""
    H = len(fx); k = [None] * H; K = [None] * H; dV = 0.0
    for t in reversed(range(H)):
        Qx = cx[t] + fx[t].T @ Vx
        Qu = cu[t] + fu[t].T @ Vx
        Qxx = cxx[t] + fx[t].T @ Vxx @ fx[t]
        Quu = cuu[t] + fu[t].T @ Vxx @ fu[t]
        Qux = cux[t] + fu[t].T @ Vxx @ fx[t]
        Vreg = Vxx + mu * np.eye(Vxx.shape[0])            # penalize deviations of the next state
        Quu_reg = cuu[t] + fu[t].T @ Vreg @ fu[t]
        k[t] = -np.linalg.solve(Quu_reg, Qu)
        K[t] = -np.linalg.solve(Quu_reg, cux[t] + fu[t].T @ Vreg @ fx[t])
        Vx = Qx + K[t].T @ Quu @ k[t] + K[t].T @ Qu + Qux.T @ k[t]
        Vxx = Qxx + K[t].T @ Quu @ K[t] + K[t].T @ Qux + Qux.T @ K[t]
        Vxx = 0.5 * (Vxx + Vxx.T)                         # keep it symmetric
        dV += k[t] @ Qu + 0.5 * k[t] @ Quu @ k[t]         # predicted change for alpha = 1
    return k, K, dV

The updates of VxV_{\mathbf x} and VxxV_{\mathbf x\mathbf x} are written in a form that is exact for any k\mathbf k and KK, so they can use the unregularized terms while the gains use the regularized ones, as in Tassa, Erez & Todorov (2012). A forward pass then tries α=1,12,14,…\alpha=1,\tfrac12,\tfrac14,\dots and accepts the first step whose actual decrease is a reasonable fraction of the predicted ∑t(α kt⊤Qu+α22kt⊤Quukt)\sum_t\big(\alpha\,\mathbf k_t^\top Q_{\mathbf u}+\tfrac{\alpha^2}2\mathbf k_t^\top Q_{\mathbf u\mathbf u}\mathbf k_t\big).

Regularization and line search (Tassa, Erez & Todorov, 2012). Far from a minimum the quadratic model can be badly wrong, and in DDP QuuQ_{\mathbf u\mathbf u} can be indefinite. Adding μI\mu I to the next state's curvature penalizes deviations from the nominal states: a large μ\mu gives small, cautious steps and μ→0\mu\to0 the full step. As in Levenberg–Marquardt, μ\mu is raised when a step fails and lowered when it succeeds. With these safeguards they ran iterative LQG online, as model predictive control, to synthesize behaviors such as a simulated humanoid getting up from the ground.

Sampling planners as stochastic optimization

Sampling planners treat the plan U=(u0,…,uH−1)\mathbf U=(\mathbf u_0,\dots,\mathbf u_{H-1}) as a random variable and improve its distribution, using only simulated costs. The cross-entropy method began as a tool for estimating the probabilities of rare events (Rubinstein, 1997) and became a general optimizer (de Boer et al., 2005).

DerivationCEM's update is maximum likelihood on the elites
  1. (μ′,σ′)=arg max⁡μ,σ ∑U∈Eln⁡N(U;μ,diag⁡σ2)(\boldsymbol\mu',\boldsymbol\sigma')=\argmax_{\boldsymbol\mu,\boldsymbol\sigma}\ \sum_{\mathbf U\in E}\ln\mathcal N\big(\mathbf U;\boldsymbol\mu,\diag\boldsymbol\sigma^2\big)

    Sample NN plans from N(μ,diag⁡σ2)\mathcal N(\boldsymbol\mu,\diag\boldsymbol\sigma^2), simulate each, and keep the set EE of the NeN_e cheapest. The refit maximizes the elites' likelihood:

  2. For a diagonal Gaussian the maximizer is the elites' mean and their standard deviation in each coordinate. Equivalently it minimizes DKL(p^E ∥ N)\KL(\hat p_E\,\|\,\mathcal N), where p^E\hat p_E is the empirical distribution of the elites: the Gaussian moves to cover the best region found so far. Practical versions smooth the update, μ←(1−β)μ+βμ′\boldsymbol\mu\leftarrow(1-\beta)\boldsymbol\mu+\beta\boldsymbol\mu', and keep σ\boldsymbol\sigma above a floor, because otherwise the spread can collapse before a good plan is found.

MPPI (model predictive path integral control; Williams et al., 2017) replaces CEM's hard cut by soft weights, and the weights come out of an optimization problem.

DerivationMPPI from a KL-regularized objective
  1. q⋆=arg min⁡q Eq[S(U)]+λ DKL(q ∥ p)q^\star=\argmin_q\ \E_q\big[S(\mathbf U)\big]+\lambda\,\KL(q\,\|\,p)

    Let pp be the current sampling distribution of plans and S(U)S(\mathbf U) a plan's simulated cost. Choose the distribution qq that trades low expected cost against staying close to pp, with a temperature λ>0\lambda>0:

  2. Eq[S]+λDKL(q ∥ p)=λ Eq[ln⁡qp e−S/λ]=λ DKL(q ∥ q⋆)−λln⁡η\E_q[S]+\lambda\KL(q\,\|\,p)=\lambda\,\E_q\Big[\ln\frac{q}{p\,e^{-S/\lambda}}\Big]=\lambda\,\KL(q\,\|\,q^\star)-\lambda\ln\eta

    Define q⋆(U)=p(U) e−S(U)/λ/ηq^\star(\mathbf U)=p(\mathbf U)\,e^{-S(\mathbf U)/\lambda}/\eta with normalizer η=Ep[e−S/λ]\eta=\E_p\big[e^{-S/\lambda}\big]. For every qq the objective rewrites as follows, so q⋆q^\star is its unique minimizer (the free-energy, or Gibbs, variational principle):

  3. q⋆q^\star is not Gaussian. Project it onto Gaussians with pp's fixed covariance by minimizing DKL(q⋆ ∥ N(μ,Σ))\KL\big(q^\star\,\|\,\mathcal N(\boldsymbol\mu,\Sigma)\big) over μ\boldsymbol\mu; the minimizer matches the mean, μ⋆=Eq⋆[U]\boldsymbol\mu^\star=\E_{q^\star}[\mathbf U].

  4. μ⋆≈∑i=1Nwi Ui,wi=e−(Si−Smin⁡)/λ∑je−(Sj−Smin⁡)/λ\boldsymbol\mu^\star\approx\sum_{i=1}^{N}w_i\,\mathbf U_i,\qquad w_i=\frac{e^{-(S_i-S_{\min})/\lambda}}{\sum_je^{-(S_j-S_{\min})/\lambda}}

    Estimate that mean from NN samples of pp by self-normalized importance sampling, since q⋆/p∝e−S/λq^\star/p\propto e^{-S/\lambda}. Subtracting the smallest cost leaves the weights unchanged and avoids numerical underflow:

  5. The temperature interpolates between extremes: as λ→0\lambda\to0 the update jumps to the single best sample, like CEM with one elite; as λ→∞\lambda\to\infty it averages all samples and learns nothing. The same softmax over costs appears in maximum-entropy RL (Control as Inference). ■\blacksquare

python
import numpy as np

def mppi_update(mu, sigma, rollout_cost, lam=1.0, n=512, rng=None):
    """mu: (H, m) current plan; rollout_cost(U) -> total simulated cost of the plan U."""
    rng = rng or np.random.default_rng()
    eps = sigma * rng.standard_normal((n, *mu.shape))       # perturbations of the current plan
    S = np.array([rollout_cost(mu + e) for e in eps])        # cost of each perturbed plan
    w = np.exp(-(S - S.min()) / lam)                         # soft-min weights
    w /= w.sum()
    return mu + np.tensordot(w, eps, axes=1)                 # weighted average of the perturbed plans

One MPPI update. In MPC it is repeated a few times per real step, the first control of the result is applied, and the plan is shifted by one step to warm-start the next update.

Predict before you look

Three sampled plans have simulated costs 1, 2 and 3, and λ=1\lambda=1. What weight does MPPI give the cheapest plan?

Show the answer

0.665

w1=1/(1+e−1+e−2)=1/1.503≈0.665w_1=1/(1+e^{-1}+e^{-2})=1/1.503\approx0.665, and the other two get 0.245 and 0.090. With λ=0.1\lambda=0.1 the cheapest plan would take almost all the weight; with λ=10\lambda=10 the three weights would be nearly equal.

Improvements target the sample budget. iCEM (Pinneri et al., 2020) samples temporally correlated, "colored" action noise whose power spectrum falls off as 1/fβ1/f^\beta, carries a fraction of the elites over to the next iteration and the next time step, and executes the best plan seen rather than the mean; it reported needing 2.7–22 times fewer samples than CEM while performing 1.2–10 times better on high-dimensional control problems. TD-MPC's planner is MPPI-like: it weights its top plans by exponentiated returns and mixes in plans proposed by a learned policy (Planning with Learned Values: TD-MPC).

Which planner, with which model?

Gradient-based optimizers (shooting with backpropagation, iLQR, DDP) use derivatives. They converge in few iterations and scale to long horizons and many controls, but they need a smooth, differentiable model, they find local minima, and with a learned model they follow its derivatives, which can be wrong even where its predictions are right.

Sampling optimizers (random shooting, CEM, MPPI) use only simulations. They parallelize on GPUs, cope with non-smooth costs and contacts, and treat the model as a black box, but the samples they need grow with the plan's dimension H⋅mH\cdot m, and they too exploit errors in the model's predicted costs. Model-based RL with neural-network models has leaned on sampling: PlaNet planned with CEM in its latent space (horizon 12, 10 iterations, 1,000 candidates, refitting to the best 100), PETS with CEM through an ensemble, and TD-MPC with MPPI.

Guarantees, and open problems

What is known is mostly local. DDP converges like Newton's method near a nondegenerate local minimum and iLQR like Gauss–Newton; neither guarantees a global optimum on nonconvex problems. CEM has no general global guarantee, and with small populations its spread can collapse before it reaches a good plan, hence the floors on σ\boldsymbol\sigma used in practice. MPPI's importance weights degenerate when λ\lambda is small or the sampling distribution is far from q⋆q^\star: the effective sample size 1/∑iwi21/\sum_iw_i^2 falls toward 1, and the update becomes as noisy as a single sample. (For the three weights of the example above it is about 1.96 out of 3.)

Key takeaways

  • Single shooting optimizes controls by simulation and backpropagation through time, whose sensitivities multiply Jacobians and become ill-conditioned for long or unstable horizons; collocation makes the states variables and enforces the dynamics as constraints.
  • DDP's backward pass is the Riccati recursion applied to a second-order model of the Q-function around a nominal trajectory, with feedforward k=−Quu−1Qu\mathbf k=-Q_{\mathbf u\mathbf u}^{-1}Q_{\mathbf u} and gain K=−Quu−1QuxK=-Q_{\mathbf u\mathbf u}^{-1}Q_{\mathbf u\mathbf x}; iLQR drops the dynamics' second derivatives (Gauss–Newton), and both solve LQ problems in one iteration.
  • Regularizing the next state's curvature and line-searching only the feedforward term make the methods reliable far from a minimum; α=0\alpha=0 reproduces the nominal trajectory.
  • CEM refits a Gaussian to elite plans by maximum likelihood; MPPI computes the mean of the KL-regularized optimal distribution q⋆∝p e−S/λq^\star\propto p\,e^{-S/\lambda} with importance weights, a soft version of the same idea.
  • Gradient planners are efficient but local and follow a learned model's derivatives; sampling planners are robust and parallel but scale with the plan's dimension; neither can fix a wrong model.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

What does iLQR drop from DDP, and with what consequence?

  1. The second derivatives of the cost; it becomes a first-order method
  2. The feedback gains; it becomes open-loop
  3. The second derivatives of the dynamics; it becomes a Gauss–Newton method that needs only Jacobians of ff and coincides with DDP for linear dynamics
  4. The forward pass; it never simulates the dynamics
Show the answer

C. The second derivatives of the dynamics; it becomes a Gauss–Newton method that needs only Jacobians of ff and coincides with DDP for linear dynamics

iLQR keeps the cost's curvature and the gains, and drops only the terms Vx′⋅f(⋅)(⋅)V'_{\mathbf x}\cdot f_{(\cdot)(\cdot)}. For linear dynamics those terms are zero anyway, so the two methods agree and solve LQ problems in one iteration.

Question 2

In the forward pass u^t=uˉt+αkt+Kt(x^t−xˉt)\hat{\mathbf u}_t=\bar{\mathbf u}_t+\alpha\mathbf k_t+K_t(\hat{\mathbf x}_t-\bar{\mathbf x}_t), what trajectory does α=0\alpha=0 produce?

  1. Exactly the nominal trajectory: the states never deviate, so the feedback term stays zero
  2. The optimal trajectory
  3. A trajectory with zero control
  4. A trajectory that depends on the regularization μ\mu
Show the answer

A. Exactly the nominal trajectory: the states never deviate, so the feedback term stays zero

With α=0\alpha=0 the first control is uˉ0\bar{\mathbf u}_0, so x^1=xˉ1\hat{\mathbf x}_1=\bar{\mathbf x}_1, and by induction every deviation is zero. The line search therefore moves continuously from the old trajectory toward the new one.

Question 3

What does MPPI's update become as its temperature λ→0\lambda\to0?

  1. The average of all sampled plans
  2. The current mean, unchanged
  3. A gradient step on the expected cost
  4. The single cheapest sampled plan
Show the answer

D. The single cheapest sampled plan

The weights are e−(Si−Smin⁡)/λe^{-(S_i-S_{\min})/\lambda}, normalized: as λ→0\lambda\to0 every plan but the cheapest gets weight 0, like CEM with a single elite. As λ→∞\lambda\to\infty the weights become equal and the update is a plain average.

Question 4

Why does CEM set its new mean and spread to those of the elite plans?

  1. It is the gradient of the expected cost
  2. It is the maximum-likelihood Gaussian for the elites, which moves the sampling distribution to cover the best region found so far
  3. It minimizes the worst-case cost
  4. It is required for the plans to be dynamically feasible
Show the answer

B. It is the maximum-likelihood Gaussian for the elites, which moves the sampling distribution to cover the best region found so far

Refitting maximizes the elites' likelihood, equivalently minimizes the KL divergence from their empirical distribution to the Gaussian. Repeating it concentrates the samples where cheap plans are.

Further reading

  • D. H. Jacobson & D. Q. Mayne, Differential Dynamic Programming (American Elsevier, 1970).
  • W. Li & E. Todorov, "Iterative linear quadratic regulator design for nonlinear biological movement systems," ICINCO (2004).
  • Y. Tassa, T. Erez & E. Todorov, "Synthesis and stabilization of complex behaviors through online trajectory optimization," IROS (2012).
  • P.-T. de Boer, D. P. Kroese, S. Mannor & R. Y. Rubinstein, "A tutorial on the cross-entropy method," Annals of Operations Research 134, 19–67 (2005).
  • G. Williams, N. Wagener, B. Goldfain, P. Drews, J. M. Rehg, B. Boots & E. A. Theodorou, "Information theoretic MPC for model-based reinforcement learning," ICRA (2017).