By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
A/B testing and canary deployments are controlled rollout strategies for ML models in production. Instead of replacing an old model with a new one instantly (risking performance drops or outages), you gradually expose users to the new model while monitoring key metrics (latency, accuracy, business KPIs). This is critical in ML pipelines where model behavior is probabilistic—even a "better" model in training may fail in production due to data drift, edge cases, or unintended biases.
Real-world scenario:A ride-hailing app wants to deploy a new dynamic pricing model (predicting surge pricing based on demand, weather, and traffic). Instead of rolling it out to all users at once, they canary-deploy the model to 5% of users in a single city, monitor ride acceptance rates and driver earnings, and compare against the baseline model. If metrics improve, they A/B test the model in 50% of another region before full deployment.
Vertex AI Model Deployment (Endpoints): GCP’s managed service for hosting ML models (TensorFlow, PyTorch, scikit-learn, custom containers). Supports traffic splitting for A/B testing and canary deployments. Best for low-latency, scalable inference.
Vertex AI Model Monitoring: Tracks prediction drift, feature skew, and latency in real time. Critical for detecting if a canary model is underperforming before full rollout.
Cloud Load Balancing (GCP): Distributes traffic between model versions (e.g., 90% to v1, 10% to v2). Works with Vertex AI Endpoints to route requests based on rules (e.g., user ID, geography).
Cloud Logging & Cloud Monitoring: Captures prediction logs, latency, and errors for both model versions. Used to compare performance during A/B tests.
BigQuery ML: Runs statistical significance tests (t-tests, chi-square) on A/B test results stored in BigQuery. Helps determine if observed differences are real or due to randomness.
Traffic Splitting (Vertex AI): Configures % of requests sent to each model version (e.g., 5% to canary, 95% to baseline). Adjustable in real time via API or console.
Shadow Mode (Dark Launch): Deploys a new model alongside the old one but discards its predictions (or logs them for comparison). Low-risk way to test model behavior without affecting users.
Multi-Armed Bandit (MAB): An adaptive A/B testing algorithm that dynamically shifts traffic to better-performing models (e.g., Vertex AI’s Optimization AI). Reduces regret (lost revenue) compared to fixed-split A/B tests.
Feature Store (Vertex AI Feature Store): Ensures consistent feature serving across model versions during A/B tests. Prevents skew from different preprocessing logic.
Dataflow (Apache Beam): Processes real-time prediction logs for A/B test analysis (e.g., aggregating conversion rates by model version).
Statistical Significance (p-value): In A/B testing, a p-value < 0.05 means the observed difference is likely real (not due to chance). BigQuery ML can compute this automatically.
Canary vs. A/B Testing:
sql -- Example: Compare conversion rates between v1 and v2 SELECT model_version, AVG(conversion_rate) as avg_conversion, COUNT(*) as sample_size FROM `project.dataset.prediction_logs` GROUP BY model_version
ML.TTEST
ML.CHI_SQUARE_TEST
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.