Dev48
Language
  • About
  • Services
  • Industries
  • Technologies
  • Articles
  • Contacts
Book a call
    Home/Articles/Ai validation in gxp how to keep models under control
Dev48
info@dev48.org+375 29 320-40-96WhatsApp@isky_by

© 2026 · All rights reserved.

AI Validation in GxP: How to Keep Models Under Control

Source: Artezio•November 29, 2026 at 03:50 PM

AI Validation in GxP: How to Keep Models Under Control

How to validate ML models under GxP: intended use, data lineage, locked models, drift monitoring and controlled retraining, mapped to GAMP 5 and Annex 22.

The European Commission, EMA and PIC/S released draft EU GMP Annex 22 for consultation in July 2025, the first GMP text written specifically for artificial intelligence, and it allows only locked models with deterministic output in critical GMP applications. For pharma teams running or planning ML in visual inspection, process control or quality review, the draft defines what AI validation in GxP has to prove: a precise intended use, traceable training data, independent test results, drift monitoring and controlled retraining.

The short answer

  • To validate an AI/ML model under GxP, define intended use and risk, prove it meets predefined acceptance criteria on an independent test set with full data lineage, and lock that version.
  • After go-live, monitor performance and data drift against documented thresholds, and treat every retraining as a controlled change.
  • The EU GMP Annex 22 draft allows only locked, deterministic models in critical GMP uses; adaptive models and LLMs belong in non-critical roles with a qualified human reviewing.

Key takeaways

  • Draft EU GMP Annex 22 (July 2025) allows only locked, deterministic models in critical GMP applications; continuously learning models and LLMs are limited to non-critical roles with a qualified human in the loop.
  • AI validation in GxP reuses the standard CSV set and adds five controls: precise intended use, traceable data lineage, a locked vs adaptive decision, drift monitoring and change-controlled retraining.
  • Training, validation and test datasets are GxP records under Part 11, Annex 11 and ALCOA+; labeling agreement is the most common weak spot.
  • Every retrain is a change. A pre-approved retraining protocol, modeled on FDA's December 2024 PCCP guidance, makes routine retrains faster without losing control.
  • The EU AI Act runs in parallel to GxP; many manufacturing models fall under GMP but not under AI Act high-risk categories.

How do you approach AI validation in GxP?

You validate an ML model the way you validate any computerized system: risk-based, documented and tied to a defined use. What changes is where the logic lives. In conventional software it sits in code a reviewer can read. In a model it sits in the training data, so the data becomes part of the validated system.

That breaks three assumptions behind classic CSV. Data defines behavior: identical code trained on different datasets produces different systems. Outputs are probabilistic, so validation covers error rates instead of one pass/fail answer per script.

And performance decays. A model validated on last year’s vials can degrade when a supplier changes glass or maintenance swaps a camera, with no software change at all.

So keep the URS, risk assessment, IQ/OQ/PQ and traceability matrix, and add five AI-specific controls:

  • Precise intended use and risk. Name the decision the model supports and how much that decision depends on the output.
  • Traceable data lineage. Treat training, validation and test datasets as GxP records.
  • A deliberate locked vs adaptive decision. Test against predefined criteria on an independent set, then lock the validated version.
  • Drift monitoring. Track performance and input drift against thresholds set before go-live.
  • Change-controlled retraining. Every retrain goes through standard change control or a pre-approved protocol.

Validate the whole system, not just the algorithm. The data pipeline, user interface, human reviewer, MES or LIMS integration and audit trail are all in scope. A model with a 99% F1 score is useless if the upstream image feed silently drops frames.

Which guidance applies: GAMP 5, FDA and Annex 22

GAMP 5 Second Edition, published by ISPE in July 2022, added Appendix D11 on AI/ML. It places an ML sub-system lifecycle (concept, project, operation) inside the overall computerized system lifecycle, so the model gets its own controls without a parallel quality system. ISPE followed in 2025 with a dedicated GAMP Guide: Artificial Intelligence.

On the FDA side, three documents matter:

  • Computer Software Assurance (CSA). The guidance for production and quality system software, finalized in September 2025, calls for risk-based assurance. High-risk functions get scripted testing; low-risk ones can rely on unscripted or ad hoc testing. For AI, effort shifts to data quality and performance evidence instead of screenshots of login screens.
  • AI credibility framework. A January 2025 draft guidance on AI supporting regulatory decisions for drugs and biologics proposes a 7-step credibility assessment. Risk combines model influence and decision consequence, assessed for a defined context of use.
  • Good Machine Learning Practice. Ten principles from FDA, Health Canada and the UK MHRA (October 2021), including independent training and test sets, representative data, human-AI team performance and monitoring of deployed models.

The EMA adopted a reflection paper on AI in the medicinal product lifecycle in September 2024; it expects early regulator contact for high-impact uses. ICH Q9(R1) and ICH Q10 sit underneath all of it.

Annex 22 is the most specific text. It covers static models with deterministic output in critical GMP applications and states that continuously learning models and generative AI/LLMs should not be used there. They may run in non-critical applications with a qualified human in the loop. The draft also expects:

  • Intended use defined with process subject matter experts, including the input sample space and subgroups
  • Acceptance criteria at least as good as the process the model replaces
  • Test data independent of training data, with access controls that prove the separation
  • Representative, accurately labeled test data
  • Explainability (for example, feature attribution) and confidence scores
  • Operational monitoring of performance and input drift, plus change control

The consultation closed in October 2025. Check whether a final text has been adopted before you finalize SOPs, because wording can shift between draft and final.

How do you define intended use, risk and data lineage?

Write an intended use precise enough that a tester could reject the model against it. “Detect defects in vials” fails. A usable version names the product and container format, defect classes (cracks, particulates, cosmetic scratches), camera and lighting setup, line speed, the decision the output drives (reject, divert to manual inspection, flag) and who reviews it.

Then score risk on the two FDA axes. Model influence: is the output the sole basis for the decision, or one input a qualified person weighs? Decision consequence: does a wrong output release a defective unit to patients, or raise a nuisance alert?

Human review is your main lever for lowering influence, but only if the reviewer has the time, training and information to disagree. Track override rates; a reviewer who accepts every suggestion is not an effective control.

For lineage, 21 CFR Part 11 and EU GMP Annex 11 apply to training sets, model artifacts, audit trails and inference outputs used in GxP decisions. ALCOA+ applies to all of them, per the MHRA GXP Data Integrity Guidance and PIC/S PI 041. A lineage record should capture:

  • Source systems and extraction queries
  • Dataset version and cryptographic hash
  • Inclusion and exclusion criteria
  • Labeling procedure, labelers and inter-rater agreement
  • Preprocessing code version, split method and random seeds
  • Known gaps, such as a product strength with few examples

DVC or MLflow handle hashing and versioning, and model cards give the documentation a standard shape. No regulator endorses specific tools, so qualify them for their use. The usual weak spot is labeling: if three inspectors disagree on what counts as a particulate, your metrics overstate quality. Measure agreement before you train.

Locked vs adaptive models: what can you defend?

A locked model always maps the same input to the same output and changes only through a controlled release. An adaptive model updates its parameters in operation, which turns the validated state into a moving target.

For critical GMP decisions today, the defensible default is a locked model with human oversight. Scheduled retraining that releases new locked versions captures most of the benefit of adaptation.

Locked still needs reproducibility work. GPU nondeterminism, library updates and unpinned seeds can shift outputs. Containerize inference, pin versions, hash the artifact and keep a registry with approved, active and retired states. Here AI integration and MLOps for production models becomes a validation asset rather than plumbing.

Set acceptance criteria before anyone sees test results. For an inspection classifier, that might be a false-negative rate for critical defects at or below the current manual rate, with a confidence interval, plus a specificity floor that keeps false rejects tolerable. Report sensitivity, specificity, F1 and calibration per class and subgroup: a model can score 98% overall and miss half of a rare critical defect class.

Keep the test set out of training and hyperparameter tuning, and restrict access so you can prove it. Cover every product, line, shift and camera in scope. SHAP or Grad-CAM show reviewers whether the model looks at the right features; they do not replace performance against criteria.

How do you monitor model drift in a validated system?

Monitor inputs and outcomes against thresholds defined during validation, and route alerts into your deviation or CAPA process.

Many practitioners treat a Population Stability Index above roughly 0.1 as worth watching and above 0.25 as a significant shift, though cutoffs vary by author and none are regulatory. Derive and justify your own thresholds from your validation data.

Concept drift needs ground truth, so budget for a periodic labeled sample, such as manual re-inspection of a fixed number of units per batch. Evidently AI, WhyLabs, Arize or Fiddler compute the statistics. The GxP part is the documented threshold, the alert route and a periodic review signed by a QA owner.

Does retraining an ML model require revalidation?

Yes. New data produces a new model, even when code and architecture stay identical. The real questions are how much revalidation each change needs and whether you can pre-approve it.

Full change control for every retrain is slow but easy to defend, and continuous learning is ruled out for critical uses. The middle path is a pre-approved retraining protocol that fixes data rules, procedure, acceptance criteria and release steps in advance. A retrain that meets it releases through a lighter, documented change.

The template comes from devices. FDA’s December 2024 final guidance on Predetermined Change Control Plans (PCCP) for AI-enabled device software defines three parts: a description of modifications, a modification protocol and an impact assessment. FDA has not extended PCCP to GMP software, so treat it as a model. ICH Q12 change management protocols are the closer pharma analogue.

Vendor models follow the same rule, and accountability stays with you. A “validated AI” claim does not transfer validation. GAMP 5 and Annex 11 expect a supplier assessment, a quality agreement and access to the model card, training data description, test results and update process. Foundation models rarely disclose training data, so lean on your own acceptance tests and require contractual notice before updates. If a vendor can push a new version silently, you do not have a locked model.

Can LLMs be used in GxP, and where does the EU AI Act fit?

LLMs fit non-critical roles where a qualified human reviews every output. They are non-deterministic and can produce fluent, wrong text, which is why Annex 22 keeps them out of critical decisions.

Reasonable GMP uses include drafting deviation summaries, triaging CAPA records, first-pass flags in batch record review and SOP search. The model proposes; a trained person decides and signs. Controls that hold up: pinned model versions and prompts under configuration management, logged inputs and outputs, retrieval limited to approved documents, and sampling-based quality checks.

Hosting matters too. A private LLM deployment for regulated industries keeps GxP data and prompts inside your validated boundary. For access, logging and abuse controls, see our notes on practical governance and security for AI features.

The EU AI Act is a separate obligation; meeting it does not satisfy GxP, or vice versa. Regulation (EU) 2024/1689 entered into force on 1 August 2024. Most high-risk obligations were scheduled for August 2026, and those for AI embedded in Annex I products such as MDR and IVDR devices for August 2027. The Commission’s 2025 Digital Omnibus proposal sought to delay some deadlines, so confirm current dates with counsel.

A vial inspection model or PAT soft sensor may fall outside AI Act high-risk categories while sitting squarely inside GMP. AI in a medical device can trigger both MDR and the AI Act. Keep device rules (PCCP, MDR, IEC 62304, ISO 14971) apart from GMP rules: the concepts overlap, the legal frameworks do not. ISO/IEC 42001 and ISO/IEC 23894 can anchor one AI management system that maps to both.

FAQ

Does GAMP 5 cover machine learning?

Yes. GAMP 5 Second Edition (ISPE, July 2022) added Appendix D11, which places an ML sub-system lifecycle inside the computerized system lifecycle. ISPE published a dedicated GAMP Guide: Artificial Intelligence in 2025.

Is EU GMP Annex 22 final?

It was published as a draft in July 2025, and the consultation closed in October 2025. Check whether a final text has been adopted before finalizing SOPs, since wording can change between draft and final.

Can a continuously learning model be used in a GMP-critical process?

Not under the Annex 22 draft. The practical alternative is scheduled retraining that releases new locked versions through change control or a pre-approved protocol.

What drift thresholds should a validated model use?

There are no regulatory values. Practitioners often watch PSI above about 0.1 and treat 0.25 as significant, but you should derive and justify thresholds from your own validation data.

Who is responsible for validating a vendor's AI model?

The regulated company. Supplier assessment, a quality agreement, access to test evidence and contractual notice of model updates are expected, and your own acceptance testing still applies.

Artezio builds compliance-ready ML systems for Pharma and Health Tech, with lineage, model registries and monitoring designed in from the first sprint. If you are scoping a GxP AI project, our AI integration and MLOps team can help you design it to pass validation.

← All articles

What this article says

More in Software Development

All →
Last minute Cyber Monday tactics: How to use Composer to build on what worked for Black Friday
Klaviyo

Last minute Cyber Monday tactics: How to use Composer to build on what worked for Black Friday

Teachable’s 2025 Rewind: A new era for online education
Teachable

Teachable’s 2025 Rewind: A new era for online education

Why you should be batching content in the new year
Teachable

Why you should be batching content in the new year

What is a customer education program and does your business need one?
Teachable

What is a customer education program and does your business need one?

What is microlearning? And how can you leverage it for student attention?
Teachable

What is microlearning? And how can you leverage it for student attention?

How to build a personal brand in 5 steps
Teachable

How to build a personal brand in 5 steps

More from Artezio

ALCOA+ Data Integrity by Design for Pharma Software
Artezio

ALCOA+ Data Integrity by Design for Pharma Software

21 CFR Part 11 Compliance Checklist for Custom Software Teams
Artezio

21 CFR Part 11 Compliance Checklist for Custom Software Teams

Computer Software Assurance vs CSV: Cut Here, Script There
Artezio

Computer Software Assurance vs CSV: Cut Here, Script There

Open-Weight vs Frontier Models: Fireworks' Pitch and Its Breaches
Artezio

Open-Weight vs Frontier Models: Fireworks' Pitch and Its Breaches

GxP Software Development: Ship Fast, Stay Validated
Artezio

GxP Software Development: Ship Fast, Stay Validated

How Much Does Custom Software Development Cost in 2025? Real Numbers & Breakdown
Artezio

How Much Does Custom Software Development Cost in 2025? Real Numbers & Breakdown