RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Glossary / Training & optimization / Epoch
Training & optimization

Epoch

An epoch is one complete pass through the entire training dataset during model training. In practice, operators fine-tuning a model (e.g., with Hugging Face Transformers or Unsloth) set the number of epochs to control how many times the model sees every example. More epochs can improve performance but risk overfitting. Training for 1–3 epochs is common for fine-tuning small models on consumer hardware; each epoch takes minutes to hours depending on dataset size, batch size, and GPU VRAM.

Deeper dive

During training, the model updates its weights after processing each batch of data. An epoch ends when all training examples have been processed once. The number of epochs is a hyperparameter that balances underfitting (too few epochs) and overfitting (too many). Early stopping—halting training when validation loss stops improving—is often used instead of a fixed epoch count. For fine-tuning large language models on consumer GPUs, operators typically use 1–3 epochs because the dataset is small (e.g., thousands of examples) and the model is already pretrained. Training for more epochs on a small dataset can cause catastrophic forgetting, where the model loses general knowledge.

Practical example

Fine-tuning Llama 3.1 8B on a custom dataset of 5,000 examples with a batch size of 4 on an RTX 4090 (24 GB VRAM) might take ~2 hours per epoch. Setting num_train_epochs=3 in the training script means the model sees each example three times. If validation loss increases after epoch 2, the operator would stop early to avoid overfitting.

Workflow example

In Hugging Face Transformers, you set TrainingArguments(num_train_epochs=3). In Unsloth's notebook, you configure max_steps=-1 and num_train_epochs=2. In llama.cpp's training tool (if used), you specify --epochs 2. The training loop logs progress per step and per epoch; operators watch the loss curve to decide if more epochs help.

Reviewed by Fredoline Eruo. See our editorial policy.

Buyer guides
  • Best GPU for local AI →
  • Best laptop for local AI →
  • Best Mac for local AI →
When it doesn't work
  • CUDA out of memory →
  • Ollama running slowly →
  • ROCm not detected →