Skip to content
View mathisweil's full-sized avatar
🔍
Open to ML engineering and applied research roles
🔍
Open to ML engineering and applied research roles

Highlights

  • Pro

Block or report mathisweil

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
mathisweil/README.md

Mathis Weil

ML engineer and researcher working on diffusion planners, RL fine-tuning and federated learning. London.

Website · Email · LinkedIn · Google Scholar · OpenReview · Hugging Face · CV

I have just finished the MSc in Data Science and Machine Learning at UCL, with a co-first-authored NeurIPS 2026 workshop paper on masked diffusion planners and a thesis on federated gradient boosting for insurance pricing, in collaboration with Ki, Lloyd's first fully digital follow syndicate.

Open to ML engineering, applied research and data science roles in London. Eligible for the UK Graduate visa, no sponsorship needed.

News

Research

Return-Weighted ELBO Fine-Tuning Degrades Masked Diffusion Planners

Craftax Classic, world seed 9, two planners side by side. The DAgger checkpoint unlocks 15 of 22 achievements and is killed by a zombie at night at step 245. After return-weighted ELBO fine-tuning the same planner unlocks 10 and is killed by a zombie at night at step 191; it never drinks water, eats a cow, wakes from sleep, makes a stone pickaxe or defeats a zombie. Paper score 11.81 (checkpoint) to 8.22 (mean of three seeds).

Same world and seed (seed 9, picked by a fixed rule; the script prints the sweep). Right: the paper's baseline_rl condition, retrained with the paper command. The icons are Craftax's 22 achievements; red marks the five the planner unlocked before fine-tuning but not after.

Muhammad Ali Khan*, Mathis Weil*, Ahmet H. Güzel, Jack Parker-Holder, Ilija Bogunovic
NeurIPS 2026 Workshop: Beyond Next-Token Prediction (BeNTo) · Sydney, December 2026 · * equal contribution
Paper · Code: Craftax (JAX), MiniHack (PyTorch) · Checkpoints: Craftax, MiniHack

Masked diffusion planners denoise a whole action plan at once and can revise any part of it. Fine-tuning them on return with a return-weighted ELBO, the standard tractable objective, makes them worse. I am the lead developer of both codebases.

  • No condition beats the starting checkpoint on Craftax Classic. The planner scores 11.81; after 500 iterations the baseline scores 8.22, and none of 25 conditions (three seeds each) ends above where it started.
  • The return signal does not explain the drop. An exact gradient decomposition puts the return term at about half the imitation gradient, yet advantage clipping, which cuts it fivefold, scores lower still.
  • Most of the drop is a sampling mismatch. In a same-host re-run, collecting rollouts at the evaluation settings shrinks the drop from 3.68 to 0.26 points.
MiniHack: the planner drafts 64 moves at once

MiniHack Room-Random-15x15, evaluation layout 13: a masked diffusion planner fills in a 64-move plan in any order over 10 denoising steps; its first 7 moves lead straight to the stairs, and the agent follows them to win.

Shown: evaluation layout 13, won in 7 moves by its first plan (picked by a fixed rule; the script prints it). Only 2 of the 50 evaluation layouts are won that directly; most wins replan several times. On this room it wins 38% of episodes, and 48.5% across the four in-distribution layouts (paper Table 8).

BibTeX
@inproceedings{khan2026returnweighted,
  title     = {Return-Weighted {ELBO} Fine-Tuning Degrades Masked Diffusion Planners},
  author    = {Muhammad Ali Khan and Mathis Weil and Ahmet H. G{\"u}zel and Jack Parker-Holder and Ilija Bogunovic},
  booktitle = {Beyond Next Token Prediction: Diffusion and Flow Models for Next-Generation Decoding},
  year      = {2026},
  url       = {https://openreview.net/forum?id=VGyjG8Gy29}
}

Federated Gradient Boosting for Commercial Insurance Risk Modelling

MSc thesis, UCL, in collaboration with Ki through UCL IXN · Supervisor: Prof Philip Treleaven · September 2026

Ten simulated insurers on public freMTPL motor data grow the same federated XGBoost tree: each sums its gradients per bin, a coordinator adds the sums and picks the best split, and every insurer applies it. As rate multipliers push their claim rates apart, the shared model prices 0, then 5, then 7 of 10 insurers worse than their own models, the worst by 16.21 points of deviance explained; on this dial one refitted intercept per insurer puts all ten back above their own models, with the harm before the refit shown in faint red.

Method panels are illustrative; results are public freMTPL data across ten simulated insurers, with claim rates pushed apart by rate multipliers.

Insurers cannot pool their claims data. I built a federated XGBoost benchmark in which each insurer keeps its raw records and shares only summary statistics such as gradient histograms, verified that it reproduces the pooled model, and measured insurer by insurer, under a pre-registered protocol, when sharing helps and when it hurts. Results here use the public freMTPL motor data: 678k policies across ten simulated insurers.

  • Federation reproduces pooling. On equal random splits it recovers a median 0.99 of the pooled model's per-insurer gain (pre-registered bar: 0.5), and a correctness gate checks it against the pooled model.
  • Where sharing hurts, and a fix. As rate multipliers push claim rates apart, the shared model prices 0, then 5, then 7 of 10 insurers worse than their own model (worst: 16.2 points of deviance explained). On this dial, refitting one intercept per insurer puts all ten back above.

XGBoost federated histogram aggregation · Hydra · 13.5k lines · 592 tests · strict mypy · CI

Code is private to Ki; access on request through Ki.

Other projects

  • Eviction-aware fine-tuning · LoRA fine-tuning of Llama-3.2-1B while a learned policy (NAMM) evicts 75 to 85% of the KV cache: 28.9 F1 on five LongBench QA tasks, against 19.0 for standard fine-tuning under the same eviction and 32.6 with the full cache. UCL team project of five, built on Sakana AI's NAMM (report).
  • SkillFindr · Semantic search and a RAG API over 1,200+ IBM SkillsBuild courses (Sentence-BERT, pgvector, FastAPI): Recall@20 0.899 and MRR 0.843 on 50 annotated queries. QMUL final-year project with IBM.
  • BidBird · Planning- and appeal-outcome risk models (Random Forest, XGBoost) served through FastAPI. 1st place with a UCL team at the Bidwells Real Estate Planning Hackathon, November 2025.

Background

  • Machine Learning Researcher, Ki, Jun 2026 - Sep 2026 · MSc thesis research, embedded in the underwriting team
  • MSc Data Science and Machine Learning, University College London, 2025 - 2026
  • Postgraduate Teaching Assistant, UCL, 2025 - 2026 · weekly practicals and marking for 280+ MSc and BSc students
  • BSc Computer Science, Queen Mary University of London, 2022 - 2025 · First Class Honours (83%), Final-Year Prize, Demonstrator of the Year 2025 (one of 14 in computer science)

Pinned Loading

  1. craftax-ReMDM-planner craftax-ReMDM-planner Public

    Masked diffusion (ReMDM) action planner for Craftax Classic in JAX/Flax. Code for "Return-Weighted ELBO Fine-Tuning Degrades Masked Diffusion Planners", NeurIPS 2026 BeNTo workshop.

    Python 1

  2. minihack-ReMDM-planner minihack-ReMDM-planner Public

    Masked diffusion (ReMDM) action planner for MiniHack in PyTorch. Code for "Return-Weighted ELBO Fine-Tuning Degrades Masked Diffusion Planners", NeurIPS 2026 BeNTo workshop.

    Python 2

  3. evo-memory evo-memory Public

    Forked from SakanaAI/evo-memory

    Eviction-aware LoRA fine-tuning of Llama-3.2-1B under learned KV-cache eviction (NAMM). UCL Statistical NLP team project, built on SakanaAI/evo-memory.

    Python 1

  4. SkillFindr-SemanticSearchEngine SkillFindr-SemanticSearchEngine Public

    Semantic course search and RAG API for IBM SkillsBuild: Sentence-BERT, PostgreSQL/pgvector, FastAPI.

    Python

  5. bidwell_hackathon bidwell_hackathon Public

    BidBird: planning-application risk models, 1st place (UCL team) at the Bidwells Real Estate Planning Hackathon, Nov 2025.

    Jupyter Notebook

  6. IRDM_CW IRDM_CW Public

    Information Retrieval and Data Mining coursework

    Python