Bagged MLX Counterfactual Model Governance
5-Seed Apple Silicon Metal Ensembles, $0-Risk Shadow Tournaments & Out-of-Sample Trap Separation
Published: 2026-12-05 | Project: BayesianPivot ⇌ Sovereign Edge ML | Discipline: Quantitative Engineering & Microstructure
Author: Nicholas Alexander MacAskill — Founder, CEO & CTO, Flocano Labs | Canonical: https://www.nicholasmacaskill.com/dossier/bagged-mlx-inference-counterfactual-model-governance
1. Executive Summary: Separating Real Lift from Non-Stationary Noise
Most quantitative machine learning pipelines fail in production for two reasons: they allow high-variance models to originate directional trades on low-signal-to-noise intraday tape, and they promote architectures based on in-sample backtests rather than live out-of-sample control groups.
Bagged MLX Counterfactual Model Governance resolves both failure modes by enforcing a strict separation of powers inside BayesianPivot: 1. Deterministic Physics Originates Every Setup: Dual-window Anis-Lloyd Hurst regime classification, peak-session liquidity windows, spatial market structure, and an 18-gate execution firewall retain 100% ownership of trade origination. 2. Bagged 5-Seed MLX Filters Traps in Sub-Millisecond Time: Rather than trusting a single random seed or heavyweight LLM, a 43 KB 5-seed bootstrap-aggregated MLX ensemble votes on setup quality in under 1 millisecond on Apple Silicon—measuring inter-seed agreement alongside calibrated win probability. 3. Zero-Risk Counterfactual Governance: Every competing model variant runs in a parallel SQLite WAL shadow tournament against identical live market tape at $0.00 live capital risk, ensuring only architectures with proven out-of-sample expectancy lift ever reach production.
2. Architecture: 10D Residual MLP & 5-Seed Variance-Coupled Bagging
Financial microstructure is non-stationary: volatility regimes, liquidity depth, and trapped-cohort positioning rotate continuously. A single neural network trained on finite intraday bars is vulnerable to initialization variance, directional regime bias, and local overfitting.
To replace slow, high-variance language-model prompts with deterministic sub-millisecond inference, the champion filter uses a compact 10-dimensional continuous microstructural Residual MLP (LayerNorm + GELU activations + skip-connected residual block + intermediate compression layer) with dual output heads—win probability and epistemic confidence—trained across five independent seeds and resampled folds:
- Variance Compression: Individual seed flukes on anomalous candles are damped by averaging predictions across all five ensemble members.
- Agreement-Coupled Epistemic Confidence: Rather than trusting raw softmax or sigmoid overconfidence, runtime confidence blends mean member confidence with an explicit inter-seed agreement penalty derived from the cross-seed probability standard deviation—automatically damping conviction whenever ensemble members diverge on out-of-distribution tape.
- Algebraic Direction-Neutral Weight Folding: To prevent the network from memorizing a directional bias from a trending training window, the directional feature column is algebraically folded into the first-layer bias and zeroed out, mathematically guaranteeing symmetric evaluation of long and short setups to within
abs(P(BUY) - P(SELL)) < 1e-6. - Zero Token Lag & Compact Footprint: The full 5-seed ensemble lives inside a 43 KB serialized weight manifest and executes its vectorized forward pass in <1.0ms on Apple Silicon—preserving live execution pacing without blocking deterministic orderflow loops.
3. Out-of-Sample Empirical Results (Oct 12 – Dec 4, 2026)
Tracked continuously inside the live counterfactual SQLite WAL ledger across 1,197 resolved out-of-sample setups. Figures below reflect uncapped out-of-sample live-tape signal expectancy (evaluated prior to account-level daily execution throttles):
| Cohort / Hypothesis | Role | Setups (n) | Net Expectancy | Avg / Trade | Disposition |
|---|---|---|---|---|---|
| 5-Seed Bagged MLX Champion | Promoted Production Gate | 240 (97W / 36BE / 107L) | +36.43R | +0.15R (40.4% WR) | Active Production |
| Quarantined Trap Cohort | Filtered / Withheld Setups | 957 (368W / 44BE / 545L) | +2.62R | +0.00R | Blocked by Gate |
| Secondary Continuation Lab | Shadow Observation (since Nov 11) | 114 | +10.07R | +0.09R | Shadow Hold |
| Strict Pain-Threshold Classifier | Shadow Challenger | 118 | -22.19R | -0.19R | Falsified ($0 Risk) |
| Mean-Reversion Neural Baseline | Shadow Challenger | 111 | -14.44R | -0.13R | Falsified ($0 Risk) |
- Clean Trap Separation: Across 957 withheld setups over the exact same window, net outcome averaged +0.00R—confirming genuine out-of-sample separation between +0.15R structural setups and zero-expectancy market noise.
- Shadow-Isolated Drawdown ($0.00 Live Capital Exposed): Competing architectures that looked compelling on retrospective slices—including strict pain-threshold classifiers (-22.19R, n = 118) and mean-reversion neural baselines (-14.44R, n = 111)—were falsified inside the shadow tournament before ever touching live capital, isolating -36.63R of potential drawdown.
- Realized Live Broker Execution (Post-Hardening Window): Translating signal expectancy across real broker spreads, slippage, and account-level execution throttles, live fleet execution over the rolling 21-day window (Nov 14 – Dec 5, 2026) recorded +2,414.64 realized net across 68 live fills (42W / 26L; 61.8% win rate, 2.06 Profit Factor), including +2,111.35 net across 48 fills since Nov 20 (56.2% win rate, 2.58 Profit Factor).
4. Verification Stack: Adversarial Parity, Brier Drift & Shadow Provenance
To prevent silent degradation between offline research and live execution, every promoted ensemble is locked behind four automated engineering invariants:
1. Train-Serve Key-Skew Regression Lock: Following a real production audit (Nov 27, 2026) that caught live payload keys silently falling back to static defaults, the adversarial test suite enforces < 1e-6 numerical parity across all 10 tensor dimensions between live runtime extraction and the offline dataset builder—paired with a hard runtime dimension-mismatch exception if schemas diverge. 2. Direction-Neutral Symmetry Assertion: Automated unit tests verify both the synthetic algebraic weight-folding identity and live production manifest symmetry (abs(P(BUY) - P(SELL)) < 1e-5), eliminating directional overfitting before deployment. 3. Rolling Brier Calibration Drift Sentry (Overall & Per-Asset): Continuously monitors rolling Brier error across resolved live-tape outcomes—flagging both global and per-asset calibration drift while strictly excluding synthetic cohort simulation rows from production calibration statistics. 4. Shadow Provenance & 48-Hour Liveness Isolation: Enforces time-bounded ledger queries anchored to active architecture deployment timestamps and strictly quarantines decommissioned experiments (such as retired semantic LoRA runs) so historical graveyard data can never contaminate active challenger leaderboards.
5. Architectural Principle: Governance Over Model Complexity
The central finding of this production study is that model governance matters more than model size. Earlier single-seed, semantic LoRA, mean-reversion, and pain-threshold challengers were not wasted work—they performed well inside stationary reversal windows before failing when market regimes rotated into sustained macro trend displacement. Each falsified model inside the shadow tournament directly established why single-regime conviction breaks under non-stationarity and shaped the direction-neutral, variance-compressed 5-seed architecture that survived out of sample. Pairing a deterministic structural core with a compact, bagged, out-of-sample-verified MLX safety gate preserves full execution discipline while adding measurable, repeatable expectancy.
Archived in the Flocano Labs Sovereign Case Study Registry. Canonical Reference: dossier/bagged-mlx-inference-counterfactual-model-governance Author: Nicholas Alexander MacAskill — Founder, CEO & CTO, Flocano Labs.