Safety & Alignment

Statistical Drift Detection

Preventing catastrophic forgetting and semantic drift during local fine-tuning cycles.

Why Drift Detection is Essential

When adapting a base model to a narrow domain, there is high risk of catastrophic forgetting—the model degrades in general reasoning or shifts too drastically in its token probabilities. MoroAI computes three mathematical drift metrics between the base model and adapted candidate:

  • Wasserstein Distance (Earth Mover's Distance): Measures the minimum work required to transform the output token probability distribution into the base distribution.
  • Jensen-Shannon Divergence (JSD): Symmetrical bound quantifying distribution divergence.
  • Maximum Mean Discrepancy (MMD): Measures distance between embedding representations in Reproducing Kernel Hilbert Space (RKHS).
# Certified safety gate requires Wasserstein drift < 0.05
moro eval drift --run-id run_01 --threshold 0.05