Architecture

GLAS: transparent AI from first principles

Recursive competing units for interpretable language modelling. A small model that beats a parameter-matched transformer while showing you every decision it makes.

The problem

The approach

Recursive competing units. Instead of attention layers, the model is a tree of specialists that compete on prediction error. The best predictor wins, and you can see who won.

Three primitives: prediction, error, recursion. Everything else — gating, routing, specialisation — emerges from these. There is no separate routing network to train and no post-hoc attribution to run.

Transparency by construction. At every character, the model exposes which group won the competition, which cell within that group, and how surprised it was. That is not an explanation layered on top of the computation; it is the computation.

The small model

A router feeds four competing groups; each group contains three competing cells. The winner at each level is decided by prediction error, so the trace of winners is the model's own account of how it produced each character. Trained on TinyShakespeare at two parameter budgets, ~100K and ~1M, against a transformer matched for parameter count.

Results

Parameter budgetGLASTransformerGap
~100K parameters1.5981.699−0.10
~1M parameters1.4161.631−0.21

Character-level cross-entropy on TinyShakespeare, lower is better. The gap widens with scale.

Training curves at 1M parameters: GLAS reaches lower cross-entropy than the matched transformer at every epoch after the second
Training comparison at ~1M parameters (GLAS 1,006,887 params; transformer 999,385 params), 50 epochs.
Final cross-entropy versus parameter count; GLAS below the transformer at both sizes, with a widening gap
Final cross-entropy against parameter count. More parameters, greater advantage.

Sample generations, 1M parameters

GLAS
O, thou shalt way, with grief,
and theressely.
HENRY BOLINGBROKE:
Why, and yourself him for
then, I prove him...
Transformer
O, the rard; or the comfort;
see that the ward see would
scatch her dead?
LADY CAPULET:
Good goodven, that in my me...

Routing transparency, live

Six successive characters generated by the 1M-parameter model. For each one: the winning group, the winning cell within it, the weight each group carried, and the model's confidence. Nothing here is inferred after the fact.

What the architecture gives you

Status

The results above are for the small model. I am currently working on how to scale it: larger datasets and model sizes to test scaling laws, training and inference efficiency, and mapping specialist groups to semantic meaning, so that transparency becomes interpretability.