# Gradients

Gradient capture is the backward-pass counterpart to [activation capture](/docs/profiling/activations) - recording how loss actually flowed back through a specific tensor during a captured training step, using the same [`RuntimeProbe`](/docs/profiling/runtime-traces#runtimeprobe-where-a-trace-comes-from) mechanism as everything else in runtime tracing.

## What gets captured

A gradient capture point set on a tensor records its gradient - the derivative of loss with respect to that tensor - as computed during a captured backward pass. Because a captured gradient is just another tensor once recorded, it's addressable and inspectable the same way an activation or a static weight is: viewable in the [Matrix and Heatmap view](/docs/editors/matrix-and-heatmap-editor), summarized by the same [tensor statistics](/docs/inspect-and-analyze/tensor-statistics), and readable scalar-by-scalar in the [Scalar Inspector](/docs/editors/scalar-inspector).

## Why gradient capture matters

A few of the most common training pathologies are gradient-shaped, not weight-shaped, and are hard to catch any other way:

-   **Vanishing gradients** - a [Layer Profile](/docs/editors/signal-and-distribution-editor) of gradient norm across layers makes a vanishing trend visible immediately, rather than requiring you to suspect it first.
-   **Exploding gradients** - an [outlier](/docs/inspect-and-analyze/outliers-and-anomalies) flag on gradient magnitude, or a [NaN breakpoint](/docs/inspect-and-analyze/nan-and-inf-detection) set on a gradient specifically, catches this at the moment it happens rather than only after weights are already corrupted.
-   **Dead regions** - a module whose gradient is consistently near-zero across many captured steps is a candidate for "not actually learning," distinct from a module that's simply converged.

## Related resources

-   [Runtime Traces](/docs/profiling/runtime-traces) - probe levels, breakpoints, and the capture mechanism gradient capture builds on.
-   [Activations](/docs/profiling/activations) - the forward-pass counterpart.
-   [Layer Profile](/docs/editors/signal-and-distribution-editor) - plotting a captured statistic like gradient norm across every layer at once.
