# stem-synth-switch

**Method:** Fine-tune `stem_ms96` from SWA with **synthetic attention switches inside w96 training windows** (↑ switch rate + explicit multi-switch). Distinct from CLAIMS `technique-synth-switch` (10 s vlaai classifier + mix820 full-trial stamps; AASD Acc 53.26).

**Train recipe**
- Init: `models/stem_ms96_swa/{held-*,all5}.pt` (restore causal `-inf` mask after SWA buffer avg)
- Architecture unchanged (abs pos, dilated stem, ms feats, w96)
- `P_SWITCH=0.7`, `P_SWITCH2=0.7`, `MIN_GAP=8` frames (~2 s @4 Hz): flip labels + negate ms channels after each cut
- Post-switch BCE gain `SW_GAIN=5.0` (v2 recipe uses 2.5); horizon/τ unchanged
- AdamW 8e-4 cosine, batch 512, 1000 steps, EMA 0.995 eval
- Score: LODO 5 + AASD + Carta @ HMM `p_stay=0.994` `scale=0.8` + causal tau-30 hp30
- Never used AASD/Carta labels

**Code / artifacts:** `stem_ms96_synth_switch.py`, `experiments/stem_ms96_synth_switch.log`, `models/stem_ms96_synth_switch/`, `results/research/stem_ms96_synth_switch.json`

## LODO (synth / hp30)

| Held | H | Acc | hp30 H | hp30 Acc |
|------|------|------|--------|---------|
| AVGC | **0.8118** | **74.91** | 0.8021 | 72.27 |
| DTU | 0.9205 | 89.74 | 0.8786 | 79.04 |
| KUL | 0.8800 | 82.62 | 0.8714 | 77.83 |
| UHD | 0.8468 | 79.85 | 0.8371 | 75.94 |
| USTC | 0.9270 | 86.78 | 0.8544 | 74.65 |
| **mean** | **0.8772** | **82.78** | — | — |

## External

| Set | H | Acc | hp30 H | hp30 Acc | vs linear_hp30 Acc 53.12 |
|-----|------|------|--------|---------|--------------------------|
| AASD | 0.6174 | **50.98** | 0.6056 | 50.90 | **Δ −2.14** |
| Carta2026 | 0.5516 | 49.50 | 0.5769 | 51.17 | — |

## Vs baselines (same HMM)

| Method | LODO mean | AVGC | AASD Acc |
|--------|-----------|------|----------|
| SWA | 0.8700 / 82.61 | 0.8015 / 74.91 | 51.08 |
| IRM↔SWA fuse w=0.5 | 0.8725 / 82.58 | 0.8100 / 75.14 | 50.94 |
| RoPE | 0.8711 / 82.68 | 0.8124 / 75.66 | 51.04 |
| **synth-switch** | **0.8772 / 82.78** | **0.8118 / 74.91** | **50.98** |
| linear_hp30 | — | — | **53.12** |
| technique-synth-switch (classifier) | 0.7643 / 69.75 | 0.6965 / 65.70 | 53.26 |

## Verdict

- LODO mean slightly above SWA/RoPE/fuse; **AVGC H 0.8118** toward 0.85 but Acc stuck at SWA **74.91** (target 78).
- **UHD H 0.8468** lost the 0.85 bar (SWA 0.8553).
- **AASD Acc 50.98** flat vs stem family, **below** linear_hp30 53.12; no open target met.
- Denser in-window synth switches + stronger post-switch gain do not transfer to real AASD switches.

## NEXT IDEA

**Switch-aware TV / transition head on frozen SWA evidence (no retrain of stem):** fit a small causal 1-D residual on SWA logits that is trained only on LODO synthetic-switch schedules (same 8–20 s / 30–90 s mix as scoring), with loss focused on post-switch recovery — keep stem frozen so UHD/AVGC base stays. Distinct from this stem fine-tune and from classifier mix820. Skip if another agent already owns a similar residual.
