---
title: Constant Matrix–Vector Multiplication
url: https://www.emergentmind.com/topics/constant-matrix-vector-multiplication-cmvm
type: topic
---

# Constant Matrix–Vector Multiplication

Searching arXiv for recent and foundational papers on constant matrix-vector multiplication and related structured/hardware formulations.
Constant matrix–vector multiplication (CMVM) is the computation of a matrix–vector product in a regime where the matrix is fixed across queries and only the input vector varies. In its most general form, the task is
\[
Y_{M\times 1}=A_{M\times N}X_{N\times 1},
\]
while neural-network formulations often write the same object as \(\mathbf{y}=\mathbf{X}^T\mathbf{W}\) with \(\mathbf{W}\) constant during inference. The fixed-coefficient assumption is the defining feature: it enables offline preprocessing, precomputation of coefficient combinations, compression of matrix structure, and specialized hardware datapaths that are not available for arbitrary online matrix–vector multiplication. Recent work treats CMVM from at least four complementary angles: arithmetic reduction for complex-valued hardware [1410.6937], FFT-coupled compression for matrices defined by special functions [2004.11610], ADC-less in-memory distributed arithmetic for neural inference [2510.02099], and data structures with subquadratic query time for structured matrices of low VC-dimension [2502.21240].

## 1. Definition and scope

In CMVM, the matrix is “constant” in the sense that its coefficients are fixed at design time or remain unchanged over a long sequence of queries. For neural-network inference, this means that weights are fixed after training and do not change during inference; the variable operand is the activation vector. For hardware-oriented complex CMVM, the matrix entries \(a_{m,n}\) are constant complex numbers and the input vector entries \(x_n\) are complex variables. For transform evaluation, the matrix is fixed once the nodes, basis family, and truncation order are fixed. For data-structural formulations, the matrix is preprocessed once and later queried with arbitrary vectors [2510.02099].

The basic scalar output of CMVM is a constant-coefficient inner product. In the real-valued neural setting,
\[
Y_j=\sum_{i=1}^{N}X_iW_{ij},\qquad j=1,\dots,M,
\]
so matrix–vector multiplication decomposes into \(M\) constant vector–vector dot products, one per matrix column. In the complex-valued setting,
\[
a_{m,n}=a_{m,n}^{(r)}+ja_{m,n}^{(i)},\quad
x_n=x_n^{(r)}+jx_n^{(i)},\quad
y_m=y_m^{(r)}+jy_m^{(i)},
\]
and the design objective is to minimize multiplicative complexity under full parallelism. In special-function transforms, the matrix entries can be values such as \(\cos(m\arccos x_n)\), \(J_m^{(\alpha,\beta)}(x_n)\), or \(l_m(\eta t_n)\), and the constant-matrix assumption is precisely what makes one-time compression worthwhile. In structural-complexity formulations, the fixed matrix is the object being preprocessed so that future products \(Mv\) can be answered faster than naive dense multiplication when the matrix has exploitable combinatorial structure [1410.6937, 2004.11610, 2502.21240].

A recurring practical interpretation is repeated use. The same weight matrix may be applied to many activations in inference, the same transform matrix to many coefficient vectors in numerical analysis, or the same graph-derived matrix to many query vectors in dynamic algorithms. CMVM therefore lies at the boundary between linear algebra, preprocessing, and specialized computation.

## 2. Arithmetic reformulations

One major CMVM strategy is to replace general multiplication by algebraic identities that exploit fixed coefficients. In distributed arithmetic (DA), a dot product
\[
Y=\sum_{i=1}^{N}X_iW_i
\]
is rewritten by expanding each variable input \(X_i\) in binary. For signed fixed-point inputs,
\[
X_i=-x_{i,B-1}2^{B-1}+\sum_{k=0}^{B-2}x_{i,k}2^k,
\]
which yields bit-plane subset sums
\[
S_k=\sum_{i=1}^{N}x_{i,k}W_i.
\]
Because the weights are constant, all \(2^N\) possible subset sums can be precomputed as a lookup table indexed by the \(N\)-bit pattern \((x_{0,k},\dots,x_{N-1,k})\). The DA recurrence is then implemented as shift-and-add. The ReRAM-based extension to matrix form stores, for each column \(j\),
\[
\text{LUT}_j[a_{N-1}\dots a_0]=\sum_{i=1}^{N}a_iW_{ij},
\]
and applies the same bit-slice address to all column-specific lookup tables in parallel, so that latency depends on input bit-width rather than the number of output columns \(M\) [2510.02099].

A second reformulation is the Winograd–Gauss reduction for complex-valued CMVM. Starting from
\[
y_m=\sum_{n=0}^{N-1}a_{m,n}x_n,
\]
the method first applies Winograd’s inner-product formula at the complex level. For even \(N\),
\[
y_m=\sum_{k=0}^{N/2-1}\big[(a_{m,2k}+x_{2k+1})(a_{m,2k+1}+x_{2k})\big]-c_m-\Sigma_N,
\]
where
\[
c_m=\sum_{k=0}^{N/2-1}a_{m,2k}a_{m,2k+1},\qquad
\Sigma_N=\sum_{k=0}^{N/2-1}x_{2k}x_{2k+1}.
\]
Since \(c_m\) depends only on the fixed matrix, it can be precomputed offline. Winograd reduces the number of complex multiplications from \(MN\) to \(N(M+1)/2\). Each complex multiplication is then implemented using Gauss’s trick,
\[
(a+jb)(c+jd)=ac-bd+j[(a+b)(c+d)-ac-bd],
\]
which uses \(3\) real multiplications instead of \(4\). The resulting fully parallel CMVM requires
\[
\frac{3N(M+1)}{2}
\]
real two-input multipliers rather than \(4MN\), at the cost of a larger adder network. In the formulation without special one-input encoders, the adder count is \(3M(N+2)+1.5N+2\) signed two-input adders plus \(3(M+1)\) \((N/2)\)-input adders [1410.6937].

These two arithmetic lines represent distinct CMVM philosophies. DA removes hard-wired multipliers by turning fixed coefficients into lookup-table contents. Winograd–Gauss reduces but does not eliminate multiplication, and is particularly natural for complex arithmetic in FPGA-style fully parallel datapaths.

## 3. Precomputation and compressed representations

A different CMVM paradigm arises when the fixed matrix is defined by special functions. The extra-components method targets matrices whose entries are samples of Chebyshev, trigonometric, Jacobi, Legendre, Gegenbauer, Laguerre, and related functions. Its central observation is that, after multiplication by a Kaiser window and a discrete Fourier transform, rows or columns of these matrices acquire a compact Fourier-domain sparsity pattern. The compressed matrix is written as
\[
\ddot A = A W_M \mathcal{F},
\]
where \(W_M\) is a diagonal window matrix and \(\mathcal{F}\) is the unitary DFT. A matrix–vector product is then factored as
\[
\mathbf{F}=\ddot A\,\mathcal{F}^*W_M^{-1}\hat{\mathbf{F}}.
\]
This separates the computation into a diagonal scaling, an FFT, and a sparse multiplication by \(\ddot A\) [2004.11610].

The “extra-components” mechanism addresses the instability caused by \(W_M^{-1}\), whose edge entries can become large. The method augments the matrix by \(s\) extra columns or rows, pads the input with zeros in the corresponding positions, and performs the compression on the augmented system. In the trigonometric case, the augmented matrix can be written as
\[
A_e=\bigl(\cos(m\theta_n)\bigr)_{n=0,\ m=-s}^{N,\ M+s},
\]
with an input vector padded by zeros on both sides. The large values of \(W^{-1}\) are then multiplied by zeros at the artificial boundary locations, which stabilizes the computation [2004.11610].

The reported complexity is \(O(N^2\log N)\) for precomputation and \(O(N\log N)\) for each subsequent multiplication. For trigonometric matrices, Appendix A gives a faster precomputation route of
\[
O(N\log N+Nq),
\]
with \(q\le 25\), by FFT-ing the Kaiser window once and evaluating only the relevant frequency components. The numerical experiments report that these procedures can decrease calculation time by several orders of magnitude compared with a conventional direct method of matrix–vector multiplication. In the Chebyshev case, target tolerance \(10^{-8}\) used bandwidth \(bw=16\) with \(s\approx N/4\), while target tolerance \(10^{-15}\) used \(bw=24\) with \(s\approx N/2\). For Jacobi transforms, block decomposition is used because negative polynomial degrees are not available; for time-domain Laguerre transforms, a two-dimensional compression
\[
\ddot D=\mathcal{F}W_MDW_N\mathcal{F}
\]
is applied [2004.11610].

This family of methods is CMVM in a strict numerical-analysis sense: the matrix is compressed once, stored in sparse FFT-coupled form, and then reused across many vectors. The efficiency gain comes not from low rank in the usual sense, but from Fourier localization after windowing.

## 4. Hardware realizations

Hardware-oriented CMVM exploits fixed coefficients at the architecture level. In the complex-valued FPGA formulation, the datapath is organized into a pre-addition stage for Winograd pairings, Gauss-based complex multiplication blocks, and a post-addition accumulation stage. Matrix coefficients and precomputed constants \(c_m\) are stored in ROM or hard-wired, and the data-flow diagrams are explicitly given for the \(N=4, M=3\) case. The method is intended for fully parallel implementations on FPGA families such as Xilinx Spartan-3, Altera Cyclone-III, and Stratix-V, where embedded multipliers are limited and adders are comparatively cheaper. The paper does not report concrete FPGA synthesis results, but its principal claim is the reduction from \(4MN\) real multipliers to \(3N(M+1)/2\) in a regular, pipeline-friendly architecture [1410.6937].

The ReRAM in-memory realization of DA is more radical. Here the matrix coefficients are transformed into lookup-table contents stored in 1T–1R ReRAM processing memory arrays (PMAs). The cells store digital bits corresponding to precomputed subset sums, so the memory functions as a ROM for DA rather than an analog crossbar. For the \(25\times 6\) matrix that represents the first convolutional layer of LeNet-5, the \(25\)-element input vector is partitioned into groups of \(8\), \(8\), and \(9\) elements, mapped to PMA-1 \((256\times 66)\), PMA-2 \((256\times 66)\), and PMA-3 \((512\times 66)\). Each cycle reads three partial sums, combines them with \(12\)-bit and \(13\)-bit adders, and feeds the result into a \(21\)-bit shift-and-add accumulator over \(8\) input bit-cycles [2510.02099].

The reported timing is \(15\ \text{ns}\) for the first cycle, \(10\ \text{ns}\) for each of the next seven cycles due to overlapped sensing and precharge, and less than \(3\ \text{ns}\) for the final \(21\)-bit addition, giving
\[
T_{\text{VMM}}\approx 88\ \text{ns}.
\]
The energy per VMM is \(110.2\ \text{pJ}\) excluding one-time precomputation, and the amortized total used for comparison is
\[
E_{\text{VMM,total}}\approx 117\ \text{pJ}.
\]
Against a bit-slicing ReRAM baseline for the same \(1\times 25 \times 25\times 6\) multiplication, the comparison is \(400\ \text{ns}\) versus \(88\ \text{ns}\) in latency and \(1421.5\ \text{pJ}\) versus \(117\ \text{pJ}\) in energy, i.e. \(4.5\times\) lower latency and about \(12\times\) lower energy. The area trade-off is explicit: the bit-slicing design uses \(1{,}200\) memory cells \(+\ 47{,}286\) transistors \(+\ 1{,}584\) passive resistors, whereas the DA design uses \(67{,}584\) memory cells \(+\ 20{,}622\) transistors, with no passive resistors and no ADC/DAC [2510.02099].

The decisive architectural distinction is that DA removes both multipliers and multi-bit data conversion from the critical computation path. The ReRAM system uses comparator-based sense amplifiers with about \(35\ \text{fJ}\) per READ rather than ADCs, and the computation path is entirely digital after binary sensing. This makes the design especially suitable for fixed-weight inference workloads in which the one-time cost of writing lookup tables is amortized across many reads [2510.02099].

## 5. Structural complexity and preprocessing-based CMVM

CMVM can also be formalized as a data-structure problem: preprocess a fixed matrix \(M\), then answer queries that return \(Mv\) for arbitrary vectors \(v\). For arbitrary dense matrices, classical worst-case and average-case results still indicate essentially quadratic query time. The structured alternative introduced for Boolean matrices is to parameterize the matrix by the VC-dimension of the set system induced by its rows. If \(\mathcal{F}_M=\{\{j:M_{i,j}=1\}:i\in[m]\}\), then \(\mathrm{VC}(M)\) is the VC-dimension of the range space \(([n],\mathcal{F}_M)\) [2502.21240].

The main static theorem states that if \(M\in\{0,1\}^{m\times n}\) has corrupted VC-dimension \(d\), then after \(O(mn)\)-time preprocessing there is a data structure that computes \(Mv\) for any \(v\in\mathbb{R}^n\) in
\[
O(mn^{1-1/d}+n)
\]
time, with high probability. For square matrices this gives \(\tilde O(n^{2-1/d})\) query time after \(\tilde O(n^2)\) preprocessing. The “corrupted” condition means that \(M=L+S\), where \(L\) has VC-dimension \(d\) and each row of \(S\) has at most \(O(n^{1-1/d})\) nonzero entries, so the guarantees survive adversarial perturbations of a subquadratic number of entries. If \(M^\top\) has corrupted VC-dimension \(d'\), a symmetric bound \(O(nm^{1-1/d'}+m)\) is available, and one can take the better of the two [2502.21240].

The technique is differential compression via a \(\Delta\)-labeled spanning tree on the columns or rows of the matrix. If \(T\) is such a tree and each edge label is \(\Delta_{i,j}=M_j-M_i\), its weight is
\[
\mathrm{weight}(T)=\sum_{e\in T}\mathrm{nnz}(\Delta_e).
\]
Given this representation, \(Mv\) can be computed in
\[
O(\mathrm{weight}(T)+n+m)
\]
time. The key structural theorem shows that for matrices of corrupted VC-dimension \(d\), the minimum-spanning-tree weight in Hamming space is at most
\[
O(mn^{1-1/d}\log n),
\]
which yields the subquadratic query algorithm. The framework extends dynamically: row updates take \(O(n)\), column updates \(O(m)\), and queries retain the same asymptotic form with \(d^*\) equal to the largest corrupted VC-dimension over the update history. For non-Boolean matrices, a parallel result uses Pollard pseudodimension: if the pseudodimension is \(d\) and the number of thresholds is \(A\), preprocessing is \(O(Amn)\) and query time is \(O(Amn^{1-1/d}+An)\) [2502.21240].

This line of work clarifies an important conceptual point: CMVM does not in general imply constant-time queries. Even in the most favorable structured regimes, the output itself has size \(n\), so \(O(n)\) is a natural lower limit in the standard RAM model. What preprocessing can achieve is subquadratic rather than constant asymptotic query time for broad structured matrix classes [2502.21240].

## 6. Applications, trade-offs, and limitations

CMVM appears in several technically distinct application families. In neural inference, vector–matrix multiplication is described as a fundamental and frequently required computation, and the fixed-weight assumption is intrinsic to inference rather than training. The LeNet-5 CONV1 mapping uses a \(25\times 6\) fixed matrix, a \(32\times 32\) padded input, and \(784\) VMMs per inference. In hardware-intensive complex arithmetic, CMVM is central in digital signal processing, FIR filters, filter banks, communication systems such as MIMO processing and equalizers, image and video processing, and linear algebra kernels in high-performance computing. In numerical transforms, fixed matrices arise from Chebyshev, Jacobi, Legendre, Gegenbauer, and Laguerre evaluations. In graph algorithms, the preprocessing view of CMVM yields subquadratic upper bounds for dynamic Laplacian solvers, effective resistance, triangle detection, approximate single-source shortest paths, and approximate \(k\)-center under structural assumptions [2510.02099, 1410.6937, 2004.11610, 2502.21240].

The principal trade-offs differ by formulation. DA-based in-memory CMVM replaces multipliers by lookup tables and shift-and-add logic, eliminates ADCs and DACs, and obtains lower latency and energy, but its memory footprint grows exponentially with the group size used for lookup-table construction. In the \(25\times 6\) case, the three PMAs contain \(67{,}584\) memory cells, much larger than raw weight storage, although this is a one-time cost. The paper also states that the DA computation is exact under fixed-point arithmetic; any accuracy impact comes from quantization, and explicit accuracy numbers for the quantized LeNet-5 case are not provided [2510.02099].

The Winograd–Gauss complex CMVM method reduces multipliers substantially, but it increases the number of adders and therefore logic utilization and routing complexity. It assumes even \(N\), with odd-length vectors handled by reduction to an even-length case. Its benefit is largest when multipliers are the dominant constrained resource, as on many FPGA and ASIC targets [1410.6937].

The extra-components method offers \(O(N\log N)\) execution time after precomputation, but the precomputation can be heavy for Jacobi and Laguerre cases, and the method is worthwhile primarily when the same matrix is used repeatedly. It is effective for oscillatory special-function kernels and less effective for some non-oscillatory kernels with complex local singularities, where wavelet-based compression can be better. Its accuracy and bandwidth are controlled by the thresholds \(\varepsilon_1\) and \(\varepsilon_2\), the window parameter \(\zeta\), and the number of extra components \(s\) [2004.11610].

The VC-dimension framework provides a theoretical explanation for why some CMVM instances admit subquadratic query time after preprocessing, but it does not establish lower bounds in the structured setting. It leaves open whether the exponent \(2-1/d\) is optimal for fixed \(d\), and it identifies improvement of the threshold factor \(A\) in the non-Boolean pseudodimension bound as an open direction [2502.21240].

Across these lines, one misconception is consistently rejected by the technical literature: “constant matrix” means fixed coefficients across queries, not trivial computation. Fixedness can be exploited through precomputation, compression, or hardware specialization, but the resulting algorithms inhabit different points in the design space. Some trade memory for energy and converter elimination, some trade adders for multipliers, some trade preprocessing for near-FFT execution, and some trade structural assumptions for subquadratic online complexity. CMVM is therefore best understood not as a single algorithmic trick but as a family of fixed-coefficient linear-algebra regimes in which preprocessing is the central resource.

Source: https://www.emergentmind.com/topics/constant-matrix-vector-multiplication-cmvm