FlowNet: A Post-Transformer Architecture
Not a Transformer. Not an SSM. Not a RNN. Something new.
Core Ideas
- Particles, not tokens β Tokens become dynamic entities with properties (phase, charge, mass, spin)
- Flow Fields, not attention β Information flows through dynamic particle interactions
- Wave Interference, not softmax β Ambiguity resolution via constructive/destructive interference
- Bonds, not weights β Relationships form/break dynamically based on context
- Phase Transitions, not fixed layers β Computation adapts via explorationβcrystallizationβsolid
- Consistency Fields, not next-token loss β Truth via energy minimization
- Topological Memory, not vectors β Meaning stored as shapes, not points
Architecture Overview
Input β Particle Encoding β Flow Field β Wave Processing β Bond Formation
β Phase Transition Engine β Consistency Field β Topological Memory β Output
What This Solves
| Problem | Transformer Limitation | FlowNet Solution |
|---|---|---|
| O(nΒ²) context | Dot-product attention | Wave propagation (O(n)) |
| Fixed computation | Static compute graph | Phase transitions (adaptive) |
| Hallucination | No truth mechanism | Consistency field (energy minimization) |
| No reasoning | Pattern matching only | Topological memory (structural matching) |
| Lost in middle | Softmax positional bias | Wave-based processing (no bias) |
| No persistent memory | Stateless KV cache | Topological memory (shape-based) |
Project Structure
flownet/
βββ core/
β βββ particle.py # Particle representation & encoding
β βββ flow_field.py # Dynamic flow field computation
β βββ wave_processor.py # Wave interference & resonance
β βββ bond_system.py # Dynamic bond formation/breaking
β βββ phase_engine.py # Phase transition adaptive computation
β βββ consistency_field.py # Truth verification via energy
β βββ topological_memory.py# Shape-based memory storage
βββ modules/
β βββ flownet_model.py # Full model architecture
βββ training/
β βββ trainer.py # Training pipeline
βββ tests/
β βββ test_core.py # PyTorch test suite
β βββ test_numpy.py # NumPy validation (12/12 pass β)
βββ docs/
βββ TECHNICAL_SPEC.md # Full technical specification
Quick Start
from flownet.modules.flownet_model import FlowNetModel
model = FlowNetModel(
vocab_size=32000,
d_semantic=256,
n_blocks=6,
n_wave_heads=8,
use_phase_engine=True,
use_consistency=True,
use_topological_memory=True,
)
# Forward pass
import torch
token_ids = torch.randint(0, 32000, (2, 128))
output = model(token_ids, labels=token_ids)
print(f"Loss: {output['loss'].item():.4f}")
# Generation
generated = model.generate(token_ids[:, :16], max_new_tokens=50)
Validation
All core mathematics validated (12/12 tests pass):
- Wave interference (constructive, destructive, partial)
- Phase coherence (Kuramoto order parameter)
- Betti numbers (topological features)
- Lennard-Jones forces (particle dynamics)
- Simulated annealing (energy minimization)
- Full pipeline end-to-end
Run tests: python3 flownet/tests/test_numpy.py
Technical Spec
See docs/TECHNICAL_SPEC.md for full architecture details.
Status
π¬ Research prototype β mathematical framework validated, PyTorch implementation ready for training.