Where the activation function goes
A neuron is a weighted sum and then a nonlinearity. In a digital accelerator those are two stages and nobody thinks about it. In compute-in-memory the sum arrives as an analog quantity that has to be converted, which raises an appealing idea: let the conversion apply the nonlinearity too, and save the step. The idea is real, it is published, and it is available to exactly the architectures that need it least.
A neuron does two things: it takes a weighted sum of its inputs, and it puts that sum through a nonlinear function. ReLU, GELU, SiLU, a sigmoid — the particular function changes with fashion and with the network, but the structure does not. Sum, then bend.
In a digital accelerator these are two stages of a pipeline and nobody gives it a second thought. The multiply-accumulate unit produces an integer; a small lookup table or a handful of gates bends it. The cost is rounding error in the last bit and a vanishing fraction of the energy.
Compute-in-memory makes it interesting, because the sum does not arrive as a number. It arrives as a current, or as a voltage on a capacitor, and something has to convert it. That converter is the most expensive thing in the macro — in published analog compute-in-memory designs the data converters routinely account for the majority of macro energy and area, which is why so much of the field's effort goes into them rather than into the array.
So the idea suggests itself: if a converter is going to resolve the sum anyway, why not have it resolve the activation function at the same time? Make the comparison thresholds follow the shape of the nonlinearity instead of being uniform, and the conversion produces the activated value directly. One stage disappears, and in principle so do some of its decisions.
It is a real idea. It is also a published and patented one, which is worth knowing before anyone builds a company on it.
The same pipeline three times, with one stage moved. Top: the nonlinearity is folded into the conversion, so the converter emits an activated value. Middle: the conversion is linear and a small table bends the result afterwards, which is what digital accelerators do. Bottom: the nonlinearity is absorbed into the weights at training time where the function allows it, and the hardware never sees it. The stage that moves is the only thing drawn in accent.
What folding it in actually buys
Two things, and they are worth different amounts.
It removes a stage. Real, but small. The activation stage in a digital datapath is a lookup table and a requantisation; against a converter and a shift-add accumulator it is not where the energy is.
It can remove converter decisions. This is the valuable one. A converter's energy scales with the number of decisions it makes [3], so any information that lets it make fewer is worth having. If the nonlinearity is going to flatten a whole region of the output range to the same value — which is exactly what ReLU does below zero, and what saturation does at the top — then resolving that region finely is wasted work.
Note what that second argument actually depends on. It is not really about the activation function. It is about knowing something in advance about the range the answer will fall in. The activation function is one source of that knowledge, and not the strongest one.
The catch, and it is structural
Folding the nonlinearity into the conversion requires one thing: at the moment of conversion, the value being converted has to be the finished sum. Bend an unfinished number and the bend is wrong, because a nonlinear function of a partial sum is not a partial result of the function.
That requirement rules the idea out of most exact designs, for a reason that has nothing to do with circuit skill.
The way to get an exact result out of a resistive array is to stop asking each cell to hold many analog levels. Store few bits per cell — one, in the limit — and combine the pieces with shift-and-add outside the array. This is bit-slicing, it goes back to the earliest crossbar accelerator proposals [1], and it is the standard answer to the accuracy ceiling the review literature describes [2]. It works because every individual read is a decision between well-separated states rather than a measurement of a small analog difference.
But bit-slicing means a single conversion holds a slice, not a neuron. The finished sum does not exist until the slices are combined, which happens after the converter, in the accumulator. There is nothing at conversion time for an activation function to be applied to.
Bit-slicing spreads a weighted sum across several reads that are combined afterwards by shift-and-add. Each conversion is exact and each is a fragment. The finished value — the only thing a nonlinearity could legitimately act on — appears after the accumulator, which is where the dashed boundary sits. This is why an activation-shaped converter and an exact bit-sliced readout are difficult to want at the same time.
So who is it for?
Fold the nonlinearity into the conversion and you need one conversion to carry a complete sum. That means the full input precision applied in one step, against a weight held in a single multi-level cell. Which is to say: the architectures with the most analog levels to resolve, the tightest tolerance on device-to-device variation, the most drift to track, and the accuracy ceiling the review literature describes.
The idea is available to exactly the designs that can least afford its preconditions. That is not an argument against anyone pursuing it — a design that has already accepted approximate arithmetic has much less to lose, and a saved converter decision is a real saving. It is an argument against treating it as a general win.
The transferable part is the weaker claim, and it survives in any architecture: a converter that knows in advance what range its answer can fall in does not have to resolve the range it cannot be in. That knowledge can come from the activation function. It can also come from the data — from how many inputs are non-zero in this particular step, which is known before the conversion starts and bounds the answer whatever network is running. That version needs no assumption about what function comes next, and it does not need the sum to be finished.
The nonlinearity, meanwhile, is perfectly happy where digital accelerators have always put it: a small per-layer programmable table after the accumulator, where the number is complete and bending it is exact.
References
- , “ISAAC: A Convolutional Neural Network Accelerator with In-Situ Analog Arithmetic in Crossbars,” ACM/IEEE International Symposium on Computer Architecture (ISCA), pp. 14-26, 2016. doi:10.1109/ISCA.2016.12simulationCited for bit-slicing: a multi-bit weight spread across several single-bit or low-bit cells, with the partial products combined by shift-and-add outside the array. The technique that makes an exact result possible, and the reason a single conversion is not a finished neuron.
- , “Resistive Switching Random-Access Memory (RRAM): Applications and Requirements for Memory and Computing,” Chemical Reviews, vol. 125, pp. 5584-5625, 2025. doi:10.1021/acs.chemrev.4c00845reviewThe field's standard review. Cited for the accuracy ceiling of an analog column: about eight bits regardless of how many bits each cell stores, because IR drop dominates device noise.
- , “ADC Performance Survey 1997-2024,” Stanford University, online dataset, 2024. github.com/bmurmann/ADC-surveymeasured siliconThe standard compilation of published converter performance. Used here only for the general relationship between resolution and energy per conversion step.