$ fssg build --deterministic --validate |

Semantic Digests for Reproducible Multimodal AI Inputs

FACET

A multimodal AI request is not reproducible if an image is merely “the file at this URL.” The pixels may change. The decoder may change. A resize pipeline may change. The prompt can remain byte-for-byte identical while the model receives a different input.

This is why I do not treat images and audio as decorative attachments to a text prompt. In FACET, they are typed contract values. They need identity, constraints, and a canonical representation before they can enter the same engineering pipeline as text.

A URL is a location, not an identity

Most provider APIs make multimodal requests convenient: pass a URL, a base64 string, or a provider-specific content block. That is a useful transport interface. It is a weak contract boundary.

A URL answers where might I fetch something? It does not prove what was evaluated. Base64 fixes the transferred bytes, but even that does not define the semantic media object if the host decodes, rotates, resamples, converts color space, strips metadata, or normalizes audio before inference.

The distinction matters whenever we compare runs, approve an operation, investigate a failure, or reuse a cached transformation. If two records say image.jpg, we still do not know whether the model saw the same image. If two byte streams differ only because equivalent media was encoded differently, we may also create false cache misses.

The contract therefore needs an identity for the normalized asset—not only its storage address.

FACET’s canonical asset envelope

FACET v2.1.3 defines multimodal message content as an ordered list of typed items: text, image, or audio. Image and audio items carry a canonical asset envelope. A simplified image value looks like this:

{
  "kind": "image",
  "format": "jpeg",
  "digest": {
    "algo": "sha256",
    "value": "…"
  },
  "shape": {
    "width": 1024,
    "height": 768
  }
}

Audio uses the same pattern with a declared format and duration. The FACET Type System also defines constraints for accepted image formats and maximum dimensions, audio formats and maximum duration, and fixed-size embeddings.

This envelope gives each field one job:

Field Contract question
kind What semantic media class is this?
format Which normalized representation is declared?
digest Which exact semantic asset does the contract reference?
shape Which dimensions or duration participate in validation?

The content list preserves ordering as well. Text followed by an image is not silently equivalent to the same items in reverse order. Multimodal structure is part of the request architecture.

The digest is only as stable as the normalization profile

“Hash the image” sounds deterministic until we ask which image bytes are being hashed.

Consider one photo with an EXIF rotation flag. One decoder may preserve the stored pixel matrix and orientation metadata; another may rotate the pixels and remove the flag. Both render the same picture to a person, yet their byte identities differ. Similar ambiguity appears with color profiles, JPEG recompression, audio sample rates, channel layouts, and metadata removal.

FACET does not hide this problem behind a universal hash claim. Asset canonicalization is defined by the host profile. The canonical request therefore includes host_profile_id, and that profile must be stable and versioned. If a codec pipeline, resampling rule, color-space conversion, or normalization rule can alter semantic digests, the host profile identity must change.

That creates a useful identity tuple:

asset identity = semantic digest + declared constraints + host profile identity

The digest identifies the normalized asset. The constraints say what the contract accepts. The host profile identifies the rules that produced the normalization. Remove any one of the three and the reproducibility claim becomes ambiguous.

This extends the same boundary I described in why FACET makes the host profile part of the contract. Multimodal inputs make that boundary visible because media preprocessing can change meaning before a provider adapter ever sees the request.

Three engineering consequences

1. Caches can key the dependency, not the filename

FACET’s Pure Mode cache contract includes canonical input values, lens identity and version, arguments, FACET version, and host profile identity. For multimodal values, the canonical form includes the semantic digest and declared constraints.

A cache lookup can therefore ask whether it has the result for this normalized asset under these semantics. It does not need to trust a mutable path such as /uploads/latest.png. And if the normalization profile changes, the profile identity prevents an old transformation from masquerading as a result under new rules.

This does not make every media operation pure. It makes the dependency explicit. As I argued in FACET Pure Mode, a missing required cache entry must still fail rather than perform hidden external I/O.

2. Tests can assert multimodal structure before inference

The public facet-compiler repository includes a specification example with text-plus-image and text-plus-audio messages. Its matrix script compiles the example to canonical JSON and asserts that content remains an array and that the expected typed items occupy the expected positions.

That test does not measure whether a model understands the image. It verifies something earlier and more deterministic: the compiler preserved the declared multimodal architecture.

This separation is important. Contract tests should first prove type validity, ordering, canonical fields, policy behavior, and failure semantics. Model-quality evaluation comes later. The same principle underlies FACET tests as executable contracts.

3. Audit records can name what the model actually received

An audit record that says “the agent inspected screenshot.png” is a narrative. An artifact that binds a semantic digest, shape, format, and host profile is a verifiable reference.

It still does not prove that a remote provider processed the asset correctly. Nor does it prove that two different providers interpret identical normalized media in the same way. The contract controls preparation and identity up to the provider boundary; provider behavior remains a separate claim.

But that narrower guarantee is valuable. It lets an engineer distinguish three failure classes:

  1. source drift — the fetched media changed;
  2. normalization drift — host preprocessing semantics changed;
  3. provider behavior drift — the same canonical asset produced different downstream behavior.

Without canonical asset identity, those failures collapse into “the vision model behaved differently.” With it, investigation starts from a named boundary.

Multimodal input belongs in the compiler

The important shift is not adding an image type to a schema. It is moving media identity into compilation.

A FACET compiler can reject unsupported formats or violated constraints before inference. It can preserve content-item order in canonical JSON. It can bind preprocessing semantics to a versioned host profile. It can make media dependencies available to cache keys, tests, and execution artifacts.

That is the same architectural move FACET makes for typed runtime inputs: external values enter through a narrow, validated boundary instead of rewriting the contract around them.

I want multimodal AI systems to answer a simple forensic question: which image, under which normalization rules, entered this execution? A URL cannot answer it. A provider payload cannot answer it consistently across vendors. A canonical typed asset can.

Once images and audio become contract values, multimodal AI stops being a special attachment path. It becomes ordinary engineering state—typed, bounded, identifiable, and testable.

Sources

For the complementary part of this workflow, see Canonical JSON as an Intermediate Representation for AI Systems.

FACET AI CLI Terminal
facet@ai:~$