# One-step regression and classification with crosspoint resistive memory arrays

Crosspoint memory arrays solve regression in one circuit step

Zhong Sun, Giacomo Pedretti, Alessandro Bricalli, Daniele Ielmini · arXiv · 2020-5-5

- **Problem** Digital solvers reach regression weights step by step, at polynomial cost. Edge devices need faster learning than that, and CMOS scaling is slowing down.
- **Method** The authors wire two RRAM crosspoint arrays into a feedback loop. The loop settles to the pseudoinverse solution, so the weights are read out after one settling of the circuit.
- **Results** On the full MNIST test set, simulated weights scored 92.15%, compared to 92.14% for the analytical solution.

## Why digital regression stays iterative

Linear regression fits an overdetermined system, where the matrix X has more rows than columns and usually no exact solution for w exists. The least squares error approach picks the w that minimizes the Euclidean norm of the residual. The pseudoinverse gives that w in closed form, as w = X+y = (X^T X)^-1 X^T y. On a digital machine, this solution is reached through a sequence of computations rather than in one pass.

The paper describes these iterative algorithms as approaching the solution with a polynomial time complexity.

Logistic regression adds a nonlinear sigmoid to a weighted sum, so its output is a binary value. It often serves as the last classification layer of a deep neural network. Logit transformation turns the labels into a summation vector s, so the weights can follow from w = X+s. Training a two-layer network usually goes through backpropagation, which reduces the squared error iteratively.

For the MNIST case, the second-layer weights come from the pseudoinverse of a 3,000×196 training matrix with a = 0.05.

## A feedback loop that solves the pseudoinverse

The circuit stores X in two crosspoint arrays and closes a feedback loop around them, so it settles to the answer rather than computing it step by step. Each array performs a matrix-vector multiplication through Ohm's law and Kirchhoff's law, one with the conductance matrix G\_X and the other with its transpose. That negative feedback keeps the circuit stable, with virtual ground inputs at all OAs.

![Figure 1: Linear regression circuit and experiments. (A) Schematic illustration of the crosspoint circuit](https://refivu.com/papers/3d9de6a9-144e-4dd9-bf46-2e45035031ef/figures/figure-a6ede97e59f8e7f6367e40ca3d7fa842.png?thumb=512)

**Fig. 1** . Linear regression circuit and experiments. (A) Schematic illustration of the crosspoint circuit

[Original paper](https://arxiv.org/abs/2005.01988v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Zhong Sun, Giacomo Pedretti, Alessandro Bricalli, Daniele Ielmini · One-step regression and classification with crosspoint resistive memory arrays · Original paper figure · Extracted the figure area from page 21 of the original PDF.

The input currents at the left array are G\_X v + i, and the TIA feedback conductance G\_TI converts the output into voltages v\_r for the right array. This zero-current condition gives G\_X^T(G\_X v + i) = 0 in Eq. (3). Solving Eq. (3) for the left-array voltages gives v = -(G\_X^T G\_X)^(-1) G\_X^T i in Eq. (4).

Eq. (4) matches the pseudoinverse solution of Eq. (2) when G\_X, i and v stand for X, -y and w. The input currents carry the negative of the data ordinates y, so the output voltages v are the regression weights w. The matrix X is mapped in a pair of crosspoint arrays, and the vector y is applied as input currents. The weights are therefore read out after one settling of the circuit, with no sequence of digital updates.

## Programming the data and the labels

Before the loop can solve anything, X must be stored in RRAM devices whose analog conductance is set by controlling the compliance current during set. The constant first column of X is a column of discrete resistors at 100 S, because it is identically equal to 1. Each x\_i is an RRAM conductance in units of 100 S for the six-point case, and the unit was chosen for the device's range of linear conduction.

A program/verify routine keeps the two copies of X within a relative error of less than 5%. Some mismatch between the two arrays is tolerated, although their conductance values should ideally be identical.

The target values enter as input currents, so the data ordinates −y are applied as currents to the left array. The input currents are kept small, so the output signal stays low enough that it doesn't disturb the device states in the stored matrix. For logistic regression, the logit transformation turns the labels into a summation vector s, which makes the fit linear again.

The authors binarize s to two fixed values set by a positive constant a, with a = 0.2 in the logistic experiment. Once the labels are binarized, the weights come from the pseudoinverse circuit of Fig. 1A without changing the hardware. The output voltage then yields the weights, and the sign of s = w0 + w1x1 + w2x2 sets the class.

![Figure 2: Logistic regression experiments. (A) Illustration of a logistic regression model, consisting of the](https://refivu.com/papers/3d9de6a9-144e-4dd9-bf46-2e45035031ef/figures/figure-6a02cc94b90388eabf7eb1b85e9b31d6.png?thumb=512)

**Fig. 2** . Logistic regression experiments. (A) Illustration of a logistic regression model, consisting of the

[Original paper](https://arxiv.org/abs/2005.01988v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

## Small hardware checks on linear and logistic regression

The six-point linear regression test compares the circuit weights with the analytical regression line. The intercept w0 shows a relative error of -4.86% against the analytical value. The slope w1 shows a relative error of 0.82%, so the slope tracks the analytical line far more closely than the intercept. The simulated transient shows the linear regression weights are computed within about 1 s.

A different, more scattered six-point set uses the input vector 0.3, 0.3, 0.5, 0.4, 0.5 and 0.7 times I0. The authors use this case to show that the same circuit solves a different linear system without changes. For prediction, an extra row stores a new point x\*, and the circuit returns y\* about 1% smaller than the analytical prediction. The same framework extends to linear regression with two independent variables on a three-column array.

Polynomial terms loaded into the crosspoint arrays let the circuit perform polynomial regression in one step.

The two-class logistic test places the circuit decision boundary against the analytical line for 6 data points. The boundary sits on the decision line where s equals zero, with s at or above zero for class 1. The simulated weight computation takes about 0.6 s. The authors describe the agreement with the analytical solution as tight. Because the circuit also classifies a new point through a grounded extra row, the same setup covers prediction for logistic regression.

## Boston housing in simulation

The Boston housing set has 506 houses with 13 attributes, and the authors train on 333 of them and test on the rest. Before loading, the matrix X is rescaled so that its conductance values in the crosspoint arrays are uniform. The price vector y is also scaled down, which prevents excessive output voltage w. The first column of X is 1, and the other columns hold the 13 attributes of each training house.

The authors simulated the circuit in SPICE, assuming the RRAM devices map matrix values within 8-bit precision. Weights read from the simulated output voltages stayed within ±1% relative error of the analytical weights. The training-set standard deviation P was 4,733$, close to the analytical 4,732$. This check tests whether the circuit keeps its accuracy when the matrix grows from six points to 333 houses with 13 attributes.

On the test houses, the circuit simulation gave a P of 4,779$, compared to 4,769$ analytically. The authors read the small gap between training and test P as support for generalization. Prices for unlabeled test houses can also be predicted in one step by storing their attributes in extra rows and reading the current.

## Training a two-layer network output layer with the pseudoinverse circuit

The authors train only the second layer of a two-layer perceptron, leaving the first layer random. To reduce the circuit size, they used 3,000 of the 50,000 MNIST training samples. The images were down-sampled to 14×14, giving 196 input neurons, 784 hidden neurons and 10 output neurons. The first-layer weights W(1) were drawn uniformly between -0.5 and 0.5.

The hidden matrix is X = f(TW(1)), so the sigmoid output keeps every entry between 0 and 1. The second-layer weights W(2) follow from the pseudoinverse of Eq. (2), with the label matrix Y transformed by Eq. (8) and a = 0.05. Each label row holds a 1 for the true digit and 0 for the other nine neurons.

Each output column of Y is applied as input current to the stored matrix X, so each column is solved in one circuit step. Training took ten steps in total, one for each digit from 0 to 9. The simulated weights classify 500 handwritten digits at 94.2% accuracy, identical to the analytical pseudoinverse solution. On the full 10,000-digit test set, the simulated weights reach 92.15%, compared to 92.14% for the analytical solution.

The authors conclude that the array can accelerate neural network training with near-ideal accuracy.

The simulated second-layer weights agree with the analytical ones for each output neuron, except for the bias weight w0. The bias acts as a regulator of each output neuron summation, so the deviated bias keeps the simulated LSE close to the analytical value. The LSEs differ among the 10 digits because they depend on the weight values. The first-layer weights are random in this study, and gradient descent methods could optimize them further to improve accuracy.

The authors suggest that transfer learning could extend this one-step training to pre-trained deep networks.

The pseudoinverse approach reaches the LSE solution in just one step, while backpropagation reduces the squared error iteratively.

## Variation, wire resistance and energy claims

The authors model the RRAM with 32 discrete conductance levels, 31 uniform levels plus one deep high resistance state. Conductance variation enters as a standard deviation of ΔG/6, ΔG/4 or ΔG/2, with ΔG the spacing between adjacent levels. Across all three settings, the Boston housing simulations keep regression and prediction accurate. In the worst case, ΔG/2, the training-set P reaches 4756$, against an ideal 4732$.

On the test set, P is 4765$ versus an ideal 4769$, so prediction lands even closer to the analytical value. The authors read these gaps as tolerable for regression, prediction and classification.

Wire resistance was tested next, using 65 nm interconnect parameters from the ITRS table together with the RRAM model. With these parasitics, the test-set P rises to 4809$, compared with the ideal 4769$. The authors judge the prediction effect to be the smaller one, consistent with the impact of device variation. Circuit speed depends on λmin, the bandwidth of the first pole, rather than directly on dataset size.

For the MNIST training circuit, the authors estimate an energy efficiency of 45.3 TOPS/W. That is 19.7 times the Google TPU and 6.5 times a highly optimized ASIC system. Both baselines come from published digital systems, so the ratio sets a simulated circuit against those figures. The same MNIST study also tests device variations, and the authors report robustness for classification.

Larger circuits draw more current, and the op-amp capability might limit it. To cap the current, the memory element would need lower conductance, via materials engineering or devices such as electrochemical transistors.

## Simulation scope, current demands and untested cases

The Boston housing and MNIST results come from simulations rather than from fabricated hardware. The SPICE model assumes that RRAM devices map matrix values with 8-bit precision. The authors didn't test whether real crosspoint devices reach that 8-bit precision at Boston scale. The wire-resistance study covers only the Boston housing dataset, using 65 nm interconnect parameters.

Larger circuits need more current, and the operational amplifiers might not supply it. To limit the current, the authors suggest low-conductance memory elements, such as electrochemical transistors. With wire parasitics, the predicted P rises to 4809$, compared to the ideal 4769$. The Boston case uses 13 attributes and 333 training houses, all handled in simulation.

The 45.3 TOPS/W energy efficiency is an estimate from the simulated MNIST network.

The hardware demonstrations use only positive independent-variable values. Negative-valued data requires translating the whole dataset to positive values, shown in Supplementary Fig. S11. The hardware experiments use six data points, so the authors didn't build arrays at Boston or MNIST size. In the MNIST weights, only the bias weight deviates from the analytical values, without affecting recognition accuracy.

## Paper info

- **Authors**: Zhong Sun, Giacomo Pedretti, Alessandro Bricalli, Daniele Ielmini
- **Venue**: arXiv · Preprint
- **First published**: 2020-5-5
- **Added**: 2026-11-6
- **Updated**: 2020-5-5
- **Version**: v1
- **arXiv**: 2005.01988
- **DOI**: 10.1126/sciadv.aay2378
- **Category**: cs.LG · cs.ET · stat.ML
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2005.01988v1) · [PDF ↗](https://arxiv.org/pdf/2005.01988v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Machine learning has been getting a large attention in the recent years, as a tool to process big data generated by ubiquitous sensors in our daily life. High speed, low energy computing machines are in demand to enable real-time artificial intelligence at the edge, i.e., without the support of a remote frame server in the cloud. Such requirements challenge the complementary metal-oxide-semiconductor (CMOS) technology, which is limited by the Moore's law approaching its end and the communication bottleneck in conventional computing architecture. Novel computing concepts, architectures and devices are thus strongly needed to accelerate data-intensive applications. Here we show a crosspoint resistive memory circuit with feedback configuration can execute linear regression and logistic regression in just one step by computing the pseudoinverse matrix of the data within the memory. The most elementary learning operation, that is the regression of a sequence of data and the classification of a set of data, can thus be executed in one single computational step by the novel technology. One-step learning is further supported by simulations of the prediction of the cost of a house in Boston and the training of a 2-layer neural network for MNIST digit recognition. The results are all obtained in one computational step, thanks to the physical, parallel, and analog computing within the crosspoint array.

## Quote from the paper

Zhong Sun, Giacomo Pedretti, Alessandro Bricalli, Daniele Ielmini (2020). One-step regression and classification with crosspoint resistive memory arrays. arXiv:2005.01988v1. https://doi.org/10.1126/sciadv.aay2378

**BibTeX**

```
@article{sun2020step,
  title = {{One-step regression and classification with crosspoint resistive memory arrays}},
  author = {Zhong Sun and Giacomo Pedretti and Alessandro Bricalli and Daniele Ielmini},
  year = {2020},
  eprint = {2005.01988},
  archivePrefix = {arXiv},
  doi = {10.1126/sciadv.aay2378},
  url = {https://arxiv.org/abs/2005.01988v1}
}
```

## Other paper commentary

- [Selective Prediction Intervals: Jointly Learning to Predict, Bound, and Abstain](https://refivu.com/en/papers/c3c86972-2a00-436d-a47b-5ee5b8d85b6e-selective-prediction-intervals-jointly-learning-to-predict.md)
- [AI-Assisted Classification under Correlation Neglect and Trust](https://refivu.com/en/papers/4b2b2db4-6896-48c0-a3f1-7811c863f6d3-ai-assisted-classification-under-correlation-neglect-and.md)
- [A low-rank decoder bottleneck bounds reliability in foundation-model perturbation prediction](https://refivu.com/en/papers/bf045779-02d9-42f9-9266-e9b3f69bf2f1-a-low-rank-decoder-bottleneck-bounds-reliability-in.md)
- [Learning vs. Optimizing Players in Budgeted Games](https://refivu.com/en/papers/1768fa8e-86a3-44ad-befa-e71d7bf1ea63-learning-vs-optimizing-players-in-budgeted-games.md)
- [Classical training of conditional instantaneous quantum polynomial-time Born machines](https://refivu.com/en/papers/6961c1e9-9a8d-4dcb-a176-a415c9bc1440-classical-training-of-conditional-instantaneous-quantum.md)
- [One Scale, Four Texts: Gaps, Overlaps and Silent Repairs in Published Grading Schemes](https://refivu.com/en/papers/7382b199-bae9-4bd2-bc8a-099292ab3de8-one-scale-four-texts-gaps-overlaps-and-silent.md)
- [Spectral Bias and Task-Model Alignment Explain Generalization in Kernel Regression and Infinitely Wide Neural Networks](https://refivu.com/en/papers/0dfeefcb-6d9e-459c-9bec-7d099df6b4b6-spectral-bias-and-task-model-alignment-explain.md)
- [ROAD: The ROad event Awareness Dataset for Autonomous Driving](https://refivu.com/en/papers/01e6bd29-da3b-4a4b-a7bd-d94b12442017-road-the-road-event-awareness-dataset-for-autonomous.md)
- [LPAC: Learnable Perception-Action-Communication Loops with Applications to Coverage Control](https://refivu.com/en/papers/c2b80a60-dd94-4389-b898-b6edeb33088f-lpac-learnable-perception-action-communication-loops-with.md)
- [Reinventing 2D Convolutions for 3D Images](https://refivu.com/en/papers/6c574208-811f-453b-ad33-424db79250ce-reinventing-2d-convolutions-for-3d-images.md)
- [Visual Spatial Reasoning](https://refivu.com/en/papers/21c16be4-8990-40f5-8849-b7c6f46d36b4-visual-spatial-reasoning.md)
- [Mastering the Game of Stratego with Model-Free Multiagent Reinforcement Learning](https://refivu.com/en/papers/c8ba1a5f-8040-4096-92b0-d848951ca124-mastering-the-game-of-stratego-with-model-free.md)

## Terms in this paper

- [Linear Regression](https://refivu.com/en/terms/772ea5657e9d-linear-regression)
- [MNIST dataset](https://refivu.com/en/terms/116e1b87655a-mnist-dataset)
- [standard deviation](https://refivu.com/en/terms/514f0034c693-standard-deviation)
- [backpropagation algorithm](https://refivu.com/en/terms/722f1704214d-backpropagation-algorithm)
- [Boston housing dataset](https://refivu.com/en/terms/6534e3cea7cb-boston-housing-dataset)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/3d9de6a9-144e-4dd9-bf46-2e45035031ef-one-step-regression-and-classification-with-crosspoint)
