An aligned copying control shows why correct answers alone do not demonstrate identity lookup.
Matching source and query positions lets a model copy values without using identity. This deliberately easy control checks that positional copying can survive even when query keys become wrong.
Seed 17 on gpu: 3 of 3 behavioral checks met. See the measurements below.
Insights
A model can copy the right value using position while ignoring matching identities. Aligned source and query positions give the model another way to recover every target. Rotating query keys while retaining target positions leaves accuracy high, so this control does not establish identity-based recall.
Repeated decoder queries retain positional information. Although branch and root reductions are compressed, decoder memory also includes the target value field’s own parcel, which still contains visible source values. Success therefore does not show that one summary preserves all source information. Keep this control beside shuffled-key recall: their different responses to broken keys distinguish copying by position from using identity.
Setup
Code
"""Show why aligned copying is insufficient evidence of identity lookup.The source and query halves have matching positions. A compressed model cancopy values by position even after query keys are changed. Successful copyingon both versions is the expected control behavior.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 ="P024"PAIR_COUNT =2
Both halves now put K2 first. The correct query targets reverse with them, but copying by relative position still solves the example without comparing keys.
This control retains the first example’s query values while rotating query keys. The targets intentionally disagree with identity lookup. A positional copier still matches them; the test requires that accuracy remain high.
Synthetic data and controls
Code
def records(*, rows: int, seed: int, namespace: str, broken_identity: bool=False) -> Iterator[dict]:"""Generate unseen, observation-local key/value associations.""" 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 = source_order 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] memory = [{**item, "role": "source", "is_query": False} for item in source] memory.extend(({**item, "role": "query", "is_query": True} for item in target))yield {"memory": memory}def normalized_rmse(model: rf.Model, records: list[dict]) ->float:"""Score only query coordinates; source values remain visible to the model.""" output = model.predict(records).to_pylist() actual, predicted = [], []for row, result inzip(records, output, strict=True):for item, coordinate inzip(row["memory"], result["predictions"]["association/memory/value"], strict=True):if item["is_query"]: actual.append(item["value"]) predicted.append(coordinate["content"]) actual = np.asarray(actual)returnfloat(np.sqrt(np.mean(np.square(np.asarray(predicted) - actual)) / np.mean(np.square(actual))))
Model tree
Figure 1: Aligned source and query records use attention summaries; visible source-value memory also reaches the decoder. Only query values are masked.
The branch and root use rf.Attention(). The value field uses rf.Mask(query="is_query", dropout=False, reconstruct=True); source values remain input while query values supply reconstruction targets.
How it works
The decoder has positional information, so it can learn to copy the first source to the first query and the second source to the second query. Rotating query identities leaves these target positions unchanged. A model following position should therefore remain accurate after this intervention.
Repeat seed calibration and retain this control alongside identity proofs. Its successful predictions cannot establish unseen-key lookup: the required information is already available through a fixed position relationship.
Reproduce
Run by stable ID from the repository root:
uv run python proofs/run.py P024
Or run the self-contained script directly:
PYTHONPATH=proofs uv run python proofs/relational/aligned_position_control.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.