All projects
Fintech / Credit risk2026

Causal Auditing of RL Loan Pricing Policies Using Process Mining

Built a system that ties process mining, causal inference, and reinforcement learning for loan/insurance offer optimization. A causally-corrected reward model is estimated from historical offer events with EconML doubly-robust estimation, and the trained RL policy is then audited with causal discovery, conformance checking, and feature-sensitivity analysis. Distributed process-mining primitives were implemented with Apache Beam and parity-verified against single-machine pm4py.

42,821
Offers in demand model
193,849 / 31,509
Events / applications

The challenge

A lender's RL agent sets loan offer terms at the point of sale, but the reward signal is confounded: historical rate assignment depended on the loan officer, the process variant the application took, and applicant-risk proxies that also affect acceptance. The objective was to build a pipeline that produces a causally-corrected reward model and then audits the trained policy to see what it actually learned to depend on.

Approach

  • Reconstructed applicant journeys from the real BPI Challenge 2017 event log with PM4py, deriving process-mining features (variant, resource, offer position, elapsed time, prior offers) that become confounder candidates in the causal model.
  • Built the demand model with EconML's LinearDML: a doubly-robust estimator combining a propensity model P(rate | X) and an outcome model P(accept | X, rate), producing reward(x, r) = P_hat(accept | x, r) * interest_revenue(r) - servicing_cost_proxy(x).
  • Trained the RL agent inside an Apache Pekko actor-based simulator where each in-flight application is an actor, then audited the learned policy with causal-learn PC discovery, pm4py token-based conformance replay, and black-box feature-sensitivity analysis.
  • Implemented distributed process mining with Apache Beam: per-case DFG construction for discovery and per-case token-based replay for conformance checking, parity-verified against single-machine pm4py on 193,849 events / 31,509 applications.
  • Orchestrated the training and audit as a Kubeflow pipeline on Kubernetes, with versioned artefacts and Mermaid-diagram exports so every finding is reproducible from a single run ID.

Outcome

The pipeline successfully ties the three fields together: process mining enriches confounder candidates, causal inference estimates the reward, and RL learns a policy that is then audited back against the same causal and process-mining tools. A concrete audit finding was that the trained policy converged to a nearly applicant-independent rate, showing near-zero sensitivity to CreditScore, NumberOfTerms, and process-state features despite their discovered causal paths to acceptance. The DML estimate itself proved sensitive to nuisance-model specification , linear nuisances gave a negative theta (-10.4), while random-forest nuisances gave positive estimates that trend toward zero with better fit , which may indicate the presence of unknown confounders causing a real limitation for a further study.

Results in detail

Figures are from the delivered engagement, normalised where data is confidential.

Causal graph over RL policy trajectories

PC algorithm with process-derived background knowledge, annotated with policy-sensitivity flags. Red marks a feature the policy relies on with no discovered causal path (spurious); yellow marks a feature the policy ignores despite having one. This is the real audit finding, not an illustration.

requested_amountCreditScoreNumberOfTermsoffer_positionelapsed_hours_since_case_startrateaccepted
  • Policy relies on a feature with no discovered causal path (spurious)
  • Policy ignores a feature that does have one
  • Undirected (orientation undetermined by PC)

Estimated rate effect on acceptance by nuisance model

EconML LinearDML theta (ATE) on the real BPIC17 offer table. Sign and magnitude depend on the nuisance-model class, a signature of weak overlap.

Nuisance-model fit (out-of-fold R²)

How well each nuisance model residualizes treatment (rate) and outcome (acceptance). RF improves residualization but leaves concentrated identifying variation.

Implied rate correlations with key confounders

Rate is mechanically entangled with OfferedAmount and NumberOfTerms via the amortization identity, creating severe overlap problems.