Adaptive cluster state can settle near five generating regression regimes without explicit group labels.
Each repeated identity follows one of five hidden relationships between x and y. The model receives no group label. This experiment asks whether adaptive Cluster state settles near the generating number of regimes.
Seed 0 on gpu: 4 of 4 behavioral checks met. See the measurements below.
Insights
Settling near five clusters does not yet show that the model discovered the five generating functions. Repeated identities follow stable regimes while their numeric inputs vary; reconstruction engages adaptive Cluster state alongside the supervised numeric task.
The recorded gates inspect terminal count and usage. Count is calculated from usage perplexity, so those diagnostics are coupled. Neither tells us whether identities share the correct regime or whether predictions work on independent observations.
The current train and validation tables are identical. Evaluate held-out regression and assignment agreement before treating this as regime discovery. The existing result supports adaptive-state behavior, with the harder behavioral claim still open.
Setup
Code
"""P018: track adaptive clusters across five hidden regression regimes.Training and validation deliberately reuse observations. Count and usageperplexity diagnose the mechanism; they do not prove partition recovery orheld-out prediction quality."""from collections.abc import Iteratorfrom functools import partialimport lightning.pytorch as litimport numpy as npimport torchfrom reporting import reportimport relflow as rffrom relflow.tensorfields.extensions.cluster import EmbedderPROOF_ID ="P018"
Examples
These are idealized values before observation noise, with illustrative regime assignments. The seeded generator assigns regimes randomly; these ID-to-regime choices are not reported measurements. y is always hidden from embedding.
One identity at the start of its curve
id: id-0007x:0.0y:10.0
An identity assigned to sin(x) + 10 has a noiseless target of 10 here.
The same identity at another input
id: id-0007x:1.5707963267948966y:11.0
At approximately π/2, the same regime gives 11. Its target varies with x, but its generating group stays fixed.
Another regime at the same input
id: id-0042x:1.5707963267948966y:-2.0
An identity assigned to the constant -2 regime gives a different answer for the same x. Repeated identity evidence can distinguish these processes. The examples describe the generating functions, not verified learned assignments or held-out predictions.
Figure 1: The ID uses a 50% training mask with reconstruction enabled. The supervised y target is always hidden from input.
How it works
The generator supplies 100 identities with 30 observations each. Its five regimes are sin(x) + 10, cos(x) + 4, -2, 0.5x - 8, and -0.3x - 14, with small additive noise. The repeated identity lets the model associate behavior across changing x values.
The ID field uses rf.Mask(rate=0.5, reconstruct=True) to engage the Cluster reconstruction loss. The numeric objective adds pressure to explain y. Cluster assignments belong to identities; row-varying x does not directly condition the query that reconstructs the identity itself.
The model trains for 30 deterministic epochs. Training and validation currently use the same 3,000 observations. An internal-state callback measures the final five epochs.
Training and evaluation
Code
def run(seed: int, steps: int|None, accelerator: str) ->tuple[dict, dict]: lit.seed_everything(seed, workers=True) model = rf.Model( name="obs", d_model=32, n_layers=1, n_heads=4, batch_size=128,id=rf.Cluster(capacity=128, n_clusters=(3, 15), mask=rf.Mask(rate=0.5, reconstruct=True)), x=rf.Number, y=rf.Number(mask=True), ) model.optimizer =lambda module: torch.optim.AdamW(module.parameters(), lr=3e-3) source = partial(records, seed=seed +42) data = rf.SyntheticDataModule(model=model, train=source, validate=source, seed=seed) trajectory = Trajectory(rf.Address("obs", "id")) trainer = lit.Trainer( accelerator=accelerator, max_epochs=30, max_steps=steps if steps isnotNoneelse-1, callbacks=[trajectory], logger=False, enable_progress_bar=False, enable_model_summary=False, enable_checkpointing=False, deterministic=True, ) trainer.fit(model=model, datamodule=data) tail = trajectory.rows[-5:] committed = [row["n_committed"] for row in tail] perplexity = [row["perplexity"] for row in tail]return {"trajectory": trajectory.rows,"final_committed": committed,"final_perplexity": perplexity, }, {"Final committed counts remain between 4 and 7": all(4<= value <=7for value in committed),"Final perplexity remains within 1.5 of five": all(abs(value -5) <=1.5for value in perplexity),"Terminal commitment is above the lower bound": committed[-1] !=3,"Terminal commitment is below the upper bound": committed[-1] !=15, }
Evidence
Latest full run
Seed 0, gpu, recorded 2026-09-15T02:23:27.629749+00:00. Outcome: met.
Create independent train, validation, and test observations. Measure held-out regression against a marginal baseline and require permutation-invariant partition recovery with ARI ≥ 0.80. Add unique-identity and no-regime controls, and replace internal instrumentation with a public diagnostic when available.
Repeat all behavioral and partition gates across three core seeds and at least ten calibration seeds before promoting this proof.
Reproduce
Run by stable ID from the repository root:
uv run python proofs/run.py P018
Or run the self-contained script directly:
PYTHONPATH=proofs uv run python proofs/cluster/hidden_regression_regimes.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.