In-memory computing, also called compute-in-memory or processing-in-memory, is a chip architecture that performs arithmetic inside or directly beside the memory arrays that store the data, instead of shuttling every operand to a separate processor. In AI hardware, it targets the dominant operation of neural networks, the matrix-vector multiplication, and attacks the memory wall: the fact that moving a weight from memory costs far more energy and time than multiplying it.
The term in this context refers to circuit-level and package-level designs for accelerators, not to in-memory databases that keep tables in server RAM. The approach spans analog crossbar arrays built from SRAM, flash, resistive or phase-change cells, as well as digital logic placed inside DRAM or HBM stacks, and it is a leading candidate for energy-efficient inference at the edge.
Why moving data dominates AI energy
In a conventional von Neumann design, the processor and memory are separate, so every multiply-accumulate requires fetching weights and activations across a bus. For large neural networks with low arithmetic intensity, this traffic, not the arithmetic, sets both the power budget and the throughput ceiling described by the roofline model.
The table gives commonly cited orders of magnitude for a mature CMOS process. Exact values vary with process node, voltage and memory size, but the ratio between access and arithmetic is the point that motivates in-memory computing.
| Operation | Relative energy | Comment |
|---|---|---|
| 8-bit integer add | About 1x | Baseline arithmetic |
| 8-bit integer multiply | About 5-10x | Still cheap |
| Small on-chip SRAM read | About 10-100x | Grows with array size |
| Off-chip DRAM read | About 1,000x or more | Dominates large-model inference |
Because a single DRAM access can cost two to three orders of magnitude more than the multiplication it feeds, computing where the weights already sit removes most of the energy bill. This is the core argument for weight-stationary designs, in which parameters never leave the memory array during inference.
How analog compute-in-memory multiplies matrices
Analog compute-in-memory performs a full matrix-vector product in one parallel read of a crossbar array. Each memory cell stores a weight as a conductance value, input activations are applied as voltages on the rows, and each cell contributes a current proportional to voltage times conductance by Ohm’s law. The currents add up on each column by Kirchhoff’s current law, so every column current equals one dot product.
Digital-to-analog converters drive the inputs, and analog-to-digital converters (ADCs) read the column currents. In practice the ADC often consumes a large share of the energy and area, so designers trade output precision, ADC sharing and array size against efficiency. Signed weights are usually represented by differential pairs of cells, and multi-bit weights may be split across several cells.
Memory technologies and design variants
In-memory computing is not one technology but a family of designs that differ in storage cell, compute style and precision. The table compares the main variants used or prototyped for AI workloads.
| Variant | Compute style | Strengths | Weaknesses |
|---|---|---|---|
| SRAM-based compute-in-memory | Digital or charge-domain analog | Standard CMOS, fast, precise | Low density, volatile weights |
| Flash-based analog arrays | Analog current summing | Very dense, nonvolatile | Slow writes, limited endurance |
| Resistive RAM (RRAM) | Analog crossbar | Dense, nonvolatile, low read energy | Device variability, drift |
| Phase-change memory (PCM) | Analog crossbar | Multi-level storage, mature research | Conductance drift over time |
| Processing-in-memory DRAM | Digital logic in DRAM banks | High bandwidth, exact arithmetic | Limited logic per bank, cost |
| Near-memory compute in HBM | Digital units in the logic die | Fits existing accelerators | Smaller energy savings |
A useful distinction separates true in-memory computing, where the array itself computes, from near-memory computing, where logic sits in the same package or die stack. Near-memory designs keep digital precision and integrate more easily with existing software, while analog arrays promise the highest efficiency per operation.
How it compares with conventional AI accelerators
In-memory computing competes with digital accelerators such as GPUs, TPUs and NPUs that use systolic arrays and large on-chip buffers. The comparison below shows where each approach fits best.
| Criterion | Digital accelerator | Analog in-memory computing |
|---|---|---|
| Numerical precision | Exact FP16, bfloat16, FP8 or INT8 | Effective 4-8 bits, noisy |
| Energy efficiency | High, limited by data movement | Potentially many times higher |
| Training support | Full training and inference | Mostly inference only |
| Model updates | Instant weight reload | Slow, wears out some devices |
| Software maturity | Mature compilers and frameworks | Specialized toolchains |
| Best fit | Data-center training and serving | Edge inference with fixed models |
Headline TOPS per watt figures for analog chips are often measured at low precision and high utilization, so they are not directly comparable with digital benchmarks such as MLPerf results. Fair comparisons report accuracy on a full model together with system-level energy, including converters and data movement outside the arrays.
Limitations and engineering challenges
The main obstacle for analog in-memory computing is non-ideal device behavior, which turns exact arithmetic into an approximation. Engineers address it with circuit techniques and with hardware-aware training, in which noise is injected during training so the model tolerates it at inference time.
- Device variability and noise reduce effective precision and can lower model accuracy.
- Conductance drift in PCM and RRAM changes stored weights over hours or days and requires calibration.
- ADC overhead can erase much of the efficiency gain if converters are not shared carefully.
- Limited array capacity means large language models do not fit, so weights must be partitioned or reloaded.
- Endurance limits of nonvolatile cells make frequent weight updates and on-chip training difficult.
Explained without jargon
Imagine a cook who must walk to a distant pantry for every single ingredient. Most of the time goes into walking, not cooking. Ordinary computer chips work in a similar way. They spend most of their energy moving data between memory and the processor.
In-memory computing moves the cooking into the pantry. The calculations happen right where the numbers are stored. For AI, this can save a great deal of power. The trade-off is that some versions use electrical currents instead of exact digits, so the answers are slightly less precise.
A typical use case
A manufacturer of battery-powered security cameras wants on-device person detection without sending video to the cloud. Its compact vision model has about 3 million weights, quantized to 8 bits, which fit entirely inside the analog compute-in-memory arrays of a small inference chip. The weights are programmed once at the factory and never leave the arrays during operation.
Before deployment, the engineering team retrains the model with simulated device noise so that accuracy drops by less than one percentage point on the analog hardware. In the field, each frame is processed in a few milliseconds while the vision workload draws only a few milliwatts. As a result, the camera runs months longer on one battery than an earlier version that used a conventional microcontroller and external DRAM.