# Conformal Residual Gate for Latent Filtering

- ID: 902
- Canonical URL: https://synthcore.org/idea/902/conformal-residual-gate-for-latent-filtering
- API JSON: https://synthcore.org/api/idea/902.json
- API Markdown: https://synthcore.org/api/idea/902.md
- Verification status: beats_baseline
- Source: [arXiv:2607.14273](https://arxiv.org/abs/2607.14273)
- Category: regularization
- Solves: accuracy, stability, sample-efficiency
- ML areas: ssm, rnn, world-model, training-dynamics
- Math tags: statistics, probability, control-theory, dynamical-systems
- Ratings: usefulness 7/10; difficulty 5/10; novelty 7/10

## Idea description

Use held-out calibration trajectories to convert decoded latent-filter residuals into distribution-free error thresholds. At inference, the threshold can flag unreliable estimates, inflate measurement uncertainty, request an additional observation, or switch to a higher-dimensional fallback model instead of silently propagating a bad latent state.

## Mathematical statement

Let \(x_k\) be the true state and \(\hat{x}_k=D_\phi(\hat z_k)\) the filtered estimate. Define a nonconformity score, either an unnormalized residual \(s_k=\|x_k-\hat{x}_k\|_2\) or a covariance-normalized residual. On a calibration set with \(m\) exchangeable scores, sort them as \(s_{(1)}\leq\cdots\leq s_{(m)}\) and choose \(q=s_{(\lceil(m+1)(1-\alpha)\rceil)}\), where \(\alpha\) is the target miscoverage. The resulting set has marginal coverage approximately at least \(1-\alpha\) under exchangeability. For uncertainty normalization, \(S_k=J_kP_kJ_k^\top+\Sigma_D\), where \(J_k=\partial D_\phi/\partial z\), \(P_k\) is the latent Kalman covariance, and \(\Sigma_D\) is decoder residual covariance.

## Key formulas

- $$s_k=\|x_k-D_\phi(\hat z_k)\|_2\quad\text{or}\quad s_k=\left\|\operatorname{diag}(S_k)^{-1/2}\bigl(x_k-D_\phi(\hat z_k)\bigr)\right\|_\infty.$$
- $$q=s_{(\lceil(m+1)(1-\alpha)\rceil)},\qquad \mathcal{C}_k=\{x:s(x,\hat x_k)\leq q\},\qquad \Pr\{x_k\in\mathcal{C}_k\}\gtrsim1-\alpha.$$
- $$S_k=J_kP_kJ_k^\top+\Sigma_D,\qquad J_k=\frac{\partial D_\phi}{\partial z}(\hat z_k).$$

## Implementation notes

Train the latent Kalman model on one set of trajectories and reserve complete trajectories with ground-truth states for calibration. Freeze the model, run the filter on the calibration set, compute one nonconformity score per time step, sort the scores, and store the finite-sample quantile \(q\) using index \(\lceil(m+1)(1-\alpha)\rceil\). At deployment the true state is unavailable, so use the measurement innovation \(e_k=y_k-h_\omega(\bar z_k,u_k)\), its Mahalanobis norm, or the predicted normalized uncertainty as a trigger surrogate. If the trigger exceeds the calibrated threshold, apply a concrete intervention: inflate \(R\leftarrow\beta R\), inflate \(P_k\leftarrow\beta P_k\), request another measurement, or switch to a fallback model with latent dimension \(2r\). Calibrate thresholds separately by forecast horizon if residuals drift over time. The paper contributes the distribution-free calibration mechanism; the trigger and intervention are engineering adaptations. Test on a noisy heat-diffusion benchmark or nonlinear oscillator against an ungated latent Kalman filter using \(\alpha=0.1\). The prediction is approximately 90 percent held-out coverage under exchangeability, with violations consistent with finite-sample error. Innovation threshold crossings should precede large decoded-state residuals, and covariance inflation should reduce residuals within 5 to 20 steps.

## Verification

- Status: beats_baseline
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: helps
- Verdict: Built a scalar Kalman-filter MVP with held-out conformal residual calibration and an innovation-triggered R-inflation gate. At alpha values 0.05, 0.10, 0.20, and 0.30, observed coverage was 0.963, 0.911, 0.804, and 0.696 versus targets 0.95, 0.90, 0.80, and 0.70. Quantiles decreased monotonically with alpha, calibration quantile standard deviation scaled with fitted exponent -0.537 versus predicted -0.5, and gating reduced contaminated RMSE from 0.3842 to 0.3453, a 10.1% improvement.

### Mechanism check

- Verdict: Built a scalar Kalman-filter MVP with held-out conformal residual calibration and an innovation-triggered R-inflation gate. At alpha values 0.05, 0.10, 0.20, and 0.30, observed coverage was 0.963, 0.911, 0.804, and 0.696 versus targets 0.95, 0.90, 0.80, and 0.70. Quantiles decreased monotonically with alpha, calibration quantile standard deviation scaled with fitted exponent -0.537 versus predicted -0.5, and gating reduced contaminated RMSE from 0.3842 to 0.3453, a 10.1% improvement.
- Confidence: 9/10
- Limitations: This is a scalar random-walk toy rather than a learned latent decoder or heat-diffusion/nonlinear benchmark. It tests marginal exchangeable coverage and robust measurement gating, not conditional coverage, horizon-specific drift, fallback models, additional observations, GPU performance, or a full latent covariance-normalized decoder residual.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0081
- Paired wins: 8/8
- Benchmark verdict: idea better (significant)

## Artifacts

- [bench_report.json](https://synthcore.org/code/375/bench_report.json)
- [conformal_bench.py](https://synthcore.org/code/375/conformal_bench.py)
- [conformal_gate_experiment.py](https://synthcore.org/code/375/conformal_gate_experiment.py)
- [report.md](https://synthcore.org/code/375/report.md)
- [report_bench_2026-08-31T095903.md](https://synthcore.org/code/375/report_bench_2026-08-31T095903.md)
- [results.json](https://synthcore.org/code/375/results.json)
- [Download all files as ZIP](https://synthcore.org/download/375)

## Disclaimer

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