Specification-Aware Sparse Differentiation: Planning under Signal Temporal Logic with Sparsemax Robustness
Organizations: University of Maryland, College Park, USA
Abstract
Gradient-based optimal control under a Signal Temporal Logic (STL) specification involves solving a nonlinear program whose constraints are smoothed robustness functions of the trajectory, and automatic differentiation without knowledge of sparsity computes the Jacobian and the Hessian that its solver needs in full. This often renders the problem computationally intractable. The dynamics and the specification prescribe a sparsity pattern through the STL syntax, the windows of the temporal operators and the variables that the predicates read. Standard tools such as CasADi recover this pattern by structural detection. In this work, we propose a method to prescribe such a pattern directly from the task specification. We show that our method allows us to exploit SparseMax, a recently proposed smooth robustness operator that is certifiably sparse and sound. Its derivative is exactly zero at every operand at or below a data-dependent threshold, which structural detection cannot see. We derive the patterns that expose this trajectory-dependent sparsity to sparse automatic differentiation, with a margin test for their reuse and Hessians confined to the variables of each constraint's support. We demonstrate the method on a dual-arm coordination task in which two arms share a hand-off zone divided into cells and one until constraint per scheduled visit keeps the other arm out of a cell until the visitor has left it. The two scenes are a zone of five cells and a circle of 64 cells, with single solves and closed-loop re-planning on a rigid-body simulation. Our exact-Hessian interior-point solves are up to 27 times faster than those with the sound log-sum-exp robustness in CasADi and IPOPT.
Figures & tables
| Sound-LSE | GMR | SparseMax | Factor | ||||
|---|---|---|---|---|---|---|---|
| Start | Quasi-Newton | Exact Hessian | Quasi-Newton | Ours | Workstation | Orin | |
| Previous solution | 100 | 67, 0.79 | 3, 1.19 | 75, 0.95 | 3, 0.12 | 6.4 | 4.6 |
| 200 | 144, 5.53 | 3, 4.13 | 135, 5.16 | 3, 0.22 | 18.4 | 14.8 | |
| 400 | 142, 10.81 | 3, 11.27 | 175, 14.48 | 3, 0.40 | 26.8 | 22.5 ∗ | |
| After a 16-sample hold-up | 200 | 112 to 170, 4.09 | – | – | 3 to 7, 0.22 | 18.7 | 13.9 |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Constraint Jacobian | Hessian of the Lagrangian | |||
| Products | Time | Products | Time | |
| Five-cell zone | ||||
| 100 | 2,806 / 7 / 4 | 6.6 s / 2.6 / 2.7 / 2.7 | 4,200 / 1,011.5 / 59.5 | 26.6 s / 339 / 260 / 4.7 |
| 200 | 5,612 / 8 / 4 | 26.8 s / 5.8 / 5.8 / 3.7 | 8,400 / 1,204 / 63 | 109.6 s / 1,103 / – / 6.9 |
| 400 | 11,222 / 8 / 4 | 114.9 s / 12.1 / 9.9 / 6.5 | 16,800 / 1,204 / 63 | 476.4 s / – / – / 17.7 |
| 64-cell circle | ||||
| Start | Sound-LSE | GMR | Supports | Widened by 2 | Widened by 5 | Prescribed | |
|---|---|---|---|---|---|---|---|
| Previous period | 100 | 67, 0.79 | 75, 0.95 | 3, 0.12 | 3, 0.14 | 3, 0.21 | 3, 0.48 |
| 200 | 144, 5.53 | 135, 5.16 | 3, 0.22 | 3, 0.37 | 3, 0.48 | 3, 1.42 | |
| 400 | 142, 10.81 | 175, 14.48 | 3, 0.40 | 3, 0.48 | 3, 0.83 | 3, 2.81 | |
| Reference motion | 100 | 96, 1.18 | 126, 1.60 | 14, 0.77 (7) | 13, 0.59 (3) | 13, 0.82 (3) | 13, 1.95 |
| 200 | 277, 11.36 | 228, 9.40 | 12, 1.27 (8) | 16, 1.42 (4) | 16, 2.36 (3) | 13, 10.37 | |
| 400 | 187, 14.09 | 228, 18.14 | 12, 2.06 (7) | 12, 1.78 (3) | 13, 2.40 (2) | 13, 21.49 |
| Runs | Sound-LSE, quasi-Newton | SparseMax, ours | ||
| Workstation | ||||
| Solve, previous solution | 100 | 4 | 0.79 (0.77 to 0.82) | 0.122 (0.120 to 0.124) |
| 200 | 4 | 5.53 (5.45 to 5.62) | 0.225 (0.223 to 0.231) | |
| 400 | 4 | 10.81 (10.70 to 10.87) | 0.403 (0.395 to 0.413) | |
| Solve, after a 16-sample hold-up | 200 | 4 | 4.09 (4.01 to 4.11) | 0.218 (0.212 to 0.234) |
| Closed loop, slowest period | 100 | 6 | 1.40 (1.33 to 1.42) | 0.461 (0.459 to 0.469) |
| Scene | Jacobian, 12 threads / one | Hessian, 12 threads / one | |
|---|---|---|---|
| Five-cell zone | 100 | 2.7 / 4.9 | 4.7 / 10.4 |
| 200 | 3.7 / 7.8 | 6.9 / 15.1 | |
| 400 | 6.5 / 14.1 | 17.7 / 39.4 | |
| 64-cell circle | 100 | 5.1 / 6.4 | 11.2 / 19.2 |
| 200 | 21.7 / 28.3 | 53.2 / 123.0 | |
| 400 | 116.3 / 132.2 | 172.8 / 355.0 |
| Horizon | New plan every | Ours, whole period | Baseline, solve alone | With construction | Factor |
|---|---|---|---|---|---|
| 2 s | 0.5 s | 0.16 (0.11 to 0.40) | 0.68 (0.46 to 1.35) | 4.15 | 4.3 |
| 4 s | 0.5 s | 0.36 (0.25 to 1.76) | 5.99 (4.04 to 8.84) | 14.64 | 16.6 |
| 8 s | 0.5 s | 0.55 (0.50 to 2.23) | 14.06 (11.91 to 20.55) | 29.87 | 25.3 |
| 2 s | 0.02 s | 0.14 (0.11 to 0.23) | 0.98 (0.72 to 1.18) | 6.41 | 7.0 |
| 4 s | 0.02 s | 0.24 (0.20 to 0.35) | 4.18 (3.60 to 5.41) | 13.06 | 17.6 |
| 8 s | 0.02 s | 0.47 (0.43 to 0.94) | 13.18 (11.27 to 20.04) | 30.78 | 28.0 |
| Sound-LSE in CasADi | SparseMax, ours | Factor | ||
|---|---|---|---|---|
| Solve, previous solution | 100 | 74, 2.38 / 3, 2.54 | 3, 0.52 | 4.6 |
| 200 | 137, 13.68 / 3, 12.35 | 3, 0.83 | 14.8 | |
| 400 | 126, 28.49 ∗ | 3, 1.27 | 22.5 | |
| Solve, after a 16-sample hold-up | 200 | 101 to 161, 11.04 | 3 to 7, 0.80 | 13.9 |
| Hessian, five-cell zone | 100 | 630 | 21.9 / 26.6 | 29 |
| Jacobian, five-cell zone | 100 | 4.5 | 12.3 / 14.0 | 0.36 |