# FlowNIDS attribution: where does the AUROC come from?

**Scope**: 10k benign training, CICIDS2017, two configs share seed=42.
See `attribution_pcl_10k/` and `attribution_raw_10k/` for full plots.

## Bottom line

The **PCL encoder hurts detection** in this regime. Raw 61-d quantile-
transformed features + CFM (or GMM) beat the PCL-encoded pipeline on every
CFM channel, with CFM-NLL jumping +18 pp.

## One-screen summary

| scorer | R1 (PCL, 32d) | R2 (raw, 61d) |
|---|---:|---:|
| best density baseline (GMM-K*) | **0.9814** | **0.9935** |
| Mahalanobis | 0.8121 | 0.9922 |
| CFM NLL (C1) | 0.8058 | 0.9867 |
| CFM terminal_norm (C2) | 0.9341 | 0.9926 |
| CFM kinetic_energy (C3) | 0.9330 | 0.9647 |
| CFM arc_length (C4) | 0.9314 | 0.9643 |
| CFM velocity (C5) | 0.9215 | 0.9157 |
| rank-ensemble (best baseline ⊕ top CFM) | 0.9899 (+0.009) | 0.9984 (+0.005) |

## Three observations

1. **CFM-NLL on PCL latent is broken** (0.806, below Mahalanobis 0.812 on
   the same latent). On raw features it's fine (0.987). The PCL bottleneck
   loses log-density calibration.

2. **GMM-16 on raw features achieves 0.9935 AUROC.** This is the simplest,
   fastest, most honest baseline and it matches everything else. The
   complete FlowNIDS pipeline (Mamba+PCL+OT-CFM) offers no absolute AUROC
   improvement over it in the 10k regime.

3. **CFM trajectory signals add ~0.005 AUROC via rank-ensemble** in both
   regimes. This is real but small. Not a standalone pitch; a defensible
   complement.

## Recommended next steps

- **Rerun on full data** (297k train) to check whether PCL pays for itself
  at scale. If same story holds, the encoder should be cut from the paper.
- **Ablate on per-attack**. Raw+GMM may win overall AUROC but lose on
  specific attack subsets where CFM trajectory helps. Check T4 heatmaps.
- **If keeping PCL**, explain what it's FOR — it's not AUROC, so it must
  be interpretability, speed, or some other axis the paper can defend.
