Checking how many agents are working

How this works
Contatti
← Blog
A dark glass panel with a grid of tiny dots, a handful glowing olive and one amber, with the AMARBARO mark centered above it.
✎post del blog

Looking inside a model: what a neuron in an AI is

The short version

An AI neuron is a small unit inside a model that can be read, located and switched off, and the honest result of doing so is that the tools work and most findings are weaker than hoped.

What this is about

Inside a language model there are millions of small units. People call them neurons, after the cells in a brain, but they are much simpler. A neuron in a model is a place where a number is computed from other numbers. Sometimes that number is high for certain kinds of text and low for others.

Looking at these units is part of a field called interpretability. The goal is to find out what a model is doing inside, not only what it says. This article shows what that looks like with our tool, mojo-neuron, and why we think the careful result is more useful than a lucky one.

Why it matters

A model is a black box for most of us. If you can see that one unit pushes up the word "snake" and another responds to sentences about water, you start to understand how the model works. You can also check claims. If someone says "this model has a unit for lying", you can test it.

It also teaches a hard lesson about evidence. It is easy to find one prompt where a neuron looks meaningful. That is not a finding. A finding has to survive a bar you set before you looked.

How it works

Let us go through what the tool can do, from easiest to hardest.

Read. For one layer of a model, the tool works out which words each neuron pushes up and which it pushes down. This is called the logit lens. Think of it as asking "if this neuron fired hard, what would the model want to say next?"

Locate. For a piece of text you give it, the tool shows how strongly one neuron fires on each token. For "The snake slithered away", you can see where neuron 777 lights up. This runs on the CPU, for a few model types.

Steer. While the model writes, the tool adds a dose of a neuron's direction. If the neuron leans toward snake words, steering makes the text lean that way. This needs the graphics card and our engine.

Ablate. The tool switches a neuron off, or scales it, and measures what changes.

What it costs to look

The quickest start reads layer 12 of a small model, Qwen2.5-0.5B, keeps the top and bottom 10 words for every neuron, and checks 8 neurons against a slow, exact calculation. On a CPU, that took 11 seconds. A bigger run, steering all 4,864 neurons of that layer plus 64 random controls, took 28.8 to 29.0 seconds on the card. An earlier public tool took 119.4 to 128.9 seconds for a comparable job on one small model.

Checks that can fail

The habit we most want you to copy is not a feature. It is how each feature is checked.

Take the logit lens. The check recomputes 8 sampled neurons with a slow exact method and demands the same ranking. A match alone proves little. A check that compares a thing to itself also matches. So the check also runs two broken versions on purpose, one with the ranking reversed and one that reads the neighbor neuron. Both must fail. If either one passes, the check is blind, and the whole check fails.

We also keep a bar before each experiment. The repository has 63 files that state a bar in advance. A number marked as found after the fact does not count as a pass.

The honest part: most research missed

The README has two tables. The first lists what passed. The second lists what mostly did not.

What passed:

  • The lens and its check, in 11 seconds for one layer.
  • Steering cost only 0.7 percent of decode speed, with 606.5 and 602.0 tokens per second as the two figures.
  • A tuned version of the lens beat the plain lens at all six layers tested, on a small amount of data.
  • A lie probe reached an AUROC of 0.87 to 0.91 on plain and reworded statements.

What missed:

  • The same lie probe on negated statements, such as "It is false that" followed by a true fact, scored 0.331. That is worse than guessing. The bar was 0.70. Its README notes a limit that fits: the probe reads a claim inside a sentence, not the sentence itself.
  • A transcoder, a kind of learned map of a layer, reached an error of 0.641 where the bar was 0.55, and a simple linear map reached 0.520.
  • A gate that decides when to steer fired wrongly on 12.3 percent of English statements, where the limit was 5 percent.
  • The plain logit lens used as a guide was no better than chance up to layer 12 of 24.
  • Three advance-registered runs of a model-dream test failed.

AUROC, in plain words, is a score where 0.5 is guessing and 1.0 is perfect. So 0.331 is below guessing. A tool that looks right on easy cases can fail on a rewording, and only a planned test shows it.

What this teaches

A tool that works on one prompt can look like a finding. A tool whose checks can fail, with bars set before the run and misses published beside passes, gives you results you can lean on.

Limits

We tested on one machine with one AMD RX 7900 XTX through ROCm. Other cards are untried. The engine work covers small dense models up to 4B and one 9B hybrid. The CPU forward pass covers only a few model families. And the steering lens refuses contexts over 96 tokens.

Words you may not know

  • Neuron: one small unit in a model that computes a number from other numbers.
  • Layer: one stage of the model. Text passes through many in a row.
  • Logit lens: a way to read which words a neuron pushes up or down.
  • Steering: adding a neuron's direction while the model writes.
  • Ablation: switching a neuron off or scaling it and measuring the change.
  • AUROC: a score for a yes-or-no test, 0.5 for guessing and 1.0 for perfect.
  • Bar: the result you decided in advance would count as a pass.

Try it

  • See every tool, number and limit on the mojo-neuron project page.
  • Get the code, public under Apache-2.0, at mojo-neuron on GitHub. The README's quick start reads one layer on the CPU. It needs the Mojo toolchain and two of our libraries, so check its install list first.
  • Pick one claim you have heard about what a model "knows" and ask what check could prove it wrong.

Commenti

Ancora nessun commento.

Accedi per commentare.