Skip to main content

Interview Lab

How can a 24-layer Transformer run 48 layer applications per token?

Inkling 2 Mini stores a 6-layer prelude, 12 middle layers, and a 6-layer final block. For one next-token prediction, it runs the middle layers 3 times and the outer blocks once each. Thinking Machines Lab architecture notes

Follow what stays fixed and what changes across the three passes.

Animated solution

Follow one next-token prediction

Inkling 2 Mini

  1. Token embeddings

    Input token IDs → hidden states

  2. Block 1 · Prelude

    Layers 1–6 · runs once

  3. Blocks 2–3 · Shared middle

    Layers 7–18 · three passes

  4. Block 4 · Final block

    Layers 19–24 · runs once

  5. Output head

    Hidden states → next-token logits

Layers with stored weights
24
Layer applications so far
0 / 48

The prelude runs once.

Its output is available to all three middle passes.

Worked solution

24 layers with distinct weights, 48 layer applications per token.

  1. Count each layer’s weights once. The stored depth is 6 + 12 + 6 = 24.
  2. Count every execution. The middle layers run 3 times, so the forward pass performs 6 + 3 × 12 + 6 = 48 layer applications.
  3. Inside the loop, each pass updates the hidden representations. Inkling 2 Mini feeds the prelude output to every pass and carries a learned message from the previous pass. These internal passes happen before the model produces next-token logits.

More passes add sequential computation while reusing stored weights. The layer count alone does not predict wall-clock latency or cache memory. Those also depend on the kernels, hardware, and what the model caches across passes.

Models that loop through depth

The example above uses Inkling 2 Mini. The original Inkling checkpoint in Architecture Explorer is a different model. Thinking Machines also published a variable-loop research checkpoint. TML-d24-varloop-research

Research papers