ladderlore
  • 输入服务名称,例如 S3 或 IAM。

概念 · 基于 AIF-C01

Epochs, steps, batch size and learning rate

How epoch, step, batch size, learning rate and optimizer shape convergence.

本课尚未翻译,暂以英文显示。

你在AI Practitioner中已学过

  • Learning rate: the size of each step. Batch size: examples per step. Epoch: one pass over the data.
  • Hyperparameters are set before training. Weights are learned.
  • Wrong values lead to overfitting or underfitting.
阅读AI Practitioner课程
  • Epoch

    Meaning
    One pass over all data
    Example
    10,000 examples seen once
  • Step

    Meaning
    One batch, one update
    Example
    100 steps at batch size 100
  • Batch size

    Meaning
    Examples per step
    Example
    32 or 256
  • Learning rate

    Meaning
    Size of each update
    Example
    0.001
  • Warm-up and decay

    Meaning
    Ramp up, then lower the rate
    Example
    Start small, end small
  • Optimizer

    Meaning
    How gradients become updates
    Example
    Adam, SGD
Terms with small numbers.

1 / 2

  • Epoch

    Meaning
    One pass over all data
    Example
    10,000 examples seen once
  • Step

    Meaning
    One batch, one update
    Example
    100 steps at batch size 100
  • Batch size

    Meaning
    Examples per step
    Example
    32 or 256

2 / 2

  • Learning rate

    Meaning
    Size of each update
    Example
    0.001
  • Warm-up and decay

    Meaning
    Ramp up, then lower the rate
    Example
    Start small, end small
  • Optimizer

    Meaning
    How gradients become updates
    Example
    Adam, SGD
Terms with small numbers.
  • Learning rate

    Too high
    Loss bounces or diverges
    Too low
    Slow or stuck
  • Batch size

    Too high
    Out of memory, weaker generalization
    Too low
    Noisy and slow epochs
  • Epochs

    Too high
    Overfits
    Too low
    Underfits
What goes wrong at each extreme.

是什么

One step (or iteration) processes one batch and updates the weights once. One epoch is a full pass over the training data. With 10,000 examples and a batch size of 100, an epoch has 100 steps. Training length is set in epochs or in a total number of steps. Fine-tuning of large language models is often set in steps.

Batch size trades speed, memory and quality. A bigger batch uses the GPU better and gives a steadier gradient, but needs more memory and can generalize worse. A smaller batch is noisier, which acts as light regularization, but each epoch takes longer. If you raise the batch size, raise the learning rate roughly along with it.

是什么

The learning rate sets how big each update is. Too high: the loss bounces or diverges. Too low: training crawls or stalls. Warm-up starts with a tiny rate and ramps up, which keeps early steps stable, and it matters for transformers. Decay lowers the rate over time, so the model settles near a good point. The optimizer, such as SGD, Adam or AdamW, decides how gradients turn into updates. Adam adapts the rate for each weight and is a common default.

是什么

For FM fine-tuning use a small learning rate and a few epochs, so you adapt the model without overwriting what it knows. Too many epochs on a small data set overfit. In Amazon Bedrock customization you set epochs, batch size and learning rate (and warm-up steps) for the job.

要记住

  • Step: one batch and one update. Epoch: one pass over the data.
  • Steps per epoch: examples divided by batch size.
  • A bigger batch: faster epochs and more memory, and it may generalize worse.
  • A learning rate too high diverges. Too low is slow.
  • Warm-up ramps the rate up. Decay lowers it.

要记住

  • FM fine-tuning: a low learning rate and a few epochs.

考试中

  • “The loss jumps up and down and never settles” points to a learning rate that is too high.
  • “Each epoch takes too long and GPU memory is free” points to a larger batch size.
  • “A fine-tuned FM overfits a small data set” points to fewer epochs or a lower learning rate.