Lesson 5 of 5 Choosing Modeling Approaches

Balancing Model Performance Against Training Time and Cost

This lesson explains how to find the option that reaches the required performance at an acceptable cost and time, since better models usually cost more data, compute and tuning.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify where training cost and time come from.
  • Reduce cost with Spot training, early stopping and smarter tuning.
  • Define good enough from business value.

Where cost and time come from

Training cost is roughly the instance price multiplied by the number of instances and the training duration. Duration grows with the size of the data, the size of the model, the number of epochs and the number of hyperparameter tuning jobs. GPUs and distributed training shorten the duration but raise the hourly price, so whether they lower the total cost depends on how efficiently the workload uses them.

Accuracy improvements show diminishing returns: the last percentage points of accuracy often cost more training time and compute than all the earlier ones together. Managed Spot Training, which runs training jobs on spare capacity at a large discount with checkpointing, is a common way to reduce cost for jobs that can tolerate interruption.

Levers for traditional ML

Managed Spot training uses spare capacity at up to 90% off, with checkpoints to resume after interruptions. Early stopping ends training and tuning jobs that stop improving. Smaller tuning budgets with Bayesian search or Hyperband find good hyperparameters with fewer jobs. Sampling the data for early experiments, choosing simpler algorithms when they meet the target and right-sizing instances (CPU for XGBoost, GPU for deep learning) all reduce cost. Warm pools reduce start-up time for repeated jobs.

The following table summarises the levers.

LeverSavesWatch out for
Managed Spot trainingUp to 90% of compute costNeeds checkpointing; longer wall-clock time possible
Early stoppingWasted epochs and tuning jobsChoose patience carefully
Bayesian or Hyperband tuningNumber of tuning jobsFewer parallel jobs learn better
Data sampling for experimentsExperiment timeFinal model on full data
Simpler algorithmTraining and inference costMust still meet the metric
Distributed trainingWall-clock timeCosts more per hour; scaling efficiency
Sort into groups

What does the lever change?

Exam skills 2.1.6

Decide whether each change mainly reduces cost and time or mainly improves model quality.

Log in to try this activity Interactive activities are free with an account.

Defining good enough

Because accuracy improvements become progressively more expensive, the target metric and its business value should be agreed before optimising. If a 1% gain in recall, for example catching more fraud, saves more than the extra training and inference costs, it is worth pursuing; if not, the work should stop.

On the exam, when cost is the qualifier, the correct answer is usually the cheaper model or approach that meets the stated target with a margin, rather than the most accurate option.

The following diagram compares the training setup of a demand forecasting model before and after changes that halve its training cost.

Halving the demand model's training cost without losing accuracy. Weekly training moves to managed Spot with checkpoints in S3; the monthly 200-job random search becomes a 50-job Bayesian search with early stopping and warm start; and profiling shows 25% GPU utilisation, so the job moves to fewer, better-utilised instances.
The scenario is illustrative.
Scenario questions

Good enough

Exam skills 2.1.6

Decide when further model improvement is worth its cost.

Log in to try this activity Interactive activities are free with an account.
Worked example

Weekly retraining budget

A demand model retrains weekly on 8 ml.p3.2xlarge On-Demand instances for 6 hours, with a 200-job random-search tuning run each month. The team must cut cost by at least half without losing accuracy.

  • Switch weekly training to managed Spot with checkpoints in S3.
  • Replace 200-job random search with 50-job Bayesian search with early stopping and warm start from the previous tuning job.
  • Profile the job: GPU utilisation is 25%, so move to fewer, better-utilized instances.

Together these changes cut cost by well over half. Buying larger GPU instances would shorten the job but increase cost, so it does not meet the requirement.

Check yourself

Which tuning strategies need the fewest training jobs?

Show answer

Bayesian optimisation or Hyperband, with early stopping and warm start.

Exam Tips

Remember for the exam

  • Lower training cost: managed Spot training with checkpoints.
  • Fewer tuning jobs: Bayesian or Hyperband with early stopping and warm start.
  • Diminishing returns: stop when the target metric is met.
  • Right-size: CPU for tree models, GPU for deep learning.
  • Distributed training saves time, not necessarily money.