kt-ram · neural-lanes · assimilation · llm · qwen3 · bitnet · quantization

Chapter 10: An LLM Pathfinder for kT-RAM

We mapped Qwen3-0.6B onto emulated kT-RAM neural lanes and found five obstacles. Most of them trace back to how ordinary language models are trained.

By Alex Nugent ·

Contents
  1. TL;DR
  2. Why a language model
  3. A language model in brief
  4. What a neural lane does
  5. What we did
  6. Obstacle 1: a few very large weights
  7. Obstacle 2: a few enormous activations
  8. Obstacle 3: signal precision
  9. Obstacle 4: small errors add up
  10. Obstacle 5: the size of a write step
  11. What worked and what did not
  12. The obstacles come from training
  13. Noise as a limit and a resource
  14. Key lessons
Conceptual illustration of a glowing amber trail crossing a maze of copper channels on graphite. It bends around an oversized copper block, fans out through several thin channels and breaks into short segments, while two side channels glow faint teal.

TL;DR#

  • This was a pathfinding run. We put a real language model, Qwen3-0.6B, onto emulated kT-RAM neural lanes to find every place where the model and the hardware disagree.
  • The lane version held up. Run in floating point , a lane-legal version of the whole model stayed closer to the original than standard 4-bit compression . One full layer was then taught onto emulated lanes from streamed examples, and it reproduced its target.
  • The path is expensive. It needs 4 to 8 synapses per weight, banks cut into dozens of pieces, extra digital work around every bank, and training streams that would run to terabytes for the whole model. Only one layer ever ran on lanes.
  • Most of that cost comes from how the model was trained. Trained in full floating point, ordinary language models learn a few very large weights and a few enormous activations, and nearly every workaround we needed was aimed at those. Other groups have trained models without them.
  • Better-fitting models already exist. Microsoft’s BitNet b1.58 was trained from the start with weights of only −1, 0 and +1. On paper it removes most of the obstacles we found.
  • The lessons point at the model. The lanes held up and the hardware needed no changes. Models that fit the lane rules should remove most of the cost.

Why a language model#

Chapter 1 proposed a way to distribute AI: “Ship synapses. Stream transforms. Forget weights.” A server converts a model into a form the hardware can hold. The server then records the converted model’s inputs and outputs and streams those pairs to edge hardware. The edge hardware learns from the pairs with its own write rule, quickly and locally, without anyone loading weights into it. The same stream can update or fine-tune devices already in the field.

Chapter 4 introduced the neural lane, and the emulator made it something we could run. Chapter 8 taught a chain of lane banks to replace a trained image classifier. Chapter 9 showed how a bank can pass activation magnitude to the next bank through timing.

A language model is the obvious next test, and a much harder one. We did not expect a clean result. We wanted to learn where the problems are.

A language model in brief#

A language model reads text as a sequence of tokens, roughly word pieces, and predicts the next one. Qwen3-0.6B does this with a stack of 28 layers. Each layer has two blocks. The attention block lets each token gather information from earlier tokens. The feed-forward block (the FFN) transforms each token on its own. That gives 56 blocks in all.

Most of the model’s 0.6 billion parameters sit in large matrices inside those blocks. A matrix multiplies a list of numbers coming in, the activations, and produces a new list going out. Between the matrices sit a few small operations: normalizations, a softmax in attention, a nonlinearity in the FFN. We keep those small operations digital and put the matrices on lanes.

To score a copy of the model, we compare its predictions for the next token with the original’s, token by token, over a fixed set of text. The measure is the KL divergence, which is zero for a perfect copy and grows as the copy’s predictions drift. For reference, llama.cpp’s popular 4-bit compression (Q4_K_M) scores 0.067 on this model on our test. Rounding every weight to plain 4 bits scores 0.289. Our best version of the model under the lane rules, run in floating point, scores 0.057.

Run in floating point under every lane limit, the whole model stayed closer to the original than llama.cpp’s 4-bit compression.

What a neural lane does#

A neural lane is a column of synapses, and each synapse is a pair of memristors whose difference in conductance is a signed weight. In the scheme from Chapter 9, input lines switch on for a duration that encodes their value. The lane integrates the current, and a falling voltage ramp reads out when the lane trips, at one of 16 levels. The lane learns through its own write rule, a short pulse that nudges the conductances toward a target.

  • Range and precision are linked. The largest weight a synapse can hold shrinks as the lane gets longer. The circuit’s gain can raise the range, but a higher gain also makes each write pulse a bigger step.
  • Signals are coarse. We set inputs and outputs to 16 levels (4 bits) on purpose, so we would work under a tighter limit than the hardware has. At the noise settings we used, read noise limits a lane to about 80 levels, between 6 and 7 bits.
  • Learning is local. The write rule only sees the lane’s own input and target.
  • There is noise. Every read carries thermal and flicker noise from the devices and the comparator.

What we did#

First, on a GPU, we replaced every matrix in the model with a simulated lane bank. A simulated bank computes what a lane bank would compute. Its inputs are rounded to 16 levels, its weights are held within the range a lane allows, and its outputs are read at 16 levels. The digital steps around the bank, such as splitting it into parts and adding the parts’ outputs, are simulated too. We call these simulated banks float stand-ins. They run in ordinary floating point, but every weight and every signal stays within what a lane can hold.

We could not copy the original weights into the stand-ins. Many of them exceed a lane’s range, and the rounding changes what the matrix computes. Instead we recorded each matrix’s inputs and outputs on real text and fitted the stand-in’s weights by gradient descent to reproduce those outputs, with every lane limit applied during the fit. We worked block by block, from the first layer to the last. Each block was fitted on the inputs produced by the stand-ins before it, with the target that brings the model’s running state back in line with the original’s, and then frozen. That let each block correct some of the error left by the blocks before it.

Second, we took one layer, layer 22, and taught its banks onto lanes in the public emulator, ktram-neural-core. We recorded each bank’s inputs and target outputs from the stand-in, streamed them in order, and let the write rule do the rest, starting from random conductances. That is the distribution step from Chapter 1, on one layer.

A float stand-in number below comes from the lane-legal model running in floating point, and a lane number comes from banks taught in the emulator.

Obstacle 1: a few very large weights#

Language models have a few weights that are much larger than the rest. On a lane, the largest weight a synapse can hold shrinks as the lane gets longer, and a bank reading 3,072 inputs has very long lanes. Raising the gain to reach the big weights made every write pulse a sledgehammer.

We cut each bank into parts, up to 64 per bank. Each part is a short bank that reads a slice of the inputs, and the digital decoder adds the parts’ outputs together. The synapse count stays the same, and each weight gets as much more room as there are parts. Splitting the FFN banks of layer 22 roughly halved their error at the same synapse count (float stand-in).

Obstacle 2: a few enormous activations#

Language models also carry a handful of activations that are thousands of times larger than the rest. Qwen3 creates one in layer 2. Its size is about 6,800 against a typical 5, and the model uses it as an anchor. Researchers call these massive activations. Related outlier features appear in about one value in a thousand.

Bar chart of FFN output size per token in Qwen3-0.6B layers 0 to 3, on a log scale. Typical and 1-in-1,000 tokens stay between about 4 and 14. The first token in layer 2 reaches about 6,700.
Most tokens leave each FFN block with an output size between 4 and 7, and even the largest one in a thousand stays below 15. In layer 2 the first token's output reaches about 6,700, roughly 1,400 times the typical token. A 16-level signal with one fixed scale cannot carry both.

Our input code clipped the top 0.1% of values, a reasonable-sounding rule that flattened the outliers in every block. When we stacked the layers, the model collapsed at layer 2 (KL 4.24). A handful of anchor tokens, well under 1% of the training data, had pulled the fit for every ordinary token toward their size. Static scales also wasted the 16 levels: one huge value forced every small value onto the bottom one or two levels.

A handful of anchor tokens, well under 1% of the data, was enough to collapse the whole model at layer 2.

The workarounds added digital work. We gave each part its own scale for each token, so the largest value in each part uses all 16 levels. We applied a fixed rotation inside each part, made of additions and subtractions, which spreads a large value over many lines. Together these cut the error of the input code at layer 22 by a factor of about 30 (float stand-in). We stored the first token’s output as a constant in most blocks, and we dropped the anchor tokens from training.

Obstacle 3: signal precision#

Language models normally run with 8 to 16 bits per activation. We held every lane signal to 4 bits on purpose, to see how far a coarse signal path could go. Under that limit, the extra precision had to come from somewhere else.

We added it with synapses. Each bank got a second copy that rounds its inputs half a level later than the first, and the decoder averages the two. It works like reading a length with two rulers whose marks are offset by half a mark. Together they resolve steps that neither ruler can. Copies on every bank took the whole model from KL 0.115 to 0.057 (float stand-in) and doubled the synapses from 4 to 8 per weight.

Line chart of whole-model KL against synapses per weight. KL falls from 0.115 at 4 synapses to 0.078 at 6.4 and 0.057 at 8, crossing below llama.cpp Q4_K_M at 0.067. Plain 4-bit rounding sits at 0.289.
Each step adds synapses and moves the whole model closer to the original. With per-token scaling, the rotation and two offset copies of every bank, the lane-rule model passes llama.cpp's Q4_K_M at 8 synapses per weight. All values are float stand-ins.

The hardware also offers a route through time. The number of levels in a read is the number of clock steps in the ramp, and at the noise settings we used, read noise allows about 80 levels. A longer read adds precision without adding synapses and costs read time instead. We have not yet measured that trade on a language model.

Obstacle 4: small errors add up#

Before fitting anything, we measured how errors from separate blocks combine. We added independent random noise to the output of every block and scored the model. Noise with 1% of each output’s power gave KL 0.059, already close to 4-bit compression. At 3% the KL was 0.175, and at 10% it was 0.595. Four groups of layers, each tested with noise on its own, summed almost exactly to the result with noise in all of them (0.577 vs 0.595).

Line chart of whole-model KL against injected noise from 1% to 30% of block output power. The curve for noise in all 56 blocks and the sum of four layer groups tested alone lie almost on top of each other.
Noise in all 56 blocks at once costs the same as the sum of four layer groups tested separately. Errors from independent blocks add up, so the error each block can afford shrinks as the model gets deeper.

Uncorrelated errors did not average out. Averaging cancels noise when several estimates of the same quantity are combined and divided. A transformer instead adds each block’s output to a running sum, the residual stream, and never divides. Independent errors then behave like a random walk. Their combined power grows with the number of blocks, and the model’s error follows that power. Errors would only cancel if they were anti-correlated.

Errors from separate blocks do not average out. They add up, so each of the 56 blocks can contribute only about a fifty-sixth of the error the whole model tolerates.

The errors from our fitted blocks were worse than random noise. At the same size they cost about twice as much, because a fitted block misses in the directions the model uses most. Seven blocks fitted separately cost 1.3 times the sum of their individual costs when installed together, so their errors compounded a little. Fitting each block to cancel the error left by the blocks before it is a deliberate attempt to make errors anti-correlated, and it recovered 17%.

The same arithmetic hides problems from single-block tests. A code that kept only part of each block’s input looked fine on one block and scored KL 3.2 on the whole model. Our early fitted blocks missed their targets by 6% to 9% each, and 56 of them would have summed to a KL between 3 and 5. To land near 4-bit quality, each block could add only about a fifty-sixth of the total.

Obstacle 5: the size of a write step#

Teaching on lanes hit the range problem from the other side. The stand-ins needed a high gain to reach their largest weights. At that gain, a single write pulse moved a lane’s output by about a sixth of its full output range, so the write rule overshot every target. At a lower gain the steps were fine, but the largest weights no longer fit.

Two line charts for the seven banks of layer 22 at gains 16, 32, 64 and 128. Left: teaching error is lowest near gain 32 and rises steeply to about 0.3 at gain 128. Right: the share of weights beyond the lane's range falls from 30 to 73% at gain 16 to zero at gain 128.
At gain 128 every bank overshoots, because each write pulse is a large step. At gain 16 the steps are small, but 30% to 73% of each bank's weights fall outside the lane's range. Gain 32 is the best single compromise, and it still leaves some banks with large errors (lane).

Splitting the banks further resolved the conflict. With eight times the parts, the gain could drop by a factor of eight and the range stayed the same. The taught gate and query banks then landed within about 0.006 (normalized error) of their stand-ins. With both on lanes, the whole-model score moved from 0.1156 to 0.1157 (lane), which is insignificant.

Dot chart of the layer 22 gate bank's error for four teaching settings, comparing the float stand-in with the bank taught on lanes. Only gain 16 with eight times the parts brings the taught error down to 0.0061.
Refitting at gain 32 or splitting the bank 4× did not close the gap between the stand-in and the taught bank. Cutting the gain to 16 with eight times the parts gave the lanes both the range and a small enough write step, and the taught error fell to less than half the next best setting (lane).

Banks taught on emulated lanes from streamed examples left the whole-model score unchanged.

The 16-level read sets a floor of its own. The write rule compares the lane’s read level with the target’s level, so it cannot see or correct an error smaller than one level. At best, taught banks matched their target level on about 85% of lanes and missed by one level on most of the rest. Splitting adds to this, because every part contributes its own one-level misses to the sum. A longer read would give the rule a finer error signal and should lower that floor, once the write step is small enough to act on it. We have not tested it.

What worked and what did not#

What happened
Whole model, lane rulesKL 0.057 at 8 synapses per weight, better than 4-bit compression (0.067). Float stand-in.
One layer on lanesAll seven banks of layer 22 were taught from streamed pairs. At the best setting, two taught banks left the whole-model score unchanged. Lane.
Read noiseIts cost was insignificant on every bank. Lane.
Conductance resolutionRounding every weight to the device’s 255-step conductance grid changed nothing (0.0779 to 0.0774). Float stand-in.
Hardware changesNone were required. A finer write step would help.
Synapses per weight4 to 8, against about 1 for a direct mapping.
Bank layoutDozens of parts per bank, each with its own readout and digital decode.
Digital workPer-part scaling, rotation, decoding and digital sums, plus special handling for the first token and the anchor tokens.
Training streamAbout 470 KB per token per layer at the best setting, or roughly 1.7 TB to sync the whole model (estimate).
Not testedMore than one layer on lanes, the full split on five of the seven bank types, and teaching one pair at a time.

The hardware needed no changes. The cost of read noise and the device’s conductance grid was insignificant.

The banks we taught at the best setting settled within a quarter of a pass over their data, about 130,000 examples. With the emulator’s 1 µs write pulse and a read clock of 10 to 100 ns, that is about a second or less per bank on hardware, and every bank can learn at the same time. This is an estimate, because no hardware for it has been fabricated yet.

The training stream sets the time instead. Every part of every bank needs its own target, so the splits that cleared obstacles 1 and 5 make each example wide.

The obstacles come from training#

The bank splits came from a few very large weights. The scaling, the rotation and the special cases came from a few enormous activations. The copies came from 16-level signals that were too coarse for the model. None of that is required for a language model to work. Ordinary models learn these features because they are trained in full floating point, where nothing discourages them.

Others have shown this directly. The Qwen team added a small gate to each attention head’s output and trained models without the attention sink or the massive activations. The largest activations fell from about 1,000 to under 100, and the gate is now part of Qwen3-Next. Outlier-Safe Pre-Training trained a 1.4 billion parameter model with essentially no outliers, at about 2% extra training cost. Its authors conclude that outliers come from the training method and are not built into language models.

Microsoft’s BitNet b1.58 is the clearest example. Every weight in its layer matrices is −1, 0 or +1 times one scale per matrix, and its activations are rounded to 8 bits with one scale per token. It was trained that way from the first step, on 4 trillion tokens. Across Microsoft’s benchmark suite it scores close to ordinary models of its size: an average of 54.2 against 55.2 for Qwen2.5-1.5B.

On paper, BitNet removes most of our obstacles:

  • Weights: with only three weight values, the largest weight is the typical weight. Banks should not need to be split, and each weight needs about one synapse.
  • Scales: BitNet already scales activations per token, which is the scaling we had to add.
  • Training stream: without splits, each example only has to carry each bank’s real outputs. By our estimate that is about 14 KB per token per layer, roughly 30 times narrower, for a model with almost five times as many layer weights.

BitNet still expects 8-bit activations, about 256 levels. Our reads gave 16, and Chapter 9 measured about 80 at the noise settings we used. Whether that gap matters is still an open question.

Noise as a limit and a resource#

Noise plays opposite roles in the two kinds of work we do on lanes. In a language model it is a limit. Each activation has to carry a precise value from one bank to the next, and read noise caps how many levels a lane can resolve. Analog in-memory computing faces the same limit. IBM researchers found that noise on a crossbar’s inputs and outputs hurts accuracy more than noise in its weights, and that models must be retrained with the noise in place to recover (Rasch et al., 2023). In sampling, the same noise is the resource. A lane read at low voltage is already a draw from a probability distribution (Chapter 3b), and Chapter 6 used that to sample from a trained bank. CHILL ZEN set its sampling temperature with the comparator’s noise. It generated Fashion-MNIST images with a lower FID than Extropic’s published reference, at a projected 2.0 nJ per image against 15.7 nJ for Extropic’s design. Probabilistic bits made from unstable magnets (Camsari, Sutton and Datta, 2019), Extropic’s all-transistor sampler (Jelinčič et al., 2025) and the older physics of stochastic resonance (Gammaitoni et al., 1998) rest on the same idea: noise helps whenever the computation is a random draw. The read voltage and the comparator setting decide which role noise plays, so the same lane can be read quiet for an activation and hot for a sample.

Key lessons#

The lane rules can hold a language model. Run in floating point under every lane limit, the whole model stayed closer to the original than 4-bit compression. The layer we taught on emulated lanes reproduced its stand-ins.

The hardware did not need to change. The cost of read noise and the device’s conductance grid was insignificant. A finer write step is the one hardware property that would help.

Most of the cost comes from how the model was trained. The splits, the scaling, the rotation and the special cases all trace back to a few large weights and a few enormous activations. Float training creates those features, and other training methods avoid them.

Every block has to be precise. Errors from separate blocks add up over the 56 blocks and do not cancel. Each block can contribute only a small share of the error the whole model tolerates, so a test on one block says little about the whole model.

Range and write step trade against each other. A higher gain reaches larger weights but makes each write pulse a coarser step. Splitting a bank into parts gives back both, at the cost of more readouts and wider training examples.

The training stream sets the teaching time. On hardware, a bank should settle in about a second. Delivering its examples takes far longer, and every split widens each example. A model that needs fewer splits is faster to teach.

Several paths follow from these lessons. We will take them up in later chapters.