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

Background

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. I developed a method for estimating causal drug effects from the longitudinal records of more than 2 million patients, in PHAIR, a project involving the Danish Medicines Agency. My earlier training is in physics and computational physics.

Causal inference CV (PDF)

Selected research

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
All publications on Google Scholar

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

Four merged pull requests to TreatmentEffect, adding overlap and balance diagnostics and ATET/ATC for AIPW, and fixing propensity clipping and the GMM moment conditions.

More on GitHub