OdyssNet: The Temporal Revolution
OdyssNet is the proof that Time is the ultimate Hidden Layer.
Traditional Deep Learning relies on Spatial Depth (layers stacked on top of each other) to solve complexity. OdyssNet discards this orthodoxy: Temporal Depth (chaos evolving over time) is a vastly more efficient substitute.
The Zero-Hidden Breakthrough
In 1969, Minsky & Papert proved that a neural network without hidden layers cannot solve non-linear problems like XOR.
OdyssNet has broken this limit.
By treating the network as a Trainable Dynamic System, OdyssNet solves non-linear problems (XOR, MNIST) using 0 Hidden Layers. It replaces spatial neurons with temporal thinking steps.
OdyssNet achieves its efficiency through Space-Time Trade-off. Instead of adding thousands of new neurons (Space) to build depth, it executes existing neurons for more steps (Time). A single physical matrix is reused across temporal steps and folds tens of layers worth of computation into a microscopic parametric footprint. This proves that intelligence is a dynamic process, not a static structure.
WORLD RECORD: Parametric Intelligence Density
OdyssNet reaches 89.89% accuracy on MNIST with 634 parameters. That is 0.14% accuracy per parameter, in a model small enough to print on a business card.
TL;DR
- OdyssNet replaces spatial depth with temporal depth: one recurrent core "thinks" for multiple steps instead of stacking hidden layers.
- That depth does not have to be backpropagated whole. Training on truncated windows, where the state crosses each boundary detached, still learns dependencies that reach back further than any single window — the core carries them forward through signals that have already been echoed and mixed. Long contexts are therefore reachable without a gradient graph spanning every timestep.
- Optional multi-head attention over the core's own state history, with a real KV cache, attached along time instead of between layers. Off by default.
- It solves non-linear tasks (XOR, MNIST) with zero hidden layers via trainable dynamics.
- Achieves 89.89% MNIST accuracy with 634 parameters, and 96.05% on 7x7 MNIST with 4,669.
- It runs as a hive. Eight bodies run the same core with no contact between them (separate states, separate caches, separate forward passes) and share one pooled Hebbian trace. Each is shown one edge of a ring drawn fresh per episode; every body then recalls edges it never observed and composes chains up to four edges long, 1.000 against 0.125 chance, with no gradient step at run time. Run apart, the same weights on the same inputs fall to chance.
- Demonstrates memory, rhythm, attractor stability, and transferable skills across tasks.
- Start with examples for proofs, then use the library API in odyssnet for your own workloads.
Key Features
- Space-Time Conversion: Replaces millions of parameters with a few "Thinking Steps".
- Layerless Architecture: A single $N \times N$ matrix. No hidden layers.
- Trainable Chaos: Uses StepNorm and Tanh to tame chaotic signals.
- Temporal Attention (3.0): Optional multi-head attention over the core's own state history (
attn_heads=4). There are no layers to stack it between, so it attends along time. Modern KV caching throughout: grouped-query heads, RoPE, a sliding window, and a preallocated ring buffer for allocation-free decoding. Its output projection starts at zero, so switching it on changes nothing until training says otherwise.
- Heterogeneous Synaptic Plasticity: Optional online Hebbian learning (
hebb_type='temporal'|'spatial'|'both', hebb_res='neuron'|'global'): the network accumulates correlations per example and learns how fast to learn via fully differentiable logit parameters (t_hebb_factor, s_hebb_decay, etc.). The plastic contribution is scaled by a zero-initialized gain, so switching it on changes nothing until training decides otherwise, which makes hebb_type an exact control. The trace is kept as the writes it is made of rather than as a matrix, so it costs steps x batch x N and never assembles one. Ablate it: measured, it helps on sequential tasks and hurts where attention already covers the same ground.
- Collective Memory Across Bodies: The persistent Hebbian buffer holds the batch mean of the live traces and is handed back to every row on the next call, so a batch can be run as a colony: independent bodies with private inputs and outputs, one shared memory living on the core. What one body learns at run time (no gradient, no weight update) every other body can read, including a body built after the fact. Measured in
convergence_hive_mind.py.
- Skill Transfer via Transplantation: Learned temporal skills can be transplanted across model sizes and re-used in new tasks.
- Living Dynamics: Demonstrates Willpower (Latch), Rhythm (Stopwatch), and Resonance (Sine Wave).
The Evidence: Zero-Hidden Benchmarks
We pushed OdyssNet to the theoretical limit: Zero Hidden Neurons.
In these tests, the Input Layer is directly connected to the Output Layer (and itself). There are no buffer layers.
| Task |
Traditional Constraint |
OdyssNet Solution |
Result |
Script |
| Identity |
Trivial |
Atomic Unit |
Loss: 0.0 |
convergence_identity.py |
| XOR |
Needs Hidden Layer |
Chaos Gate (Time-folded) |
Solved (3 Neurons) |
convergence_gates.py |
| MNIST |
Needs Hidden Layer |
Zero-Hidden |
Acc: 98.71% |
convergence_mnist.py |
| MNIST (8k) |
Needs Hidden Layer |
Embedded Challenge |
Acc: 93.71% |
convergence_mnist_embed.py |
| MNIST (Record) |
Needs Hidden Layer |
634-Param Core + Attention |
Acc: 89.89% |
convergence_mnist_record.py |
| MNIST Reverse (Generation) |
Needs Decoder |
728-Param Generator |
90.71% Compression |
convergence_mnist_reverse_record.py |
| Sine Wave |
Needs Oscillator |
Programmable VCO |
Perfect Sync |
convergence_sine_wave.py |
| Latch |
Needs LSTM |
Attractor Basin (Willpower) |
Infinite Hold |
convergence_latch.py |
| Stopwatch |
Needs Clock |
Internal Rhythm |
Error: 0 |
convergence_stopwatch.py |
| Detective |
Needs Memory |
Cognitive Silence (Reasoning) |
Perfect Detect |
convergence_detective_thinking.py |
| Skill Transfer |
Needs Re-Training |
Add -> Multiply Transplant |
1.7x Lower Final Loss |
convergence_skill_transfer.py |
| Hive Mind |
Needs Re-Training to Share |
Pooled Plastic Trace (Collective Memory) |
1.000 on Facts No Body Saw (chance 0.125) |
convergence_hive_mind.py |
| Image Diffusion |
Needs a UNet + VAE |
573k-Param Denoiser (trajectory memory) |
~86% Class Fidelity in 15 min |
experiment_diffusion.py |
The MNIST Zero-Hidden Miracle
Standard Neural Networks require Hidden Layers to solve MNIST or XOR. A direct connection (Linear Model) cannot capture the complexity and fails (stuck at ~92%).
OdyssNet solves full-scale MNIST (28x28) with Zero Hidden Layers (Direct Input-Output).
- Inputs: 784
- Outputs: 10
- Hidden Layers: 0
- Thinking Time: 10 Steps
The input layer "talks to itself" for 10 steps. The chaotic feedback loops extract features (edges, loops) dynamically over time and do the work of spatial layers. This proves that Temporal Depth can replace Spatial Depth.
One Memory, Many Bodies
Eight bodies share one 21,280-parameter core and touch nothing else: separate hidden states, separate attention caches, separate forward passes, private inputs and private outputs. Each is shown one edge of an 8-node ring drawn fresh every episode. Every private carrier is then wiped (state zeroed, attention cache reset), and each body is asked to walk the ring from a query symbol, one echo step per edge.
| 320 queries per column |
hop 1 |
hop 2 |
hop 3 |
| together, one shared memory |
1.000 |
1.000 |
1.000 |
| apart, one body alone |
0.297 |
0.134 |
0.094 |
| together, memory blank |
0.147 |
0.141 |
0.112 |
Chance is 0.125. Hop 1 is an edge another body observed; hops 2 and 3 compose edges held by different bodies, which no body could answer from its own inputs. The ring exists only for that episode, so the answer cannot be in the weights, and nothing is trained at run time: the study pass runs under torch.no_grad(), so the write is the architecture's own plasticity.
The only thing between the bodies is the plastic trace they leave on the shared core, which the library pools as the batch mean. The controls say so from every side: move one body's edge and a different body's answer follows it (1.000) while that body run alone answers bit-identically; install another colony's memory and the answers follow that ring (1.000); run the bodies apart and pool the memories afterwards and the result matches the batched one to 3.0e-08; with hebb_type=None the whole thing sits at chance. Trained to seven hops instead of three, the same colony holds 1.000 through four edges and then falls away (0.884, 0.775, 0.228). One echo step walks one edge, so composition depth is temporal depth. Full protocol in section M.
Installation & Usage
OdyssNet is designed as a modular PyTorch library.
Installation
# Recommended: install in development mode
pip install -e .
# Or install all dependencies (including optional LLM/dev extras)
pip install -r requirements.txt
Note on CUDA: The requirements.txt points to CUDA 11.8 compatible PyTorch. If you have a newer GPU (RTX 4000/5000), you might need to install PyTorch manually:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
Quick Start
import torch
from odyssnet import OdyssNet, OdyssNetTrainer, set_seed
# Reproducible results for all examples
set_seed(42)
# Initialize a Zero-Hidden Network
# 1 Input, 1 Output.
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = OdyssNet(num_neurons=2, input_ids=[0], output_ids=[1], device=device)
trainer = OdyssNetTrainer(model, lr=1e-4, device=device)
# Train
inputs = torch.randn(100, 1)
trainer.fit(inputs, inputs, epochs=50)
Initialization Protocols
weight_init=['quiet', 'resonant', 'quiet', 'zero'] is the default strategy: one entry each for encoder/decoder, core matrix, memory feedback, and gate parameters. A single string like 'resonant' is expanded across the slots.
activation=['none', 'tanh', 'tanh', 'none'] is the default activation layout. The first 3 entries map to encoder/decoder, core, and memory paths. The 4th slot is reserved for config symmetry.
gate=None resolves to the default gate layout ['none', 'none', 'identity'] (encoder/decoder off, core off, memory identity gate on). You can pass gate='sigmoid' to gate all branches, ['none', 'none', 'sigmoid'] for memory-only gating, or ['none', 'none', 'none'] to disable all gating.
- All Networks (Default Core):
- Use
weight_init='resonant' and activation='tanh'. The core starts at the Edge of Chaos (ρ(W) = 1.0), which keeps signal fidelity across temporal steps.
- Bipolar Rademacher skeleton + spectral normalization to ρ = 1.0.
- Alternative — Large Networks (>10 Neurons):
weight_init='orthogonal' remains a solid fallback for pure stability.
- Alternative — Tiny Networks (<10 Neurons, Logic Gates):
weight_init='xavier_uniform' with activation='gelu' if resonant convergence is too slow.
- Optional — Parametric Gating: