Skip to main content

Description

DVC params commands help you track and compare parameters (hyperparameters, configuration values) across different experiments and commits. Parameters are typically stored in YAML, JSON, TOML, or Python files and define model training configurations.

Subcommands

params diff

Show changes in params between commits in the DVC repository, or between a commit and the workspace.
dvc params diff

Arguments

a_rev
string
default:"HEAD"
Old Git commit to compare (defaults to HEAD).
b_rev
string
default:"workspace"
New Git commit to compare (defaults to the current workspace).

Options

--targets
list
Specific params file(s) to compare (even if not found as params in dvc.yaml). Shows all tracked params by default.
--all
flag
Show unchanged params as well.
--deps
flag
Show only params that are stage dependencies.
--json
flag
Show output in JSON format.
--md
flag
Show tabulated output in the Markdown format (GFM).
--no-path
flag
Don’t show params path.

Examples

Basic Parameter Comparison

$ dvc params diff
Path         Param              HEAD     workspace
params.yaml  model.learning_rate  0.001   0.01
params.yaml  model.batch_size     32      64
params.yaml  model.epochs         100     150

Compare Specific Files

$ dvc params diff --targets params.yaml config/train.yaml
This compares only the specified parameter files.

Show Only Changed Parameters (Default)

$ dvc params diff HEAD~3 HEAD
Shows parameters that changed in the last 3 commits.

Include Unchanged Parameters

$ dvc params diff --all
Path         Param                HEAD     workspace  
params.yaml  model.learning_rate  0.001    0.01       (changed)
params.yaml  model.batch_size     32       32         
params.yaml  model.epochs         100      150        (changed)

JSON Output for Automation

$ dvc params diff --json
{
  "params.yaml": {
    "model.learning_rate": {
      "old": 0.001,
      "new": 0.01,
      "diff": 0.009
    },
    "model.epochs": {
      "old": 100,
      "new": 150,
      "diff": 50
    }
  }
}
Use --json output with tools like jq for automated parameter validation in CI/CD pipelines.

Show Only Stage Dependencies

$ dvc params diff --deps
Filters to show only parameters that are declared as dependencies in pipeline stages.
The --deps flag is useful when you have many parameters but only want to see those that affect pipeline execution.

Parameter File Formats

DVC supports multiple parameter file formats:
params.yaml
model:
  learning_rate: 0.001
  batch_size: 32
  epochs: 100

preprocessing:
  normalize: true
  augmentation: false
params.json
{
  "model": {
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 100
  }
}
params.toml
[model]
learning_rate = 0.001
batch_size = 32
epochs = 100
params.py
LEARNING_RATE = 0.001
BATCH_SIZE = 32
EPOCHS = 100

Use Cases

Hyperparameter Tracking

Track how hyperparameters change across experiments and their impact on metrics.

Experiment Comparison

Compare parameter configurations between different experiment runs.

Reproducibility

Ensure exact parameter values are recorded for reproducing results.

Configuration Management

Manage different configurations for development, staging, and production.
Parameters must be tracked in dvc.yaml or passed explicitly via --targets to be compared.
  • dvc metrics - Compare metrics across experiments
  • dvc plots - Visualize how parameters affect outcomes
  • dvc exp show - Show both params and metrics together

Build docs developers (and LLMs) love