Inferensys

Glossary

Run ID (Experiment ID)

A Run ID (or Experiment ID) is a unique identifier assigned to a single execution of a machine learning training or evaluation script, used to log and retrieve all associated metadata, parameters, and results.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
EXPERIMENT TRACKING

What is Run ID (Experiment ID)?

A Run ID (or Experiment ID) is the fundamental unit of record in machine learning experiment tracking, serving as a unique key to retrieve all data associated with a single training or evaluation execution.

A Run ID (Experiment ID) is a unique, immutable identifier assigned to a single execution of a machine learning training or evaluation script. It acts as a primary key within an experiment tracking system, enabling the precise logging, versioning, and later retrieval of all associated metadata. This includes hyperparameters, evaluation metrics, code state, output artifacts, and environment snapshots, forming a complete audit trail for reproducibility and analysis.

The Run ID is the cornerstone of systematic model development, allowing engineers to compare different hyperparameter tuning trials via a run comparison dashboard. By querying a tracking server with a specific Run ID, teams can perfectly recreate any past experiment's conditions, debug failures, and promote the best-performing model configuration from the model registry to production with full lineage tracking.

EXPERIMENT TRACKING

Core Characteristics of a Run ID

A Run ID (Experiment ID) is the atomic unit of machine learning experimentation. These characteristics define its role as the primary key for reproducibility and analysis.

01

Unique Identifier

A Run ID is a globally unique identifier (UUID) assigned to a single execution of a training or evaluation script. This uniqueness is fundamental, ensuring every experiment—even with identical parameters—can be distinguished, retrieved, and compared.

  • Primary Key Function: Acts as the immutable reference for all associated data in a tracking system.
  • Format: Often a string hash (e.g., run_abc123def456) or a sequential number, but must be unique within the project scope.
  • Prevents Ambiguity: Critical for collaborative environments where multiple engineers may run similar experiments concurrently.
02

Immutable Logging Anchor

The Run ID serves as an immutable anchor point to which all experiment metadata is permanently attached. Once created, the ID itself does not change, even if the run's associated data (like final metrics) is updated.

  • Centralized Reference: All logged data—hyperparameters, metrics, artifacts (model files, visualizations), and code state—is indexed by this ID.
  • Audit Trail: Enables precise historical querying (e.g., "show me all data for run xyz789").
  • Lineage Foundation: The first step in establishing full data provenance and model lineage, tracing from raw data to final prediction.
03

Metadata Aggregation Point

A Run ID aggregates diverse, time-series, and static metadata into a single, queryable entity. This consolidation is what transforms a script execution into an analyzable experiment.

Core Metadata Categories:

  • Parameters: Hyperparameters, configuration flags, and environment variables.
  • Metrics: Evaluation scores (accuracy, loss, F1) logged at each epoch or step.
  • System Metrics: GPU/CPU utilization, memory usage, and runtime duration.
  • Artifact References: Pointers to saved model checkpoints, dataset versions, and logs.
  • Contextual Data: Git commit hash, user, timestamp, and custom tags.
04

Reproducibility Enabler

The primary engineering value of a Run ID is enabling experimental reproducibility. By linking code, data, and environment state, it allows any team member to precisely recreate the conditions of a past run.

  • Snapshot Reference: The ID points to a complete snapshot, including the environment (library versions), data version (e.g., dataset hash), and code version (Git commit).
  • Facilitates Debugging: Engineers can re-run a failed or interesting experiment (run_id=abc123) with exact parameters to diagnose issues.
  • Audit Compliance: Provides a verifiable record for regulatory or internal governance requirements, proving how a model was built.
05

Comparison & Analysis Unit

In experiment tracking systems, the Run ID is the fundamental unit for comparative analysis. Tools use IDs to fetch and contrast runs, powering dashboards and visualizations that guide model selection.

  • Run Comparison: Analysts select multiple Run IDs to compare their metrics and parameters side-by-side in a table or parallel coordinates plot.
  • Hyperparameter Tuning: Each trial in a hyperparameter sweep (e.g., using Optuna or Ray Tune) generates a unique Run ID, allowing the optimization algorithm to track performance across the search space.
  • Model Selection: The best-performing Run ID, as determined by an objective function like validation accuracy, is typically promoted to a model registry.
06

Integration with MLOps Pipelines

A Run ID is not isolated; it integrates into broader MLOps pipelines and lifecycle stages, acting as a handoff token between development and production systems.

  • Pipeline Runs: In a multi-step pipeline run, each step may have its own sub-run ID, all linked to a parent execution ID for full lineage.
  • Model Registry Promotion: A Run ID associated with a trained model file can be registered, versioned, and transitioned through stages (Staging → Production).
  • Deployment & Monitoring: The ID can tag a model in production, linking its predictions back to the exact experiment that created it for drift detection and performance monitoring.
EXPERIMENT TRACKING

How Run IDs Work in Practice

A Run ID (or Experiment ID) is the unique identifier for a single machine learning training or evaluation execution. This section details its practical role in logging, retrieval, and analysis.

In practice, a Run ID is generated at the start of an experiment and acts as a primary key for all associated data. Every logged hyperparameter, metric, artifact (like model checkpoints), and code snapshot is tagged with this immutable identifier. This creates a centralized, queryable record for that specific execution, enabling precise retrieval and comparison. The ID is typically a hash or a timestamp-based UUID, ensuring global uniqueness across a project or team.

The Run ID enables core experiment tracking workflows. Engineers use it to compare runs via a dashboard, reproduce results by fetching the exact code and parameters, and promote a specific model version to a model registry. It forms the foundational link for lineage tracking, connecting a model's predictions back to the training data and configuration that produced it, which is critical for auditability and debugging in production systems.

IMPLEMENTATION PATTERNS

Run IDs in Popular Frameworks & Platforms

A Run ID is the atomic unit of experiment tracking, but its implementation varies across tools. This section details how major frameworks generate, manage, and utilize these unique identifiers.

01

MLflow: UUIDs with Nested Hierarchy

MLflow generates a Universally Unique Identifier (UUID) for each run. This ID is immutable and serves as the primary key for all logged data. Key characteristics include:

  • Hierarchical Organization: Runs are grouped under parent Experiment IDs, allowing logical categorization (e.g., "bert-sentiment-2025").
  • Artifact URI: The Run ID is part of the path for storing model checkpoints, plots, and other artifacts (e.g., s3://mlflow-bucket/123/abcdef/artifacts/model.pkl).
  • REST API Core: All operations—logging metrics, fetching parameters, or registering a model—require the Run ID as a primary argument in the Tracking Server's API.
02

Weights & Biases: Centralized Run Management

Weights & Biases (W&B) assigns an alphanumeric Run ID (e.g., 3q7h1xzj) that is intrinsically linked to its cloud-native platform.

  • Centralized Context: The ID points to a dedicated cloud page containing all run metadata, system metrics, logged console output, and visualizations.
  • Project & Entity Scope: The full run path includes the entity (user/team) and project name (e.g., my-team/sentiment-model/3q7h1xzj), enabling granular access control and organization.
  • Resumable Runs: The Run ID allows scripts to resume interrupted training sessions by re-initializing the run with the same ID, ensuring continuity in metric logging.
03

TensorFlow & Keras: Callback Integration

In the TensorFlow ecosystem, Run IDs are often managed via callbacks that integrate with external trackers.

  • TensorBoard: The tf.keras.callbacks.TensorBoard callback automatically organizes logs under a timestamped directory (e.g., logs/fit/20250115-102030), which acts as a de facto Run ID for visualization.
  • Custom Loggers: Frameworks like tf.summary.create_file_writer() use log directory paths as unique identifiers. For full experiment tracking, these paths are typically registered with a separate system (like MLflow) to generate a formal Run ID.
  • Distributed Training: In multi-worker setups, a single logical Run ID must be propagated and used consistently across all workers to aggregate events correctly.
04

PyTorch Lightning & ClearML: Automated Logging

High-level frameworks automate Run ID creation and lifecycle management.

  • PyTorch Lightning: Integrates directly with trackers like MLflow, W&B, and Neptune. The Trainer class automatically generates and manages a Run ID, passing it to the logger. The ID is accessible via trainer.logger.experiment.
  • ClearML: Upon script execution, the ClearML agent automatically captures the environment and creates a Task with a unique ID. This Task ID functions as the Run ID, linking code, stdout, and results without requiring manual initialization in the training script.
05

Custom Implementation: Hashing for Determinism

Teams building in-house tracking often generate deterministic Run IDs to guarantee reproducibility.

  • Common Strategy: Create a hash (e.g., SHA-256) of a concatenated string containing the git commit hash, dataset version, and the hyperparameter configuration (sorted).
  • Benefits: This method ensures that re-running the exact same code and data produces the identical Run ID, preventing duplicate entries in the tracking database.
  • Example: run_id = sha256(f"{git_sha}:{data_hash}:{json.dumps(sorted(params))}")[:12]. This ID can then be passed to a logging client or used as a directory name for artifacts.
06

Kubeflow Pipelines & Step Execution

In orchestrated workflows, Run IDs exist at multiple levels of granularity.

  • Pipeline Run ID: Identifies a single execution of the entire multi-step DAG.
  • Component Run ID: Each step (e.g., data preprocessing, training, evaluation) within the pipeline has its own unique execution ID, often a child of the pipeline Run ID.
  • Lineage: The hierarchy (Pipeline Run ID → Component Run ID) is critical for lineage tracking, enabling engineers to trace a final model artifact back through the specific data and code versions used in each step of its creation.
RUN ID (EXPERIMENT ID)

Frequently Asked Questions

A Run ID (or Experiment ID) is the fundamental unit of experiment tracking. This FAQ addresses common questions about its purpose, structure, and role in machine learning workflows.

A Run ID (or Experiment ID) is a unique, immutable identifier assigned to a single execution of a machine learning training or evaluation script, used to log, version, and retrieve all associated metadata, parameters, and results.

It serves as the primary key in an experiment tracking database, linking every piece of data generated during that run. This includes:

  • Hyperparameters and configuration files
  • Metrics like loss and accuracy over time
  • Artifacts such as trained model files and visualizations
  • Code version (e.g., Git commit hash)
  • Environment snapshot of dependencies

Without a Run ID, it becomes nearly impossible to reproduce results, compare different model versions, or audit the lineage of a model deployed to production.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.