> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trainy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Downsampling & Smoothing

> How Pluto applies downsampling and smoothing to line charts

## Downsampling

When a run logs thousands or millions of data points, transferring and rendering every point would be impractical. Pluto **downsamples** the data server-side before sending it to the browser, which keeps page loads fast, reduces bandwidth, and allows charts to render smoothly even for very long training runs. Instead of shipping raw data, Pluto divides the x-axis into evenly spaced buckets and reduces each bucket to a **single plotted point**.

Two settings in the line chart settings drawer control that:

| Setting        | Decides                                   |
| -------------- | ----------------------------------------- |
| **Resolution** | How many buckets the x-axis is split into |
| **Sampling**   | Which value each bucket plots             |

A bucket with no points in it is left empty — Pluto does not interpolate across gaps.

### Resolution — How Many Buckets

Resolution defaults to **Auto (screen-fit)**, which fits roughly one point per 4 pixels of chart width (clamped to 200–3,000). You can also pin it to **High (500)**, **Max (1,000)**, or **Ultra (3,000)** points per series. Lowering it produces a coarser summary; raising it preserves more detail at the cost of rendering performance. See [Performance](/pluto/visualizations/lines#performance).

### Sampling — What Each Bucket Plots

A bucket usually holds many raw points, so Pluto must choose one value to plot for it. **Sampling** decides how.

#### Average (with min/max envelope)

The default. Each bucket contributes:

* **Mean** (AVG) — the plotted point
* **Min / Max** — a shaded band around the mean

If a bucket contains only one point, it is plotted directly with no band.

<img src="https://mintcdn.com/trainy/aYE6TEOOjuWImSUp/images/pluto/downsampling-aggregation.png?fit=max&auto=format&n=aYE6TEOOjuWImSUp&q=85&s=589a516c67d71acd2a6aa287a0517ebf" alt="Downsampling aggregation" width="1234" height="408" data-path="images/pluto/downsampling-aggregation.png" />

#### LTTB (preserve spikes)

Largest Triangle Three Buckets plots a **real logged data point** from each bucket — picked to preserve the curve's visual shape — rather than a computed mean. A one-step spike therefore survives downsampling instead of being flattened into its bucket's average. Best when sharp spikes matter: gradient norms, learning-rate schedules.

Both charts below plot the same `train/grad_norm` over 6,000 steps:

<div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', alignItems: 'flex-start' }}>
  <img src="https://mintcdn.com/trainy/RSBzmM6c9FBJXx6L/images/pluto/sampling-avg.png?fit=max&auto=format&n=RSBzmM6c9FBJXx6L&q=85&s=695b1b9127a69cf7d7692d0909519cf5" alt="Average sampling: flat line with spikes only in the min/max band" style={{ width: '48%', minWidth: '260px', borderRadius: '8px' }} width="742" height="808" data-path="images/pluto/sampling-avg.png" />

  <img src="https://mintcdn.com/trainy/RSBzmM6c9FBJXx6L/images/pluto/sampling-lttb.png?fit=max&auto=format&n=RSBzmM6c9FBJXx6L&q=85&s=494fd1e598cf54e597afec56fdeff6b6" alt="LTTB sampling: spikes preserved in the line itself" style={{ width: '48%', minWidth: '260px', borderRadius: '8px' }} width="742" height="808" data-path="images/pluto/sampling-lttb.png" />
</div>

Under **Average** (left) each spike is averaged into its bucket's mean, so the line stays flat near `1.0` and the spikes appear only in the shaded band. Under **LTTB** (right) the spikes are real points on the line.

<Note>
  Sampling only changes **which value a bucket's point reports**. The min/max band and the **Min**/**Max** tooltip columns are computed under both settings.
</Note>

### Min/Max Band and Outliers

In pluto, the shaded band around the mean line represents the min and max values within each bucket. This is particularly useful for spotting outliers — a spike that appears as a faint vertical band at full zoom can be revealed as an actual extreme data point when you zoom in.

<video autoPlay muted loop playsInline src="https://mintcdn.com/trainy/aYE6TEOOjuWImSUp/images/pluto/downsampling-outlier-zoom.mp4?fit=max&auto=format&n=aYE6TEOOjuWImSUp&q=85&s=c395a1a4029aeff978eae8091da9ade4" style={{ width: "100%", borderRadius: "8px" }} data-path="images/pluto/downsampling-outlier-zoom.mp4" />

### Screen-Aware Bucket Counts

Bucket counts are tied to the visible x-axis range. As you zoom into a region, fewer raw points fall within the view, so each bucket contains fewer points and the chart reveals more of the underlying raw data. At full zoom, you see individual data points with all their noise. Zooming back out re-aggregates the data into smoother buckets.

<video autoPlay muted loop playsInline src="https://mintcdn.com/trainy/aYE6TEOOjuWImSUp/images/pluto/downsampling-bucket-zoom.mp4?fit=max&auto=format&n=aYE6TEOOjuWImSUp&q=85&s=ea03405db6ba735baae137842f6afc21" style={{ width: "100%", borderRadius: "8px" }} data-path="images/pluto/downsampling-bucket-zoom.mp4" />

<Note>
  Downsampling is applied **before** smoothing. The smoothing algorithms operate on the already-downsampled points, not the raw data.
</Note>

## Smoothing

Smoothing applies a mathematical filter to reveal trends in noisy metrics. When enabled, the smoothed line is displayed prominently while the original raw data is shown faintly behind it as reference.

<Frame caption="unsmoothed data">
  <img src="https://mintcdn.com/trainy/h1o38dT1xyYib-6X/images/Screenshot2026-02-09at8.04.24PM.png?fit=max&auto=format&n=h1o38dT1xyYib-6X&q=85&s=9cd85e175ff5dabdd2409745373c6957" alt="Screenshot 2026 02 09 At 8 04 24 PM" width="1708" height="1118" data-path="images/Screenshot2026-02-09at8.04.24PM.png" />
</Frame>

<Frame caption="smoothed data">
  <img src="https://mintcdn.com/trainy/h1o38dT1xyYib-6X/images/Screenshot2026-02-09at8.04.44PM.png?fit=max&auto=format&n=h1o38dT1xyYib-6X&q=85&s=97fc4f71b67022298ed6c7c0b648abad" alt="Screenshot 2026 02 09 At 8 04 44 PM" width="1706" height="1167" data-path="images/Screenshot2026-02-09at8.04.44PM.png" />
</Frame>

### Enabling Smoothing

There are two ways to access smoothing controls:

**Settings Drawer** — Click the **settings icon** in the chart toolbar to open the line chart settings drawer. The **Line Smoothing** section lets you toggle smoothing on/off, select an algorithm, adjust the parameter with a slider, and toggle visibility of the original data.

<img src="https://mintcdn.com/trainy/h1o38dT1xyYib-6X/images/Screenshot2026-02-09at8.05.07PM.png?fit=max&auto=format&n=h1o38dT1xyYib-6X&q=85&s=7d977dcdd9dfe25d27a27ea30a3ed162" alt="Smoothing settings in the settings drawer" style={{ width:"64%" }} width="601" height="824" data-path="images/Screenshot2026-02-09at8.05.07PM.png" />

**Inline Toolbar** — Each line chart group has an inline smoothing slider in its toolbar for quick access without opening the full settings drawer.

<img src="https://mintcdn.com/trainy/h1o38dT1xyYib-6X/images/Screenshot2026-02-09at8.04.55PM.png?fit=max&auto=format&n=h1o38dT1xyYib-6X&q=85&s=08c59fbf10363bb4ccbd8d690cf979b4" alt="Inline smoothing slider" style={{ width:"52%" }} width="360" height="75" data-path="images/Screenshot2026-02-09at8.04.55PM.png" />

### Algorithms

Pluto supports four smoothing algorithms. Each uses a **window** whose size is determined by the smoothing parameter (0–1). A higher value means a larger window and more aggressive smoothing.

#### Exponential Moving Average (EMA)

A causal (backward-looking) filter where each smoothed value is a weighted combination of the previous smoothed value and the current point. Recent points are weighted more heavily, with weights decaying exponentially into the past. This is the most commonly used algorithm for training loss curves.

#### Time Weighted EMA (TWEMA)

Similar to EMA but accounts for **irregular spacing** on the x-axis. Standard EMA assumes evenly spaced steps — TWEMA adjusts the decay factor based on the actual time or step distance between points, producing more accurate results when logging intervals vary.

#### Gaussian

Applies a Gaussian (bell curve) kernel centered on each point. Unlike EMA, this is a **non-causal** filter — it looks both forward and backward. This produces a smoother result with less phase lag, but the edges of the curve may be less stable.

#### Running Average

A simple moving average (SMA) that computes the unweighted mean of all points within the window. Straightforward and easy to reason about, but can lag behind sharp transitions more than EMA.
