DSv4-Flash REAP Wiki

Wiki pages

On this page

Resources

External review

From the DeepSeek-V4-Flash-0731 interpretability project

How we watched the model think

The technical setup, explained for someone who doesn't do ML for a living.

The model

DeepSeek-V4-Flash-0731 is a "mixture of experts" language model. Instead of processing every word through one big neural network, it has 256 small expert networks at each of its 43 layers. For each token (roughly, each word or piece of a word), a gate picks the best 6 experts for that token and sends it to just those. The rest sit idle.

PropertyValueWhat it means
Layers43How many times the token gets processed in sequence
Experts per layer256How many sub-networks are available at each layer
Experts used per token6How many of those 256 actually get activated
Vocabulary129,280How many distinct tokens the model knows
Expert precisionfp44-bit floats for expert weights (saves memory, slight quality tradeoff)
Attention precisionfp88-bit floats for attention (good balance of speed and quality)
Gate functionsqrt-softplusThe math the gate uses to score each expert

The observation harness

We wrote a Python script called observe_religious.py that does one simple thing: it feeds text to the model and records which experts get selected, without letting the model generate any output. It's like putting the model in an fMRI machine. We can see which parts light up, but we're not changing anything.

Here's what happens for each piece of text we feed in:

  1. The model reads the text token by token
  2. At every layer, we intercept the gate's decision and record: which 6 experts were picked, how strongly each was picked (gate weight), and how active each was (activation norm)
  3. We write this to disk as JSON, one record per text sample
  4. Before accepting a record, we run integrity checks (see below)

The harness runs on two GPU machines working together (the model is too big for one). We verified our interception code line-by-line against the model's actual gate logic to make sure we're recording what the model really does, not a distorted version of it.

How we got the text

  1. Download religious texts from Project Gutenberg and Wikipedia. We were polite about it: max one request every 0.8 seconds for Gutenberg, every 3 seconds for Wikipedia.
  2. Split each book into chunks of at most 16,384 tokens (the model's maximum input size).
  3. Strip verse numbers from the Bible ("1 In the beginning..." becomes "In the beginning..."). This is the step that accidentally created the digit confound we describe in the results.
  4. Tokenize using the model's own tokenizer.
  5. Save as JSONL with checksums so we can detect corruption.

How we measured expert importance (REAP)

We needed a way to rank which experts matter most for a given text. We use a metric called REAP, which is just two things multiplied together:

A high REAP score means the expert was both frequently selected and contributed a lot when selected. We compute this per expert, per layer, per text sample, then average across all samples in a category.

Looking inside the model (J-lens)

We also used two techniques to see what the model is "thinking" at each layer:

We ran both on 80 samples across all traditions. See the J-space lens page for details and the interactive viewer.

Integrity checks

Every single record has to pass these checks before we accept it. If any check fails, we throw the record out and stop the run:

Result: zero violations across all 3,682 records.

The hardware

WhatDetails
Two GPU serversBoth are DGX Spark machines. One acts as the "head" (rank 0), the other as the "worker" (rank 1). They communicate over a direct network link.
ContainerThe model runs inside a Docker container with all dependencies pinned.
Crash recoveryIf the network link between the two GPUs hiccups (which happened several times), the harness skips already-completed records on restart. Zero data lost across 3,682 records and 3 crashes.