Understand Training Changes

Compare model checkpoints to see exactly what changed during training. Debug issues, analyze fine-tuning, and validate training runs.

Comprehensive Analysis

Everything you need to understand model changes

📊

Multi-Format Support

Load PyTorch, SafeTensors, NumPy, and HuggingFace checkpoints seamlessly.

📈

Rich Metrics

L2 diff, cosine similarity, relative change, and element-wise statistics.

🔍

Pattern Detection

Automatically identify training patterns like gradient flow and layer freezing.

🏷️

Layer Analysis

Categorize and compare attention, MLP, embedding, and other layer types.

💡

Training Insights

Get automated insights about frozen layers, stability, and architecture changes.

📄

Beautiful Reports

Generate HTML, JSON, or text reports with visualizations and summaries.

Metrics Computed

For each parameter, we compute comprehensive statistics

L2
Euclidean Distance
cos θ
Cosine Similarity
Δ%
Relative Change
max
Max Difference

Change Patterns

Automatically detect how your model changed during training

📉

Gradient Pattern

Earlier layers changed more than later layers - common in transfer learning

📈

Inverse Gradient

Later layers changed more - typical for fine-tuning on new tasks

👁️

Attention Heavy

Attention mechanisms changed most - learning new relationships

🔢

MLP Heavy

Feed-forward layers changed most - learning new features

❄️

Sparse Changes

Very few layers changed - possible frozen layers or early stopping

⚖️

Uniform

All layers changed equally - full model training

Quick Start

Compare checkpoints in just a few lines of code

Python example.py
from model_diff import compare_checkpoints, DiffAnalyzer, create_diff_report

# Compare two checkpoints
diffs, summary = compare_checkpoints(
    "model_v1.pt",
    "model_v2.pt"
)

# Print summary
print(f"Modified: {summary.modified_parameters}")
print(f"Cosine Similarity: {summary.avg_cosine_similarity:.4f}")

# Analyze the differences
analyzer = DiffAnalyzer()
analysis = analyzer.analyze(diffs, summary)

print(f"Pattern: {analysis['change_pattern']}")

# Generate HTML report
report = create_diff_report(
    diffs, summary, analysis,
    format="html",
    old_name="Base",
    new_name="Fine-tuned"
)

with open("report.html", "w") as f:
    f.write(report)

Workflow

From checkpoints to insights in four simple steps

1

Load

Load checkpoints from any format

2

Compare

Compute differences between parameters

3

Analyze

Detect patterns and generate insights

4

Report

Create beautiful visualizations