TL;DR
Active subspace methods offer a powerful way to perform Bayesian inference and quantify uncertainty in deep neural networks, but they suffer from prohibitive memory costs due to storing massive full-dimensional gradients. This paper introduces Compressed Active Subspaces (CAS), which uses a memory-efficient, structured random projection to compress the parameter space before finding the active subspace. This simple twist reduces memory requirements dramatically, allowing active subspace methods to scale to models with over half a billion parameters without sacrificing predictive performance or uncertainty quality.
What Problem Does This Paper Address?
Deep learning models are notoriously bad at knowing what they don't know. Bayesian neural networks (BNNs) provide a principled framework for uncertainty quantification (UQ), but calculating a full posterior distribution over millions or billions of parameters is computationally intractable. "Active subspace" (AS) methods solve this by finding a low-dimensional subspace spanned by the parameter directions that most heavily influence the model's output.
However, standard AS methods have a major bottleneck: to find these influential directions, you have to sample and store many full-dimensional model gradients. If your model has 50 million parameters ($N$) and you take 500 gradient samples ($M$), storing the gradient matrix requires $O(NM)$ memory. For large modern networks, this quickly leads to Out-Of-Memory (OOM) errors on standard hardware, limiting the scalability of an otherwise elegant UQ method.
Methods
The authors propose Compressed Active Subspaces (CAS). Instead of computing and storing full-dimensional gradients, CAS first projects the high-dimensional parameter space into a lower-dimensional intermediate space using a fixed, structured isometric embedding matrix $P \in \mathbb{R}^{N \times R}$ (where $R \ll N$).
Crucially, $P$ is not a dense matrix (which would defeat the purpose by requiring massive storage itself). Instead, the authors employ a normalized CountSketch-like construction:
- Each model parameter is randomly and uniformly assigned to one of $R$ bins.
- Each parameter is given a random sign ($+1$ or $-1$).
This sparse structure means $P$ can be stored in $O(N)$ memory using simple index arrays and signs, and matrix multiplications take only $O(N)$ operations. Because $P^T P = I_R$, it preserves the Euclidean geometry of the parameter space.
Active subspace construction (via SVD) is then performed entirely within this compressed $R$-dimensional space, reducing the gradient storage cost from $O(NM)$ to $O(RM)$. Once the dominant $K$ active directions are found in the compressed space, they are mapped back to the original full-dimensional space using $P$ to perform standard Bayesian subspace inference.
Datasets
The method was evaluated on:
- A synthetic univariate regression dataset ($y = x + 0.3\sin(2\pi x) + 0.3\sin(4\pi x) + \epsilon$) with missing data regions to test uncertainty behavior.
- Five standard benchmarks from the UCI Machine Learning Repository for regression tasks: Airfoil, Boston, Concrete, Energy, and Yacht.
No new benchmarks were introduced; the focus was on scaling up existing evaluation protocols to larger model sizes.
Key Insights and Ideas
- Geometry Preservation is Key: The CountSketch-like projection isn't just fast; its isometric property ($P^T P = I$) ensures that the geometric relationships and distances between parameters are preserved during compression. This allows the active subspace found in the compressed domain to remain highly meaningful when mapped back.
- Random Subspaces Aren't Enough: Simply picking a random subspace (like the "Sketch + Haar" baseline) performs poorly when compression ratios are high. You still need to find the active directions, but doing so within a sketched space works surprisingly well (see Figure 3).
- Breaking the Memory Wall: The "aha moment" is realizing that we don't need the exact full-dimensional gradients to find the most influential directions. A properly structured random projection retains enough gradient covariance information to identify the dominant eigenvectors.
Key Results
- Massive Scalability: Standard Active Subspaces hit a memory wall and trigger OOM errors at around 30 million parameters. As shown in the memory usage analysis, CAS successfully scales comfortably to a model with 500 million parameters—more than an order of magnitude larger—using the same memory budget.
- Maintained Accuracy and UQ Quality: On the UCI regression tasks, CAS achieved root-mean-square error (RMSE) and negative log-likelihood (NLL) values that closely matched standard AS, despite operating in a highly compressed space.
- Robust Uncertainty Quantification: In the univariate regression task, CAS accurately captured increased predictive uncertainty in regions lacking training data, matching both standard AS and exact Gaussian Process regression:
Limitations and Future Work
- Intermediate Dimension Tuning: While CAS is robust across various compression ratios, performance can degrade if the intermediate dimension $R$ is chosen to be too small relative to the complexity of the network.
- Extension to LLMs: The experiments in this paper were restricted to single-hidden-layer neural networks up to 500 million parameters. Extending and validating CAS on modern transformer architectures (like Large Language Models) remains an open and promising direction.
- Integration with Downstream PEFT: Future work could explore combining CAS with other parameter-efficient fine-tuning methods (like LoRA) to further optimize Bayesian inference pipelines for massive models.
Summary updated