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 / Hyperparameter
Training & optimization

Hyperparameter

A hyperparameter is a configuration variable set before training begins that controls the learning process, not a parameter learned from data. In local AI, operators encounter hyperparameters when fine-tuning models: learning rate, batch size, number of epochs, and LoRA rank. These values directly affect training speed, model quality, and VRAM usage. For example, a batch size too large can exceed GPU memory, while a learning rate too high may cause divergence. Hyperparameters are tuned empirically—operators run multiple training runs with different values to find what works for their dataset and hardware.

Deeper dive

Hyperparameters fall into two categories: model hyperparameters (e.g., number of layers, hidden size) and training hyperparameters (e.g., learning rate, batch size, optimizer choice). Model hyperparameters define the architecture and are fixed before training; changing them means using a different model. Training hyperparameters control the optimization loop. Key ones include: learning rate (step size for gradient updates), batch size (samples per forward/backward pass), epochs (full passes over the dataset), and weight decay (regularization). For LoRA fine-tuning, rank and alpha are additional hyperparameters that control the expressiveness of the adapter. Operators often use learning rate schedulers (e.g., cosine decay) to adjust the rate during training. Hyperparameter search methods like grid search or Bayesian optimization help find good values, but are computationally expensive on consumer hardware. A common heuristic: start with values from similar published fine-tunes, then adjust based on loss curves and VRAM usage.

Practical example

Fine-tuning Llama 3.1 8B with LoRA on an RTX 4090 (24 GB VRAM). A typical hyperparameter set: learning rate 2e-4, batch size 4 (due to VRAM limit), LoRA rank 16, alpha 32, 3 epochs. If batch size is set to 8, the runtime will throw an out-of-memory error. If learning rate is set to 1e-2, loss may spike and training fails to converge. Operators monitor loss and adjust these values between runs.

Workflow example

In Hugging Face Transformers, hyperparameters are passed to TrainingArguments: TrainingArguments(output_dir='./results', learning_rate=2e-4, per_device_train_batch_size=4, num_train_epochs=3). In llama.cpp's fine-tuning script, they are set via command-line flags: --learning-rate 2e-4 --batch-size 4 --epochs 3. Operators often log these in a config file or notebook cell, then iterate by changing one value at a time and comparing loss curves.

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 →