On Sketching Quadratic Forms

Alexandr Andoni, Jiecao Chen, Robert Krauthgamer, Bo Qin, David P. Woodruff, Qin Zhang

Abstract

In large-scale data analysis, sketching techniques are essential for approximating properties of massive matrices with limited memory. This paper explores the fundamental limits of sketching quadratic forms $x^T Ax$, specifically for graph Laplacian and Symmetric Diagonally Dominant (SDD) matrices. We demonstrate a significant separation between "for all" and "for each" sketching models. While "for all" sketches (like spectral sparsifiers) require a size proportional to $1/\epsilon^2$, we show that "for each" sketches can achieve a size nearly linear in $1/\epsilon$, effectively breaking a long-standing barrier in the field.

Introduction

As datasets grow, the need for succinct summaries, or "sketches," becomes paramount. A common task is estimating the quadratic form $x^T Ax$ for a matrix $A \in \mathbb{R}^{n \times n}$ and a query vector $x \in \mathbb{R}^n$. For graph Laplacians, this corresponds to estimating cut weights. Traditional methods, such as spectral sparsification, provide a $(1 \pm \epsilon)$-approximation for all possible queries simultaneously. However, these methods are constrained by a $1/\epsilon^2$ dependence in their size. This work investigates whether relaxing the requirement to a "for each" guarantee—where the sketch must work for any fixed query with high probability—allows for more efficient representations.

Problem Formulation

The research distinguishes between two primary sketching models:

  1. "For All" Model: A single sketch $S(A)$ must allow the estimation of $x^T Ax$ for every $x \in \{0,1\}^n$ (cut queries) or $x \in \mathbb{R}^n$ (spectral queries) simultaneously.
  2. "For Each" Model: For any fixed query $x$, the sketch $S(A)$ provides a $(1 \pm \epsilon)$-approximation with high probability (e.g., $1 - 1/poly(n)$).

Historically, spectral sparsifiers have been the standard "for all" sketch, with a known size of $\tilde{O}(n/\epsilon^2)$. The central question is whether the "for each" model can circumvent the $\Omega(n/\epsilon^2)$ lower bound.

Theoretical Framework

Lower Bounds via Communication Complexity

To establish the optimality of existing "for all" sketches, the authors employ communication complexity. By reducing the Gap-Hamming-Distance problem to the sketching task, they prove that even arbitrary data structures for "for all" cut queries require $\Omega(n/\epsilon^2)$ bits. This confirms that the $1/\epsilon^2$ dependence is a fundamental limit for simultaneous approximation.

Upper Bounds: The Cut-Preprocessing Algorithm

To break the $1/\epsilon^2$ barrier in the "for each" model, the authors introduce a novel Cut-Preprocessing algorithm. Unlike simple edge sampling, this approach utilizes:

  • Recursive Partitioning: The graph is decomposed using sparse cuts (based on Cheeger’s constant). Edges across these sparse cuts are stored explicitly.
  • Variance Reduction: For the remaining dense components, the algorithm combines exact vertex degrees with a refined sampling strategy. This creates an estimator with significantly lower variance than standard uniform sampling, enabling a $1/\epsilon$ dependence.

For general spectral queries ($x \in \mathbb{R}^n$), a more sophisticated partitioning strategy based on endpoint degrees is used to achieve an $\tilde{O}(n\epsilon^{-1.6})$ bound.

Key Results

The primary contribution of this work is the formal separation between the "for all" and "for each" models for graph Laplacians. The results show that the "for each" guarantee is significantly more efficient, reducing the sketch size from $\tilde{O}(n/\epsilon^2)$ to $\tilde{O}(n/\epsilon)$ for cut queries.

Summary of upper and lower bounds for sketching quadratic forms across different matrix families and query models.

The table above highlights the hierarchy of bounds established in the paper. Notably, for Laplacian cut queries, the "for each" model achieves a near-optimal $\tilde{O}(n/\epsilon)$ size, whereas the "for all" model remains stuck at $\Omega(n/\epsilon^2)$.

Discussion and Future Work

This work demonstrates that the choice of sketching model—"for all" versus "for each"—has a profound impact on the achievable compression. While the $1/\epsilon^2$ barrier is real for simultaneous guarantees, it can be overcome for individual queries.

Future research directions include:

  • Closing the Spectral Gap: Reducing the current $\tilde{O}(n\epsilon^{-1.6})$ upper bound for spectral queries toward the $\Omega(n/\epsilon)$ lower bound.
  • Broadening Matrix Classes: Investigating other structured matrix families that might admit similar improvements.
  • Algorithmic Efficiency: Optimizing the recursive partitioning steps, which currently rely on computationally intensive sparse cut computations, for practical large-scale applications.

Summary updated

BibTeX
@inproceedings{andoni2015sketching,
  author = {Alexandr Andoni and Jiecao Chen and Robert Krauthgamer and Bo Qin and David P. Woodruff and Qin Zhang},
  title = {{On Sketching Quadratic Forms}},
  booktitle = {ITCS},
  year = {2015},
  doi = {10.1145/2840728.2840753},
}
Figure