HomeHeroesModels⚙️ MLOpsQuantum⚙️ MLOps🧠 NPEAD

⚙️ MLOps — Model Lifecycle & Operations

How E-DICE models are trained, validated, deployed, and monitored in production.

📊 Current State — What We Have Today

CapabilityStatusImplementationGap
Model Registry✅ Livemodel_registry.py — versioned NPEAD states in DynamoDB + S3No UI, no approval gate
Automated Training✅ LiveNightly: GCN (800 epochs), FusionWeightLearner (500 epochs), Meta-Learning PolicyNo experiment comparison
Immediate Learning✅ Liveimmediate_learn.py — policy updates after every GPU batch jobNo validation before deploy
Outcome Tracking✅ LiveOutcome Memory (Phase 4) — every prediction vs actual result loggedNo drift detection
Audit Trail✅ Liveaudit_logger.py — all autonomous actions traced with decision reasonNot queryable (raw DDB)
CI/CD Containers✅ LiveGitHub Actions → ECR → Lambda/Batch auto-deploy on pushNo staging environment
Rollback⚠️ PartialModel registry supports version rollback; locked=true prevents regressionManual trigger only
Performance Monitoring⚠️ PartialNPEAD accuracy tracked (89.7%), FusionWeightLearner (86.8%)No alerts, no dashboard
Data Validation⚠️ PartialCortexQ validation (6 rules), FRSI rank guards, chemistry BLOCKED_SMARTSNo schema enforcement
Feature Store❌ MissingFeatures computed inline at training timeNo reuse, no versioning
Experiment Tracking❌ MissingStdout logs onlyNo MLflow/W&B/comparison
A/B Testing❌ MissingSingle model path, no shadow deploymentCan't compare model versions
Model Approval Gate❌ MissingNightly auto-deploys if accuracy improvesNo human sign-off
Data Drift Detection❌ Missing—Training distribution not monitored
Reproducibility❌ MissingNo seed pinning, no DVC, no pipeline DAGsCan't reproduce past training

🏗️ Architecture — Current Model Pipeline

┌─────────────────────────────────────────────────────────────────────┐
│                        NIGHTLY ORCHESTRATOR                         │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│  ┌──────────┐   ┌──────────────┐   ┌───────────────┐              │
│  │ Outcome  │──→│ Meta-Learning│──→│ NPEAD-DLE v6.1│              │
│  │ Memory   │   │ Policy       │   │ (action select)│              │
│  └──────────┘   └──────────────┘   └───────────────┘              │
│       ↑                                     │                       │
│       │         ┌──────────────┐            ↓                       │
│       │         │ FusionWeight │      ┌───────────┐                │
│       └─────────│ Learner      │      │ CortexQ   │                │
│                 └──────────────┘      │ Validation│                │
│                                       └───────────┘                │
│  ┌──────────┐   ┌──────────────┐                                   │
│  │ CIFOG GCN│   │ QGCN         │   ← Quantum escalation           │
│  │ (276node)│──→│ (SV1 refine) │                                   │
│  └──────────┘   └──────────────┘                                   │
│                                                                     │
│  ┌──────────────────────────────┐                                   │
│  │ Immediate Learn (per-batch)  │   ← Real-time weight updates     │
│  └──────────────────────────────┘                                   │
└─────────────────────────────────────────────────────────────────────┘
         │                    │                      │
         ↓                    ↓                      ↓
   cortex-heroes        edice-platform-state    cortex-brain-bus
   (193 targets)        (model weights)         (learning signals)

🎯 Models in Production

ModelTypeAccuracyTrainingSamplesLast Updated
NPEAD-DLE v6.1Evidence-directed action selector89.7%Continuous (immediate learn)837 outcomesNightly
CIFOG GCNGraph Convolutional Network—800 epochs nightly276 nodes, 3517 edgesNightly
FusionWeightLearnerLogistic regression (L2)86.8%500 epochs nightly106 heroesNightly
Meta-Learning PolicyPer-class weight optimizer—Nightly (outcome aggregation)51 outcomesNightly
CortexQ Gen v46-layer Transformer (GPT)100% validityOffline (40 epochs, 10K mols)3.2M paramsStatic
Cortex Master v73-layer FFN (53→128→64→32)—Offline53-dim inputStatic
QGCNGCN + QAOA quantum layer—Nightly (post-GCN)272 low-confidence nodesNightly

🗺️ Roadmap to Formal MLOps

Phase 1 — Observability (Week 1-2)

Can't improve what you can't measure.

1.1 Model Performance Dashboard
NPEAD accuracy over time FusionWeight accuracy trend GCN loss curve Prediction confidence distribution
Implementation: CloudWatch custom metrics + simple HTML dashboard reading from DDB
1.2 Automated Alerts
Alert if accuracy drops >2% Alert if nightly fails Alert if FRSI regresses Alert if GPU job fails silently
Implementation: SNS topic + CloudWatch alarms on platform-state metrics
1.3 Training Lineage
Log training data hash per run Log hyperparameters Log before/after weights S3 artifact per training run
Implementation: Extend nightly to write training manifest to S3 per run
Phase 2 — Governance (Week 3-4)

Human oversight before models go live.

2.1 Model Approval Gate
Nightly computes new weights → writes to model:candidate:{name} → waits for approval → only then promotes to model:active:{name}.
Auto-approve if: accuracy improves AND no regression on holdout set AND within 5% of previous weights.
2.2 Shadow Deployment
New model version runs in parallel (shadow mode) for 24h. Compare predictions against production model. Promote only if shadow ≥ production on key metrics.
2.3 Automated Rollback
If accuracy drops >3% within 24h of promotion → auto-rollback to previous version. Already have model_registry.py rollback mechanism — just needs trigger.
Phase 3 — Reproducibility (Week 5-6)

Any past training run can be exactly reproduced.

3.1 Feature Store
Versioned feature sets stored in S3. Training reads from feature store, not raw DDB. Features: molecular (7-dim), NPEAD (12-dim), enrichment (30-dim), brain signals (20-dim).
3.2 Training Pipeline DAG
Step Functions workflow: extract features → validate data → train → evaluate → compare → gate → deploy. Each step idempotent, retryable, logged.
3.3 Data Drift Detection
Compare feature distributions between training windows. Alert if KL-divergence > threshold on any dimension. Triggers retraining with expanded data.

📐 Metrics We Track Today

NPEAD accuracy: 89.7% FusionWeight accuracy: 86.8% Total outcomes: 837 Heroes: 193 GCN nodes: 276 GCN edges: 3517 Molecules: 2355 Capsules: 41 Repurposing: 221 QGCN escalated: 272

🔧 What Changes Today to Get There

Immediate (already in place):
Next sprint (Phase 1 — this week):
Critical gap to close:

🔄 Dev/Prod Environment

Same account (865950114883), isolated by prefix. CI auto-deploys to dev. Prod only on manual trigger.
ComponentDevProd
DynamoDB (8 tables)cortex-dev-*cortex-*
API Lambdacortex-dev-apicortex-api
Nightly Lambdacortex-dev-nightlycortex-intelligence-nightly
Schedule4am UTC3am UTC
Batch Job Defcortex-dev-docking-gpucortex-docking-gpu
Web (S3)cortex-dev-web-865950114883edicer-api-docs-865950114883
API Gateway/dev/ stage/prod/ stage
ECR Tags:dev:latest
# Setup (one-time):
AWS_PROFILE=edice-r python3 scripts/create_dev_env.py

# CI flow:
push → build → auto-deploy to dev → you validate → you say "deploy" → promote to prod

# Code reads:
STAGE=dev  → cortex-dev-heroes, cortex-dev-molecules, cortex-dev-repurposing
STAGE=prod → cortex-heroes, cortex-molecules, cortex-repurposing