Walker

Walker is a decoder-only language model that adds trajectory modeling to the Transformer.

Attention looks at other tokens. Walker looks at how representations move.

Results

Evaluation

MMLU

Validation cross-entropy

Validation cross-entropy so far

Training curve

Training plot

The idea

Attention asks "what should I look at?" by comparing queries with keys:

Attention(Q,K,V)=softmax ⁣(QK⊀d)V \text{Attention}(Q,K,V)=\text{softmax}\!\left(\frac{QK^\top}{\sqrt{d}}\right)V

Walker keeps attention and asks a second question: "where is my representation going?"

Treat the hidden states x₁, xβ‚‚, x₃, … as a path. Walker measures how that path moves:

dt=xtβˆ’xtβˆ’1 d_t = x_t - x_{t-1}

This is a discrete derivative of the hidden state. Attention averages over content. The difference signal captures direction and change, which averaging does not.

Attention can look around the path. Walker also walks along it.

The trajectory signals: velocity, multi-step displacement and the turning angle

Figure 2. The hidden states form a path. Walker reads its velocity d⁽¹⁾, its displacement over longer strides d⁽²⁾ and d⁽⁴⁾, and how sharply it bends (the angle θ).

Architecture

Walker architecture: (a) the full model, (b) one Walker block

Figure 1. (a) Walker is a stack of 16 blocks between a token embedding and a language-model head. (b) Inside a block, the Walk pathway (green) runs in every block and attention (blue) runs in every fourth block, both added to the residual stream. A feed-forward sub-layer follows.

What the Walk pathway computes

Signal Definition What it captures
Velocity (stride 1) dβ½ΒΉβΎβ‚œ = xβ‚œ βˆ’ xβ‚œβ‚‹β‚ Where the state just moved
Velocity (stride 2, 4) dβ½Β²βΎβ‚œ = xβ‚œ βˆ’ xβ‚œβ‚‹β‚‚, dβ½β΄βΎβ‚œ = xβ‚œ βˆ’ xβ‚œβ‚‹β‚„ Longer-range motion
Turn Ο„β‚œ = dβ½ΒΉβΎβ‚œ βˆ’ dβ½ΒΉβΎβ‚œβ‚‹β‚ Change of direction
Curvature ΞΊβ‚œ = 1 βˆ’ cos(dβ½ΒΉβΎβ‚œ, dβ½ΒΉβΎβ‚œβ‚‹β‚) How sharply the path bends; gates the update
Global dynamics Path-level reductions (see Figure 1) Whole-path structure that attention does not compute

The local update is

Ξ”xt=[βˆ‘k∈{1,2,4}tanh⁑(wk)βŠ™dt(k)+tanh⁑(wΟ„)βŠ™Ο„t]βŠ™(1+tanh⁑(Ξ³) κt),xt←xt+Ξ”xt \Delta x_t=\Big[\sum_{k\in\{1,2,4\}}\tanh(w_k)\odot d^{(k)}_t+\tanh(w_\tau)\odot\tau_t\Big]\odot\big(1+\tanh(\gamma)\,\kappa_t\big), \qquad x_t \leftarrow x_t+\Delta x_t

Two design decisions:

  • Exact no-op at initialisation. With every Walk gain and the curvature-gate parameter set to zero, the update Ξ”xβ‚œ is exactly zero. The model starts as an ordinary Transformer and learns how much trajectory to use.
  • Higher learning rate for the Walk parameters (three times the backbone's).

Walker adds trajectory features alongside attention. It does not replace it.

Model details

Parameters ~0.95 B
Layers 16
Hidden size D 2048
Attention heads 16
Vocabulary (GPT-2 BPE) 50257
Context length max_t 16384
Precision bfloat16
Architecture custom WalkGPT (attention + trajectory). Not a transformers AutoModel

Training

Trained on a ~15 B-token mixture of open corpora (see datasets above). That is roughly 1000Γ— less data than SmolLM2/OLMo-class models and is the main limit on factual precision.

Checkpoints

File Notes
checkpoints/ckpt_ongoing_step29750.pt Training checkpoint at step 29750 (model + optimizer state)

Usage

⚠️ Walker is a custom architecture, so transformers AutoModel / pipeline cannot load it. Use the trainer's own inference loader, which rebuilds the network from the saved config.

The quickest route is try_walker.py, placed next to train_walker_1b_continue.py:

python try_walker.py --ckpt checkpoints/ckpt_ongoing.pt --prompt "The migration of the Arctic tern"

Or from Python:

import importlib.util

spec = importlib.util.spec_from_file_location("walker", "train_walker_1b_continue.py")
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)

model, tokenizer, cfg = mod.build_model_for_inference(
    "checkpoints/ckpt_ongoing.pt", device="cuda")
model.eval()

ids = tokenizer("The migration of the Arctic tern", return_tensors="pt")["input_ids"].cuda()
out = model.generate(ids, max_new=64, temperature=0.8, top_p=0.9)
print(tokenizer.decode(out[0]))

A companion Gradio Space / MoLab portal visualises the hidden-state trajectory in 3-D while tokens are generated; see the Space linked from this repository.

Design history

Walker is the end of a longer search: twelve designs, most of them falsified. The full story, with a verdict for each design, is in HISTORY.md.

Show the lineage

Cladogram of the designs that led to Walker

Stored objects, richer relations and learned interaction operators did not beat attention. What survived was modelling how the representation moves, which became the Walk. See HISTORY.md for the evidence behind each branch.

Limitations

  • Base model. It continues text and does not answer questions. Instruction following needs SFT.
  • Factual precision is bounded by the ~15 B-token budget.
  • Math is unreliable for base language models; route arithmetic to a tool.

Summary

Walker=Attention+Trajectory Modeling \boxed{\text{Walker}=\text{Attention}+\text{Trajectory Modeling}}

Attention: what information is relevant? Walker: how is the representation moving?

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Datasets used to train Papatpong/Walker

Space using Papatpong/Walker 1