Route random source values to sibling targets using fresh Hash identities.
Fresh identifiers link two independently ordered branches. The model must retrieve each target’s matching source value without relying on a persistent vocabulary, a population average, or shared position.
Seed 17 on gpu: 6 of 6 behavioral checks met. See the measurements below.
Insights
Fresh identities can connect source values to targets in another branch without a learned identity vocabulary. Shared Hash encoding preserves within-batch equality. Coordinate-local encoding binds each source key to its value, and visible target keys can condition repeated queries over source context carried through the root.
Independent branch orders remove reliable positional copying. Rotating only target keys while retaining target values breaks accuracy, showing that the association matters. Retaining tokens also outperforms the tested compressed route, unlike the small persistent-Category control. This is evidence for two entities under one protocol, not an exact join or unlimited memory. Missing sources, duplicate identities, and collisions require explicit conventions and further tests.
Setup
Code
"""Transfer values between sibling branches using fresh Hash identities.Every split uses unseen names and independent source/target order. Comparecompressed and preserved routes, then rotate query keys while retaining targetsto test whether improved transfer really depends on identity.Run this file with --help for seed, training-budget, and reporting options."""from __future__ import annotationsfrom collections.abc import Iteratorfrom functools import partialimport lightning.pytorch as litimport numpy as npimport torchfrom reporting import reportimport relflow as rfPROOF_ID ="P037"PAIR_COUNT =2
Target values are supervision hidden by mask=True. Every row has new identities, and train, validation, and test use disjoint key namespaces. Target identities and source records remain visible.
The identifiers and source values are new, but the equality relationship is the same. Correct hidden targets follow their matching source values without requiring either identifier to belong to a persistent learned vocabulary.
This intervention starts from the first example. The target labels deliberately retain the original values even though the keys now select the other source. A rise in error against those retained labels tests dependence on identity.
Synthetic data and controls
Code
def records(*, rows: int, seed: int, namespace: str, broken_identity: bool=False) -> Iterator[dict]:"""Generate observation-local key/value associations in sibling branches.""" rng = np.random.default_rng(seed)for row inrange(rows): keys = [f"{namespace}-{row:06d}-{pair:02d}"for pair inrange(PAIR_COUNT)] values = rng.uniform(-1.0, 1.0, size=PAIR_COUNT) query_keys =list(keys)if broken_identity: query_keys = query_keys[1:] + query_keys[:1] source_order = rng.permutation(PAIR_COUNT) query_order = rng.permutation(PAIR_COUNT) source = [{"entity_id": keys[index], "value": float(values[index])} for index in source_order] target = [{"entity_id": query_keys[index], "value": float(values[index])} for index in query_order]yield {"source": source, "target": target}def normalized_rmse(model: rf.Model, records: list[dict]) ->float: actual = np.asarray([item["value"] for row in records for item in row["target"]]) output = model.predict(records).to_pylist() predicted = np.asarray( [coordinate["content"] for row in output for coordinate in row["predictions"]["association/target/value"]] )returnfloat(np.sqrt(np.mean(np.square(actual - predicted)) / np.mean(np.square(actual))))
Model tree
Figure 1: Two separately trained models share this schema. Retained and compressed labels describe alternative reductions at the root and both branches; target values are masked.
The retained route uses reduction=None at both branches and root. A matched control replaces those reductions with rf.Attention().
How it works
Hash preserves equality within an encoded batch without a learned vocabulary. Coordinate-local mixing binds source identity to value, and retained source context remains available to queries conditioned on visible target identities. The key-rotation control leaves target values and source records unchanged while breaking the intended match.
Repeat three core seeds and ten calibration seeds, then sweep 2, 4, 8, and 16 entities. Add explicit permutation/equivariance tests, absent sources, duplicate keys, padding, and Hash collisions. The Category control uses recurring identities and succeeds under the tested compression. Exact production retrieval can use a preprocessing join.
Reproduce
Run by stable ID from the repository root:
uv run python proofs/run.py P037
Or run the self-contained script directly:
PYTHONPATH=proofs uv run python proofs/relational/hash_identity.py
Add --accelerator gpu for CUDA or --seed 42 for another seeded experiment. --steps 2 checks execution with a short training budget; it is recorded as a smoke run.