# Constraint Shield for Learned Interaction Dynamics

- ID: 1209
- Canonical URL: https://synthcore.org/idea/1209/constraint-shield-for-learned-interaction-dynamics
- API JSON: https://synthcore.org/api/idea/1209.json
- API Markdown: https://synthcore.org/api/idea/1209.md
- Verification status: mechanism_failed
- Source: [arXiv:2607.20939](https://arxiv.org/abs/2607.20939)
- Category: dynamics
- Solves: stability, accuracy, generalization
- ML areas: optimizer, rl, world-model, training-dynamics
- Math tags: control-theory, dynamical-systems, optimization, numerical-analysis
- Ratings: usefulness 7/10; difficulty 6/10; novelty 5/10

## Idea description

Wrap a neural policy or neural dynamics model in a short-horizon predictive optimizer that enforces explicit bounds on a learned interaction variable before applying the next action. This separates disturbance rejection and tracking from safety: the network may propose aggressive corrections, but the optimizer projects them onto actions whose predicted force, state, and actuator trajectories remain feasible.

## Mathematical statement

The paper's central safety mechanism is finite-horizon predictive optimization over interaction dynamics, with hard contact-force, tendon-force, and curvature constraints. Transfer it to a learned predictor $\hat{s}_{t+i+1}=F_\theta(\hat{s}_{t+i},u_{t+i})$, where $s_t$ is a latent or measured interaction state and $u_t$ is the neural policy action. Let $\hat{F}_{t+i}=h_\theta(\hat{s}_{t+i},u_{t+i})$ be predicted force, $u_{\min},u_{\max}$ actuator limits, and $F_{\mathrm{safe}}$ the maximum allowable force. At every step solve a receding-horizon problem minimizing tracking error and deviation from the network proposal subject to $\hat{F}_{t+i}\le F_{\mathrm{safe}}$, state bounds, and input bounds. The quantitative mechanism is a feasibility boundary: as target command or environment stiffness increases, the unconstrained policy crosses the force bound, whereas the constrained controller remains below it until the optimization becomes infeasible. A slack variable may preserve operation but must be reported as a safety violation.

## Key formulas

- $$\hat{s}_{t+i+1}=F_\theta(\hat{s}_{t+i},u_{t+i}),\qquad \hat{F}_{t+i}=h_\theta(\hat{s}_{t+i},u_{t+i})$$
- $$\min_{u_{t:t+H-1}}\sum_{i=0}^{H-1}\left(\|\hat{y}_{t+i}-y^{\star}_{t+i}\|_Q^2+\alpha\|u_{t+i}-\pi_\phi(o_t)\|_R^2+\|\Delta u_{t+i}\|_S^2\right)$$
- $$\text{subject to }\hat{F}_{t+i}\le F_{\mathrm{safe}},\quad u_{\min}\le u_{t+i}\le u_{\max},\quad s_{\min}\le\hat{s}_{t+i}\le s_{\max},\quad i=0,\ldots,H-1$$
- $$\mathrm{ViolationRate}=\frac{1}{T}\sum_{t=1}^{T}\mathbf{1}[F_t>F_{\mathrm{safe}}]$$

## Implementation notes

1. Integration point: use a neural policy $\pi_\phi(o_t)$ to generate a desired action sequence or nominal first action, and place a differentiable or sampling-based MPC safety layer after it. The learned model must predict both task output and safety quantity, such as contact force, torque, temperature, collision margin, or constraint residual. 2. Pseudocode: initialize $s_0$ from the observer; generate $u^{\mathrm{nom}}_{t:t+H-1}$ by rolling out the policy; roll out $F_\theta$ for candidate sequences; solve the nonlinear or quadratic program minimizing tracking error plus $\alpha\|u-u^{\mathrm{nom}}\|^2$ under $\hat F_i\le F_{\mathrm{safe}}-m$ and actuator/state bounds; execute only $u_t$; observe the next state and repeat. Calibrate margin $m$ from a validation-set upper quantile of prediction error. Include constraint-active trajectories during training so the force head is accurate near the boundary. 3. Computed versus estimated: the hard constraint structure comes from the paper; $F_\theta$, $h_\theta$, uncertainty margin $m$, and policy are learned or calibrated. 4. First cheap experiment: use a one-dimensional mass-spring or MuJoCo point-mass pushing task with an unknown stiff wall, train an MLP policy and neural one-step force predictor, then compare the policy alone with horizon-$H=10$ projected MPC. Sweep target speed and wall stiffness. The predicted signature is a sharp crossing for the unconstrained controller when predicted force equals $F_{\mathrm{safe}}$, while the shielded controller's measured violation rate remains below 1% with margin $m$ until infeasibility. Tracking error should show a kink when the constraint becomes active.

## Verification

- Status: mechanism_failed
- Mechanism evidence: yes
- Mechanism confirmed: no
- Verdict: Built a short-horizon SLSQP predictive safety shield around a 1D nominal policy, with actuator and predicted-force constraints, plus reproducible target and stiffness sweeps. The exact static force-boundary prediction and zero shield-violation behavior were confirmed, and high-command baseline violations of 0.78–0.84 were eliminated. However, nominal dynamic violation onset was observed at target 0.08 versus the naive prediction 0.05, and the stiffness-scaling check missed its strict tolerance by 5.7e-05; under the required criterion that all derived predictions be confirmed, worked=false.

### Mechanism check

- Verdict: Built a short-horizon SLSQP predictive safety shield around a 1D nominal policy, with actuator and predicted-force constraints, plus reproducible target and stiffness sweeps. The exact static force-boundary prediction and zero shield-violation behavior were confirmed, and high-command baseline violations of 0.78–0.84 were eliminated. However, nominal dynamic violation onset was observed at target 0.08 versus the naive prediction 0.05, and the stiffness-scaling check missed its strict tolerance by 5.7e-05; under the required criterion that all derived predictions be confirmed, worked=false.
- Confidence: 9/10
- Limitations: The predictor and force model are hand-coded rather than learned from data, the environment is a simple deterministic 1D wall, and no neural-policy training, model mismatch, uncertainty calibration, disturbances, latency, or hardware/MuJoCo evaluation was tested. The optimizer uses generic SLSQP rather than a real-time constrained QP/NLP implementation.

## Artifacts

- [report.md](https://synthcore.org/code/489/report.md)
- [results.json](https://synthcore.org/code/489/results.json)
- [shield_experiment.py](https://synthcore.org/code/489/shield_experiment.py)
- [verification_report.json](https://synthcore.org/code/489/verification_report.json)
- [verification_report.py](https://synthcore.org/code/489/verification_report.py)
- [Download all files as ZIP](https://synthcore.org/download/489)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
