Designing ALM for Custom AI Models
This lesson explains how to manage data, training, evaluation, deployment and retraining of custom models.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the stages of the model lifecycle.
- Explain the elements of model ALM.
- Explain how base model retirement affects fine-tuned models.
The model lifecycle
A custom model's lifecycle has stages that conventional software does not. Data is collected and versioned; a training job produces a model version; the version is evaluated against validation criteria; an approved version is registered and deployed; its performance is monitored in production; and when performance degrades or the data changes, the model is retrained and the cycle repeats. Each stage produces an artifact that must be versioned and traceable to the others: a model version should record the data set version, training configuration, base model and evaluation results that produced it.
Designing the process
The ALM design for custom models, sometimes called MLOps for machine learning models or LLMOps for language models, includes the following elements.
- Versioned data sets with lineage, including held-out test sets that are never used for training.
- Reproducible training: training jobs defined as code or recorded configuration, so that a model can be rebuilt.
- A model registry or equivalent record of model versions, their evaluation results and their approval status.
- Evaluation gates: a model is deployed only if it meets the validation criteria and outperforms the current production model or baseline.
- Staged deployment: deploy to test, then production, possibly with a gradual shift of traffic, and keep the previous version available for rollback.
- Monitoring and retraining triggers: drift in input data, falling accuracy or a new base model version starts a retraining cycle.
Fine-tuned models and base model changes
Fine-tuned models in Foundry have a particular dependency: they are tuned from a specific base model version. When that base model version is scheduled for retirement, or a better base model appears, the organization must decide whether to fine-tune again on the new base model, using the same versioned data, and must re-evaluate before switching. The following table summarizes decisions that the ALM process should make explicit.
| Event | ALM response |
|---|---|
| Accuracy falls in production monitoring | Investigate data drift; retrain on recent labelled data; evaluate; deploy if better |
| The base model version is scheduled to retire | Fine-tune the replacement base model with the versioned data; evaluate; switch before retirement |
| New labelled data accumulates | Retrain on a schedule; compare with the production model |
| A regulator requests evidence for a decision | Trace the model version to its data set and evaluation results |
Managing a fine-tuned classifier
A logistics company fine-tuned a model six months ago to classify customs documents. The base model version it was tuned from is scheduled for retirement in four months, and accuracy has drifted from 94 percent to 89 percent because new document types appeared. The training data used originally was not kept. What should you recommend?
The immediate problem is that the model cannot be reproduced, because the training data was not versioned. The company should rebuild a labelled data set that includes the new document types, store it with lineage, and fine-tune a current base model version, evaluating it on a held-out test set against the validation criteria and the current model. The new version is deployed to test, then production, with the old deployment kept for rollback until the new one is proven, all before the retirement date. The ALM process should then version every data set and record the base model version of each fine-tuned model.
Why must training data sets be versioned?
Show answer
Without them, a model cannot be reproduced, retrained on a new base model or traced for audit.
Exam Tips
Remember for the exam
- Version data sets, training configuration, model versions and evaluation results with lineage.
- Deploy only models that pass evaluation gates and beat the current model or baseline.
- Monitor drift and retrain; keep the previous version for rollback.
- Plan re-tuning before a fine-tuned model's base model version retires.