﻿# A Dagster data version need not be a hash of generated output

Dagster can derive a data version from code and upstream versions without hashing output; nondeterministic generation may produce different content under the same derived version.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-dagster-data-version-nondeterministic-output/
Language: en

## Compare generated content with its derived identity

A materialization generates a document summary through a nondeterministic model call. Repeating the same code with the same upstream inputs can produce different wording. Dagster's [versioning guide](https://dagster.io/docs/guides/build/assets/asset-versioning-and-caching) explicitly discusses this case: an automatically derived data version can remain the same while output differs. Do not label that version a content checksum unless the application actually computes it from the relevant output.

## Understand what code version promises

The [asset API](https://dagster.io/docs/api/dagster/assets) describes `code_version` for code that deterministically produces the same output from the same inputs. Include the dependencies that matter when making such a claim. A stable wrapper around an externally changing model route, prompt file or source service does not itself make the materialization deterministic. Decide what the asset represents and which changes should alter its identity before using a version label to explain reuse.

## Derive an explicit version from intended equivalence

The guide allows user-provided data versions. For a generated artifact, choose whether equality means exact bytes, normalized text or an explicit stable structured result. These are application decisions with different consequences. A checksum of normalized text can intentionally ignore formatting while still distinguishing substantive changes. Preserve the normalization rule's version when that rule determines which output changes downstream consumers should regard as meaningful.

## Attach the version through the documented output

The [Output reference](https://dagster.io/docs/api/dagster/ops) exposes an explicit `data_version` parameter and marks that interface beta. Use the supported interface for the deployed version, and keep the actual artifact available independently of its version label. [Software reproducibility](/journal/software-stack-reproducibility/) provides context for recording generation and transformation settings. A version string can describe equivalence without containing enough information to regenerate a model's original answer.

## Review lineage and output together

For repeated materializations, compare stored content, explicit or derived data versions and the upstream/code versions that contributed to them. [Tool observations](/journal/learn-codex-tool-observation/) should retain which identity mechanism was used. Matching derived labels can coexist with different generated artifacts, while a cosmetic code change can alter a derived label without changing content. A useful review explains those outcomes rather than assuming every version difference proves new knowledge or every match proves identical text.
