Home Knowledge Base Weights & Biases (W&B)

Weights & Biases (W&B) is the developer-first MLOps platform for experiment tracking, hyperparameter optimization, and model management — providing real-time, interactive visualizations of training runs that sync to the cloud instantly, enabling ML researchers and engineers to collaborate, compare experiments, and identify what makes models perform better with a UI designed for the way researchers actually work.

What Is Weights & Biases?

Why W&B Matters for AI

W&B Core Components

Experiment Tracking (Runs): import wandb

wandb.init( project="llm-fine-tuning", name="llama-3-8b-lora-v3", config={ "model": "meta-llama/Llama-3-8B", "learning_rate": 2e-4, "lora_rank": 16, "batch_size": 8, "epochs": 3 } )

for epoch in range(config.epochs): train_loss = train_epoch() val_loss = evaluate()

wandb.log({ "train/loss": train_loss, "val/loss": val_loss, "train/epoch": epoch })

Log final model as artifact

wandb.log_artifact("model_checkpoint/", name="fine-tuned-llama", type="model") wandb.finish()

Auto-Logging (HuggingFace Integration): from transformers import TrainingArguments

training_args = TrainingArguments( output_dir="./output", report_to="wandb", # One flag enables W&B logging run_name="llama-experiment-v5" )

HuggingFace Trainer automatically logs all metrics to W&B

Sweeps (Hyperparameter Search): sweep_config = { "method": "bayes", # Bayesian optimization "metric": {"name": "val/loss", "goal": "minimize"}, "parameters": { "learning_rate": {"min": 1e-5, "max": 1e-3, "distribution": "log_uniform"}, "lora_rank": {"values": [8, 16, 32, 64]}, "batch_size": {"values": [4, 8, 16]} } }

sweep_id = wandb.sweep(sweep_config, project="llm-fine-tuning")

def train(): with wandb.init() as run: config = run.config model = train_with_config(config.learning_rate, config.lora_rank) val_loss = evaluate(model) wandb.log({"val/loss": val_loss})

wandb.agent(sweep_id, function=train, count=50) # Run 50 experiments

Artifacts (Data & Model Versioning):

Log dataset as versioned artifact

artifact = wandb.Artifact("training-dataset", type="dataset") artifact.add_dir("./data/") run.log_artifact(artifact)

Later: retrieve exact dataset version used for any run

artifact = run.use_artifact("training-dataset:v3") artifact.download()

W&B Tables:

W&B vs MLflow vs Neptune

FeatureW&BMLflowNeptune
UI QualityExcellentGoodGood
Sweeps/HPOBuilt-inExternalBasic
Self-hostingYes (paid)Yes (free)Yes (paid)
HF IntegrationExcellentGoodGood
CollaborationExcellentLimitedGood
Free TierGenerousN/A (self-host)Limited

Weights & Biases is the experiment tracking platform that turned ML research into a collaborative, visual, and reproducible practice — by providing live training visualizations, automated hyperparameter search, and one-click experiment sharing with a SDK that integrates in three lines of code, W&B became the standard tool for ML teams who want to work faster and understand their models more deeply.

weights biasesexperimentvisualize

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.