Start here
About 60 secondsThe idea, in a minute.
- The question
- Can a trainable neural fabric learn useful hard routing from low-level cell and switch primitives, and does a successful small stateful task transfer to byte-level language modeling?
- What we found
- On running parity, all three frozen fabrics achieved 100% exact-sequence accuracy through length 128 and an identity-routing intervention reduced token accuracy to 50.09%. On WikiText-2, none routed input to the fixed readout; test loss was 4.629 bits per byte versus 2.989 for a parameter-matched GRU.
- Why it matters
- The paired tasks separate whether a hard circuit can be learned at all from whether the same routing recipe can solve a substantially richer prediction problem. They expose routing credit assignment as a practical bottleneck.
The parity task needs only one stateful cell path, so its success does not demonstrate multi-cell composition or reusable compilation. WikiText has one small topology and budget; its failure does not rule out better-conditioned fabrics.
A concrete example
The readout route is causal on parity
In the three-seed running-parity confirmation, the frozen fabric routed the binary input to its fixed readout cell in every seed.
- 01
Train
The fabric used one shared cell kernel, persistent state, and sampled hard switch configurations while learning cumulative XOR.
- 02
Freeze
Configuration logits were replaced with 44 literal bits; no weights were retrained.
- 03
Intervene
Forcing all switches to identity routing reduced mean length-128 token accuracy from 100% to 50.09% and exact-sequence accuracy to zero.
The learned route was functionally necessary for this task, while its existence alone did not imply that the topology would be found on a harder task.
Running parity result record (in download archive)Read the formal abstract
Can a neural circuit learn its wiring while it learns its computation? The first test here gives the circuit only low-level pieces: a shared recurrent cell, persistent state, and hard switches. On a task where every bit must update a running XOR, it learned a working route in each of three seeds, even on sequences four times longer than those used for training.
The follow-up asked whether that recipe could transfer directly to byte-level WikiText-2 without adding ready-made language operations. It did not. Each fabric missed the one route connecting input to the fixed readout, predicted the dominant byte, and trailed a parameter-matched GRU by 1.639 bits per byte. Together, the results show a real but narrow trainability result and a sharp task-dependent credit-assignment failure.
01 Research question
Can a trainable neural fabric learn useful hard routing from low-level cell and switch primitives, and does a successful small stateful task transfer to byte-level language modeling?
02 Experiment setup
The full procedure, model settings, datasets, and evaluation choices are recorded here.
Explore the complete methodology
In the parity experiment, eight width-8 cells used a shared width-32 update kernel, persistent width-8 state, four configuration bits per cell, and three stages of hard 2-by-2 switches. Training used sequence lengths 8–32; evaluation used lengths 16, 32, 64, and 128. The final confirmation used seeds 202, 303, and 404, 500 optimizer steps, batch size 128, and 2,048 deterministic evaluation sequences per seed and length. A width-15 GRU with 1,502 parameters was the control; the fabric training graph had 1,554 parameters and froze to 1,498 floating-point parameters plus 44 configuration bits.
The final routing estimator sampled a legal hard Gumbel switch configuration on each training forward. An earlier deterministic straight-through estimator was abandoned after its initial route sent the input away from the readout and supplied almost no useful topology gradient; its seed 101 was excluded from confirmation. The WikiText transfer used byte identities, sequence length 64, batch size 16, 1.024 million training bytes per seed, and three seeds 101, 202, and 303. Its eight width-64 cells shared a width-152 kernel and were compared with a two-layer width-64 GRU. Training and inference used Apple MPS. The published local artifacts record the exact configurations and summaries.
The WikiText result record reports Python 3.12.13 and PyTorch 2.13.0 on macOS MPS. Reproduction command from the repository root: `python3 projects/trainable-neural-fabric/primitive_wikitext.py --steps 1000 --batch-size 16 --evaluation-bytes 131072 --seeds 101 202 303 --models gru fabric --device mps --output artifacts/mac/2026-09-01-hard-neural-logic-fabric-wikitext/results.json`. The checksum-pinned WikiText-2 byte corpus must be available at the path accepted by the script.
The parity confirmation ran with Python 3.12 and PyTorch on CPU. Reproduce it from the repository root with `python3 projects/trainable-neural-fabric/running_parity.py --steps 500 --batch-size 128 --evaluation-examples 2048 --seeds 202 303 404 --models gru fabric --output artifacts/mac/2026-09-01-hard-neural-logic-fabric-parity/results.json`. The report documents the focused unittest command and the excluded estimator-diagnostic seed.
03 What happened?
On running parity, all three frozen fabrics achieved 100% exact-sequence accuracy through length 128 and an identity-routing intervention reduced token accuracy to 50.09%. On WikiText-2, none routed input to the fixed readout; test loss was 4.629 bits per byte versus 2.989 for a parameter-matched GRU.
Test bits per byte · scale shown from 0 to 5
How to read thisThe fabric was 1.639 BPB worse than the paired-parameter GRU and took 123.978 ms versus 10.317 ms for batch-one inference.
The limitThree seeds; byte-level WikiText-2 and eager Apple MPS timing. Parity is a separate experiment and is described in the article, not mixed into this chart.
Each row compares a model on the same three-seed byte-level WikiText-2 transfer. Score is mean test bits per byte (lower is better); latency is mean batch-one MPS milliseconds.
Full results and data table
| Model | Test bits per byte | Batch-one latency (ms) |
|---|---|---|
| Two-layer GRU | 2.989485660776984 | 10.31659120021181 |
| Frozen primitive fabric | 4.6287101299423075 | 123.97776018866959 |
On parity, GRU and frozen fabric both reached 100% exact-sequence accuracy at every evaluated length. All fabric seeds routed input cell 0 to readout cell 7. Replacing learned switches with identity routing gave 50.09% mean token accuracy at length 128, a 49.91 percentage-point intervention effect, and zero exact sequences. Extraction preserved hard-evaluation accuracy exactly. The fabric used 14.85 ms per batch-one sequence at length 128 versus 0.843 ms for the GRU; mean training time was 14.91 versus 2.26 seconds.
On WikiText-2, the fabric averaged 4.629 test bits per byte and 19.67% byte accuracy, compared with 2.989 bits per byte and 41.94% for the GRU. Frozen input destinations were cells 0, 4, and 4, never the readout cell 7. Every seed produced the same 19.6716% accuracy, consistent with dominant-byte prediction. Learned and identity routing gave the same validation loss. Hard evaluation and frozen evaluation matched exactly, indicating that extraction was not the failure. The fabric had 66,712 deployed parameters plus 76 bits, and used 123.98 ms batch-one MPS latency versus 10.32 ms for the 66,432-parameter GRU.
04 What does this mean?
What this suggests
- Hard-forward topology learning can work with explicit route exploration on a minimal persistent-state computation.
- The direct WikiText transfer exposes a bottleneck in discovering a path from input cell 0 to fixed readout cell 7.
What we still don’t know
- Whether a fixed or separately learned transport path allows the shared kernel to learn useful byte predictions.
- Whether multiple circuit microsteps and cell-to-cell state transport enable genuine composition.
Read the full discussion
The parity result is stronger than a score alone: the route intervention shows the learned topology mattered. Yet the task can be solved with one routed cell, so it is a minimal stateful sanity check rather than evidence of composed circuit synthesis. The fabric did not establish that a learned substrate can be reused to compile another task.
WikiText changes the topology problem. The current one-microstep design requires input cell 0 to connect directly to readout cell 7; persistent state is not routed through a multi-cell computation. All three runs failed to discover that connection. This is consistent with a severe credit-assignment bottleneck, but the experiment does not distinguish whether the cause is the search estimator, architecture, optimization budget, or their interaction. A fixed-route ablation that first demonstrates useful byte prediction, followed by multi-step routed state, is the most informative next gate.
05 Limitations
The parity task needs only one stateful cell path, so its success does not demonstrate multi-cell composition or reusable compilation. WikiText has one small topology and budget; its failure does not rule out better-conditioned fabrics.
Read all study limitations
These are small experiments with three seeds per task and different task-specific model sizes and budgets. Running parity is synthetic and unusually simple. WikiText is a checksum-recorded byte-level proxy, not a standard subword benchmark or large language model. The eager executor is slow and no fused kernel was evaluated. No trained fabric checkpoints are present in the selected experiment directories; the results JSON is available, but it is not a weights file. The source code and tests permit inspection and rerunning when the dataset and runtime are available, but these records alone do not supply weights for direct inference reproduction.
06 References & materials
Keep the complete record
Take the research with you.
The full write-up, source code, and recorded experiment materials.
Download everything together or choose individual files.
Both experiment scripts are self-contained apart from Python 3.12.13 and PyTorch 2.13.0; no sibling model modules or src package imports are required. WikiText-2 corpus files are external inputs and must match the SHA-256 values recorded in the result JSON. Focused tests are included for inspection. No trained fabric checkpoints are present in the selected experiment directories; the JSON files are result records, not weights.