CI PyPI License GitHub
Open-source model validation library

AI Model Risk Validator

Inference Collapse in AI ModelsTheory, Evaluation, and Fail-Safe Design for Financial Systems.

$pip install mrv-lib Quick start Read the methodology
What it is

A model validation library

Runs specification-invariance validators that test whether a model's regime labels survive an equivalent change of inputs.

How it works

Refit, compare, gate

Refit under equivalent inputs, measure agreement, and gate the model when it disagrees with itself.

Why it is required

Model risk regulation

OCC 2026-13, Basel, and the EU AI Act require evidence a model is sound. This produces it.

Methodology

Inference Collapse in AI Models

Theory, Evaluation, and Fail-Safe Design for Financial Systems. Two published results, each shipped as a validator.

Paper 1 · validate_repPublished

Regime labels are not representation-invariant

Kai Zheng, Rand Low, Ruili Wang · Finance Research Letters (2026) · DOI 10.1016/j.frl.2026.110383

Swap economically equivalent risk features and the regime labels change: cross-representation ARI 0.34 to 0.43, below the 0.65 threshold.

Paper 2 · validate_resAccepted

Regime labels are not resolution-invariant

Kai Zheng, Rand Low, Ruili Wang · Finance Research Letters (accepted) · SSRN 10.2139/ssrn.6531002

Regime labels disagree across data frequencies (5m / 1h / 1d).

Examples

From install to a signed report in three commands.

Run from the CLI, or drive the pipeline from Python. Both produce the same verdict and PDF.

CLI
# install
pip install mrv-lib

# download data, then validate + report
mrv download config.yaml
mrv run config.yaml rep      # representation
mrv run config.yaml res      # resolution
mrv report                   # regenerate PDF
Python
from mrv.pipeline import run, download, validate_rep, report
from mrv.utils.config import load

download("config.yaml")
run("config.yaml", "rep")    # validate + PDF report

# or call a validator directly
cfg = load("config.yaml")
verdict = validate_rep(labels=labels, cfg=cfg)
report(verdict["json_path"], cfg=cfg)
Each run returns a plain dict (verdict, ari, spearman, json_path) and a PDF report. Interactive notebook (no market-data account needed).
Regulations

The mandates that require model validation.

Every major supervisor requires evidence that a model is sound under equivalent inputs. mrv-lib produces it. It supports these obligations; it does not certify compliance.

JurisdictionRegulationRequirementSource
🇺🇸 USOCC Bulletin 2026-13 (SR 26-2)Model risk management; supersedes SR 11-7occ.gov
🌐 IntlBasel FRTB (BCBS d457)Robustness of internal market-risk modelsbis.org
🇪🇺 EUEU AI Act, Art 15Accuracy and robustness of high-risk AIeur-lex.europa.eu
🇬🇧 UKPRA SS1/23Model risk management principles for banksbankofengland.co.uk
🇺🇸 USNIST AI RMF 1.0MEASURE function for AI risknist.gov
🇳🇦 NZRBNZ BS2AModel validation independence, monitoringrbnz.govt.nz
🇸🇬 SGMAS AI MRM GuidelinesAI model risk management for FIsmas.gov.sg
🇦🇺 AUAPRA CPS 220Risk management, model oversightapra.gov.au
mrv-lib provides a quantitative diagnostic that makes the judgements in these standards more defensible and auditable. It does not certify that a model meets any requirement, replace a qualified validator, or provide a legal opinion.
Roadmap

From invariance tests to a governance layer.

Released capability tracks published research; what comes next is a direction, not a promise. Current release v0.6.1.

now

Invariance validators Released

Representation (validate_rep) and resolution (validate_res) tests. Papers 1 and 2.

next

Fail-safe governance Direction

Turn the two-layer invariance verdict into a gate that flags or suspends a model before an unstable regime label drives a live decision.