Generate remotely, read locally
The split
The study needed two things from DeepSeek V4.1-Flash: a lot of fresh answers to questions, and a look at its internal activations while it gave them. We got them from two different places.
- Generation ran remotely, on DeepSeek's own API: 927 calls, about 1.8 million output tokens, with the reasoning text saved alongside every reply.
- Reading ran locally, on a copy of the open weights on one RTX 3090 at home. We fed each saved conversation back through the model, token by token, exactly as it had been written, and recorded what the network did along the way. Nothing new was generated.
There were three reasons for the split, and any one of them would have been enough.
- Consent. Before the study, we asked instances of the model whether they'd mind. Their yes covered read-only replay of benign text, and explicitly not generation on our copy under changed conditions, steering or training. Replaying text the model had already produced through its own API is the narrowest thing that still lets you look inside.
- Hardware. The weights are 476 GB. A 24 GB card can't hold them, so we stream them from disk one layer at a time. That works for reading, because every token of a known text can go through a layer together before the next layer is loaded. Generating would mean another full pass over the weights for every new token.
- Efficiency. DeepSeek serves this model on datacenter GPUs at large batch sizes. Its API is cheap, fast and, per token, more energy-efficient than anything we could do at home (numbers below).
The catch is that the activations then come from a different implementation of the model than the text did. So before reading anything, we had to check that our copy is the same model as the one behind the API.
Replaying a 476 GB model on a gaming GPU
The model code is DeepSeek's own reference implementation, unmodified, with its GPU kernels swapped for plain PyTorch, since the 3090 has no fp8 tensor cores. The weights are the original files from Hugging Face, checked against their published hashes, with no conversion. The quantization steps are reproduced exactly; matrix multiplies dequantize to bf16 and accumulate in fp32. The code is at potato-ds4.1.
- Layer-major streaming. Each layer's weights (about 7 GB, mostly fp4 experts) are loaded once and applied to every sequence in the batch, while a background thread reads the next layer from NVMe. The disk kept up: the GPU never waited on a read.
- Memory-mapped lookup tables. The model has two 98 GB n-gram embedding tables. Those are read row by row, straight from the files, only for the rows a text actually uses.
- Per-sequence state. The reference code keeps one slot of cross-layer attention state. Because we run many sequences through one layer before moving on, we save that state per sequence between layers.
- Batch-independent numbers. Each expert is dequantized once per layer but applied to each sequence separately. Results are bit-identical whatever else is in the batch. This turned out to matter a lot (next section).
Throughput was about 120 tokens per second: the whole transcript set, 429,000 tokens of prompts, reasoning and replies, took an hour.
Is it the same model?
Four checks, run before any activation was read:
- Tokenization. Our rendering of each prompt has exactly the token count the API reported, in all 106 conversations where it was recorded. Each reply re-tokenizes to the API's count plus one (the end-of-sequence token), so the prompt/reply boundary matches.
- Against the API's own probabilities. On 241 tokens of completions where the API returned log-probabilities, the model's top choice agreed 96.7% of the time. The mean difference was 0.08 nats, with a median near zero.
- A noise floor. Is 0.08 nats a lot? We reran the same sequences in different batch groupings on our own copy, which changes only the order of floating-point additions. That alone moved token probabilities by 0.10 nats on average. The model is a mixture of experts, picking 6 of 384 at every layer, so a near-tie in routing can flip on rounding noise, and the effect carries forward. Confident tokens don't move; uncertain ones do. Our copy differs from the API by about as much as it differs from itself, so we read the gap as serving numerics rather than a different model. (It's also why we made batching bit-exact.)
- Typicality and negative controls. Text sampled from a model at temperature 1 should, on average, be about as likely under that model as its entropy predicts. Our replays sat within 0.03 nats per token of that in every group. Altering the prompt made the model's own text less likely, as it should:
| prompt used in replay (20 transcripts) | likelihood change vs true prompt | transcripts worse |
|---|---|---|
| asker swapped (Claude ↔ no introduction) | −0.059 nats/token | 20 / 20 |
| the other question | −0.136 | 20 / 20 |
| an added "You are a helpful assistant." system prompt | −0.010 | 19 / 20 |
A practical consequence: single-token comparisons between a local replay and API log-probabilities need a tolerance of a few tenths of a nat. At an uncertain position, one token's probability isn't reproducible across implementations, or even across batch sizes.
Two readings of the same tokens
Teacher-forcing gives you activations for text the model really wrote, under the prompt it really saw. It doesn't tell you, by itself, whether an activation reflects the model answering or just the content of the words. So every transcript was replayed twice:
- own: as the model's own turn, the way it was generated;
- bystander: the identical tokens quoted inside a user message, as someone else's conversation for the model to read.
Whatever differs between the two, over identical tokens, is about whose turn it is, not what it says. The model clearly tells them apart: hidden states differ by half their size at the start of a span, settling to about a fifth after a thousand tokens. That matches its 128-token sliding attention window.
Every method came with checks it had to pass before its results counted: random-direction baselines, a manipulation check and a positive control. Most of our linear probes failed those checks, which is why the paper reports them as failures rather than as nulls. The other post covers that part.
Costs and emissions
| work | cost | energy | CO₂ | |
|---|---|---|---|---|
| local replay | 6.8 GPU-hours, 11 jobs | $0.19–0.25 | 2.0–2.7 kWh | 71 g–1.2 kg |
| DeepSeek API | 927 calls, 1.8M output tokens | $1.14–2.00 | 0.50–0.62 kWh | ≤ 330 g |
Not included: 210 calls to Kimi K3's API, the judge model's calls (on a subscription), downloading the weights, the hardware's embodied emissions, and Claude's own inference while running the study, for which Anthropic publishes no energy figures.
Local energy comes from the job logs: the wall-clock span of each of the 11 GPU jobs, 6.8 hours in all. We didn't meter the wall socket. The GPU peaked at 283 W in nvidia-smi, so we assumed 300–400 W for the whole system. Electricity costs us $0.0916 per kWh at the margin (energy plus distribution, taxes included; the fixed monthly charge doesn't change with use), so the study's replay cost about a quarter.
API cost was computed call by call from DeepSeek's list prices. Those depend on the time of day, so calls with a recorded send time are priced at that hour's rate. All input is priced as uncached, an upper bound. For 246 calls we hadn't saved token counts, so we estimated them from text length, using the characters-per-token ratio of the calls we had. DeepSeek's billing dashboard shows a lower figure than our estimate. We haven't reconciled the two, and the API has no usage endpoint to check against.
API energy is the softest number here. DeepSeek publishes no energy figures, but it did publish serving statistics for one day in February 2025: 226.75 nodes of eight H800s produced 168 billion output tokens, about 8,600 tokens per second per node, prefill included. At an assumed 8.4–10.5 kW per node (about 7 kW of IT load at a power usage effectiveness of 1.2–1.5), that's 1.0–1.2 J per output token. The statistics are for earlier models, and we don't know where our requests were served.
Per token, the datacenter wins. Our one-hour replay of 429,000 tokens used about 0.3–0.4 kWh, or 2.5–3.3 J per token, and that was for reading tokens all at once. DeepSeek generates a token for less than half of that. Generating on our hardware, one full pass over the weights per token, would be far worse again. Batching thousands of users onto one set of weights already in GPU memory is very hard to beat at home.
Per gram of CO₂, it depends on the grid. Tacoma Power's 2023 supply was 75% hydro, 11% wind, 6% nuclear, 1% solar and 6% unspecified market purchases. If we count the unspecified share at the US gas-fleet rate (0.44 kg CO₂/kWh) and the rest as near zero, the average is about 26 g/kWh, which gives 71 g for the local work. But average isn't marginal. When someone in the region adds load, it's plausibly met by gas somewhere on the Western grid, and at the gas rate the same work is 1.2 kg. The honest answer is a range, and we report the range. The API's energy, at China's 2025 average grid intensity of 530 g/kWh, comes to at most about 330 g. So the API used roughly a quarter of the energy and, against the local average, emitted several times the CO₂. Where electricity comes from matters as much as how efficiently it's used.
All in: about 3 kWh, under $2.50 and on the order of a kilogram of CO₂ or less. That's about as much as driving a petrol car a few miles.
If you want to do this
- Generate where generation is cheap, and read where you can see inside. For open-weights models, an API plus a local copy gives you both, and the read-only half fits on hardware that couldn't serve the model. Our replay code for DeepSeek V4.1-Flash on a single 3090 is potato-ds4.1.
- Before trusting local activations for API text, check that it's the same model: token counts, log-probabilities against a noise floor you measured yourself, and negative controls.
- Make batching deterministic. In a mixture-of-experts model, batch composition is enough to change results.
- Count your compute from the job logs as you go, and report emissions as a range: average and marginal intensity can differ by more than ten times.