ladderlore
  • Type a service name, like S3 or IAM.

Concept · Builds on AIF-C01

Overfitting, underfitting and catastrophic forgetting

Read the training and validation curves, pick the matching fix, and protect a fine-tuned model from forgetting.

You know from AI Practitioner

  • Underfitting (high bias): poor on training data and on new data.
  • Overfitting (high variance): strong on training data, poor on new data.
  • Fixes: more data, early stopping, regularization, a simpler or bigger model.
Read the AI Practitioner lesson
  • Both losses high

    Diagnosis
    Underfitting
    Fix
    Bigger model, more features, train longer
  • Low training, high validation

    Diagnosis
    Overfitting
    Fix
    More data, regularize, stop early
  • Both losses low

    Diagnosis
    Good fit
    Fix
    Keep it
Read the curves, then pick the fix.
  • Data replay

    Mix some old or general data into the new data.

  • Low learning rate

    Small updates change the weights less.

  • PEFT adapters

    Train a small adapter. The base stays frozen.

  • Frozen layers

    Keep early layers fixed. Train the top only.

Four ways to limit forgetting.

What it is

Plot training loss and validation loss for each epoch. Both high and flat: underfitting, so the model is too simple or under-trained. Training loss keeps falling while validation loss rises or stalls: overfitting. Both low and close together: a good fit.

What it is

Fixes for overfitting: more or more varied training data (data augmentation), regularization (L1 shrinks some weights to zero, which also selects features, and L2 shrinks all weights), dropout (randomly switching off neurons during training), early stopping at the lowest validation loss, a smaller model, and fewer or better features. Fixes for underfitting: a larger or more complex model, more features, longer training and less regularization.

What it is

Catastrophic forgetting happens in fine-tuning: training on a new task overwrites weights, and the model loses skills it had. Reduce it with data replay (mix some original or general data into the new data), a low learning rate, parameter-efficient fine-tuning such as LoRA that keeps the base weights frozen, frozen early layers, and fewer epochs. Evaluate the tuned model on the old tasks too, not only the new one.

Remember

  • Training loss low and validation loss high: overfitting.
  • Both losses high: underfitting.
  • Overfitting fixes: more data, L1 or L2, dropout, early stopping, a smaller model.
  • Underfitting fixes: a bigger model, more features, longer training, less regularization.
  • L1 can zero out weights. L2 shrinks them.

Remember

  • Forgetting: data replay, low learning rate, PEFT, frozen layers. Test the old tasks too.

On the exam

  • “Training accuracy 99 percent, validation accuracy 70 percent” points to overfitting: add data, regularize or stop earlier.
  • “A fine-tuned model lost its general skills” points to catastrophic forgetting: data replay, LoRA or a lower learning rate.
  • “Both training and validation error are high” points to a larger model or more features.