Tuned lens for Inkling 2 Mini (all 48 layer visits)

A tuned lens for Thinking Machines' Inkling 2 Mini, a looped transformer whose layers 6–17 run three times (48 layer visits per token from 24 layers).

A tuned lens is a small learned translator per layer: it maps a hidden state from the middle of the model into the "language" of the final layer, so the model's own output head can read it. This is the idea from Eliciting Latent Predictions from Transformers with the Tuned Lens (Belrose et al., 2023).

This is not a copy of Inkling. It contains only 48 small translators (2304 Γ— 2304 each). You still need the model itself (for example through NDIF).

What's covered

Every layer visit, read at the input of the visit. Visits are numbered 0–47 in the order they run:

visits layers part
0–5 0–5 prelude (runs once)
6–17 6–17 loop run 1
18–29 6–17 loop run 2
30–41 6–17 loop run 3
42–47 18–23 coda (runs once)

layer_visits.json lists the mapping.

Note on layer 6 (visits 6, 18, 30): Inkling restarts every loop run from the prelude's output and passes the previous run's work in through gated "messages" inside the layers. So the input of layer 6 is identical on all three runs, and these three translators see the same data.

Files

File Format
translators.safetensors A_{visit} (2304 Γ— 2304) and b_{visit} (2304): translated state = A @ h + b, then Inkling's own final norm and output table
lens/thinkingmachines/Inkling-2-Mini/ the same translators in the format of the tuned-lens library (params.pt with {i}.weight = A βˆ’ I and {i}.bias, where i is the layer visit)

Use it with the tuned-lens library

The lens/ folder follows the layout of AlignmentResearch's lens collection, so the official library loads it straight from this repo:

import os
os.environ["TUNED_LENS_REPO_ID"] = "loh0607/inkling-2-mini-tuned-lens"
os.environ["TUNED_LENS_REPO_TYPE"] = "model"

from tuned_lens import TunedLens
lens = TunedLens.from_model_and_pretrained(model)   # model = Inkling 2 Mini
logits = lens(hidden_state, idx=visit)               # visit = 0..47, not the layer number

Pass the layer visit (0–47, see the table above) as idx, not the layer number. I checked that the library's predictions match the reference implementation in translators.safetensors on 100% of held-out positions. The library does not apply Inkling's logit soft cap (tanh at 30), which leaves the top predictions unchanged.

How it was trained

  • Data: 150 passages (TinyStories text and short chat-format questions), ~30 positions each: 4,127 positions per visit (3,303 train / 824 held out, split by passage).
  • Target: Inkling's own prediction at the final layer (KL divergence between the lens's prediction and the model's), using Inkling's real output table and final norm.
  • Each translator starts as "no change" (exactly the logit lens) and is trained for 4 epochs with Adam.

Results (held-out passages)

How often the lens's top word matches Inkling's actual final prediction:

logit lens this tuned lens
prelude (layers 0–5) 1–7% 46–58%
loop runs 1–3 (layers 6–17) 1–27% 47–69%
coda (layers 18–23) 12–71% 66–87%

Live example (a fresh prompt, never seen in training)

"Which instrument is Yo-Yo Ma famous for playing? Answer in one word.": Inkling's real next token is "Cel" (cello). Top predictions at the last position:

visit logit lens tuned lens (top 3)
layer 6, loop run 1 μ•ˆλ…•ν•˜μ„Έμš” The, Sara, Tuesday
layer 15, loop run 1 οΏ½ The, Kenya, Cel
layer 15, loop run 2 (blank) The, Yo, Cel
layer 9, loop run 3 , Cel, The, Yo
layer 17, loop run 3 ΠžΡ‚Π²Π΅Ρ‚ Cel, cello, Yo
layer 20, coda piano Cel, cello, Yo
layer 23, coda cello Cel, cello, Yo

The logit lens only finds the answer in the last two layers; the tuned lens shows it forming in the loop and becoming the top prediction during loop run 3.

Limitations

  • Small training set (4,127 positions per visit); fp16 weights.
  • A tuned lens reads what the model is about to say. In my experiments it did not reveal hidden intermediate reasoning steps (it named the hidden middle person about as often as an unrelated name from the prompt); a probe trained on the hidden step itself did.

Code and write-up

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

Model tree for loh0607/inkling-2-mini-tuned-lens

Finetuned
(120)
this model

Paper for loh0607/inkling-2-mini-tuned-lens