Machine learning · NLP & LLMs · Causal inference

Kiril Klein, PhD

From clinical data to reliable models and evidence.

I build ML systems for healthcare end to end, with NLP, LLMs and transformers for longitudinal records, and develop methods to estimate treatment effects from observational data.

Machine Learning Engineer at Aiomic · Copenhagen

Explore explainers Download CV

Portrait of Kiril Klein

01 / Explainers

Things you can poke at

Interactive pages that teach one idea by letting you change it. Free, and they run in the browser.

Biology · 3D

Tree Explorer

A 3D tree you can fly around. Zoom in on the leaves, the trunk or the roots to see how each part works.

Source

Causal inference

Causal Sandbox

Guided lessons and a full simulator. Change the confounding, the adjustment set or the estimator, and compare the estimate with the known true effect.

Source

LLM agents

Agent Field Atlas

A map of LLM agents that you cross by building one: a trip planner in plain Python, from a single model call to an evaluated agent.

Source

Language models · Paper

Bolmo Explainer

A walkthrough of Bolmo (Nature, 2026): how a finished subword language model is rebuilt to read and write raw bytes.

Source

02 / Research

Selected research

All publications on Google Scholar

PhD thesis · University of Copenhagen · 2026

Scalable Causal Inference on Electronic Health Records Using Transformers

Connecting EHR transformers with target trial emulation: from clinical prediction to treatment-effect estimation and large-scale drug-safety screening.

Read the thesis PDF · 11 MB

03 / Open source

Open-source software

CausalEstimate

A Python library for treatment-effect estimation from propensity scores and outcome predictions, including IPW, AIPW, TMLE, and matching. Source code.

BONSAI

A framework for transformer modelling of electronic health records. I am its main developer and coordinated the team behind its causal-inference extension, BONSAI Causal. Paper (JOSS).

statsmodels

Contributions to TreatmentEffect: overlap and balance diagnostics, ATET/ATC for AIPW, and fixes to propensity clipping and the GMM moment conditions.

More on GitHub

04 / About

Research depth. Engineering ownership.

At Aiomic, I designed and built the ML system for clinical document analysis and brought it into production. It combines gradient boosting, fine-tuned encoder transformers and LLMs in one workflow, with blinded validation before deployment.

I completed my PhD at the University of Copenhagen and the Pioneer Centre for AI, where I developed a method for estimating causal drug effects from the longitudinal records of more than 2 million patients. My earlier training is in physics and computational physics.

CV (PDF)Causal inference CV (PDF)