RESYNC: Residual Latent-State Synchronization for Deadline-Bound Streaming Inference
Abstract
Predicting every observation in a high-rate stream requires a model to finish before the next arrival. A large model may offer better predictions but miss that deadline. We propose RESYNC: the large model runs asynchronously, while a fast path updates its latest exact but stale latent state using the observations received since that state was computed and applies its unchanged prediction head. The updater learns from the frozen model's representations without task labels. Across one real and two synthetic streams and five architecture families, RESYNC beats the best compact or distilled alternative with a paired 95% interval above zero in all twelve dataset--architecture pairs with a material teacher advantage at anchor ages of 4--12 observations, and in eleven pairs at older tested ages up to 32. The share of the teacher's gain preserved remains complete on the real stream but is lower and generally declines with anchor age on the synthetic streams. In live replay with 1 ms arrivals, the synchronous large models cannot deliver any predictions on time while RESYNC serves at least 99.4% of arrivals within the interval, with 0.35--0.62 ms median latency on one CPU thread: around the same speed as or faster than the compact model, and 7.9--17.7 faster than synchronous large-model inference. RESYNC targets settings with background compute available but a strict per-observation response deadline.
Figures & tables
| Dataset | Architecture | Teacher | Compact | KD | Stale | RESYNC | Gain capt. | best fast model | RESYNC | Gain capt. |
|---|---|---|---|---|---|---|---|---|---|---|
| FI-2010 | Transformer | 0.676 | 0.545 | 0.543 | 0.390 | 0.688 | 1.00 | +0.143 [+0.128, +0.160] | 0.686 | 1.00 |
| DeepConvLSTM | 0.652 | 0.592 | 0.575 | 0.389 | 0.667 | 1.00 | +0.075 [+0.063, +0.087] | 0.665 | 1.00 | |
| InceptionTime | 0.633 | 0.372 | 0.357 | 0.376 | 0.638 | 1.00 | +0.266 [+0.232, +0.304] | 0.637 | 1.00 | |
| Mamba-2 | 0.670 | 0.529 | 0.625 | 0.394 | 0.683 | 1.00 | +0.058 [+0.054, +0.062] | 0.683 | 1.00 | |
| TSMixer | 0.688 | 0.661 | 0.690 | 0.391 | 0.695 | – | +0.004 [+0.002, +0.007] | 0.695 | – | |
| Teacher | Compact | RESYNC | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | Architecture | p50 | Coverage | p50 | Coverage | p50 | p95 | Coverage | Anchor age | Speed-up |
| FI-2010 | Transformer | 4.61 | 0.240 | 0.80 | 0.999 | 0.46 | 0.54 | 0.998 | 7 [9, 73] | 10.7 |
| DeepConvLSTM | 5.77 | 0.187 | 0.48 | 1.000 | 0.37 | 0.52 | 1.000 | 9 [11, 19] | 17.3 | |
| InceptionTime | 4.57 | 0.242 | 0.65 | 1.000 | 0.59 | 0.64 | 0.999 | 7 [9, 37] | 7.9 | |
| Mamba-2 | 7.39 | 0.143 | 1.60 | 0.902 | 0.59 | 0.66 | 0.999 | 14 [18, 41] | 13.4 | |
| TSMixer | 7.76 | 0.136 | 0.90 | 0.999 | 0.62 | 0.68 | 1.000 | 15 [19, 31] | 13.4 | |
| Synchronous teacher | Compact model | RESYNC | |
|---|---|---|---|
| (GPU) | (CPU) | (CPU, body on GPU) | |
| Latency p50 (ms) | 5.56 (4.49–7.76) | 0.76 (0.46–1.60) | 0.56 (0.35–0.62) |
| Coverage (%) | 19.5 (13.5–24.8) | 99.9 (90.2–100.0) | 99.9 (99.7–100.0) |
| Missed deadlines (%) | 100.0 (100.0–100.0) | 0.2 (0.0–100.0) | 0.1 (0.0–0.6) |
| CPU cores | 1.00 (1.00–1.00) | 0.63 (0.40–0.99) | 1.34 (1.21–1.37) |
| GPU busy (%) | 98 (98–99) | – | 90 (85–93) |
| Incremental | ||||||||
| RESYNC | RESYNC’s time | Next size | Teacher | |||||
| Dataset | Family | ms | F1 | ms | F1 | ms | F1 | F1 |
| FI-2010 | Continual Transformer | 0.38 | 0.688 | 0.27 | 0.603 | 1.22 g | 0.654 | 0.676 |
| Mamba-2, recurrent | 0.51 | 0.683 | 0.29 | 0.646 | 1.00 | 0.677 | 0.670 | |
| Synthetic-1 | Continual Transformer | 0.42 | 0.862 | 0.29 | 0.462 | 1.33 g | 0.919 | 0.937 |
| Mamba-2, recurrent | 0.49 | 0.927 | 0.32 | 0.540 | 0.97 | 0.933 | 0.940 | |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Synthetic-1 | Synthetic-2 |
|---|---|---|
| Channels | 10 sensor, 2 cue value, 2 marker | 10 sensor, 7 cue value, 3 marker |
| Hidden sources | 3 oscillators, mean periods 32, 46, 83 events | 3 AR(1) sources, memory 0.95 |
| Rule | 1 of 4 oscillator components | tier 0 / 1 / 2 with probability 0.1 / 0.2 / 0.7 |
| Segment length | 32–64 events | 48–80 events |
| Cue packets | 2 packets of 2 events, 16 events apart | 3 packets of 1 event, at offsets 0, 8, 16 |
| Lags | – |
| Dataset | Architecture | Teacher (params) | Compact (params) | RESYNC params | |
|---|---|---|---|---|---|
| FI-2010 | Transformer | large (8.48M) | small (5.0k) | 256 | 411.4k |
| DeepConvLSTM | xlarge (11.67M) | mini (1.4k) | 512 | 682.8k | |
| InceptionTime | large (2.89M) | mini (1.1k) | 256 | 411.4k | |
| Mamba-2 | base (245.8k) | mini (1.1k) | 64 | 207.9k | |
| TSMixer | xlarge (31.91M) | tiny (75.8k) | 512 | 682.8k | |
| Synthetic-1 | Transformer | large (8.47M) | small (4.6k) | 256 | 401.4k |
| Train F1 | Test F1 | stationary (test) | stationary (test) | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Architecture | T | R | T | R | Share | R right | T right | R right | T right | T + stationary |
| Transformer | 0.747 | 0.720 | 0.676 | 0.688 | 0.063 | 0.72 | 0.21 | 0.25 | 0.64 | 0.697 |
| DeepConvLSTM | 0.693 | 0.690 | 0.652 | 0.667 | 0.048 | 0.69 | 0.21 | 0.28 | 0.60 | 0.666 |
| InceptionTime | 0.705 | 0.690 | 0.633 | 0.638 | 0.031 | 0.46 | 0.41 | 0.44 | 0.45 | 0.619 |
| Mamba-2 | 0.731 | 0.712 | 0.670 | 0.683 | 0.052 | 0.69 | 0.22 | 0.27 | 0.63 | 0.685 |
| TSMixer | 0.735 | 0.718 | 0.688 | 0.695 | 0.053 | 0.62 | 0.28 | 0.28 | 0.62 | 0.696 |
| RESYNC at anchor gap | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | Architecture | Teacher | Best fast | ||||||||||
| FI-2010 | Transformer | 0.676 | 0.545 | 0.519 | 0.689 | 0.688 | 0.687 | 0.686 | 0.686 | 0.685 | 0.685 | 0.685 | 0.686 |
| DeepConvLSTM | 0.652 | 0.592 | 0.489 | 0.670 | 0.667 | 0.666 | 0.666 | 0.665 | 0.666 | 0.665 | 0.665 | 0.665 | |
| InceptionTime | 0.633 | 0.372 | 0.410 | 0.640 | 0.638 | 0.637 | 0.636 | 0.636 | 0.637 | 0.637 | 0.637 | 0.637 | |
| Mamba-2 | 0.670 | 0.625 | 0.548 | 0.685 | 0.683 | 0.683 | 0.683 | 0.683 | 0.683 | 0.683 | 0.681 | 0.683 | |
| TSMixer | 0.688 | 0.690 | 0.529 | 0.696 | 0.695 | 0.694 | 0.694 | 0.696 | 0.695 | 0.694 | 0.695 | 0.695 | |
| Dataset | Architecture | |||||
|---|---|---|---|---|---|---|
| FI-2010 | Transformer | -0.025 [-0.052, +0.003] | +0.144 [+0.129, +0.161] | +0.143 [+0.128, +0.160] | +0.143 [+0.127, +0.160] | +0.141 [+0.126, +0.159] |
| DeepConvLSTM | -0.103 [-0.115, -0.090] | +0.078 [+0.066, +0.089] | +0.075 [+0.063, +0.087] | +0.074 [+0.062, +0.086] | +0.074 [+0.063, +0.085] | |
| InceptionTime | +0.038 [+0.023, +0.055] | +0.268 [+0.233, +0.307] | +0.266 [+0.232, +0.304] | +0.265 [+0.231, +0.304] | +0.265 [+0.231, +0.303] | |
| Mamba-2 | -0.077 [-0.086, -0.066] | +0.060 [+0.056, +0.064] | +0.058 [+0.054, +0.062] | +0.058 [+0.054, +0.062] | +0.058 [+0.054, +0.062] | |
| TSMixer | -0.161 [-0.177, -0.145] | +0.005 [+0.002, +0.008] | +0.004 [+0.002, +0.007] | +0.004 [+0.001, +0.007] | +0.004 [+0.001, +0.007] | |
| Synthetic-1 | Transformer | +0.093 [+0.090, +0.095] | +0.054 [+0.051, +0.056] | +0.034 [+0.031, +0.036] | +0.020 [+0.018, +0.023] | +0.003 [-0.000, +0.006] |
| Dataset | Architecture | |||||
|---|---|---|---|---|---|---|
| FI-2010 | Transformer | +0.141 [+0.125, +0.159] | +0.140 [+0.125, +0.158] | +0.141 [+0.125, +0.158] | +0.140 [+0.125, +0.158] | +0.141 [+0.125, +0.159] |
| DeepConvLSTM | +0.073 [+0.062, +0.085] | +0.074 [+0.063, +0.085] | +0.073 [+0.062, +0.085] | +0.074 [+0.062, +0.085] | +0.074 [+0.062, +0.085] | |
| InceptionTime | +0.264 [+0.231, +0.302] | +0.265 [+0.231, +0.303] | +0.266 [+0.232, +0.303] | +0.265 [+0.231, +0.302] | +0.265 [+0.232, +0.303] | |
| Mamba-2 | +0.058 [+0.054, +0.062] | +0.058 [+0.054, +0.062] | +0.058 [+0.054, +0.062] | +0.056 [+0.053, +0.060] | +0.058 [+0.054, +0.062] | |
| TSMixer | +0.005 [+0.003, +0.008] | +0.005 [+0.002, +0.007] | +0.004 [+0.001, +0.007] | +0.005 [+0.002, +0.007] | +0.004 [+0.002, +0.007] | |
| Synthetic-1 | Transformer | -0.006 [-0.009, -0.003] | -0.009 [-0.013, -0.006] | -0.011 [-0.015, -0.007] | -0.016 [-0.020, -0.012] | -0.019 [-0.022, -0.015] |
| Teacher | Compact | RESYNC service | RESYNC anchor age | RESYNC | ||||||||||
| Coverage | Pairs | Dropped (%) | Miss (%) | Stall | p99 | Median | p99 | Max | (%) | Pairs | Count | Share (%) | ||
| (ms) | range | miss | median | max | max | max (ms) | max (ms) | range | max | max | median | (after stall) | max | |
| 1 | 0.14–0.25 | 3 | 0.11 | 0.33 | 0.57 | 123 | 0.71 | 7–15 | 20 | 80 | 0.00 | 7 | 98 (98) | 0.066 |
| 1.5 | 0.20–0.39 | 0 | 0.06 | 0.11 | 0.14 | 90 | 0.72 | 4–9 | 13 | 50 | 0.00 | 6 | 26 (23) | 0.012 |
| 2 | 0.29–0.52 | 0 | 0.02 | 0.07 | 0.08 | 84 | 0.73 | 4–6 | 9 | 41 | 0.00 | 3 | 5 (5) | 0.003 |
| 2.5 | 0.34–0.65 | 0 | 0.00 | 0.07 | 0.09 | 80 | 0.72 | 3–5.5 | 7 | 31 | 1.07 | 0 | 0 (0) | 0.000 |
| Teacher | Compact | RESYNC service | RESYNC anchor age | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | Architecture | (ms) | Coverage | Miss (%) | Dropped (%) | Miss (%) | p99 (ms) | Median [p5–p95] | Max | (%) | |
| FI-2010 | Transformer | 1 | 0.24 | 0.22 | 0.19 | 0.27 | 0.61 | 7 [5–9] | 73 | 0.00 | 9 |
| 1.5 | 0.36 | 0.07 | 0.06 | 0.11 | 0.59 | 4 [3–5] | 13 | 0.00 | 0 | ||
| 2 | 0.49 | 0.11 | 0.02 | 0.04 | 0.57 | 4 [3–5] | 10 | 0.33 | 0 | ||
| 2.5 | 0.47 | 0.00 | 0.04 | 0.04 | 0.67 | 3 [2–5] | 31 | 33.14 | 0 | ||
| 3 | 0.62 | 0.00 | 0.03 | 0.03 | 0.60 | 3 [2–3] | 27 | 49.92 | 0 | ||
| Controlled (s3), all gaps | Live replay, ms | |||||||||
| Dataset | Architecture | Tick p50 (ms) | Tick slope | Re-enc. slope | Re-enc./tick, | Launches / 1k | Switch ticks (%) | p99 other | p99 switch | |
| FI-2010 | Transformer | 0.37 | -0.002 | 26.9 | 3.6 | 6.8 | 199 | 20 | 0.53 | 0.65 |
| DeepConvLSTM | 0.33 | +0.005 | 26.8 | 3.7 | 7.3 | 166 | 17 | 0.42 | 0.58 | |
| InceptionTime | 0.25 | +0.004 | 23.9 | 4.2 | 8.4 | 199 | 20 | 0.66 | 0.67 | |
| Mamba-2 | 0.22 | +0.000 | 24.3 | 4.6 | 9.6 | 107 | 11 | 0.69 | 0.71 | |
| TSMixer | 0.27 | -0.003 | 23.8 | 3.9 | 7.9 | 99 | 10 | 0.71 | 0.70 | |
| CPU cores | GPU busy (%) | Peak host memory (GB) | Peak GPU memory (MB) | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | Architecture | Teacher | Compact | RESYNC (worker) | Teacher | RESYNC | Teacher | Compact | RESYNC | Teacher | RESYNC |
| FI-2010 | Transformer | 1.00 | 0.64 | 1.26 (0.89) | 98 | 87 | 1.07 | 0.67 | 1.08 | 66 | 99 |
| DeepConvLSTM | 1.00 | 0.40 | 1.21 (0.87) | 98 | 85 | 1.19 | 0.66 | 1.21 | 172 | 172 | |
| InceptionTime | 1.00 | 0.63 | 1.37 (0.92) | 98 | 92 | 1.23 | 0.66 | 1.24 | 45 | 45 | |
| Mamba-2 | 1.00 | 0.99 | 1.37 (0.87) | 98 | 91 | 1.32 | 0.67 | 1.33 | 36 | 69 | |
| TSMixer | 1.00 | 0.82 | 1.35 (0.89) | 99 | 93 | 1.09 | 0.66 | 1.10 | 157 | 190 | |
| Latent error, | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | Architecture | Fresh | R | Rec. | R | Rec. | R | Rec. | R | Rec. |
| FI-2010 | Transformer | 0.699 | 0.531 | 0.657 | 0.707 | 0.607 | 0.706 | 0.486 | 0.27 | 0.65 |
| DeepConvLSTM | 0.664 | 0.495 | 0.506 | 0.685 | 0.422 | 0.680 | 0.306 | 0.24 | 2.32 | |
| InceptionTime | 0.660 | 0.479 | 0.482 | 0.670 | 0.431 | 0.669 | 0.402 | 0.16 | 0.69 | |
| Mamba-2 | 0.684 | 0.560 | 0.660 | 0.695 | 0.623 | 0.693 | 0.599 | 0.42 | 0.70 | |
| TSMixer | 0.687 | 0.499 | 0.589 | 0.698 | 0.550 | 0.695 | 0.558 | 0.32 | 0.55 | |
| Method | Size | Time (ms) | Macro-F1 |
|---|---|---|---|
| FI-2010 | |||
| RESYNC on the Transformer teacher | – | 0.38 | 0.688 |
| Continual Transformer (exact) | small | 0.27 | 0.603 |
| Continual Transformer (exact) | tiny | 1.22 (GPU, window) | 0.654 |
| Synchronous Transformer teacher | large | 4.06 (GPU) | 0.676 |
| RESYNC on the Mamba-2 teacher | – | 0.51 | 0.683 |
| Dataset | Model | Size | Params | Window F1 | Stream F1 | Agreement | Latent error | Step, CPU | Step, GPU | Window, GPU |
|---|---|---|---|---|---|---|---|---|---|---|
| FI-2010 | Continual Transformer | mini | 971 | 0.564 | 0.564 | 1.000 | 3.6e-07 | 0.29 (0.00) | 0.69 (0.00) | 0.70 (0.00) |
| small | 2,963 | 0.603 | 0.603 | 1.000 | 3.4e-07 | 0.27 (0.00) | 0.64 (0.00) | 0.68 (0.00) | ||
| tiny | 18,563 | 0.654 | 0.654 | 1.000 | 3.2e-07 | 1.23 (0.00) | 1.88 (0.00) | 1.22 (0.00) | ||
| base | 69,891 | 0.684 | 0.684 | 1.000 | 3.4e-07 | 1.29 (0.00) | 1.80 (0.00) | 1.14 (0.00) | ||
| large | 1,065,987 | 0.660 | 0.660 | 1.000 | 3.8e-07 | 3.13 (1.00) | 1.67 (0.00) | 1.07 (0.00) | ||
| xlarge | 4,229,123 | 0.671 | 0.671 | 1.000 | 3.4e-07 | 8.06 (1.00) | 1.95 (0.00) | 1.28 (0.00) |