<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Matrix Compression via Randomized Low Rank and Low Precision Factorization</title></titleStmt>
			<publicationStmt>
				<publisher>arXiv</publisher>
				<date>10/17/2023</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10482591</idno>
					<idno type="doi"></idno>
					<title level='j'>arXivorg</title>
<idno>2331-8422</idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Rajarshi Saha</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Matrices are exceptionally useful in various fields of study as they provide a convenient framework to organize and manipulate data in a structured manner. However, modern matrices can involve billions of elements, making their storage and processing quite demanding in terms of computational resources and memory usage. Although prohibitively large, such matrices are often approximately low rank. We propose an algorithm that exploits this structure to obtain a low rank decomposition of any matrix A as A≈LR, where L and R are the low rank factors. The total number of elements in L and R can be significantly less than that in A. Furthermore, the entries of L and R are quantized to low precision formats −− compressing A by giving us a low rank and low precision factorization. Our algorithm first computes an approximate basis of the range space of A by randomly sketching its columns, followed by a quantization of the vectors constituting this basis. It then computes approximate projections of the columns of A onto this quantized basis. We derive upper bounds on the approximation error of our algorithm, and analyze the impact of target rank and quantization bit-budget. The tradeoff between compression ratio and approximation accuracy allows for flexibility in choosing these parameters based on specific application requirements. We empirically demonstrate the efficacy of our algorithm in image compression, nearest neighbor classification of image and text embeddings, and compressing the layers of LlaMa-7b. Our results illustrate that we can achieve compression ratios as aggressive as one bit per matrix coordinate, all while surpassing or maintaining the performance of traditional compression techniques.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Low-rank structures for matrices have proven to be incredibly valuable and ubiquitous across numerous fields of study. Several real-world matrices approximately exhibit low-rank structure due to inherent redundancy or patterns, allowing them to be approximated using low-rank factors. Udell and Townsend <ref type="bibr">[67]</ref> provide a potential justification by considering a generative model with latent variables for real-world matrices. Applications where low-rank structures in matrices are exploited include, but are not limited to, imaging (Lingala et al. <ref type="bibr">[32]</ref>), fine-tuning large language models (Aghajanyan et al. <ref type="bibr">[1]</ref>, Hu et al. <ref type="bibr">[23]</ref>, Karimi Mahabadi et al. <ref type="bibr">[28]</ref>, Valipour et al. <ref type="bibr">[68]</ref>, Wang et al. <ref type="bibr">[74]</ref>), compressing neural networks (Ben Noach and Goldberg <ref type="bibr">[6]</ref>, Idelbayev and Carreira-Perpinan <ref type="bibr">[24]</ref>, Mao et al. <ref type="bibr">[37]</ref>, Phan et al. <ref type="bibr">[45]</ref>, Swaminathan et al. <ref type="bibr">[61]</ref>, Tahaei et al. <ref type="bibr">[62]</ref>, Wang et al. <ref type="bibr">[75]</ref>, Winata et al. <ref type="bibr">[76]</ref>, Yu et al. <ref type="bibr">[82]</ref>), obtaining efficient NN architectures (Jaderberg et al. <ref type="bibr">[25]</ref>, Tai et al. <ref type="bibr">[63]</ref>), etc. Given a matrix A 2 R n&#8677;d , a low-rank approximation is given by A &#8673; LR, where L 2 R n&#8677;m , R 2 R m&#8677;d denote the left and right low-rank factors with m &#8999; min{n, d}. Since m(n + d) &#8999; nd,  Naive quant. was done with 2-bits per pixel of this 10 3 &#8677; 10 3 image. Quantizing the SVD factors "directly" (i.e., DSVD) and (our) LPLR/LSVD algorithms factorize the image into a product of tall &amp; wide matrices reduces the total number of elements, allowing each entry to be represented using upto 8-bits of precision per pixel. Despite the increase in precision per pixel, the total number of bits remains the same at 2 &#8226; 10 6 .</p><p>the total number of entries in LR can be significantly smaller than A, enabling matrix compression.</p><p>The need for compression is driven by the overwhelming storage demands and computational complexity linked to large matrices. In a comparable but distinct line of work, low-precision (LP) representations have also been studied extensively as a means to reduce the memory footprint. Quantization of a continuous valued variable using a small number of bits reduces storage requirement while trading off accuracy. In addition, they also facilitate low latency for real-time inference and low energy consumption (see Gholami et al. <ref type="bibr">[19]</ref>). Works of Alimisis et al. <ref type="bibr">[2]</ref>, Safaryan et al. <ref type="bibr">[53]</ref> have studied various matrix compression operators for distributed optimization.</p><p>In this work, we introduce LPLR: Low-Precision Low-Rank factorization -a general matrix compression algorithm that simultaneously exploits the low-rank structure of a matrix and quantizes it, to obtain a low-rank factorization, such that the elements of the factors are represented using a small number of bits. Although LPLR can generically refer to a class of algorithms whose main goal is to obtain low-precision representations and exploiting low-rank structures in matrices, in the rest of the paper, we reserve this acronym for our proposed algorithm in Alg. 1. Fig. <ref type="figure">1</ref> shows the effectiveness of LPLR in preserving the semantic features in image compression. Other algorithms designed towards achieving the same objective have been named and described appropriately throughout the paper.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.1">Related Works</head><p>Low-rank approximation: The optimal rank-k approximation of a matrix A 2 R n&#8677;d , denoted as A k , can be obtained by performing the singular value decomposition (SVD) of A, which gives A = U&#8963;V &gt; . To obtain A k , we keep only the top k singular values along with their corresponding left and right singular vectors, setting the remaining singular values to zero. In other words,</p><p>where i , u i , and v i represent the i-th singular value, left singular vector, and right singular vector, respectively. The matrix A k minimizes the Frobenius norm kA b</p><p>Ak F under the constraint that the rank of b A is at most k. This result is known as the Eckart-Young-Mirsky theorem <ref type="bibr">[16]</ref>, which states that kA A k k 2 F = P i&gt;k 2 i . However, computing the SVD has a high computational complexity of O(nd 2  ) (n d without loss of generality), which can be impractical for large matrices. Therefore, alternative methods such as in Jin et al. <ref type="bibr">[26]</ref>, Ye and Du <ref type="bibr">[80]</ref>, Zhang et al. <ref type="bibr">[83]</ref> have been proposed which solve variants of the minimization problem. Chi et al. <ref type="bibr">[9]</ref> provide a survey of optimization-based approaches for obtaining low-rank approximation.</p><p>Along a parallel line of work, randomized low-rank factorization algorithms have demonstrated their effectiveness in handling massive datasets efficiently while maintaining competitive accuracy levels. Several works, including those by Derezinski et al. <ref type="bibr">[11]</ref>, Drineas and Mahoney <ref type="bibr">[14]</ref>, Drineas et al. <ref type="bibr">[15]</ref>, Halko et al. <ref type="bibr">[21]</ref>, Ma and Solomonik <ref type="bibr">[35]</ref>, Mahoney <ref type="bibr">[36]</ref>, Martinsson et al. <ref type="bibr">[41]</ref>, Tropp et al. <ref type="bibr">[65]</ref>, Witten and Cand&#232;s <ref type="bibr">[77]</ref> have focused on reducing the complexity of computing SVD to approximately O(nm 2  ), where m &#8999; d. These algorithms aim to approximate the range space of matrix A by utilizing a sketched version AS, where S 2 R d&#8677;m is a random matrix with m &#8999; d. The columns of A are then projected onto this approximate range space. By choosing m = k + p, where p 2 is a small integer, the resulting low-rank approximation A &#8673; LR provided by these algorithms can be proven to be within a small multiplicative factor of the optimal rank-k approximation, stated as E kLR Ak 2 F &#63743; (1 + ) kA k Ak 2 F . The sketching matrix S is typically selected from the widely used class of Johnson-Lindenstrauss (JL) embeddings. A popular choice when A is dense is to sample a Gaussian matrix where each entry S ij &#8672; N (0, 1 m ). Randomized quantization: JL embeddings also have practical uses in vector quantization. In this context, when quantizing a vector x 2 R d , instead of quantizing x directly, the encoder quantizes Sx, and then the decoder obtains an approximation of x through S &gt; Q(Sx) &#8673; x. This randomized transformation equalizes the coordinate values of x, allowing for a smaller range of values and higher precision for the quantizer Q under a fixed bit-budget. As a result, it leads to a smaller `2 error compared to independently quantizing each coordinate in a naive manner. Works such as Chen et al. <ref type="bibr">[8]</ref>, Lyubarskii and Vershynin <ref type="bibr">[34]</ref>, Mayekar and Tyagi <ref type="bibr">[42]</ref>, Safaryan et al. <ref type="bibr">[52]</ref>, Saha et al. <ref type="bibr">[54,</ref><ref type="bibr">55,</ref><ref type="bibr">56]</ref>, Studer et al. <ref type="bibr">[58]</ref>, Suresh et al. <ref type="bibr">[59,</ref><ref type="bibr">60]</ref>, Vargaftik et al. <ref type="bibr">[69,</ref><ref type="bibr">70]</ref>, Young et al. <ref type="bibr">[81]</ref> explore different variations of this concept for different applications.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Proposed Algorithm</head><p>Prior to detailing our algorithm, we first review the characteristics of the uniformly dithered quantizer that we employ within our approach. Uniformly dithered quantization has been utilized in various prior works Alistarh et al. <ref type="bibr">[3]</ref>, Bernardo et al. <ref type="bibr">[7]</ref>, Gray and Stockham <ref type="bibr">[20]</ref>, Mayekar and Tyagi <ref type="bibr">[42]</ref>, Suresh et al. <ref type="bibr">[59,</ref><ref type="bibr">60]</ref>, and is succinctly described in &#167;(2.1) below.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">Uniformly dithered quantizer</head><p>Let us consider quantizing a scalar x with |x| &#63743; R. Given a bit-budget of B bits, the scalar quantizer with dynamic range R is described by first specifying the M = 2 B quantization points as:</p><p>R, q 2 = R + , q 3 = R + 2 , . . . , q M = R + (M 1) .</p><p>Here, the resolution is given by = 2R M 1 , and the quantizer operation is defined as:</p><p>&#8674; q k+1 with probability r, q k with probability 1 r,</p><p>where k = arg max j {q j &#63743; x}, i.e., x 2 [q k , q k+1 ), and r = x q k . Such a quantizer satisfies</p><p>i.e., it is unbiased and the quantization error variance is dictated by R and B. Here, the E(&#8226;) is over the randomness from dithering in (1) (ref.</p><p>App. C). If the input x to the quantizer falls outside this range, i.e., x &gt; R or x &lt; R, the quantizer is said to be saturated. Finally, to quantize any matrix X, we obtain Q R,B (X) by quantizing each entry independently, i.e., [Q R,B (X)] ij , Q R,B (X ij ).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Proposed algorithm: LPLR</head><p>In order to comprehend low precision and low rank representations, we first introduce a simple strategy, which we name as direct-SVD quant. This method involves two main steps: It first computes the optimal rank-k decomposition A k = U k &#8963; k V &gt; k , and then, it quantizes the low-rank factors independently, namely,</p><p>Here, Q and Q 0 are uniform scalar quantizers with respective bit-budgets B and B 0 . A detailed analysis of this direct-SVD quantization approach can be found in Appendix H, along with pseudocode provided in Algorithm 2. Despite its simplicity, this is not the optimal strategy due to two reasons. Firstly, it necessitates computing the SVD of A, which is computationally expensive at O(nd 2  ). Secondly, let us consider improving the approximation to A when the first factor is fixed to Q(U k ) by solving the optimization problem:</p><p>This computes the projection of the columns of A onto the range space of Q(U k ). Suppose the resulting projection coefficients are further quantized to get Q 0 (Q(U k ) &#8224; A). Since X &#8676; is the solution of (3), for a sufficiently large value of B 0 , it is evident that</p><p>, and hence, better than direct-SVD quant. However, this approach of projecting onto the range space of Q(U k ) (which we refer to as LPLR-SVD and analyze in App. I), still requires the computation of U k , so we can replace U k by AS, i.e., an approximation of the Algorithm 1: LPLR: Randomized Low-Precision Low-Rank factorization</p><p>bit-budgets B, B 0 respectively. Output :Factorization: LR where L 2 R n&#8677;m , R 2 R m&#8677;d Sample a Gaussian sketching matrix S 2 R d&#8677;m with entries S ij &#8672; N 0, 1 m . Compute an approximate basis of column space of A by forming the sketch: AS. Quantize the approximate basis with Q to get Q(AS).</p><p>). return Low-rank and low-precision approximation LR where</p><p>range space obtained through random linear combinations of the columns of A (also known as a randomized rangefinder <ref type="bibr">[40]</ref>). This leads us to our LPLR algorithm, described in Alg. 1, which finds</p><p>and forms the low-rank low-precision approximation</p><p>) where Q, Q 0 are quantization operators. While the solution of this problem is available in closed form as W &#8676; = Q(AS) &#8224; A, one can also use an approximation of W &#8676; by solving this least-squares minimization using an iterative method such as conjugate gradient descent.</p><p>In addition to the above argument supporting the superiority of LPLR compared to other baselines (ref. to Tabs. 1 and 2), there exists another essential reason why LPLR outperforms them. This reason directly relates to the selection of S as a Gaussian matrix, which is an integral component of LPLR. Random Gaussian matrices are JL embeddings and possess an equalization property that enhances the precision of uniform quantizers. In particular, let us consider an arbitrary vector x 2 R d and obtain an estimate as b</p><p>x = S &gt; Q(Sx) using a uniform quantizer Q. It can be shown that the vector quantization error remains constant and does not grow with the dimension d, expressed as</p><p>. This represents a substantial improvement compared to the na&#239;ve strategy of independently quantizing each coordinate of x, which leads to a quantization error growth rate of O(d). We provide a detailed explanation of this phenomenon in App. D. Furthermore, even when the quantization is 1-bit per coordinate, e.g., Q(Sx) = Sign(Sx), this embedding provides strong near-isometric embedding properties due to the properties of random hyperplane tessellations <ref type="bibr">[48]</ref>.</p><p>While the strong equalization property of Gaussian embeddings is a known result, certain works such as Saha et al. <ref type="bibr">[55,</ref><ref type="bibr">56]</ref>, Suresh et al. <ref type="bibr">[59,</ref><ref type="bibr">60]</ref> opt for using randomized Hadamard embeddings instead of Gaussian ones. The reason behind this choice is twofold: (i) Gaussian matrices are dense, requiring O(d 2</p><p>) multiplications when computing Sx, and (ii) the entries of S are floating point numbers that must be stored in full precision, contradicting the objective of quantizing x using fewer bits. However, these concerns are not problematic for LPLR because the effects of S in the first low-rank factor are neutralized by the second low-rank factor, and computing AS is not the rate determining step. In fact, we exploit both the equalization property and the subspace approximation property of Gaussian matrices to derive a superior upper bound for the approximation error, as discussed next in &#167;3.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Approximation Error Analysis</head><p>We are now in a position to state the approximation error guarantee of LPLR Let us denote the i th row of our input matrix A as a (i) . For convenience of analysis, we make the following assumption. Assumption 3.1. Rows of matrix A have bounded norm, i.e., ka (i) k &#63743; R for some known R &gt; 0.</p><p>The following result gives an informal upper bound on the expected Frobenius norm error of the factorization returned by Alg. 1. Theorem 3.2. LPLR approximation error (Informal) Suppose our input matrix A 2 R n&#8677;d with ka (i) k &#63743; R = O(1) has singular values 1 , . . . , r with r = rank(A) and target rank as k. Let &#63743;(A) = 1 / r and &#63743;(A k ) = 1 / k respectively be the condition numbers of A and the best rank-k approximation of A, and let us denote</p><p>. Furthermore, for a sufficiently small constant &#9999; &gt; 0, suppose the dynamic range of Q is set to be c 1 p log (n/&#9999;) /m, and that of Q 0 is set to 2&#63743; p m/d. Then, the LPLR factorization returned by Alg. 1 satisfies</p><p>and c 4 are constants that depend on R.</p><p>We provide a less formal version of our main result here, suitable for interpretation. The formal statement of this result, including specific constant values, can be found in Thm. G.2 of App. G. It does not necessitate the assumption n &#8673; d and provides distinct thresholds for B and B 0 . Thm. G.2 asserts that, for a target rank-k, as long as m k + 2, one can ensure an arbitrarily small approximation error of &#9999; by selecting the number of bits to be at least above a certain threshold budget. The threshold depends on the error tolerance &#9999;, dimensions n and d, the sketch size m, and the spectrum of A. The value of &#63743; is determined by taking the smaller of two quantities. In the case of matrices with a sharp decline in singular values (e.g., matrices of exact rank-k), where the ratio k / k+1 approaches zero, &#63743; &#8673; &#63743;(A k ). For matrices with a smoother spectrum (e.g., all singular values are equal), &#63743; = &#63743;(A), the condition number of the input matrix A. Remark 1. We consider two distinct scenarios based on Asm. 3.1. The first case assumes that the row norms are bounded by a constant, represented by R = O(1). This assumption is reasonable when the rows of A correspond to different normalized features of a data point. The second case assumes that the individual entries of A are bounded by a constant, i.e., A ij = O(1). This implies that R = O( p d), which is a reasonable assumption for scenarios like images, where it is known that each pixel value is bounded. In Tab. 1, we compare the performance of the algorithms when</p><p>. The expressions in Tab. 2 can be obtained in a similar manner from the formal version in Thm G.2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Analysis outline</head><p>The derivation of the upper bound on the approximation error of LPLR is presented in App. G. In this section we outline a brief proof sketch that highlights the main challenges of the proof. As mentioned already in &#167;2.2, the analysis of LPLR utilizes the subspace embedding and equalization properties of random Gaussian matrices. A key component in Alg. 1 is the choice of dynamic range for quantizers Q and Q 0 . Note that when either Q or Q 0 gets saturated in lines 2 and 5 of Alg. 1, a trivial factorization of LR = 0 is returned. We choose the dynamic ranges R Q and R Q 0 to be sufficiently high enough so that this happens with a very low probability. Lemma E.1 states this formally for quantizer Q,</p><p>Here, kASk max is max-norm of the matrix AS, i.e., the coordinate with maximum magnitude. This concentration result is a consequence of the equalization property of Gaussian matrix S.</p><p>On the other hand, the input to the second quantizer is Q(AS) &#8224; A and Lemma E.2 provides a concentration result for the max-norm of this matrix. Although in a general worst-case scenario, the coordinate values of the pseudo-inverse of a matrix with small entries can be large (Alon and Vu <ref type="bibr">[4]</ref>), because we compute the pseudo-inverse of the matrix AS, which is rectangular (m &#8999; n) and with random Gaussian entries, k(AS)</p><p>&#8224; k 2 does not shoot up arbitrarily as shown by Rudelson and</p><p>Vershynin <ref type="bibr">[51]</ref>. We then show that kQ(AS) &#8224; k 2 is not too far from k(AS) &#8224; k 2 , allowing us to derive an expression for R Q 0 . We get for = d m and t = r</p><p>The second part of the analysis deals with upper bounding the approximation error when the second low-rank factor is unquantized, i.e., kQ(AS)Q(AS) &#8224; A Ak 2 F conditioned on the event that Q and Q 0 are unsaturated. We reduce this problem to analyzing the solution of the following: e X = arg min  Dimension dependent terms are color highlighted for ease of comparison with Tab. 1.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Algorithms Approximation error Bit-budget (per entry) Computation</head><p>Na&#239;ve uniform</p><p>We refer to (4) as the sketched least squares problem with quantized response as it is a variant of the generalized least squares problem,</p><p>. This is potentially a problem of independent interest, and we analyze the solution of (4) in detail in App. F. Exploiting the subspace embedding property of S we show that</p><p>+ quantization error term. This leads us to the proof of Lemma G.1 which gives the approximation error of LPLR when Q and Q 0 are unsaturated. Finally, taking into account the low-probability saturation events, for which the error is kAk 2 F , we derive our main result in Thm. G.2. Subsequently, we discuss the approximation made in App. G.2 and arrive at the informal result of Thm. 3.2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Comparison with baselines</head><p>We are now in a position to compare the performance with baselines in Tabs. 1 and 2.</p><p>Naive quantization: The most straightforward baseline for matrix quantization is na&#239;ve quantization where each coordinate of the matrix is quantized independently, agnostic to any low-rank structure in the matrix A. In this, we allocate B bits to each coordinate of A and since there are nd entries in the matrix, from (1), the Frobenius norm error is upper bounded by R 2 nd</p><p>(2 B 1) 2 . Note that this holds true irrespective of whether</p><p>To ensure that the error is within a certain tolerance &#9999;, we then require 1  2 log 2 nd &#9999; bits. In this, and also other expressions for bit-budget requirements of algorithms in Tabs. 1 and 2, we have ignored the multiplicative constant factors inside the log 2 (&#8226;) for simplicity of exposition. The exact expressions can be found in the corresponding appendices where we derive them.</p><p>One of the primary reasons why both direct-SVD and LPLR are expected to perform better than na&#239;ve is that the former strategies exploit the low-rank structure of the matrices to reduce the total number of parameters being quantized, i.e., k(n + d) for direct-SVD and m(n + d) for LPLR, vs. nd for na&#239;ve. Given a total number of bit-budget for the entire matrix A, since we now quantize fewer parameters than before, we can allocate a higher number of bits to each parameter, enabling higher precision. The price we pay for exploiting the low-rank structure of matrices is the additional kA k Ak 2 F dependent term, which is usually very small for matrices that can be well approximated by a low-rank structure. For matrices that are exactly rank k, this term is 0. As we see in our numerical simulations in &#167;4, several real-world matrices can be well-approximated by a low-rank structure.</p><p>Direct-SVD quant.: From Tab. 1, we see that to achieve an &#9999;-quantization error, direct-SVD requires direct-SVD, due to the additional p n factor. Thus, it makes sense to expect that direct-SVD can perform better in this regime. This is supported by our numerical experiments in Tabs. 4 to 7, where direct-SVD indeed outperforms LPLR in certain scenarios. Nevertheless, it is crucial to emphasize that direct-SVD necessitates computing the SVD, which can be prohibitive for very large matrices due to the current memory limitations of available GPUs, making LPLR the only viable option.</p><p>Computational complexity: Unsurprisingly, na&#239;ve quant. requires the least computation, i.e., O(nd), as it does just a single pass over all the elements of A. The O(nd 2</p><p>) complexity of direct-SVD quant. stems from the requirement of computing SVD (assuming n d). LPLR is the best of both worldsfor the same bit-budget, LPLR has a smaller approximation error than both direct-SVD and na&#239;ve, and a complexity of O(ndm), arising from the requirement to compute AS, i.e., a product of two dense matrices of dimensions n &#8677; d and d &#8677; m, which is better than direct-SVD, since m &#8999; d.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Numerical Simulations 4.1 Overview</head><p>We evaluate the robustness of LPLR on multiple tasks, namely, image compression, binary, and multi-class classification across disparate domains including vision, text and raw images, and neural network weight matrices. We consider a range of input configurations to showcase the performance and non linear effects of joint quantization and low rank approximation on a given dataset, especially at lower bit budgets. LPLR provides competitive results at bit budgets as low as a single bit, providing extreme model compression while maintaining non trivial performance for the task at hand.</p><p>Baselines. We employ naive quantization, which quantizes the input matrix by rounding to the nearest scalar in the underlying data type's quantization grid, as our primary benchmark. Na&#239;ve quant. and its variants -Dettmers et al. <ref type="bibr">[12]</ref>, Yao et al. <ref type="bibr">[79]</ref>, are the most popular method in use across domains, as their memory and computational run time requirements scale extremely well with model and dataset sizes. In addition, we also evaluate the performances of direct-SVD quantization and LPLR-SVD to disambiguate between the entangled effects of quantization and exploiting low rank structure.</p><p>Metrics. We evaluate LPLR performance using task specific goodness of fit metrics, as well as relative Frobenius norm error between the original and matrix reconstructed from its low-rank factors, i.e., kLR Ak 2 F . In addition to this, we enforce parity between the number of bits used by all quantization schemes, so that the total space required (in bits) for storing the approximated matrix is identical across LPLR, LPLR-SVD, direct-SVD quant., and na&#239;ve quant.</p><p>Notation. In all our experiments, we denote the bit budget for the left low rank factor L as B, for the right low rank factor R as B 0 , and the corresponding bit budget for naive quantization as B nq . For simplicity, we maintain equal bit budgets B = B 0 for both quantizers Q and Q 0 . Wherever necessary, we also abbreviate direct-SVD quant. as DSVD, LPLR-SVD as LSVD., and na&#239;ve quant. as NQ.</p><p>The main algorithm is implemented in Pytorch (Paszke et al. <ref type="bibr">[44]</ref>), and utilizes Hugging Face <ref type="bibr">[78]</ref> implementations of all datasets and large language models. All experiments were performed on a single GPU NVIDIA TITAN RTX. Further simulations and experimental details can be found in App. J. Our code is available at <ref type="url">https://github.com/pilancilab/matrix-compressor</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">Image Compression</head><p>Image compression is a prototypical application of low rank matrix compression, as images are known to be significantly rank deficient in many practical scenarios (Zhang et al. <ref type="bibr">[84]</ref>, Zhou et al. <ref type="bibr">[85]</ref>). In this task, we apply LPLR on 1000 &#8677; 1000 dimensional Shepp Logan phantom images from Gach et al. <ref type="bibr">[18]</ref>. These are a set of synthetic 2D images designed to simulate the typical characteristics and structures found in computed tomography (CT) scans. They consist of geometric shapes, including circles and ellipses, representing different tissues or organs within the scanned object.</p><p>The main results are summarized in Tab. 3. To ensure a fair comparison, we adjust the rank of the matrix so that bit budgets are identical between na&#239;ve quant. and LPLR. This allows us to preserve the original datatype of the image (consequently a large dynamic range R), while substantially reducing the pixels used to represent the image, as low as 1 bit per pixel (on average). Specifically, in Figure <ref type="figure">1</ref>, we can observe the least visual distortion in the case of LPLR, which preserves critical semantic features of the images, such as the small ellipses. It is clear that LPLR outperforms both techniques at lower naive quantization bit budgets. We attribute the better visual and quantitative performance to the higher dynamic range available to LPLR as well as structure preserved in the low rank decomposition. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3">Embeddings extracted from pre-trained models</head><p>The efficacy of pre-trained embeddings is well established in vision (Li et al. <ref type="bibr">[31]</ref>, Parisi et al. <ref type="bibr">[43]</ref>), text (Qi et al. <ref type="bibr">[49]</ref>, Rezaeinia et al. <ref type="bibr">[50]</ref>) for rapid feature computation as an input to a variety of downstream tasks. Embeddings also play a crucial role in a number of software applications, including but not limited to, open source vector search libraries <ref type="bibr">(Liu [33]</ref>, Marqo <ref type="bibr">[39]</ref>), semantic search engines (Amazon AWS <ref type="bibr">[5]</ref>), vector databases (Pinecone <ref type="bibr">[47]</ref>). Since most applications rely on proximity in "embedded space", it is essential that common operations on embeddings be computationally efficient. Specifically, one would like to optimize nearest neighbor (NN) searches which solve the optimization problem arg min i kx i yk 2 2 (reducible to arg max i Xy where X is the matrix with training vectors {x i } as its rows, and y is the query vector). The time complexity of NN search scales linearly with dimensions of X 2 R n&#8677;d and number of neighbors (k). By embedding the data matrix in a dimension m &#8999; d, we directly speedup the run-time and reduce storage costs. Moreover, as datasets grow exponentially in size (especially document databases) and transfer learning becomes the dominant modality of training new models, embedding compression becomes a necessity for storing data without a corresponding exponential increase in hardware requirements.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3.1">Embedding Classification</head><p>In this experiment, we evaluate several embeddings of standard datasets, namely CIFAR-10, CIFAR-100, IMDB and Emotion datasets. CIFAR-10 consists of 60,000 color images divided into 10 classes, with each class containing 6,000 images. The dataset is split into 50,000 training images and 10,000 test images, with a resolution of 32x32 pixels. CIFAR-100 increases the number of classes to 100 categories for an identical training and test size as CIFAR-10. The IMDB dataset consists of 25,000 train and test sentences containing annotated binary sentiment labels for movie reviews, plot summaries and other rating information. The Emotion dataset is a sentiment analysis dataset, containing 16,000 train and 2000 test sentences, each exemplifying a singular emotion, which represents the sentiment label for that sentence.</p><p>For CIFAR-10 and CIFAR-100, we embed the entire dataset using MobileNet v3 (Howard et al. <ref type="bibr">[22]</ref>) pretrained on ImageNet (Deng et al. <ref type="bibr">[10]</ref>) producing an embedding matrix of dimension 60000 &#8677; 1024, which we compress using LPLR and compare with the baselines in &#167;4.1. To evaluate the goodness of embeddings, we build a 3-NN, a KNN Classifier using K = 3 nearest neighbors under Euclidean distance). We report the performance of the model using standard classification metrics -classification accuracy and weight averaged F1 score. We utilize a uniform bit budget B = B 0 = 8 bits for the quantizers Q, Q 0 across all cases. Tabs. 4 and 5 present our results under this setup. For each case we benchmark absolute performance using a 3-NN classifier on the training set.</p><p>Similarly, we embed text sentences from IMDB and Emotion databases using BeRT (Devlin et al. <ref type="bibr">[13]</ref>) into 512 dimensional vectors, and construct a 3-NN classifier using Euclidean distance to perform binary and multi-class classification on the respective embeddings, and report classification metrics in Tabs. 6 and 7. We see that LPLR outperforms direct-SVD quant. and na&#239;ve quant at lower bit budgets, and has performance parity as we increase B nq to 4 bits. We find that we match (and even exceed) the unquantized benchmark at single bit precision, which we attribute to the dominating low rank factorization, and its regularizing effect on data under extreme rank constraints. It is important to note that performance parity with direct-SVD quant. is also a successful outcome, since LPLR provides runtime improvements over taking an SVD to compress the data.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3.2">Compressing Weight Matrices of a Large Language Model</head><p>In this section, we present results on a major application of matrix compression -compressing the weight matrices of deep neural networks. We choose LlaMa by Touvron et al. <ref type="bibr">[64]</ref>, a popular foundation Large Language Model (LLM) as the network of our choice. LLMs are a natural candidate for matrix compression, due to their massive stacked transformer layers, rendering them difficult to deploy on several GPUs, let alone a single GPU. Many methods have emerged to quantize and compress these models in order to make them amenable to single GPU deployment and inference, including naive quantization with outlier exclusion (Dettmers et al. <ref type="bibr">[12]</ref>), second order methods (Frantar et al. <ref type="bibr">[17]</ref>), low rank parameter reduction (Hu et al. <ref type="bibr">[23]</ref>), amongst others.</p><p>We apply LPLR to the 2-dimensional weight tensors, i.e., matrices in LlaMa, leaving any other tensor, which does not lend itself to a low rank decomposition, unquantized. Figs. 2a and 2b (better  resolution in App. J) showcase our results on applying LPLR and LPLR-SVD with bit budgets of 8 bits and 4 bits respectively, using relative Frobenius norm error as the metric. While it is clear that LPLR and LPLR-SVD perform significantly better across all layers (on average), there are outliers where na&#239;ve quant. is the better choice. We can a observe periodic structure in the error profile of na&#239;ve quant., implying that the low rank structure is a function of the index of attention layer in transformer blocks. It is important to note that a low Frobenius norm error is not a direct indicator of performance for other task specific metrics. It is possible to construct a holistic compression strategy using error profiles similar to Figures <ref type="figure">3,</ref><ref type="figure">4</ref> to adopt a per-layer quantization strategy, minimizing both task specific metrics as well as relative Frobenius norm error. We discuss this further in Appendix K.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Conclusions</head><p>In this work, we have considered the problem of obtaining a low-precision and low-rank factorization of a matrix. Such a factorization of a matrix into a product of tall and wide matrices has several advantages, including compression of the original matrix. We proposed a fast randomized algorithm to obtain this factorization which requires O(nmd) computations -considerably faster than alternative methods. Our algorithm employs a Gaussian sketch to estimate the range space of matrices that are approximately low-rank. By utilizing the properties of subspace approximation and equalization in Gaussian embeddings, we established an upper bound on the approximation error attained by our algorithm, and show that it can be significantly smaller than its counterparts. Finally, we empirically evaluate our method on several vision and text datasets, where we show significant task performance at highly compressed bit budgets as low as a single bit. This provides a novel pragmatic approach to work with large datasets and models in real world settings, making them more accessible to researchers and deployment on regular consumer hardware. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>K Limitations and further discussions A Notations</head><p>We first gather some common notations in linear algebra and probability theory that have been used throughout the paper. Boldface upper and lowercase letters, A and a denote matrices and vectors respectively. I d denotes the d &#8677; d identity matrix. The subscript may be dropped if the dimension is clear from the context. For any matrix A, its i th row and j th column are denoted by a (i) and a j respectively. The singular values of A are denoted by max (A) = 1 2 . . . r = min (A), where r = rank(A). Similarly, the eigenvalues are denoted as 1 (A), . . . , r (A). The maxnorm of A is defined as kAk max = max i,j |A ij |, the spectral norm of A is defined as kAk 2 = sup kxk=1 kAxk = max (A), and the Frobenius norm is kAk</p><p>. For any vector x, kxk = x 2 i 1/2 denotes the `2-norm, and</p><p>denotes the `1-norm. We use the notations &lt; and 4 for the positive semi-definite (PSD) cone ordering (or the Loewner ordering) of symmetric matrices, i.e., for any symmetric matrices X and Y, X &lt; Y () X Y is PSD. X &#8224; denotes the Moore-Penrose pseudo-inverse of a matrix X. log(&#8226;) denotes the natural logarithm, i.e., base e. log 2 (&#8226;), i.e., with base 2 is specified explicitly. A normal distribution with mean &#181; and variance 2 is denoted as N (0, 2 ), while a multivariate normal distribution in R d is denoted as N (&#181;, &#8963;). E[&#8226;] denotes expectation of a random variable. The probability measure over which the expectation is taken is described in text. We also use big-'oh' notation O(&#8226;) that hides constants for asymptotic expressions, while e O(&#8226;) also hides terms that depends logarithmically on dimension.</p><p>We now list some notations that are either less commonly known or used specifically in this paper, along with some remarks such as their occurrence in the paper. Several of these notations have also been introduced in-context, but they are additionally collected here for easy reference.  </p><p>Quantizers for the first and second low-rank factors with bit-budgets B and B 0 , and dynamic ranges RQ and R Q 0 respectively.</p><p>- </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B Preliminaries B.1 Linear algebra inequalities</head><p>We state (with proofs) some standard inequalities from linear algebra that will be useful in proving our main results.</p><p>Lemma B.1. (Frobenius norm of matrix products) For any matrices A and B, we have kABk F &#63743; kAk F kBk 2 .</p><p>Proof. Note that:</p><p>Here, (i) follows from the definition of spectral norm of a matrix, and this completes the proof.</p><p>Lemma B.2. (Loewner ordering for matrix products) For any matrix A and B, we have</p><p>Proof. For any vector x 6 = 0, we have,</p><p>The other direction holds similarly. This completes the proof.</p><p>Proof. Let e i 2 R n and b e j 2 R d denote the i th and j th canonical basis vectors in R n and R d respectively. Then, using Cauchy-Schwarz inequality, we have,</p><p>completing the proof.</p><p>Lemma B.4. (Submultiplicativity of spectral norm) For any two matrices A and B, we have kABk 2 &#63743; kAk 2 kBk 2 . Moreover, an analogous "reverse-submultiplicativity" result for the minimum singular value of a matrix product also holds true, i.e., min (AB) min (A) min (B).</p><p>Proof. Using Lemma B.2, we have, Proof. We have the following chain of inequalities,</p><p>where (i) is the reverse triangle inequality. This completes the proof.</p><p>Lemma B.6. (Rotation invariance of singular values) For a given matrix A, i (A) = i (UA) for all i = 1, . . . , rank (A) for any unitary matrix U.</p><p>Proof. For i = 1, . . . , rank(A), since U &gt; U = I, we have</p><p>Lemma B.7. (Rotation invariance of Frobenius norm) For a given matrix A, kUAk F = kAk F for any unitary matrix U.</p><p>Proof. We have, kUAk</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B.2 Probability and random matrix theory</head><p>We restate some results from probability and random matrix theory which will be useful in deriving the main result of our paper.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B.2.1 Tail bound for Gaussian distribution</head><p>Gaussian distributions have strong concentration properties which we exploit in deriving the results of this paper. The following tail bound on a Gaussian random variable can be found in standard texts such as Wainwright [73, &#167;2.1.2], and is restated here.</p><p>Lemma B.8. (Chernoff bound for centered Gaussian) For X &#8672; N 0, 2 , we have,</p><p>The proof of this follows from a direct application of Chernoff bound.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B.2.2 Inverse Wishart distribution</head><p>Consider a matrix S 2 R d&#8677;m , each row of which is drawn independently from the distribution N (0, ), where 2 R m&#8677;m . Then, the probability distribution of the m &#8677; m random matrix S &gt; S is called the Wishart distribution with d degrees of freedom, denoted as W ( , d). Moreover, the distribution of the matrix S &gt; S &gt; 1 is called the inverse Wishart distribution and is denoted by</p><p>, d . These distributions have been studied extensively and further details can be found in Mardia et al. <ref type="bibr">[38]</ref> or Siskind <ref type="bibr">[57]</ref>.</p><p>Lemma B.9. (Expected trace of inverse Wishart matrix) Suppose S 2 R d&#8677;m matrix, each entry of which is drawn independently from N 0, 1 m . Then, the matrix</p><p>Here, = 1 m I m , implying Tr</p><p>, which completes the proof.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B.2.3 Random Gaussian matrices</head><p>The spectral norm of random matrices with Gaussian entries have interesting concentration properties.</p><p>In this section, we present a lemma from Vershynin <ref type="bibr">[71]</ref> that formally states this result.</p><p>Lemma B.10. Let the entries of matrix S 2 R d&#8677;m be distributed according to S ij &#8672; N 0, 1 m . Then for every t 0, with probability at least 1 2e</p><p>The above lemma is a straightforward modification of the result in Vershynin <ref type="bibr">[71,</ref><ref type="bibr">Corr. 5.35]</ref>, which states the concentration result when the entries are distributed according to N (0, 1). Note that given S with entries S ij &#8672; N 0, 1 m as above, the matrix b S = p m S will have entries b S ij &#8672; N (0, 1). Furthermore, i ( b S) = p m i (S) and the conclusion is immediate.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B.2.4 Subgaussian random variables</head><p>Subgaussian random variables refer to a class of distributions that are dominated by the distribution of a centered Gaussian random variable. There are several equivalent ways to characterize subgaussian random variables which can be found in several textbooks (see for example, Vershynin [72, Prop.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>2.5.2]</head><p>). We will focus on the following definition. More formally, the distribution of a random variable X is subgaussian if the moment generating function of X 2 is bounded at some point, i.e.,</p><p>Definition B.11. (Subgaussian norm) The subgaussian norm of a subgaussian random variable X, denoted by kXk 2 is defined to be the smallest K in <ref type="bibr">(14)</ref>. In other words, kXk 2 , inf</p><p>It can be shown that any bounded random variable X is subgaussian, and satisfies,</p><p>We next present a result that upper bounds the spectral norm of a matrix with subgaussian entries.</p><p>Lemma B.12. (Vershynin [72, Thm 4.4.5]) Let X be a d &#8677; m random matrix whose entries X ij are independent, zero-mean, subgaussian random variables. Then, for any t &gt; 0, we have,</p><p>with probability exceeding 1 2e t 2 . Here, K = max i,j kA ij k 2 and C is an absolute constant.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C Quantization error of uniformly dithered scalar quantizer</head><p>For a scalar x 2 [ R, +R], let us denote the quantization error of uniformly dithered scalar quantizer with a bit-budget of B bits as &#9999; = Q R,B (x) x. Clearly, the quantization error is bounded as |&#9999;| &#63743; .</p><p>The following result further characterizes its mean and variance of this error.</p><p>Lemma C.1. The uniformly dithered scalar quantizer as described in (1) satisfies,</p><p>where the E(&#8226;) is over the randomness due to dithering in the quantizer operation.</p><p>Proof. Suppose x 2 [q k , q k+1 ) and q k+1 = q k + , where</p><p>To evaluate the variance,</p><p>This completes the proof.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D Gaussian embeddings: Application of equalization to vector quantizers</head><p>In this section, we show a result on how Gaussian embeddings help in reducing the `2-quantization error of a uniformly dithered vector quantizer. We consider a clipped version of the uniform scalar quantizer with bit-budget B described in &#167;2.1 and App. C. In order to quantize a vector x 2 R d with kxk 2 &#63743; R using a uniform scalar quantizer (as described above), the quantization operation is applied to each coordinate of the vector independently, i.e.,</p><p>Here, the subscript B is dropped because the bit-budget is evident from the context. Furthermore, since kxk 2 &#63743; R implies x i 2 [ R, +R] for every i 2 [d], the quantizer Q R does not saturate. From Lemma C.1, the expected quantization error is given by,</p><p>Quantizing Gaussian embeddings: Suppose instead of quantizing x 2 R d directly, we quantize u = Sx 2 R m , where S 2 R m&#8677;d with S ij &#8672; N 0, 1 m . Note that for every j 2 [m], we have</p><p>&#8984; . Since u j can be anything in ( 1, +1), there is a finite probability that the uniform scalar quantizer might get saturated. For this reason, for any scalar u 2 ( 1, +1), we define the clipped uniformly dithered quantizer with clipping parameter t as follows:</p><p>The dynamic range of the quantizer is parameterized by t, which is to be chosen appropriately. Note that it is just for this section for the purposes of illustration, that we choose the clipped variant of the quantizer. In LPLR, we choose the dynamic range to be high enough so in practice it remains unsaturated with a very high probability. The following proposition upper bounds the quantization error of quantizing Gaussian embeddings.</p><p>Proposition D.1. For a given vector x 2 R d with kxk &#63743; R, the clipped uniformly dithered quantizer described in <ref type="bibr">(19)</ref> </p><p>, where the expectation is over the randomness in the construction of S and the quantization dither.</p><p>Proof. Since {u i } i2[m] are independently and identically distributed, let us denote the distribution as m . The expected quantization error for the clipped quantizer is then given by,</p><p>Here, the expectation is over the stochasticity of the quantization dither, as well as the random matrix S. The factor of 2 in the second term appears due to symmetry of clipping and that of Gaussian distribution. Using <ref type="bibr">(18)</ref>, the first term on the R.H.S. can be upper bounded as,</p><p>To analyze the second term, note that,</p><p>where erf(z) denotes the error function defined as,</p><p>Simple calculation would show,</p><p>Since @ (t, ) @ 0, (t, ) is a non-decreasing function of . Since</p><p>where erfc(z) = 1 erf(z) is the complementary error function.</p><p>Quantization error of a scalar Gaussian sketch:</p><p>We first consider the quantization of x &gt; s, and upper bound the error</p><p>). Consequently, using ( <ref type="formula">21</ref>) and ( <ref type="formula">25</ref>), for any t 0, we have,</p><p>Here, (i) follows from the upper bound erfc(z) &#63743; e z 2 p &#8673;z from Karagiannidis and Lioumpas <ref type="bibr">[27]</ref>. Quantization error of a vector Gaussian sketch: We now consider for any t 0, the expected quantization error for x 2 R d with kxk 2 &#63743; R and S 2 R m&#8677;d with S ij &#8672; N 0, 1 m . Each row of S now independently plays the role of s in <ref type="bibr">(26)</ref>. Using <ref type="bibr">(26)</ref>, the vector quantization error is simply m times the scalar quantization error, and is now given by,</p><p>Choice of dynamic range t:</p><p>This completes the proof.</p><p>Note that since E[S &gt; S] is an identity matrix, an estimate b x of x can be recovered from Q(Sx) as S &gt; Q(Sx). We can use the O(1) bound on kQ(Sx) Sxk 2 to get a bound on kS &gt; Q(Sx) xk 2 as follows:</p><p>From properties of random Gaussian matrices, we know that ). The entries of S themselves are floating point numbers that have to be stored in full precision, hence this defeats the whole purpose of quantizing x using fewer bits. However, this is not an issue for matrix compression because in LPLR, we do not explicitly compute the S &gt; Q(SA) anywhere. In other words, the effects of S in the first low-rank factor is nullified by the second low-rank factor. Unlike vector quantization, the corresponding sketch size m for LPLR only needs to be the same order as the inherent rank k, which can be much smaller than min{n, d}, i.e., the dimensions of the matrix being compressed.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E Dynamic range of quantizers</head><p>We now derive high probability upper bounds on the maximum magnitude of the input to uniform quantizers Q and Q 0 . Choosing these upper bounds to be the dynamic range of the uniform scalar quantizers will ensure that the quantizer remains unsaturated with a high probability, which is our desired regime of operation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E.1 Quantization for the first low-rank factor</head><p>We first look at the choice of dynamic range for the quantizer Q, which is used to obtain the first low-rank factor. The input to the quantizer is AS 2 R n&#8677;m where A 2 R n&#8677;d and S 2 R d&#8677;m , and the entries of S are i.i.d. as S ij &#8672; N 0, 1 m . Lemma E.1 below gives a high probability upper bound on the max norm of AS. This probability is computed over the randomness in the construction of S.</p><p>Lemma E.1. (Max norm of AS) Given matrix A 2 R n&#8677;d with bounded row norms, i.e., a (i) &#63743; R, and S 2 R d&#8677;m with entries distributed as S ij i.i.d.</p><p>&#8672; N 0, 1 m , with probability exceeding 1 &#9999; 8nR 2 , the max norm of AS satisfies,</p><p>Proof. Since (AS) ij = s &gt; j a (i) , where a (i) 2 R d is the i th row of A and s j 2 R d is the j th column of S, we have (AS</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>&#8984;</head><p>. Using Lemma B.8 and an application of union bound gives,</p><p>A subsequent application of union bound over all the entries of AS yields,</p><p>in the above completes the proof.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E.2 Quantization for the second low-rank factor</head><p>We now obtain a high-probability upper bound on the max norm of Q(AS) &#8224; A, which is the input to the second quantizer Q 0 . Let us define Q to be the event that the quantizer Q does not saturate. From Lemma E.1, Q occurs with a sufficiently high probability. An appropriate choice of dynamic range for Q 0 will ensure that conditioned on the event that Q occurs, the quantizer Q 0 also does not saturate with a high probability. The following lemma states this formally.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Lemma E.2. (Max norm of Q (AS)</head><p>&#8224; A) Let our input matrix A 2 R n&#8677;d have non-zero singular values 1 , . . . , k , k+1 , . . . , r , where r = rank(A), and bounded row norms a (i) &#63743; R. Let &#63743;(A) = 1 / r and &#63743;(A k ) = 1 / k respectively be the condition numbers of A and the best rank-k approximation of A, and for some small &#9999; &gt; 0, let us denote</p><p>where = d/m is the aspect ratio of the sketching matrix S 2 R d&#8677;m with S ij i.i.d.</p><p>&#8672; N 0, 1 m .</p><p>Furthermore, suppose the dynamic range of the quantizer</p><p>as dictated by Lemma E.1, and suppose for some absolute constant C, the bit-budget B satisfies,</p><p>Then, we have,</p><p>Proof. We have the following chain of inequalities:</p><p>where (i) and (ii) follow from Lemmas B.3 and B.4 respectively. We now need to upper bound</p><p>, which is done as follows:</p><p>Here, E = Q(AS) AS 2 R n&#8677;m is the quantization error matrix from Q, (i) follows because the singular values of Q (AS) &#8224; are inverses of the singular values of Q (AS) (assuming Q (AS) is invertible), and (ii) follows from Lemma B.5.</p><p>Lower bounding min (AS): It now suffices to derive the a lower bound on min (AS), which we do next. We derive two different lower bounds, either of which could be tighter depending on the singular value profile of A. The final lower bound will be the maximum of both.</p><p>For the first lower bound, let A = U&#8963;V &gt; be the full singular value decomposition of A, where U 2 R n&#8677;n , &#8963; 2 R n&#8677;d , and V 2 R d&#8677;d . Then, denoting e S = V &gt; S, we have,</p><p>where A k is the best rank-k approximation of A. Here, once again, (i) follows from Lemma B.5 and (ii) follows from Lemma B.4. In order to further lower bound min (A k S), let us denote the SVD of A k as A k = U&#8963; k V &gt; k . Since the best rank-k approximation is obtained by retaining the top-k singular values of A and zeroing out the rest, we have U 2 R n&#8677;n , &#8963; k 2 R n&#8677;k and V k 2 R d&#8677;k . Let us further denote e S = V &gt; k S. Then we have</p><p>where (i) follows from Lemma B.6, and (ii) follows from Lemma B.4. Note that the (i, j) th entry of e S is e</p><p>, where the last equality follows from the fact that the columns of V k are orthonormal. In other words, the entries of e S 2 R d&#8677;m are distributed according to e S ij &#8672; N 0, 1 m . Using (39), ( <ref type="formula">38</ref>) can be further lower bounded as</p><p>where (i) once again follows from the rotation invariance of spectrum, i.e., Lemma B.6.</p><p>On the other hand, let r = rank (A) and r by the smallest non-zero singular value of A. Then, A = U&#8963;V &gt; = U&#8963; r V &gt; r and using the same arguments as in <ref type="bibr">(39)</ref>, we also have</p><p>Combining ( <ref type="formula">40</ref>) and ( <ref type="formula">41</ref> </p><p>Substituting this in <ref type="bibr">(42)</ref>, with probability exceeding 1 2e</p><p>Upper bounding kEk 2 : Finally, conditioned on the event Q, the entries of E are bounded. Choosing the dynamic range of Q as dictated by the upper bound on kASk max in Lemma E.1, we have, with probability exceeding</p><p>Since E ij is a bounded w.h.p., it is also subgaussian w.h.p. (ref. eq. ( <ref type="formula">16</ref>)) with subgaussian norm given by,</p><p>From Lemma B.12 we get for some absolute constant C,</p><p>Completing the proof: Finally, combining <ref type="bibr">(36)</ref>, <ref type="bibr">(37)</ref>, ( <ref type="formula">44</ref>) and (47), we get with probability exceeding 1 </p><p>Then,</p><p>it follows that with probability exceeding 1</p><p>This completes the proof.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>F Sketched least squares with quantized response</head><p>Since the approximation error guarantees of sketched least squares with quantized response might be a problem of independent interest, this is a standalone section, and the notations used in this section are independent of the rest of the paper.</p><p>Consider the generalized least squares problem</p><p>where 2 R `&#8677;p and Y 2 R `&#8677;q . The sketched variant of ( <ref type="formula">54</ref>) with quantized response is given by, e X = arg min</p><p>where G 2 R m&#8677;`i s a Gaussian sketch matrix with entries are distributed as G ij &#8672; N 0, 1 m , and</p><p>is the uniformly dithered quantizer as described in <ref type="bibr">(1)</ref>. We assume that the dynamic range R kGYk max so that Q is unsaturated. The solution of ( <ref type="formula">55</ref>) can be obtained in closed form as,</p><p>The following lemma provides a characterization of the accuracy of e X with respect to the original problem <ref type="bibr">(54)</ref>. Lemma F.1. Let G 2 R m&#8677;`b e a random Gaussian matrix with entries distributed as G ij &#8672; N 0, 1 m , and Q &#8984; Q R,B be a uniformly dithered quantizer with dynamic range R and bit-budget B. Furthermore, suppose 2 R `&#8677;p and Y 2 R `&#8677;q be given, and let us denote</p><p>F and e X = arg min</p><p>Let E = Q(GY) GY be the quantization error matrix. Then, if R kGYk max , we have</p><p>, where r = rank( ), and max and min are the maximum and minimum singular values of respectively.</p><p>Proof. The solution of the generalized least squares problem (54) can be written as:</p><p>where y i 2 R p denote the i th column of Y. Consequently, we will first analyze the standard least squares problem x &#8676; = arg min</p><p>and generalize the results by concatenating x &#8676; i to obtain X &#8676; . The sketched variant of ( <ref type="formula">58</ref>) with quantized response is given by, e x = arg min</p><p>The solution of ( <ref type="formula">59</ref>) is available in closed form as e x = (G ) &#8224; Q(Gy). Let us denote the quantization error as &#9999; , Q(Gy) Gy 2 R m . We then have,</p><p>(60) Here, (i) follows as the cross term disappears because,</p><p>) where the last equality follows from <ref type="bibr">(2)</ref>, since E Q [&#9999;] = 0 when Q is a uniformly dithered quantizer.</p><p>Let us denote the quantization error matrix by E = Q(GY) GY 2 R m&#8677;q . Generalizing <ref type="bibr">(60)</ref> to the generalized least squares problem by treating each column y i separately and adding, we have,</p><p>Here, (i) follows from known results on the approximation error of sketched generalized least squares Halko et al. <ref type="bibr">[21]</ref>, Pilanci <ref type="bibr">[46]</ref>, and r is the rank of A.</p><p>Upper bounding Ek (G ) &#8224; Ek 2 F : The remainder of the proof concerns upper bounding the final term in <ref type="bibr">(62)</ref>. Since</p><p>for any matrix X, using the cyclic property of trace,</p><p>Since R kGYk max , from (2), the (i, j) th -entry of the quantization error matrix E satisfies,</p><p>So,</p><p>In other words, E Q &#8677; EE &gt; &#8676; is a diagonal matrix whose diagonal elements are upper bounded by q 2 4 . Let us denote &#8676; = (G ) &#8224; &gt; &gt; (G ) &#8224; . Then, (63) simplifies to,</p><p>Furthermore,</p><p>Here, (i) follows from Lemma B.1, (ii) is consequence of Lemma B.2, and (iii) follows from Lemma B.9. Combining ( <ref type="formula">63</ref>), ( <ref type="formula">66</ref>) and (67) yields,</p><p>This completes the proof.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>G LPLR algorithm: Approximation error analysis</head><p>To prove Thm. 3.2, we will first prove the result when both quantizers Q and Q 0 are unsaturated. We first prove Lemma G.1, which gives us an upper bound on the approximation error when Q and Q 0 are unsaturated. Since we can ensure that they remain unsaturated with high probability (with appropriate choices of dynamic ranges), the final approximation error upper bound in Thm. 3.2 is slightly worse than Lemma G.1.</p><p>Lemma G.1. Let our matrix A 2 R n&#8677;d have non-zero singular values 1 , . . . , k , k+1 , . . . , r , where r = rank(A), and bounded row norms a (i) &#63743; R. Let &#63743;(A) = 1 / r and &#63743;(A k ) = 1 / k respectively be the condition numbers of A and the best rank-k approximation of A, and let us denote</p><p>; , for some sufficiently small &#9999; that satisfies 0 &lt; &#9999; &#63743; 4nR 2 &#63743;(A) </p><p>where,</p><p>and B 2 is equal to</p><p>Furthermore, let E be the event that both quantizers Q and Q 0 are unsaturated. Then,</p><p>, where 1 (&#8226;) is the indicator function.</p><p>Proof. Let us denote the quantization error matrices from Q and Q 0 as E 2 R n&#8677;m and E 0 2 R m&#8677;d respectively, i.e., E = Q(AS) AS and</p><p>The cross terms disappear in (i) because,</p><p>where, (ii) follows from E Q 0 [E 0 ] = 0 as the quantizer Q 0 is unbiased when unsaturated.</p><p>Analyzing the term T 1 : Recall that A k is the best rank-k approximation of A obtained using computing the full-SVD of A and subsequently making all singular values of A less than k as 0.</p><p>We next analyze the first term in <ref type="bibr">(69)</ref> as</p><p>where e X , arg min</p><p>. This minimization problem is a Gaussian sketched variant of a generalized least squares problem with the response matrix quantized as seen in App. F. Corresponding to the notations in App. F, here we have S &gt; instead of G, A &gt; k instead of , and A &gt; instead of Y. As a consequence of Lemma F.1, we have the upper bound,</p><p>Analyzing the term T 2 : The term T 2 can be written as,</p><p>where, (i) follows once again since</p><p>The first term in ( <ref type="formula">73</ref>) can be rewritten as E</p><p>Similar to <ref type="bibr">(65)</ref> in the proof of Lemma F.1,</p><p>Let us denote , S &gt; A &gt; AS. Then using the fact that 1 E &#63743; 1, we get,</p><p>Tr</p><p>Here, the last equality follows as</p><p>Furthermore, the second term</p><p>Here, (i) follows since</p><p>1 E is a diagonal matrix as seen before, and (ii) follows from the upper bound derived on</p><p>Combining all of the above, the approximation error of our low-precision low-rank approximation scheme can be upper bounded as,</p><p>Here, the first term T 3 is the low-rank approximation error, whereas the remaining terms, i.e., T 4 , T 5 and T 6 appear due to quantization. We now analyze each of them separately.</p><p>Analyzing the term T 4 : Since we choose the dynamic range of quantizer Q to be R r</p><p>Here, we can ensure (i) holds true, i.e., that this term does not exceed &#9999;/4 if we set the bit-budget B to satisfy,</p><p>Analyzing the term T 5 : Since we choose the dynamic range of the quantizer Q 0 to be equal to</p><p>to Lemma E.2), where t and &#63743; are defined as in <ref type="bibr">(33)</ref>, we have</p><p>where we have made use of Asm. 3.1. Once again, in order to ensure (i), it suffices to choose the bit-budget B 0 to be</p><p>Note that in order for the dynamic range of quantizer Q 0 to hold true in Lemma E.2, we also require B to satisfy (34), i.e.,</p><p>Analyzing the term T 6 : Using bit-budgets B and B 0 as in ( <ref type="formula">80</ref>) and ( <ref type="formula">82</ref>), the final term is</p><p>Here, (i) is ensured by choosing &#9999; to be sufficiently small -specifically, &#9999; &#63743; 4nR 2 &#63743;(A) 2 .</p><p>Tying it all together: Combining ( <ref type="formula">79</ref>), <ref type="bibr">(81)</ref>, and ( <ref type="formula">84</ref>), with the bit-budgets set appropriately as dictated by ( <ref type="formula">80</ref>), <ref type="bibr">(83)</ref>, and (82), eq. ( <ref type="formula">78</ref>) simplifies to</p><p>This completes the proof.</p><p>G.1 LPLR approximation error: Proof of Thm. 3.2</p><p>We now formally state our main approximation result.</p><p>Theorem G.2. (LPLR approximation error (formal)) Let our matrix A 2 R n&#8677;d have non-zero singular values 1 , . . . , k , k+1 , . . . , r , where r = rank(A), and bounded row norms a (i) &#63743; R.</p><p>Let &#63743;(A) = 1 / r and &#63743;(A k ) = 1 / k respectively be the condition numbers of A and the best rank-k approximation of A, and let us denote</p><p>; , for some sufficiently small &#9999; that satisfies 0 &lt; &#9999; &#63743; 4nR 2 &#63743;(A) 2 . Here = d/m is the aspect ratio of the sketching matrix S 2 R d&#8677;m with S ij i.i.d.</p><p>&#8672; N 0, 1 m . Suppose the dynamic ranges of the quantizers Q and Q 0 are set to R </p><p>where,</p><p>and B 2 is equal to</p><p>Then, the low-precision and low-rank factorization returned by Alg. 1 satisfies</p><p>where the expectation is over the random sketching matrix S, as well as the inherent stochasticity from quantizers Q and Q 0 .</p><p>Proof. For the purpose of analysis, we assume that Alg. 1 returns L = 0 and R = 0 if either quantizer Q or Q 0 gets saturated. In practical implementation, it can easily be checked if either quantizer Q or Q 0 gets saturated or not, and the algorithm can be repeated again with a new realization of the sketching matrix S and stochastic quantizer Q. Since the choice of dynamic ranges for Q and Q 0 ensures that they remain unsaturated with a high probability, "reasonably few" realizations of S would suffice to get at least one good realization in which Q and Q 0 are unsaturated.</p><p>However, in what follows, we assume that that if either quantizer Q or Q 0 gets saturated, then the algorithm returns 0 as an estimate of A, resulting in a Frobenius norm error of kAk F . Since this happen with a very small probability, we show that its contribution to the expected Frobenius norm error of Alg. 1 is small as well. With this in mind, the expected approximation error can be written as</p><p>Inequality (i) follows from Asm. 3.1 and the fact that the expectation of indicator function of an event is the probability of the event. From Lemma G.1, the first term can be upper bounded as:</p><p>Since Lemmas E.1 and E.2 state the probabilities of quantizers Q and Q 0 being unsaturated, Pr (1 E C ) can be obtained by an application of union bound as</p><p>Then, (87) can be written as:</p><p>This completes the proof.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>G.2 Informal version of Thm. G.2</head><p>From Thm. G.2, we can get a (simplified) asymptotic dependence of the bit-budgets B and B 0 . We have B max{B 1 , B 2 },</p><p>where we have ignored the constant terms inside the log 2 (&#8226;) in (i) and considered the regime m &#8999; d in (ii). Furthermore, B 2 is</p><p>where c 0 is approximately a constant. Here, (i) follows because when m &#8999; d, we have p</p><p>Similarly,</p><p>. Comparing (91) and (92), we have</p><p>Moreover, the bit-budget B 0 is</p><p>where once again, to get (i) we have ignored the constants, and (ii) holds true when m &#8999; d. Moreover, suppose n &#8673; d (if they are not equal, then the total bit-budget should be computed as a weighted average, since the L has nm elements and the second low-rank factor has md elements).</p><p>Then, for some constant c 3 that depends on R, the total bit-budget is</p><p>for constants c 1 , c 2 and c 4 that depend on R, where additive logarithmic terms are ignored with respect to m. This gives us the result in Thm. 3.2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>H Direct-SVD Quantization: Approximation error analysis</head><p>In this section, we consider the baseline scheme for obtaining low-precision low-rank factorization by first computing the optimal low-rank factorization using SVD and individually quantizing the low-rank factors with uniform scalar quantizers. For any given matrix, A 2 R n&#8677;d , we compute the full SVD as A = U&#8963;V &gt; . The best (unquantized) rank-k approximation can be obtained from this by considering the singular vectors corresponding to the top-k singular vectors, and constructing the matrix</p><p>Here, (U&#8963;) k 2 R n&#8677;k is the sub-matrix obtained by selecting the first k columns of U&#8963;, and V &gt; k 2 R k&#8677;d is the sub-matrix obtained by selecting the first k rows of V &gt; . Subsequently, these low-rank factors are quantized with uniform scalar quantizers Q and Q 0 (having bit-budgets B and B 0 respectively). The algorithm pseudocode is given in Alg. </p><p>Proposition H.1. (Direct-SVD quant. approximation error (formal)) Let our matrix A 2 R n&#8677;d have maximum singular value 1 . Suppose our target rank is k, and for some small &#9999; such that 0 &lt; &#9999; &#63743; 3k 2 1 , the dynamic ranges of quantizers Q and Q 0 are set to be 1 and 1 respectively with bit-budgets satisfying</p><p>Then, the factorization returned by direct-SVD quantization in Alg. 2 satisfies E kLR Ak </p><p>The approximation error is given by</p><p>where the cross term disappears in (i) because when Q 0 is unsaturated, E Q 0 [E 0 ] = 0, and</p><p>Analyzing term T 1 : The first term in (96) can be upper bounded as</p><p>Here, in (i), we utilize the fact that A k = e U k V &gt; k and the cross term vanishes once again as quantizer Q is unsaturated, i.e., E[E] = 0 and,</p><p>The second term in ( <ref type="formula">97</ref>) is</p><p>Here, (i) follows because</p><p>So, (97) can be upper bounded as</p><p>Analyzing term T 2 : We upper bound the second term in (96) as</p><p>where the cross term vanishes in (i) because</p><p>Here, (i) and (ii)</p><p>] is a diagonal matrix following the same argument as (99), i.e.,</p><p>Finally, (iii) follows because the i th column of e U k is i u i , so</p><p>Here, (i) and (ii) follow because E[E 0 E 0&gt; ] and E[E &gt; E] are diagonal, which can be seen using similar arguments as in (99). So, ( <ref type="formula">101</ref>) is</p><p>Choice of dynamic range for quantizers Q and Q 0 : Using Lemma B.3, the max-norm of the input to the first quantizer can be upper bounded as k e U k k max &#63743; k e U k k 2 = 1 , and that of the second quantizer is kV k k max &#63743; kV k k 2 = 1. Therefore, choosing the dynamic ranges of Q and Q 0 to be 1 and 1 respectively, would ensure that they remain unsaturated, and (105) can be rewritten as</p><p>.</p><p>Choice of bit-budgets B and B 0 : For a given &#9999; &gt; 0, suppose we choose B and B 0 so that</p><p>With such a choice, the second and third terms in (106) would not exceed &#9999;. Furthermore, the last term of (106) will be</p><p>whenever &#9999; &lt; 3k 2 1 . This completes the proof.</p><p>Prop. H.1 states that when n &#8673; d, in order to guarantee an &#9999;-additive error approximation with respect to the best rank-k approximation, we require (ignoring constant multiplicative factors inside the log 2 (&#8226;)), a total budget (ref. to Tab. 1) of</p><p>I LPLR-SVD algorithm: Approximation error analysis LPLR-SVD is a simpler variant of our LPLR algorithm in which instead of approximating the range space of A using AS, we compute the full-SVD of A 2 R n&#8677;d as A = U&#8963;V &gt; , where U 2 R n&#8677;n , &#8963; 2 R n&#8677;d , and V 2 R d&#8677;d . The pseudocode of LPLR-SVD is provided in Alg. 3.</p><p>We first compute the SVD, A = U&#8963;V &gt; , followed by quantizing the singular vectors corresponding to the top-k singular values, scaled by the singular values. We denote e U = U&#8963;, and the sub-matrix formed by the first k columns as e U k . We quantize this basis to get L = Q( e U k ) as the first low-rank factor. Subsequently, we project the columns of A onto the subspace spanned by this quantized basis, i.e., we solve the optimization problem</p><p>The solution of this is given by W</p><p>The second low rank factor is given by quantizing it again as</p><p>The following result provides an upper bound on the approximation error of LPLR-SVD. The proof of this result is similar to Thm. </p><p>return Low-rank and low-precision approximation LR where</p><p>2&#63743;(A k ) respectively. Furthermore, suppose the bit-budgets of the quantizers satisfy</p><p>where,</p><p>and,</p><p>Then, the low-precision and low-rank factorization returned by Alg. 3 satisfies</p><p>Proof. Since the solution of</p><p>is available in closed form as</p><p>the quantization error matrices as</p><p>Then, the approximation error is</p><p>where the last equality follows the because the quantizer Q 0 is unbiased. Here, the E is over the stochasticity of the quantizers. This decomposition is similar to (69), and can be treated similarly. The term T 1 consists of the low rank approximation error and the error from the first quantizer, whereas the term T 2 consists of error from the second quantizer. We follow steps similar to the proof of Lemma G.1 which are detailed below.</p><p>Analyzing term T 1 : Using similar reasoning as <ref type="bibr">(71)</ref>, this term can be written as</p><p>This is the same as (100) in the analysis of direct-SVD quant., and hence can be upper bounded as</p><p>Analyzing term T 2 : This term is again the same as (101) in the analysis of direct-SVD quant., and can be upper bounded as</p><p>Using ( <ref type="formula">111</ref>) and (112), we get:</p><p>Choice of dynamic range for quantizers Q: Since the input to the quantizer is e U k , we need an upper bound on k e</p><p>(114) Note that this upper bound is tight in the worst-case sense, i.e., if we consider all matrices with bounded spectral norm, we have sup X : X=U&#8963;V &gt; ,kXk 2 &#63743;r k e U k k max = r. Hence, the dynamic range of quantizer Q is set as 1 .</p><p>Choice of dynamic range for quantizers Q 0 : On the other hand, the input to quantizer</p><p>We adopt an approach similar to the proof of Lemma E.2 to upper bound the max-norm of Q( e U k ) &#8224; A as follows:</p><p>where (i) and (ii) follow from Lemmas B.3 and B.4 respectively. We upper bound Q( e U k ) &#8224; 2 as:</p><p>Here, (i) follows because the singular values of Q( e U k ) &#8224; are inverses of the singular values of Q( e U k ), and (ii) follows from Lemma B.5.</p><p>We are now left with upper bounding kEk 2 . Since a choice of 1 for the dynamic range of Q ensures that quantizer Q remains unsaturated, the entries of E are bounded as:</p><p>Since E ij is a bounded w.h.p., it is also subgaussian w.h.p. (ref. eq. ( <ref type="formula">16</ref>)) with subgaussian norm given by,</p><p>From Lemma B.12 we get for some absolute constant C,</p><p>, we get:</p><p>(120) Let us choose our bit-budget B of quantizer Q to be such that kEk 2 &#63743; k 2 , i.e.,</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B log</head><p>where &#63743;(A k ) = 1 / k is the condition number of the best rank-k approximation of A. Then, using (116), we have:</p><p>So, if we choose the dynamic range of quantized Q 0 to be 2&#63743;(A k ), it will remain unsaturated with probability exceeding 1 &#9999; 4nR 2 , provided that the bit-budget of first quantizer satisfies B satisfies (121).</p><p>Choice of bit-budgets B and B 0 : Referring to (113), the term T 3 is,</p><p>The term T 4 is:</p><p>With the above choices of B and B 0 , the term T 5 is:</p><p>Tying it all together: Similar to what is done in the proof of Thm. G.2, for the purpose of analysis, we assume that Alg. 3 returns L = 0 and R = 0 if quantizer Q 0 gets saturated. In practical implementation, it can easily be checked if either quantizer Q or Q 0 gets saturated or not, and the algorithm can be repeated again with a new realization of the stochastic quantizer Q. Since the choice of dynamic ranges for Q ensures that it remains unsaturated with a high probability, "reasonably few" realizations would suffice to get at least one good realization in which Q is unsaturated.</p><p>However, in what follows, we assume that that if quantizer Q gets saturated, then the algorithm returns 0 as an estimate of A, resulting in a Frobenius norm error of kAk F . Since this happen with a very small probability, we show that its contribution to the expected Frobenius norm error of Alg. 3 is small as well. Let us denote the event that quantizer Q is unsaturated as E. Then, the expected approximation error can be written as</p><p>) where inequality (i) follows from Asm. 3.1 and the fact that the expectation of indicator function of an event is the probability of the event, and (ii) follows from (113). Using appropriate choices of B and B 0 and small enough &#9999;, from (122), ( <ref type="formula">123</ref>), (124), and (125), we have</p><p>Note that from (123) and ( <ref type="formula">121</ref>), the bit-budget of the quantizers must satisfy:</p><p>where,</p><p>and,</p><p>This completes the proof. </p><p>and,</p><p>This gives a total bit-budget of</p><p>J Additional numerical simulations For image compression, we also perform a normalize and shift operation of our DSVD/LPLR/LSVD output in order to adjust the scale and bias of the output image, as described next.</p><p>Normalize and shift: Let us denote the factorization obtained from executing DSVD/LPLR/LSVD on the input matrix X 2 R n&#8677;d by Y = LR. Then, we can improve the estimate provided by this factorization by considering &#8629;Y + I n&#8677;d . The overhead in storing these two additional scalars in full-precision is negligible when n and d are large. The optimal values of &#8629; and can be found as:</p><p>Closed-form expressions for (&#8629; &#8676; , &#8676; ) can be obtained by equating the derivatives of k&#8629;Y + I Xk 2 F to zero, and solving the resulting linear equations. Doing this algebra yields,</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>J.2 Wall-clock time for compressing image embeddings</head><p>We now report the wall-clock time for computing the low-rank quantized factors via LPLR, LSVD, and DSVD for embedding compression in Tab. 10. This reinforces the validity of our theoretical assertions concerning the computational advantage of LPLR when compared to its alternative methods.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>J.3 High-resolution figures for Llama weight compression</head><p>We now provide higher resolutions figures of Figs. 2a and 2b as Figs. <ref type="figure">3</ref> and<ref type="figure">4</ref>, respectively. The code to reproduce these numerical simulations is available at our github repository <ref type="url">https://github.com/pilancilab/matrix-compressor</ref>. = 8 bits, Bnq = 4 bits, ordered by the original sequence of layers on the "Layer" -axis. We observe consistently better Frobenius norm error using LPLR and LPLR-SVD, with the exception of specific layers which lend themselves to na&#239;ve quantization.    </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>K Limitations and further discussions</head><p>On uniformly dithered quantizer: We would like to point out that the approximation error upper bound for our algorithm (derived in Thm. G.2), as well as for the baselines such as direct-SVD quantization (refer to Prop. H.1) holds true only for randomized rounding, or uniformly dithered quantizers. Dithering is preferred due to its ability to produce an unbiased estimate of the input. It offer an advantage by introducing a non-zero probability of quantizing an input to either its ceiling or floor, resulting in reduced variance when averaging multiple independent realizations. Moreover, the unbiasedness of the quantizer output simplifies the analysis. In our experiments, we did not observe any difference while using deterministic rounding instead of dithered rounding.</p><p>Comparison with LPLR with direct-SVD and LPLR-SVD: As we see from the numerical evaluations (ref. to Tab. 6 and Tab. 7), direct-SVD quant. and LPLR-SVD performs better than our proposed LPLR algorithm (that computes a Gaussian sketch). Intuitively, one would expect the performance of LPLR-SVD and LPLR (with Gaussian sketch) to be similar because the core idea behind both of them is the same -Quantize the first low-rank factor, and then project the columns of A onto the quantized (first) low-rank factor. For LPLR-SVD the basis being quantized (top-k singular vectors) is the exact top-k rangefinder (for the column space of A), whereas in LPLR, we sketch using the Gaussian matrix to get an approximate rangefinder. This sketching error might make LPLR worse over LPLR-SVD. But because sketching also introduces "equalization effect of the Gaussian matrices", we can improve the resolution of the uniform scalar quantizers by choosing a smaller dynamic range. Hence, there is a tradeoff when comparing LPLR and LPLR-SVD -a tradeoff between sketching error and the quantization error.</p><p>Let us now focus on LPLR-SVD and direct-SVD quant. We will extrapolate this intuition to a comparison between LPLR and direct-SVD quant. The factorization obtained using direct-SVD quant. is</p><p>, where the approximation obtained using LPLR-SVD is</p><p>Here, e U k is the n &#8677; k matrix obtained using the first k columns of U&#8963;, where A = U&#8963;V &gt; is the full SVD of A. Let us assume B 0 ! 1 so that we don't have to worry about the second quantizer. Then, we are left to compare the approximations: . So, for B 0 ! 1, it is evident that direct-SVD can only perform as good as LPLR-SVD, and not better than that. Furthermore, note that this difference in performance will be small when the bit-budget of the first quantizer, B is large, and it will be large when B is small. When B ! 1, this difference will be exactly zero. In other words, direct-SVD quant. and LPLR-SVD will be the same factorization when B ! 1 and B 0 ! 1. When both B and B 0 are finite, direct-SVD can outperform LPLR-SVD depending on which one out of</p><p>is closer to the optimal solution, i.e., Q( e U k ) &#8224; A. A limitation of our analysis is that we cannot always definitively predict which one will perform better, because we derive upper bounds on the approximation error.</p><p>Comparison of LPLR with naive quantization: In Tables <ref type="table">1</ref> and<ref type="table">2</ref>, we have compared LPLR with other benchmarks. In the column denoting approximation errors, aside from the common quantization error &#9999; present across all rows, DSVD and LPLR introduce an additional term representing the error from low-rank approximation. Consequently, it might appear that naive quantization consistently outperforms these methods. However, it's essential to recognize that compression techniques based on low-rank factorization hold value exclusively when the matrix being compressed is inherently low-rank, meaning that kA k Ak 2 F starts off as small. If kA k Ak F = 0, LPLR can achieve identical error levels as naive quantization, while demanding fewer bits than the latter. In other words, given the same bit-budget, LPLR can achieve a lower level of error compared to naive quantization.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Matrix compression with and without any computation constraints:</head><p>In situations where computational resources are limited, employing the naive strategy emerges as the most cost-effective approach for matrix quantization. Nevertheless, due to its failure to capitalize on a matrix's inherent low-rank arrangement, naive quantization may prove considerably suboptimal. As matrices increase in dimension, accommodating them in memory becomes impractical, rendering approaches like DSVD or LSVD unviable. In such scenarios, our LPLR method stands as a viable alternative, demanding slightly more computational effort than naive quantization, yet capable of harnessing the low-rank structure for improved approximation accuracy.</p><p>If there is no scarcity of computation resources in being able to compute the SVD, and our goal is to just compress an input matrix A, then it is possible to compress the matrix with all the strategies, and choose the best one. However, it must be kept in mind that LPLR provides significant savings with respect to computational complexity, i.e., O(ndm), compared to LPLR-SVD, which has a complexity of O(nd 2</p><p>). Consequently, if the matrix being compressed is very large, it might not even be feasible to do direct-SVD quant. or LPLR-SVD, given the current memory limitations of available GPUs, and LPLR (with Gaussian sketch) becomes our only option. Furthermore, a careful examination of Tabs. 6 and 7 shows that even though LPLR-SVD and direct-SVD quant. have a smaller Frobenius norm error than LPLR, the accuracy and weighted F1 scores are still comparable. One aspect of quantization that we have not studied in detail is its inherent regularization effect when testing the performance on test datasets. Whether LPLR leads to a better regularization effect that the other baselines is an open question that will be studied in future works.</p><p>Comparison with existing works on quantized random projections for approximate nearest neighbor search: Prior works of Li and Li <ref type="bibr">[29]</ref> and Li and Li <ref type="bibr">[30]</ref> consider the idea of quantized random projections specifically for the the application of approximate nearest neighbor search. Although related, the goals of these works are different from matrix compression considered in our work. These prior works approximate the matrix vector product Ax by Q(A)Q 0 (S &gt; x). For their setup, in addition to Q(AS), the random matrix S needs to be stored in full-precision, in order to process an incoming query x. So, their storage requirement is nm quantized and dm full-precision parameters. In contrast, LPLR stores only the quantized entries of L and R, i.e., m(n + d) quantized entries, and A &#8673; LRx, implying a smaller storage requirement. Furthermore, since LPLR involves computation of Rx, where R consists of md quantized values, it can leverage modern advancements in hardware primitives for speeding up low-precision computations, such as half and mixed-precision compute.</p><p>Extension to streaming settings: LPLR as presented in this paper, is used for compression when the entire matrix A is available. An interesting extension is to consider a variant of LPLR to streaming data settings in order to handle new data points. It is possible to do so using sketching based low rank approximations <ref type="bibr">[66]</ref>. The left factor L is updated with the concatenation of an additional row corresponding to the newly arriving datapoint. The second factor R, which is the solution of a new least squares minimization problem, can be updated using Woodbury matrix inversion lemma.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>LPLR-SVD used in the simulations computes the left low-rank factor L as Q(U k S) where Sij &#8672; N (0, 1/m) instead of simply U k in order to exploit the equalization property of Gaussian embeddings.</p></note>
		</body>
		</text>
</TEI>
