Reported experiment
N-Dimensional Smooth Graphs
The architecture
A single NDSG layer updates input x by mixing it along d learned graph structures:
where:
- x ∈ ℝb×n — input (batch_size × n_nodes)
- Pi ∈ ℝn×n — a learned row-stochastic matrix for dimension i, computed as Pi = softmax(Di / τi)
- wi — learnable importance weight for dimension i
- α — small smoothing factor (~0.1)
- d — number of NDSG dimensions (typically 2–6)
Each Pi is a learned graph. Different dimensions can specialize:
- Dimension 0: local / adjacency-like connections
- Dimension 1: medium-range dependencies
- Dimension 2+: longer-range or abstract structure
The parameters of the model are the graphs. No separate attention matrices, no separate convolution kernels — just the stochastic transition matrices and their weights.
CPU-first numbers
The architecture was pivoted from GPU-centric to CPU-centric design, with concrete measured results:
| Config | Params | Speed (it/s) | Memory | Latency |
|---|---|---|---|---|
| TinyFast | 49,600 | 79.3 (92.2 JIT) | 0.2 MB | ~12 ms/batch |
| UltraFast-128 | 147,968 | 38.3 (42 JIT) | 0.59 MB | ~25 ms/batch |
| Small | 247,558 | ~20 | 1.0 MB | higher |
| (Original GPU-focused) | 10M+ | 8 (GPU) | 1.3 GB | — |
TinyFast gets 10× more throughput than the original GPU-first design while using about 6,500× less memory. It runs happily on a laptop, no accelerator needed.
What actually worked
- Small models fit in L2 cache. 64–128 hidden dimensions stay in cache; 768+ thrashes it.
- Few layers beat many. 2–3 NDSG layers; deeper hurt.
- Few dimensions beat many. 2–6 graphs beat 32+.
- Block processing. 64-sample blocks for cache locality.
- torch.jit.script for 1.2–1.5× speedup.
- BatchNorm over LayerNorm — more CPU-friendly.
- OMP_NUM_THREADS = 4 optimal for most consumer CPUs.
What didn't work
- einsum on CPU — slower than straightforward matmul.
- Sparse operations — overhead dominates at these sizes.
- Mixed precision — no benefit on CPU.
- Large batches — cache misses dominate.
On this workload small dense operations and modest batches performed well. Cache size, memory bandwidth, precision, backend and batch shape all affect that result.
Framing: learn structure, not just weights
Most neural architectures are pattern-matchers with fixed structure: the architecture is chosen, only the weights are learned. NDSG makes the structure itself the parameter — the stochastic matrices Pi are where the learning happens.
This is similar in spirit to graph neural networks, but:
- GNNs usually take the graph as input (known topology, unknown features).
- NDSG has no input graph — it learns d graphs from data.
- Each graph is row-stochastic, so x' stays on a convex combination of previous values.
The softmax-stochasticity is the key structural prior: each node redistributes probability mass along its outgoing edges, scaled by the learnable weight wi.
Honest caveats
A few things to flag:
- Benchmark depth. The speed/memory numbers are on the stated hardware and batches; different setups will differ. They are comparative (CPU-optimized vs GPU-transplanted) rather than absolute SOTA claims.
- Task scope. The published benchmarks focus on WikiText-style language modeling and auxiliary multimodal tasks. It has not been run against transformer baselines at matched parameter counts at larger scale.
- “Universal computation” claims. The architecture is NC²-compatible and has been tested on small pointer-chasing and copy-reverse tasks. Extrapolation from those to universal byte-level multimodal intelligence is aspirational, not measured.
- Learned structure ≠ interpretable structure. Nothing forces Pi to correspond to a human-readable graph; what emerges is whatever minimizes loss on the training data.
The reported model has about 49,000 parameters and ran at 80 iterations per second in this setup. At four bytes per parameter the weights occupy about 0.196 MB. Runtime memory also includes activations, state and allocator overhead.
Why it fits a broader program
NDSG sits naturally alongside the other byte-level architectures on this site:
- Streaming byte models — sibling: streaming constraint + iterative refinement + reservoirs.
- The Hecke-node architecture — sibling: algebraic inductive bias at level 163.
- The φ3 algebra — sibling: deductive architecture search via Hilbert series.
All four share the conviction that byte-level processing with strong structural priors is underexplored, and that small models with the right structure can beat large models without it.
Cite this page
Richard Hoekstra. N-Dimensional Smooth Graphs. https://richardhoekstra.nl/papers/ndsg.html