betaFeedback

WorksComputer Science

Closed-Form Optimal Weight Splitting for Matrix-Vector Multiply on Noisy In-Memory Accelerators

Abstract

Analog in-memory computing performs the matrix-vector multiplications of neural networks directly inside the memory array, which saves time and energy. But each memory cell stores only a few levels and is noisy, so one cell cannot hold a weight precisely. The standard fix is to split each weight across several cells, like digits of a number. The base of this split decides the trade-off: a large base gives fine resolution but amplifies the noise, and a base near one averages the noise but wastes resolution. The best-known prior analysis considers only the noise, and so it always picks a base of one. We propose a principled method that also accounts for the limited number of levels per cell. It gives the optimal base in closed form, from a single measurement of the device noise. On a device-physics simulator, the optimal split is 3.3 dB more accurate than the common base-16 split, and it beats equal splitting in end-application accuracy.

Introduction

The matrix–vector multiply (MVM) is the computational core of scientific computing (the inner loop of Krylov solvers, the application of discretized differential operators, dense factorizations) and of machine-learning inference. Analog in-memory computing (AIMC) performs it in a single physical step: weights become the conductances of cells in a resistive crossbar, the input vector is applied as voltages, and by Kirchhoff’s laws the bit-line currents sum to the matrix–vector product. For MVM-bound workloads the efficiency gain is large enough to make AIMC a seriously pursued accelerator substrate.

Unlike a digital low-precision format, whose error is deterministic rounding a numerical analyst can bound, an AIMC crossbar realizes arithmetic with a stochastic error budget: the programmed state is perturbed by device noise, and the analog summation adds IR-drop and analog-to-digital conversion error on top. The designer’s knob is therefore not the rounding mode but the encoding: how to represent each value across the physical cells so that this hardware noise does the least damage to the result. Choosing that encoding for maximum accuracy on an imprecise unit is exactly the question this workshop poses of low-precision hardware in general; AIMC is an extreme, and increasingly practical, instance.

The standard encoding lever is redundancy: store each value across several cells and let the bit-lines sum them, like the limbs of a multi-word number, except each limb is physically noisy. This creates a genuine tension. Spreading a value across a fine place-value grid (a large base) buys resolution but gives the high tile a large place value, which amplifies its noise in the summed output; storing identical copies (base one) averages the noise away but adds no resolution. The base of the representation trades these off. The closest prior analysis, Le Gallo et al. [1], derives a closed-form slicing error for analog crossbars but models device noise only; that term is monotone in the base, so their closed form gives an optimal base of one (equal-fill), and the resolution axis never enters. Their experiments do report a case where b=2b=2 helps, but through an error-correction programming algorithm, not from the representation itself, and without a model of why. Others fix the base empirically [10] or search it per device; Mackin et al. [2] optimize a significance factor by evolutionary search over a proxy metric, reporting a value of two. What is missing is the resolution–noise trade: an error model that also carries the finite-grid quantization floor, so that a nontrivial base is optimal for the encoding itself and can be read off from the device noise rather than fixed or searched. We build that model on the assumption that each tile’s MVM-output noise is additive: its magnitude does not scale with the stored code, though it is calibrated per tile from the programmed weights; the non-additive parts of a real crossbar (IR-drop, ADC) are not modeled but are carried in the device-physics simulation of Sec. V, where the predicted optimum is shown to survive them.

We resolve this by treating the crossbar as a custom fixed-point representation with a per-tile output-noise parameter η\eta and asking the classical numerical question: how to represent for minimum error under a hardware error model. We contribute:

  • An error model with the resolution–noise trade. We extend the closed-form slicing-error model of [1], whose noise term we recover exactly, by adding the finite-grid quantization floor, and minimize it to a closed-form optimal base, bopt=1+1/(12bound2η2)b_{\mathrm{opt}} = 1 + 1/(12\mathrm{bound}^{2}\eta^{2}). It is an interior optimum that recovers the prior equal-fill (b=1b=1) result only in the noise-dominated limit (Sec. IV).

  • An encoding and a search-free calibration rule. An overlapping place-value split realizes the interior base while keeping the high tile’s place value, and thus the amplification of its noise in the output, small; a fixed shared rotation makes the Gaussian model apply to real operators (Sec. III). The base follows from one device-

  • Validation across three fidelities. From an analytic model through a full device-physics simulator to end applications, the predicted base gives +3.3 dB over the naive nibble split and is operator-agnostic across scientific and neural-network MVMs (§ 5).

Low-Precision MVM as a Numerical Problem

Tile MVM and encoding: A crossbar tile computes y=Wxy = W x with W∈RT×TW \in\mathbb{R}^{T \times T}. Each weight is not stored as a real number but encoded as nWn_W integer cell states {sk}k=0nW−1\{s_k\}_{k=0}^{n_W-1}, sk∈[−bound,bound]s_k \in[-\mathrm{bound}, \mathrm{bound}] with bound=2q−1−1\mathrm{bound} = 2^{q-1} - 1 for a signed qq-bit cell, and decoded by a place-value sum with a shared per-column scale,

w^=scale⋅∑k=0nW−1bksk.(1)\hat{w} = \mathrm{scale} \cdot\sum_{k=0}^{n_W-1} b^k s_k. \tag*{(1)}

The base bb and cell count nWn_W define the representation: b=1b = 1 is equal-fill duplication, b=2qb = 2^q is a non-overlapping bit-slice, and intermediate bb is the overlapping regime this paper studies.

The error budget: Two sources corrupt w^\hat{w}, mirroring the on-silicon decomposition of the MVM error into a weight-programming (“linear”) term and a residual device term [3]. Quantization is deterministic, from the finite integer grid, familiar from any fixed- or floating-point format (posits, custom low-precision) and here set by the master step Δ=scale\Delta= \mathrm{scale}. The distinctively analog source is read noise. The output is read as nWn_W separate tile products y~k\tilde{y}_k that the periphery scales by place value bkb^k and sums, y^=scale∑kbky~k\hat{y} = \mathrm{scale}\sum_k b^k\tilde{y}_k; each tile read carries an additive error y~k=yk+nk\tilde{y}_k = y_k + n_k, with nk∼N(0,σout2)n_k \sim\mathcal{N}(0,\sigma_{\mathrm{out}}^2). We normalize this as η\eta, the per-tile output-noise std relative to the per-tile signal RMS, the same kind of normalized noise (σδG/Gmax⁡)(\sigma_{\delta G}/G_{\max}) used to characterize PCM crossbars [4]. Because the place-value scaling is applied after the noisy read, the output error decomposes as

y^−y=(y^q−y)⏟quantization+scale∑kbknk⏟noise,(2)\hat{y} - y = \underbrace{(\hat{y}_q-y)}_{\text{quantization}} + \underbrace{\mathrm{scale}\sum_k b^k n_k}_{\text{noise}}, \tag*{(2)}

where y^q\hat{y}_q is the noiseless quantized output. The tile at place value bkb^k thus has its output noise weighted by bkb^k in the sum. This coupling of place value to output noise is the mechanism the encoding must manage, and the object we optimize in § 4. We measure the resulting error as the relative MVM MSE, relMSE=E∥y−y^∥2/E∥y∥2\mathrm{relMSE} = \mathbb{E}\lVert y-\hat{y}\rVert^2/\mathbb{E}\lVert y\rVert^2, equivalently SNR=−10log⁡10relMSE\mathrm{SNR} = -10\log_{10}\mathrm{relMSE}.

Assumptions: For analytic tractability, and following common practice in AIMC noise modeling, we take Wij,xjW_{ij}, x_j i.i.d. Gaussian, clip weights at Wmax⁡=kσσWW_{\max} = k_\sigma\sigma_W (kσ=3k_\sigma= 3, so clipping loss is negligible; § 4), and use signed 4-bit cells (bound =7= 7) throughout. Crucially, we take each tile’s MVM-output noise nkn_k to be additive: its variance σout2\sigma_{\mathrm{out}}^2 is a per-tile quantity, calibrated from the programmed weights, but within a tile it does not scale with the individual stored code. This models the regime in which the dominant read error is a fixed jitter set by the ADC and peripheral circuitry rather than by the individual programmed conductance: in a differential pair the two devices are read against each other, so a common conductance-scale factor cancels, and after global drift compensation the residual is well approximated as additive [3]. Real crossbars are not exactly additive: the output noise can scale with the stored code, and a conductance-proportional (multiplicative) component would recover the b=1b=1 optimum of [1]. Our result applies to the additive-limited regime, with the general case a mixture (§ 7). As § 4 shows, it is precisely the additive term that moves the optimum off b=1b=1. The Gaussian operand assumption is likewise not merely convenient: a fixed random orthogonal rotation of WW (Sec. III), which cancels in the MVM, drives the per-column operand distribution toward Gaussian even for heavier-tailed real weights, so the analysis applies to real operators, not only synthetic ones.

Overlapping Base-N Representation

Encoding: For nW=2n_W = 2, a weight ww is master-quantized onto an integer grid of range bound(1+b)\mathrm{bound}(1+b) and split by place value across two cells:

m=round⁡(w/scale),sH=trunc⁡(m/b),sL=m−bsH,(3)m = \operatorname{round}(w/\mathrm{scale}), \qquad s_H = \operatorname{trunc}(m/b), \qquad s_L = m - b s_H, \tag*{(3)}

with scale=Wmax⁡/[bound(1+b)]\mathrm{scale} = W_{\max}/[\mathrm{bound}(1+b)] and both sH,sLs_H,s_L clipped to [−bound,bound][-\mathrm{bound},\mathrm{bound}]; the bit-level reconstruction w^\hat{w} via the decode sum (1). The base bb is a positive integer: it is the radix that carves the integer code mm into the two integer cell codes, so sL=m−bsHs_L = m-bs_H is integral only for integer bb. Absent clipping, the low digit satisfies ∣sL∣≤b−1|s_L| \le b-1, so for b≤bound+1b \le\mathrm{bound}+1 it never saturates. This is why equal-fill is that sHs_H and sLs_L are in general different integers.

The overlap principle: High digit kk covers the integers [kb−bound,kb+bound][kb-\mathrm{bound},kb+\mathrm{bound}], a run of 2bound+12\mathrm{bound}+1 values spaced bb apart, so the reconstructed grid has no gap precisely when b≤2bound+1b \le2\mathrm{bound}+1. Base-16 exceeds this (16 > 15): the value 8 needs sL=8s_L=8 or −8-8, both outside [−7,7][-7,7], so it is unreachable, a gap in the representable grid. The stronger condition b≤bound+1b \le\mathrm{bound}+1 used below also keeps the low digit unsaturated (∣sL∣≤b−1≤bound|s_L| \le b-1 \le\mathrm{bound}). Overlap is redundant: the master range bound (1+b)(1+b) is covered without the high tile’s place value bb growing large. The per-tile output noise is the same at any base; the base only sets how strongly the high tile’s noise is weighted in the summed output (2), so the noise variance scales as ∑kb2k\sum_k b^{2k}: 1+62=371+6^2=37 for seven cells versus 1+162=2571+16^2=257 for the naive non-overlapping base-16 nibble split (Figure 1), a 7×7\times reduction that § 4 makes exact. The base therefore sets a resolution–noise trade: larger bb gives a finer grid but more strongly amplifies the high tile’s noise in the output.

Overlap principle: high-digit coverage and noise cost of the base

Figure 1. Overlap principle. (a) Value-range covered by each high digit ([kb−bound,kb+bound][kb-\mathrm{bound}, kb+\mathrm{bound}] in low-cell-step units): for base-6 the bands overlap into gap-free coverage, while base-16’s bands leave gaps (e.g. ±8\pm8) in the representable grid. (b) Noise cost: the tile noise variance amplifier 1+b21+b^2 Eq. (5) is 37 for base-6 vs. 257 for base-16, the ≈7×\approx7\times gap behind the measured +3.3 dB, shaded over the validity range b≤bound+1b\leq\mathrm{bound}+1.

Preconditioning: The rotation of Sec. II is a fixed block-diagonal random orthogonal matrix, shared across tiles and reproducible from a seed, so it adds no storage and costs one matmul per tile block; applied to WW and undone on input, it cancels in the exact product. Beyond Gaussianizing the per-column marginal it decorrelates the operand across the tile, the analog of incoherence preconditioning in randomized numerical linear algebra.

Closed-Form Error Analysis

Two-cell noise propagation

We take nW=2n_W=2 throughout this subsection (the general case is § 4 C). The high and low cells are read as two separate tile products that the periphery combines by place value; we model each tile’s output as carrying an additive error nkn_k once its code is programmed,

nk∼N(0,σout2),k∈{H,L},(4)n_k \sim\mathcal{N}(0,\sigma_{\mathrm{out}}^2), \qquad k\in\{H,L\}, \tag*{(4)}

where σout2\sigma_{\mathrm{out}}^2 is calibrated per tile from the programmed weights but, being additive, does not scale with the individual stored code. On a real crossbar this output noise can scale with the code; we assume it additive and validate the resulting prediction against the full non-additive physics in § 5. For the closed form we take a common σout\sigma_{\mathrm{out}} across the high and low tiles, an idealization that the device-physics sweep, which uses the true per-tile noise, relaxes. Combination scales the high tile by its place value bb, so the noise on the reconstructed output is scale⁡(bnH+nL)\operatorname{scale}(bn_H+n_L), with variance

Var⁡(y^)noise=scale⁡2σout2(1+b2).(5)\operatorname{Var}(\hat{y})_{\mathrm{noise}}=\operatorname{scale}^2\sigma_{\mathrm{out}}^2(1+b^2). \tag*{(5)}

The place value enters before this sum, which is what makes the noise grow with bb; had a single additive error been injected on the combined output, it would carry no bb-dependence and no interior optimum would exist. The variance is independent of the stored integers sH,sLs_H,s_L: the integers set the noiseless signal but never multiply the noise. This is the key observation: the MVM noise depends only on the cells’ place values {1,b}\{1,b\}, not on whether the cells carry identical (equal-fill) or different (place-value) values, so non-equal-fill and equal-fill share the same noise expression. The relative MSE is this variance over the signal power. Substituting scale⁡=Wmax⁡/[bound(1+b)]\operatorname{scale}=W_{\max}/[\mathrm{bound}(1+b)] and Wmax⁡=kσσWW_{\max}=k_\sigma\sigma_W, the bb-dependence is kσ2(1+b2)/(1+b)2k_\sigma^2(1+b^2)/(1+b)^2 times a factor set by σout\sigma_{\mathrm{out}} and the signal scale; collecting that factor into the normalized noise η\eta (the per-tile output-noise std relative to the per-tile signal RMS) gives the relative noise MSE kσ2η2(1+b2)/(1+b)2k_\sigma^2\eta^2(1+b^2)/(1+b)^2. Only the bb-dependence matters for the optimum, and η\eta is the single device number that sets it. This noise term coincides with the equal-fill slicing-error expression of Le Gallo et al. [1] (their Eq. 8, generalized to nWn_W cells in Eq. (8)); our contribution is not this term but the quantization floor we add to it next, which turns their monotone b=1b=1 optimum into an interior one.

Total error and the optimal base

The finite master grid, of step Δ=scale⁡\Delta=\operatorname{scale}, adds a uniform-quantization term Δ2/12\Delta^2/12 which normalizes to kσ2/[12bound2(1+b)2]k_\sigma^2/[12\mathrm{bound}^2(1+b)^2] (the Gaussian-tail clipping term, the mass beyond kσσWk_\sigma\sigma_W, is ≈4×10−4\approx4\times10^{-4} at kσ=3k_\sigma=3 and is dropped). The total relative MVM error is

relMSE⁡(b)=kσ2η21+b2(1+b)2+kσ212bound2(1+b)2.(6)\operatorname{relMSE}(b)=k_\sigma^2\eta^2\frac{1+b^2}{(1+b)^2}+\frac{k_\sigma^2}{12\mathrm{bound}^2(1+b)^2}. \tag*{(6)}

Setting drelMSE⁡/db=0\mathrm{d}\operatorname{relMSE}/\mathrm{d}b=0 yields the closed-form optimum

bopt=1+112bound2η2(7)b_{\mathrm{opt}}=1+\frac{1}{12\mathrm{bound}^2\eta^2} \tag*{(7)}

(capped at 2bound+12\mathrm{bound}+1).

Since bb is an integer (Sec. III), the deployed base is the nearest integer to this continuous optimum. The minimum is shallow, so this rounding costs little: for a representative η=0.02\eta=0.02 the formula gives bopt=5.25b_{\mathrm{opt}}=5.25, and both integer neighbors, b=5b=5 and 6, lie within 0.02 dB of the continuous optimum, with the whole band b=3b=3–8 within 0.2 dB. The continuous formula thus selects which integer bases to consider; the flat minimum makes the final rounding immaterial, so the calibration need only land in the basin, not hit an exact value. Two limits interpret (7), and one of them recovers the prior result. As η→0\eta\to0 the optimum runs to the cap (precision-limited: use the finest master grid, i.e. pure bit-slicing). As η→∞\eta\to\infty it falls to b=1b=1, equal-fill duplication, whose averaging is optimal when noise dominates. This b=1b=1 limit is exactly the conclusion of Le Gallo et al. [1], who minimize the noise term alone (the first summand of (6), monotone in bb); their PCM noise is state-dependent (multiplicative), so the resolution axis never enters their closed form and ADC quantization is handled separately from the base. (Their experiments do find b=2b=2 optimal in one case, but via an error-correction programming algorithm rather than the representation itself.) Folding the master-grid quantization floor into the same objective is what creates the interior optimum at moderate η\eta: under additive output noise the resolution gained by a finer grid is worth the extra amplification of the high tile’s noise up to boptb_{\mathrm{opt}}. The two conclusions are thus the two regimes of one formula: multiplicative/noise-dominated (b=1b=1) versus additive/resolution-limited (an interior boptb_{\mathrm{opt}}, the overlap regime of Sec. III), where at the optimum the scheme is noise-floor-limited with peak SNR scaling as 1/η21/\eta^2.

General nWn_W cells

For nWn_W cells at place values {1,b,…,bnW−1}\{1,b,\ldots,b^{n_W-1}\} the same derivation gives

relMSE⁡=kσ2η2TS2+kσ212bound2S2,(8)\operatorname{relMSE}=k_\sigma^2\eta^2\frac{T}{S^2}+\frac{k_\sigma^2}{12\mathrm{bound}^2S^2}, \tag*{(8)}

with the geometric sums S=(bnW−1)/(b−1)S = (b^{n_W} - 1)/(b - 1) and T=(b2nW−1)/(b2−1)T = (b^{2n_W} - 1)/(b^2 - 1). The noise factor T/S2T/S^2 is algebraically identical to the equal-fill slicing error of Le Gallo et al. [1] (their Eq. 8, squared); we recover it and add the quantization floor. The corners of (8) recover known results: b=1⇒T/S2=1/nWb = 1 \Rightarrow T/S^2 = 1/n_W (equal-fill: error drops by exactly nWn_W, the familiar noise-averaging gain); nW=1⇒T/S2=1n_W = 1 \Rightarrow T/S^2 = 1 (single-cell baseline); b→∞⇒T/S2→1b \to\infty\Rightarrow T/S^2 \to1 (noise-averaging benefit vanishes; pure precision extension).

Does the optimum change structurally with nWn_W? The trade-off itself does not: the noise factor T/S2T/S^2 still rises with bb and the quantization floor 1/(12bound2S2)1/(12\mathrm{bound}^2S^2) still falls, so (8) keeps an interior minimum. What changes is where it sits. Adding cells supplies resolution through more slices rather than a finer per-step grid: SS grows as bnW−1b^{n_W-1}, so the quantization term collapses far faster in nWn_W than in bb, and its gradient in bb flattens (numerically, d(1/S2)/db\mathrm{d}(1/S^2)/\mathrm{d}b at fixed bb shrinks sharply from nW=2n_W=2 to 3, 4). The noise term, by contrast, keeps rising in bb. The balance therefore tips toward smaller bases as nWn_W increases: at η=0.02\eta=0.02 the best integer base in [1,2bound+1][1,2^{\mathrm{bound}+1}] moves from b=5b=5 (nW=2n_W=2) to b=2b=2 (nW=3,4n_W=3, 4). So more cells do not call for a larger base; they let a smaller, less noise-amplifying base reach the same resolution. The nW=2n_W=2 case we deploy is the one where the base is doing the most work.

Where non-equal-fill wins

Since the two encodings share the identical noise term (Eq. (5)), the comparison between equal-fill and place-value reduces entirely to the quantization floor: for the same cell budget, place-value provides S=1+bS = 1 + b reconstruction levels versus nWn_W for equal-fill. Place-value therefore strictly wins whenever quantization is non-negligible, the few-bit regime AIMC occupies, which is the same statement, from the encoding side, as bopt>1b_{\mathrm{opt}} > 1: both say the resolution term matters. The two coincide only at b=1b = 1, when noise dominates and quantization is irrelevant.

Evaluation

The theory makes a falsifiable prediction: when the tile-output noise is additive (does not scale with the stored code), the optimal base is not one, opposing the equal-fill (b=1b=1) optimum that holds under multiplicative noise [1]. We therefore test not just whether the closed form fits, but which regime the hardware occupies, and find the interior optimum, at three levels of fidelity.

Analytic (Monte-Carlo): Figure 2 sweeps the base for η∈{0.02,0.05,0.10}\eta\in\{0.02, 0.05, 0.10\}: Monte-Carlo relative MSE (markers) tracks the closed form (6) (curves), and the SNR peaks fall on the predicted bopt={5.25,1.68,1.17}b_{\mathrm{opt}} = \{5.25, 1.68, 1.17\}. Agreement is within ≈1%\approx1\% for b≤bound+1b \le\mathrm{bound}+1; beyond that (shaded) the low cell cannot hold every residue and the model’s validity bound is exceeded, seen as the Monte-Carlo curve rising above theory, a departure confined to the region the analysis already excludes.

Figure 2. Theory validation. (a) relative MSE vs. base, Monte-Carlo (markers) vs. closed form (6) (solid). (b) SNR; dashed vertical marks the predicted boptb_{\mathrm{opt}} from (7). Shading marks b>bound+1b > \mathrm{bound}+1, beyond the analytic validity bound, where Monte-Carlo is expected to depart from theory.

Device-physics simulation: We evaluate on a physics-based simulator of an analog in-memory crossbar tile. As one representative point in the AIMC design space (among many possible array sizes and cell precisions) we model a 512×512512 \times512 array of multi-level cells storing signed 4-bit weights differentially; the method and its closed form are not specific to this choice. The simulator reproduces the dominant non-idealities of AIMC MVM: programming variation, IR-drop from finite wire and cell resistance solved on the resistive network, and ADC quantization of the bit-line currents. The resulting tile-output noise is not the additive quantity our closed form assumes: IR-drop is a nonlinear function of the currents actually flowing and ADC error depends on the output magnitude, so the effective output noise scales with the code. This makes the test stronger than the model, which asks whether the predicted optimum survives once realistic, non-additive output effects replace the idealized additive assumption. Figure 3 reports mean per-layer MVM SNR gain relative to b=1b=1 under this model (absolute levels are omitted). It does survive: the SNR does not peak at b=1b=1 but rises to an interior maximum at b=5b=5, ≈1.6\approx1.6 dB above b=1b=1, and beats the naive base-16 split by ≈3.3\approx3.3–3.43.4 dB. Both models trace the same inverted-U and peak at the same base, so the optimum is model-agnostic. The interior optimum predicted from additive output noise thus holds under the full IR-drop and ADC physics, so on this device the base should be tuned, not fixed at one. The effective η\eta is not a single datasheet constant: it aggregates programming noise, IR-drop, ADC quantization, per-column normalization, and the operand distribution, so it must be calibrated for a given device and workload rather than derived in closed form. The device-physics simulation is that calibration: the peak location fixes the operating η\eta (b=5b=5 inverts through (7) to η≈0.02\eta\approx0.02), and this is the “single device-noise measurement” that the encoding needs. What the closed form contributes is the shape that measurement is read against, an interior optimum with a broad flat top (b=3b=3–8) rather than the monotone descent to b=1b=1 of the multiplicative regime; the exact base within that basin is not critical, so the calibration need only land in it.

Figure 3. Device-physics simulation: mean per-layer MVM SNR vs. base (IR-drop, programming noise, ADC) for Gemma-3 270M and Llama-3.2 1B. Both trace the same inverted-U, peaking at b=5b=5 (circled) with a flat top (b=3b=3–88) and ≈\approx3.3–3.4 dB over base-16 (a separated point, dashed; nothing sampled in 8–16).

Why a single global base. Since η\eta is a per-tile quantity, boptb_{\mathrm{opt}} is in principle per-tile; a global base is justified only if the tiles agree. They do. Sweeping the base per 512×512512 \times512 tile and recording each tile’s best base, the optimum is tightly concentrated: on Gemma 48% of tiles peak at b=5b=5 and 92% within b∈{4,5,6}b\in\{4,5,6\}; on Llama 46% at b=5b=5 and 97% within {4,5,6}\{4,5,6\}; essentially no tile prefers a base outside that band. No tile statistic predicts the optimum (correlations of the per-tile best base with weight std, kurtosis, and dynamic range are all ∣r∣<0.05|r|<0.05), and the per-tile base-sensitivity is only 0.22 dB. The rotation (Sec. III) is what homogenizes the tiles: it drives every tile’s operand toward the same Gaussian, so all tiles want the same base and a per-tile or learned base rule has nothing to exploit. A single global b=5b=5–66 is therefore near-optimal tile-by-tile, not merely on average.

EncodingLaplacian SNR gain (dB)Gemma-270MLlama-1B
equal-fill (b=1b=1)+0.0+0.0%+0.0%
rotated non-uniform—+4.6%+3.9%
residual redundancy—+12.3%+7.7%
base-NN split (b=6b=6)+1.6+13.1%+9.0%

Table 1. End-application fidelity, reported relative to equal-fill (b=1b=1) so no absolute capability is disclosed: Laplacian single-matrix SNR gain over b=1b=1 (dB), and transformer eight-task accuracy as % change over b=1b=1 (10-run means, ±\pm0.008 absolute run-to-run noise on the accuracy). All encodings use two cells per weight; rotated non-uniform and residual redundancy are data-dependent neural-network encodings with no fixed scientific-MATVEC analog, hence the omitted Laplacian entries. Base-NN split (b=6b=6) matches the strongest baseline (residual redundancy) within noise, using only uniform placement.

End-application fidelity: The optimum is a property of the encoding under noise, so it is operator-agnostic. On a single matrix–vector product for representative scientific operators, a 2D five-point Laplacian (finite-difference/FEM stencil) and an ill-conditioned dense matrix (κ=103\kappa=10^3), the same inverted-U appears, peaking at b≈4b\approx4–66 with ≈\approx3.4 dB over base-16 (Table I). On transformer inference we compare three encodings at the same two-cell budget: equal-fill (b=1b=1) stores the same value in both cells and averages; rotated non-uniform applies the fixed rotation of Sec. III and quantizes both cells to shared Lloyd-Max levels, an incoherence-style baseline in the spirit of [16], [17]; residual redundancy puts the weight in one cell and its leftover residual in the other, the successive error-correction strategy with which [1] reaches an interior base. Base-NN split (at b=6b=6, the integer neighbor of the bopt≈5b_{\mathrm{opt}}\approx5 of Sec. IV) clearly beats equal-fill and rotated non-uniform, and matches residual redundancy, the strongest baseline, to within the run-to-run noise on both models (±\pm0.008). The distinction is not accuracy but cost: base-NN reaches the top group using only uniform placement, whereas residual redundancy needs per-tile Lloyd-Max codebooks, and unlike either baseline the base follows from the closed-form optimum rather than empirical search. Accuracy is averaged over eight zeroshot commonsense tasks from the LM-Evaluation-Harness (ARC-easy, ARC-challenge, HellaSwag, PIQA, WinoGrande, OpenBookQA, BoolQ, COPA), each a ten-run mean with noise resampled per run. Notably equal-fill (b=1b=1), the optimum for multiplicative noise, is the worst row on both models, the end-application signature of the additive regime the theory identifies. The flat basin also shows up here: re-running base-NN at b=5b=5 (the other integer neighbor of bopt=5.25b_{\mathrm{opt}}=5.25, with its own matched calibration) changes the eight-task accuracy by +0.0003 on Gemma (indistinguishable from b=6b=6) and −0.006 on Llama (within about one standard deviation, ±\pm0.005). Either base is near-optimal in accuracy, so the rounding of the continuous boptb_{\mathrm{opt}} to an integer is immaterial in practice.

AIMC error analysis and weight slicing: Accurate inference on phase-change-memory crossbars is well established [4]. Closest to us, Le Gallo et al. [1] give a closed-form model of the analog slicing error as a function of the base and slice count, and validate it against a PCM chip. Their closed form is noise-only: under the state-dependent (multiplicative) PCM noise they consider, the error is monotone in the base and minimized at b=1b=1 (equal-fill), and ADC quantization is treated separately. Their experiments do surface an interior case (b=2b=2 optimal at t0t_0 with a max-fill error-correction algorithm), but as a programming-algorithm effect rather than a property of the representation, and without a model of the base that would explain or locate it. We build directly on their noise expression, which we recover exactly (Sec. IV), and add the finite-grid quantization floor to the same objective. Under additive output noise this produces an interior optimal base in closed form, of which their b=1b=1 closed-form result is the noise-dominated limit; the base optimum thus depends on the device’s noise regime rather than being universally one. Complementary to the analytic view, a realized 64-core PCM accelerator stores weights at equal significance and decomposes the measured error into programming and residual terms [3] (our b=1b=1 corner and error decomposition), and Mackin et al. [2] optimize an unequal significance factor numerically by evolutionary search, where our closed form removes the per-device search. Device-variation studies quantify how programming noise degrades inference accuracy [5], [6], hardware-aware training partly recovers it [7], and noise-optimized rescaling adapts deployment to the device [8]; advances in multi-level conductance control now offer thousands of programmable states [9]. Other bit-slicing schemes allocate weight bits across cells: Diware et al. propose an unbalanced bit-slicing [10] and an accurate, energy-efficient RRAM bit-slicing [11], and refined multi-conductance programming improves per-cell precision [12]. These choose the split empirically; we contribute the analytic optimum and its device-parameter dependence.

Low-precision numerics: Our question, how to represent values for minimum error on an imprecise arithmetic unit, parallels the reduced-precision program in scientific computing: mixed-precision iterative refinement [13], alternative number formats [14], and low-bit floating-point with error mitigation [15]. We share the representation-optimization goal but differ in the error model: stochastic device noise rather than deterministic rounding.

Randomized preconditioning: The optional rotation is a fixed orthogonal transform that Gaussianizes and decorrelates the operand, in the lineage of incoherence-based methods for quantization: Hadamard-incoherence and learned-rotation schemes [16], [17] use the same principle to tame outliers before low-bit encoding. A separate axis of the same encoding problem is the choice of clip and reconstruction levels for a single cell (uniform vs. non-uniform placement); here rotation and non-uniform levels enter only as the rotated non-uniform baseline we compare against, and our contribution is orthogonal to them, the significance base of the multi-cell split rather than the within-cell codebook.

Conclusion

Weight splitting on a noisy in-memory accelerator is governed by a single dial. Because each tile’s additive output noise enters the sum weighted only by its place value, not by the stored code, the base bb trades quantization resolution against amplified noise with no other coupling, and the trade has a closed-form optimum bopt=1+1/(12 bound2η2)b_{\mathrm{opt}} = 1 + 1/(12\,\mathrm{bound}^{2}\eta^{2}), an overlap of the cell ranges set entirely by the device noise η\eta and the cell resolution, with duplication and bit-slicing as its two endpoints. The practical consequence is a reversal of prior guidance: equal-fill (b=1b=1) is optimal only when the tile-output noise is multiplicative, whereas when it is additive the best base is interior, which we confirmed from an analytic model through full device physics (with realistic, non-additive IR-drop and ADC) to scientific and neural-network MVMs. The optimum can be determined quickly, before device programming: measure η\eta once and evaluate boptb_{\mathrm{opt}} in closed form, with no per-model numerical search. Because the base only sets how a weight is split across cells, using boptb_{\mathrm{opt}} carries the same programming and read cost as equal-fill.

Scope and limitations: The result rests on an additive tile-output-noise model (noise that does not scale with the stored code), and its reach is exactly that model’s. (i) Mixed noise. Real crossbars show code-dependent output noise: a conductance-proportional (multiplicative) component and

state-dependent effects such as retention drift and programming errors that depend on the target state; our variance ση2(1+b2)\sigma_{\eta}^{2}(1+b^{2}) omits these. A multiplicative term adds a bb-dependent factor that pulls the optimum back toward b=1b=1, so the true optimum for a given device lies between our additive boptb_{\mathrm{opt}} and the multiplicative b=1b=1; quantifying that interpolation from a measured noise-vs-code curve is the natural extension. (ii) Discrete base. boptb_{\mathrm{opt}} is a continuous relaxation of an integer parameter; we round to the nearest feasible base, which the shallow minimum makes lossless in practice (Sec. V). (iii) Validity range. The two-cell form holds for b≤bound+1b \leq\mathrm{bound}+1 (beyond which the low cell cannot cover every residue), and for nW>2n_W > 2 the optimum shifts to smaller bases (Sec. IV C). (iv) Single matvec. We optimize one WxW x; error propagation through an iterative solver, where the per-step optimum need not be the fixed-point optimum, is a separate study. More broadly, casting an analog crossbar as a custom number representation lets the low-precision-numerics toolkit set hardware encodings by closed form rather than by convention.

References

References

  1. [1]M. Le Gallo, S. R. Nandakumar, L. Ciric et al., “Precision of bit slicing with in-memory computing based on analog phase-change memory crossbars,” Neuromorphic Computing and Engineering, vol. 2, no. 1, p. 014009, 2022.DOI
  2. [2]C. Mackin, M. J. Rasch, A. Chen et al., “Optimised weight programming for analogue memory-based deep neural networks,” Nature Communications, vol. 13, no. 1, p. 3765, 2022.DOI
  3. [3]M. Le Gallo, R. Khaddam-Aljameh, M. Stanisavljevic et al., “A 64-core mixed-signal in-memory compute chip based on phase-change memory for deep neural network inference,” Nature Electronics, vol. 6, 2023.DOI
  4. [4]V. Joshi, M. Le Gallo, S. Haefeli et al., “Accurate deep neural network inference using computational phase-change memory,” Nature Communications, vol. 11, no. 1, p. 2473, 2020.
  5. [5]Q. Wang, Y. Park, and W. D. Lu, “Device variation effects on neural network inference accuracy in analog in-memory computing systems,” Advanced Intelligent Systems, vol. 4, 2022.DOI
  6. [6]A. Bhattacharjee, A. Moitra, and P. Panda, “Examining the role and limits of batchnorm optimization to mitigate diverse hardware-noise in in-memory computing,” in Proc. Great Lakes Symp. on VLSI (GLSVLSI), 2023.DOI
  7. [7]M. J. Rasch et al., “Hardware-aware training for large-scale and diverse deep learning inference workloads using in-memory computing-based accelerators,” Nature Communications, vol. 14, 2023.arxiv.org/abs/2302.08469
  8. [8]Y. Hou, H. Tsai, K. El Mghraoui, and T. Gokmen, “NORA: Noise-optimized rescaling of LLMs on analog compute-in-memory accelerators,” in Design, Automation & Test in Europe (DATE), 2025.DOI
  9. [9]M. Rao, H. Tang, J. Wu, W. Song et al., “Thousands of conductance levels in memristors integrated on CMOS,” Nature, vol. 615, 2023.DOI
  10. [10]S. Diware, A. Gebregiorgis, R. V. Joshi, S. Hamdioui, and R. Bishnoi, “Unbalanced bit-slicing scheme for accurate memristor-based neural network architecture,” in IEEE Int. Conf. on Artificial Intelligence Circuits and Systems (AICAS), 2021.DOI
  11. [11]S. Diware, A. Singh, A. Gebregiorgis, R. V. Joshi, S. Hamdioui, and R. Bishnoi, “Accurate and energy-efficient bit-slicing for RRAM-based neural networks,” IEEE Trans. on Emerging Topics in Computational Intelligence, vol. 7, 2023.DOI
  12. [12]H. So, H. Ji, S. Kim, and S. Kim, “Sophisticated conductance control and multiple synapse functions in TiO₂-based multistack-layer crossbar array memristor for high-performance neuromorphic systems,” Advanced Functional Materials, 2024.DOI
  13. [13]E. Oktay and E. Carson, “Multistage mixed precision iterative refinement,” Numerical Linear Algebra with Applications, vol. 29, no. 4, p. e2434, 2022.
  14. [14]M. Klöwer, P. Düben, and T. Palmer, “Number formats, error mitigation, and scope for 16-bit arithmetics in weather and climate modeling,” J. Advances in Modeling Earth Systems, vol. 12, 2020.DOI
  15. [15]L. Cambier, A. Bhiwandiwalla, T. Gong, M. Nekuii, O. H. Elibol, and H. Tang, “Shifted and squeezed 8-bit floating point format for low-precision training of deep neural networks,” in Int. Conf. on Learning Representations (ICLR), 2020.arxiv.org/abs/2001.05674
  16. [16]A. Tseng, J. Chee, Q. Sun, V. Kuleshov, and C. De Sa, “QuIP#: Even better LLM quantization with Hadamard incoherence and lattice codebooks,” in Int. Conf. on Machine Learning (ICML), 2024.arxiv.org/abs/2402.04396
  17. [17]Z. Liu et al., “SpinQuant: LLM quantization with learned rotations,” in Int. Conf. on Learning Representations (ICLR), 2024.arxiv.org/abs/2405.16406

Paper details

vlnc:W_bcv4au3j
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents