﻿# Aim metric contexts: a changing context field creates different sequences rather than extra point metadata

Design Aim metric contexts as stable sequence identities, keeping step-like changing values out of context when a continuous training curve is intended.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-aim-metric-context-sequence-cardinality/
Language: en

## Identify the sequence before interpreting its chart

An Aim tracking integration records loss with a context containing the current batch identifier. The researcher expects a continuous curve but finds many tiny sequences instead. The [Aim concepts guide](https://aimstack.readthedocs.io/en/latest/understanding/concepts.html) defines a sequence through its run, name and context. In the documented aim.Run model, context belongs to sequence identity. It is not simply a free-form annotation that can change for every point without changing which sequence receives that point.

## Use context for stable measurement distinctions

Training and validation loss can share a name while using distinct subset contexts. Different dataset slices may also merit separate sequences when their trajectories should be compared independently. Define those distinctions deliberately and keep their vocabulary stable across runs. A spelling change or a different value type can split a concept that the dashboard user thought was identical. Recording the intended context schema makes that split visible before grouping or aggregation hides its origin.

## Keep progress in the progress coordinate

If the intention is to append points to a single trajectory, use the appropriate progress coordinate rather than constructing a fresh identity from each batch. This does not imply that every measurement should be merged: per-slice and per-task results can need genuine separate contexts. Decide whether a field answers which measurement series this is or where the point lies within that series. The distinction is a data modeling decision and affects later query results, not only chart decoration.

## Query the name and context together

The [query language reference](https://aimstack.readthedocs.io/en/latest/using/search.html) shows filters combining metric names and contexts. A name-only query can intentionally return several measurement populations. The [explorer guide](https://aimstack.readthedocs.io/en/latest/ui/pages/explorers.html) then describes grouping and comparing those sequences. Inspect the selected context values before averaging curves; the same metric name can include training, validation or incompatible evaluation slices whose combined trend has no intended scientific interpretation.

## Test context cardinality with a short run

Send a few recognizable points under stable training and validation contexts, then inspect which sequences were created. Repeat with a deliberately changing context field to expose the identity difference. Related guides cover [explicit table schemas](/journal/data-guide-frictionless-table-schema/) and [evaluation population drift](/journal/data-guide-evidently-schema-population-drift/). The useful outcome is a stable metric schema with an expected sequence population. A dashboard that can display every recorded point does not alone establish that the original curve was modeled correctly.
