null theory.
← Back to notebook Planning note, October 2026

Taking the transformer apart.

A plan for a small causal transformer on adjoint, our in-house autograd engine, with one careful ablation to see what each piece actually contributes. No training runs yet.

Starting question

What is learned inside a small causal transformer, and which architectural decisions make learning easier or harder? A useful answer should go beyond a diagram: it should identify specific operations, testable expectations, and measurable differences across controlled changes.

What we plan to build

A small causal transformer, from scratch, on top of adjoint , the lab’s in-house CPU autograd engine. Owning both the model and the engine keeps the stack small enough to read end to end, so every operation in the forward and backward pass is one we can inspect.

  • Token and position embeddings, and a stack of transformer blocks with masked scaled dot-product attention, residual connections, and layer normalization.
  • An autoregressive training loop with cross-entropy loss, written against adjoint’s autograd.
  • Deterministic tests of the causal mask, tensor shapes, forward pass, and gradients.

The matrix M masks future positions for causal attention. The softmax converts the available attention scores into weights, and their weighted combination of the value vectors produces the output.

First planned experiment

One ablation: remove layer normalization while keeping everything else fixed. Train on a small, controlled synthetic task, across multiple seeds, with one fixed evaluation set and matched compute budgets for both conditions. Record final loss and accuracy per seed, plus a few selected internal activations.

The goal is not a benchmark number. It is to see whether a specific architectural piece changes the training trajectory in a way that reproduces across seeds, under matched conditions, on an evaluation set chosen before the runs.

Results

Not started

When runs exist, this section will hold loss curves across seeds with and without layer norm, final evaluation accuracy per seed, and the exact training script and config. Until then, this page describes an intention, not a result.

Related work

Our approach follows this line of work: reimplement at small scale, then change one component at a time and measure what moves.

Next note: adjoint vs PyTorch