Mat Zaga

Mat Zaga

Hi, I'm Mat. After 10+ years at BCG and in technical product leadership — including Facebook and, most recently, spy satellites — I went back to maths grad school at Baruch, CUNY, in New York to get more hands-on and re-tool myself.

I graduate in December 2026 and am looking for an interesting full-time quant role · a role that could benefit from my maths skills and tech leadership background. 

I don't expect you to spend your afternoon digging through my GitHub. Here are the architecture diagrams and write-ups behind my recent technical work, plus a few things a resume has no room for. Email me if you want to chat.

Dual UK / EU citizenship · Work authorisation in the US

Recent technical projects

Baruch CUNY grad school era
2025 — 2026
Jane Street puzzle
Solved after a 10-year maths break ↗
Work in progress
Polymarket behavioural bias
Systematic exploitation of prediction-market mispricing
Work in progress
Attention fine-tuning, BERT-class
Where a small model's attention should go

Before grad school

Technical leadership jobs, selected
2013 — 2025

Skills and technologies

Maths and tooling around
#cross-sectional-panel-methods #penalised-regression #ridge #lasso #elastic-net #gradient-boosting #random-forests #walk-forward-CV #purge-and-embargo #rank-IC-screening #collinearity-pruning #MDA-feature-importance #bounded-variable-least-squares #active-set-KKT #constrained-optimisation #knapsack #reinforcement-learning #self-play #potential-based-reward-shaping #model-calibration #label-smoothing #temperature-scaling #vision-transformers #contrastive-fine-tuning #Net2Net-growth #inter-rater-agreement #Fleiss-kappa #deflated-Sharpe #paired-testing #SPAN-and-IRM-margin #entropy-based-autofocus #missing-data-rules #Python #NumPy #pandas #SciPy #PyTorch #scikit-learn #XGBoost #LightGBM #HistGBM #SetFit #FinBERT #Ollama #SQL #kdb+ #C++ #Node-JS #d3 #Streamlit #headless-Linux #cron-engines #Alteryx #Tableau #Claude-API-agents #Claude-Code #Codex #Claude-Design #LLM-aided-development #LLMs-NLP-RAG #FigJam #derivatives-margin #CME-and-ICE-APIs #statistical-arbitrage #market-microstructure #earnings-call-NLP #prediction-markets #telematics #satellite-imaging

About me

Passports / work authorisation
🇬🇧
🇪🇺 Portugal & Greece
🇺🇸 STEM OPT/CPT
My languages
🏴󠁧󠁢󠁥󠁮󠁧󠁿 English
RU Russian
🇳🇱 Dutch
Locations
Education
CUNY logoBaruch College, CUNY MATHS DEPT MS · GPA 3.8+ · EXP. DEC 2026
London School of Economics logoLSE MSc Applied Maths, with merit · 2013
Erasmus University Rotterdam logoErasmus University Rotterdam Computer science minor · exchange
Yandex School of Data Analysis logoYandex School of Data Analysis Masters programme · visiting student
Elsewhere
Still from The Crown, Season 5 Episode 6, Ipatiev House
A cameo in Netflix's The Crown, Season 5 Episode 6, “Ipatiev House”. Netflix ↗
Ironman 70.3, Portugal — the finish. I signed up 1.5 months before, not knowing how to swim.
Mat mid-shot at a badminton centre in Indonesia
Badminton bootcamp, Indonesia.
Weekday Mics at Flop House Comedy Club poster
Occasional standup musings, Brooklyn NY.
Built September 2026
Weekday Mics at Flop House Comedy Club poster
$2m+ saved instantly · paid summer '26 contract · ARB TG

Prop desk margin optimisation

Built the desk's margin-optimisation pipeline end to end: exchange and broker positions in, equivalent-exposure lower-collateral trades out, ranked live on a trader dashboard.

CME and ICE APIs, SPAN and IRM margin methodologies replicated in-house; Python cron engine on headless Linux, Node/JS front end for the desk.

~$5–10m/day relief identified ~$1–3m traded immediately
Scope of the optimisation
Margin optimisation map: offset tightness against cost to capture, instrument names struck out
Sensitive info redacted · click to enlarge
Simplified project architecture
data code gate / check publish failure external API 01Orchestration & configurationProduct, account and broker mappings are config data withper-entry provenance, hand-built from the exchanges’ filesEvery setting and lookup table is validated on every run;a bad entry stops the job by name 02Position & margin statement ingestionBroker statements today, the data team’s kdb+ store next:one data contract, the schema gate inherited by every backend 03Input validation gatesEvery product must map to a SPAN clearing code, anaccount scope and a calendar unit; no match refusesby name, never defaults 04Margin re-pricing at the exchangesCME CORE (SPAN) and ICE ICA (IRM), Eurex folded intoverified ICE clones; priced via the exchange’s own calculator(generated upload files) or its APIPoint-in-time: any book at any past date’s published riskparameters; no file, no run CME CORE API · ICE ICA API · Eurex (verified ICE clone) 05Exchange calculator output gatesEach product family’s SPAN margin must rebuild from itscomponents; families plus cross-model offset must equalthe totalThe exchange must echo the date it priced; totals bandagainst the broker statement before anything is stored Gated results storeAppend-only, latest wins; every page and every what-ifbelow reads from it 06Optimisation scenario modellingFive levers: cheaper account terms, identical-contract nettingacross accounts, calendar consolidation, cross-exchange folds,whole-block removal by business lineLever 4: bounded-variable least squares (active-set,KKT-verified) solves the hedge slice that flattens theFOMC-bucket delta ladder, rounded to whole lotsCounterfactual books priced through the venue calculator;savings decomposed per lever, interaction term shown,never summed away 07Reconciliation & publish gatesEvery published figure ties to the broker statement, downto its initial/maintenance ratio against the broker’s factortable471 cross-widget consistency checks; missing input reportsINCONCLUSIVE, never a quiet pass 08 · Dashboard rendering & publishingnothing is published unless every gate is green Every page rebuilt from the record from zero each run; nothing appended, so a refactor must come out byte-identical Dated reports are immutable; the fixed-URL shell escapes its input and cannot call a failed run current Ranked lower-collateral trades on the desk dashboard~$5–10m/day of margin relief identified; ~$1–3m traded immediately Failure laneAny failed gate: non-zero exit, error file for the mailer,previous report untouched, re-run idempotentThe fixed-URL shell says NOT UPDATED TODAY, names theday it shows and quotes the gate Dev harnesses — not nightlyGolden check rebuilds every page and byte-compares againsta human-approved baselineLookup stress attacks the product tables with products neverheld; a live sweep re-prices every recorded CME figure any gate fails, at any stage
Click to enlarge
ML ELECTIVE PROJECT, MILLENIUM PM GUIDANCE

Forecasting 24-hour residual returns

Predicting 24-hour forward residual returns across ~875 US equities, 2010—2014, on 15-minute intraday snapshots and daily OHLCV.

Fairly standard clean pipeline: ~32 candidate features — intraday microstructure, aggregated intraday, daily price-volume, cross-sectional — narrowed to 18 by rank-IC screening, collinearity pruning and risk-exposure checks. Two-stage normalisation: per-stock 20-day rolling z-score, then per-date winsorisation and cross-sectional z-scoring. MDA feature importance was quite informative too.

RF alone performed a bit better OOS, but final submitted model for methodological purity was an ensemble of Ridge, RF and XGBoost; cross-validated weight search converged on simple equal thirds. 

The only better result in the comparison group on the same data used 100's features which I didn't pursue to retain some parsimony.

OOS R² 0.0004
Project architecture
Residual returns pipeline: feature construction, normalisation, model ensemble, walk-forward validation
Whitepaper
Scroll for all pages · click to enlarge
NLP ELECTIVE PROJECT · BLOOMBERG/PROTONLP INSTRUCTOR 

Calibrating a transformer that was sure of itself

Improved transformer calibration and robustness to overconfidence via label smoothing and temperature scaling for an earnings-call classifier — a SetFit / FinBERT / HistGBM ensemble, tuned under F1 and substantive-recall constraints.

The label set is the foundation: ~2,500 sentences from 131 transcripts judged independently by three model families (Sonnet, Qwen, Gemma), reconciled by majority vote with Fleiss' κ and an outlier-judge diagnostic; 2—1 disagreements hand-audited in full, unanimous calls sampled for blind spots.

Then a classifier zoo — rules, LogReg and HistGBM heads on cached embeddings plus ~25 hand-crafted features, FastText, SetFit, FinBERT, and two ensembles — with thresholds swept per model under a substantive-recall floor, macro-F1 as tiebreaker, and one single-shot held-out evaluation. The winner is retrained on train+val and served in a Streamlit GUI that highlights boilerplate inline.

Substantive-recall floor ≥ 0.96 Fleiss' κ target ≥ 0.60
Project architecture
Scroll the full pipeline · click to enlarge
End-to-end pipeline: sentence extraction, three-judge gold labelling, feature engineering, the classifier zoo, threshold tuning and inference into the GUI
Whitepaper
Scroll for all pages · click to enlarge
Equilibre (ex-deepmind) · generals.bot competition · summer 2026 

A top-10 game bot on a tenth of the compute

generals.io is a two-player, real-time strategy game where you can't see most of the board. The competition version lets you build castles and gives you 150 ms per move on one CPU core. I started from a published self-play recipe and changed what the network sees, where its games start, how it was pushed to try castles, and how progress was measured.

Below: the training loop, then the improvements. Each letter is an improvement made at that step.

generals.io mid-game board, spectator view
Mid-game, seen with full information. Each bot only sees its own land and one ring around it.
My bot trajectory
3000250020001500 $0$10$20$30$40$50 GPU spend on the training that produced each shipped version best competition bots >3000 · reportedly hundreds to thousands of $ best hand-written bot ≈2000 · game theory, no ML, no GPU — among top humans median player ≈1500 1800214924152523 my behavioural clone of human games, before any real GPU temporary plateau — see (D) why
One training loop
The network 7.1M weights · later grown to 11M Play 512 games per batch in parallel · 4 and 8 GPUs; 16 staged Score every move better or worse than expected? Update the weights nudge toward better moves Saved snapshot weights averaged over time Measure it does it beat the old ones? Past versions of itself 15 frozen opponents chooses moves 524k moves which to reinforce every 50 steps every snapshot joins once it beats 60% of them supplies the opponents becomes the next network The player: a vision transformer over the board. A 38 standard input layers + 11 new derived — e.g. enemy reach time, castle price per cell. Both sides played by the network; batches sized for parallel rollout. B Curriculum: half the games start inside real human blunders or value-surprise moments. Each move scored against what the network expected to happen. C Material bonus written as after − before: guides exploring, cannot be farmed. Weights move a small step toward the moves that scored well. D Plateau reason: step size on an unreset clock × a tenth of the top bots' budget. A time-averaged copy of the weights: the version that plays. E Ships inside hand-written rules, using 7 ms of the 150 ms move budget. Head-to-head vs earlier snapshots and outside reference bots. F ~30k paired games on a laptop, $0; a self-audit halved our own claims. Opponents drawn in proportion to how often they still win. G Draw weights found inverted for 1,700 steps — by logging, not reading.
Improvements, by training-loop stage
A
What the network sees
  • 38 standard layers: armies, ownership, fog, move history.
  • +11 derived: five threat maps — how soon an enemy force reaches each cell, how much could arrive, distance to your own general — computed in one fused pass.
  • Countdowns to the turn-800 and turn-1200 rule changes; the raw turn counter can't resolve them in half-precision.
  • Castle price per cell, computed by the game's own billing code, so it can never drift.
  • A planned “predict the threat” output was cut and made an input: it's computable, so predicting it is leakage.
B
Where games start — the curriculum
  • Self-play rarely reaches rare decisive moments, so they're mined from 284k human games by exact rules: a castle built then lost within 50 turns; a 20-stack two squares from the enemy general but four by path; land taken behind you after first contact.
  • Plus value surprises: moments where the network's own prediction flipped and never recovered.
  • Restart 10 turns before the blunder so the network gets to choose differently; keep one tick per episode, not nine copies of one moment.
C
Castles: taught, not bribed
  • A fresh agent never builds — 35+ army up front, slow payback — and a per-castle bonus makes it build everywhere.
  • So the bonus is potential-based (Ng, Harada & Russell, 1999): after − before, cancels over a game, can't create a new optimum.
  • Castle tries forced only on cells passing four rule checks: repays before turn 1200, leaves ≥1 army behind, no enemy force can reach it in time, nothing unseen within 3 squares.
  • The forcing switches itself off on a cell once the network's own urge to build there passes 25%.
D
Why it plateaued
  • Step size followed an inherited clock, 0.5 / t1.1, written for one 4,050-step run whose tail is the cooldown.
  • Five legs resumed without resetting it: leg 3 stepped at 6.5e-5, leg 5 at 1.6e-5 — cooldown sizes, while still learning. Leg 5 read flat.
  • The combination that hurt: tiny steps on a budget a tenth of the top bots'. The fix is two lines — reset the clock at each resume.
E
Serving
  • Time-averaged weights ship inside hand-written rules — loop-breaker, mate-in-one check, doomed-castle veto — using 7 ms of the 150 ms budget.
  • The other 140 ms measured unspendable: over 274,462 positions, the region a deeper proof needs to see was fully visible 0.89% of the time. Fog, not time, blocks depth.
F
Measuring honestly
  • ~30,000 games on a laptop, each map played twice with sides swapped so luck cancels.
  • Progress had been read against opponents already beaten 95%+ of the time — past that the scale goes blind (one “gate” at 108–0 carried ±3,277 rating points).
  • Self-audit: +688 claimed across three legs, +320 real. Fix: score against live ladder ratings of opponents actually drawn; retire any yardstick once beaten past 85%.
G
Opponents
  • 15 frozen past versions, drawn in proportion to how often they still win; anything beaten >90% gets zero games.
  • The draw weighting was found inverted for 1,700 steps — by logging which opponents were actually drawn, not by re-reading the code.
Improvements, whole pipeline
Data — two rulebooks, nothing thrown away
  • 200k games on the new rules + 212k on the old. Instead of filtering to strong, current games (−80%), player skill and rule version were fed in as inputs — conditioning embeddings added to attention.
  • Pre-registered test: the full messy corpus matched hand-curated data within 49 rating points on a 50-point tie line. Every position in all 8 board symmetries; split by map, not by game.
Growing 7M → 11M without disturbing it
  • Student shape per Straka & Schmid 2026 (deeper over wider at fixed budget). Distilling into a fresh net failed: 1.6% vs its teacher after 48k steps.
  • Grew it Net2Net-style instead (Chen, Goodfellow & Shlens, 2016): copy every weight into a deeper net, insert four zero-output layers. Identical function on day one — 49% vs its teacher, untrained.
The bill
  • ~$41 of GPU behind the shipped version — the chart's x-axis — and ~$185 across every training leg including the dead ends, against $1,000+ for the 3rd-place bot. Paid GPUs only trained; all 30k test games ran on a laptop, after testing had been eating 19% of every paid second on the rented box.
Tried and dropped, with the number that killed each
  • Seven serving add-ons over ~20k paired games: one read +28, an independent 800 games put it at +4; the unchanged control varied 0.7275–0.7625 across map sets — nothing ships on one batch.
  • Four attempts at a specialist to beat the champion (~$7), all collapsed within ~100 steps; each had been started from the champion's weights.
  • Before believing “flat”: a snapshot against a bit-identical copy of itself scored exactly 0.5000.
Built on Straka & Schmid's open generals.io trainer — 2025: imitation then RL; 2026: pure self-play, 15M-parameter vision transformer. Their recipe and hyper-parameters kept; inputs, game starts, castles and measurement changed.
Akuna Capital · November 2025

Options 201, examined

Trader-training course on options pricing and risk, completed with the closing examination.

Akuna Capital Options 201 certificate of completion, Matvei Zaga, November 17 2025
Baruch College, City University of New York · Maths department

Preliminary transcript

GPA 3.8+
Baruch College course history: MTH courses with grades
SURVEILLANCE SATELLITES · 2024 · PRODUCT DIRECTOR, CORE ENG (PROPULSION, MECH, RADIO)

Recovering imaging on a GPS-denied satellite

Details are confidential, but if you're curious about what to do, when a multimillion dollar satellite loses GPS in orbit - talk to me. Imaging depends on knowing quite exactly where the spacecraft is.

I led the recovery: entropy-based autofocus, external orbital data and curtailed view angles — restoring commercial-grade capacity on a >$20M asset that was facing write-off. Specifics are under NDA.

A contract role, taken deliberately as a bridge: it ran up to enrolling full-time in the Baruch graduate maths programme.

Synthetic-aperture radar: the satellite images by sweeping a side-looking beam along its track
Varjo · head of software product · 2022-2024

Real-time VR for enterprise - miles better than Meta Quest or Vision Pro

Took a real-time HD VR platform 0-to-customers against an Nvidia product with a thousand times the funding, leading 20 engineers.

Mat pitching the Varjo streaming product Watch on YouTube ↗
Me back when I was pitching enterprise VR software to industry and military
Arrival · 2020 — 2021 · Product Director

Data platform for a 2,000-person eng org

Owned the internal data-tooling platform: 10x data quality and org-wide adoption.

SAMSARA (NYSE: IOT) · 2019 — 2020 · ONE OF THE FIRST HIRES ON THE EUROPEAN ENG TEAM

Patented fuel-efficiency scoring

Correlation and regression models over high-dimensional telematics — speed, RPM, pedal use, auxiliary equipment.

Most of the work was handling heterogeneous, partially missing signals and defining segmentation rules across vehicle classes so the score stayed interpretable.

Mat at a vehicle transporter, instrumenting telematics hardware Laptop dashboard on a workbench beside a transporter
Tinkering with the truck wiring in a client's warehouse
US PATENT 11,190,373 - MODELLING VEHICLE DIAGNOSTIC DATA (FMS, OBD) AND FUEL RELATIONSHIPS
Scroll for all pages · click to enlarge
Facebook · 2018 — 2019 · Product Manager

Ad enforcement as a knapsack problem

Reframed a quality-versus-revenue enforcement decision under do-not-touch account constraints as constrained optimisation, backtested the policy on historical data, and shipped proof-of-concept code for production.

Two years of quality targets in one, at ⅓ the cost
Mat presenting at an internal Facebook London Audience Network strategy session
Internal Facebook London Audience Network strategy session
Mat beside the traffic light he installed in the Rathbone Square office
I put up an actual traffic light in the Rathbone Square office — the internal name of my team's workstream
BCG · 2013 — 2018 · Consultant

Telco churn from cell-level network quality

Modelled how cell-level network quality drove subscriber churn using geolocated data, and mapped the highest-churn cells into a maintenance priority list.