Lukasz Stafiniak

Zurich

I am a developer and researcher working at the intersection of functional programming, machine learning systems, and formal methods.

I received my PhD in 2015 for work on GADTs for Reconstruction of Invariants and Postconditions, developing type-inference techniques based on constraint abduction and generalization. From 2015 to 2021 I was at Google, working on knowledge representation, semantic parsing, and deep reinforcement learning.

Since April 2024 I have been sponsored by Ahrefs to develop OCANNL (OCaml Compiles Algorithms for Neural Networks Learning), an OCaml-native deep learning framework.

Primary Projects

OCANNL — OCaml-based deep learning system with backends for CPU, CUDA, and Metal. Designed around shape inference and compositional model building.

Ludics — Autonomous task manager and personal AI infrastructure — a harness for humans working with AI agents, including coordinated multi-agent research workflows.

Tools & Libraries

ppx_minidebug — OCaml PPX preprocessor for logging type-annotated let-bound values and function results, optionally as collapsible HTML or Markdown trees.

ocaml-cudajit — OCaml bindings for CUDA driver API and NVRTC runtime compilation.

ocaml-metal — OCaml bindings to Apple Metal for general compute applications.

ocaml-gccjit — OCaml bindings for libgccjit.

navi-parens — VS Code extension: navigate structured code with keybindings (programming languages and LaTeX).

Publications

curious-ocaml — Educational book about OCaml covering logic, algebra, computation, functions, constraints, monads, and effects.

Hyperparameter Selection for Imitation Learning — ICML 2021 (minor infrastructure contribution).

Measuring Compositional Generalization: A Comprehensive Method on Realistic Data — ICLR 2020.

InvarGenT — Invariant generation as type inference using GADTs and existential types. PhD thesis (2015); early result: Joint Constraint Abduction Problems (UNIF 2011).

Toss — General Game Playing and hybrid modelling: games as mathematical structures with moves as rewriting rules, supporting discrete and continuous dynamics. First-Order Logic with Counting for General Game Playing — AAAI 2011 (with Lukasz Kaiser).

Just for Fun

Pascal-course — A comprehensive Pascal programming course based on the Free Pascal implementation.

pic-breeder-imaginary — A Pic Breeder clone in OCaml.

percolation — Visualizing percolation (various strategies).

Links

GitHub · X (Twitter)