[Paper Review] Minimizing FLOPs to Learn Efficient Sparse Representations
This paper proposes a method to learn high-dimensional, sparse embeddings that minimize floating-point operations (FLOPs) during retrieval by directly regularizing the number of FLOPs via a continuous relaxation. The approach achieves up to 50× faster inference than dense embeddings while maintaining competitive accuracy by encouraging uniform non-zero distribution across dimensions, outperforming baselines in speed-accuracy trade-offs.
Deep representation learning has become one of the most widely adopted approaches for visual search, recommendation, and identification. Retrieval of such representations from a large database is however computationally challenging. Approximate methods based on learning compact representations, have been widely explored for this problem, such as locality sensitive hashing, product quantization, and PCA. In this work, in contrast to learning compact representations, we propose to learn high dimensional and sparse representations that have similar representational capacity as dense embeddings while being more efficient due to sparse matrix multiplication operations which can be much faster than dense multiplication. Following the key insight that the number of operations decreases quadratically with the sparsity of embeddings provided the non-zero entries are distributed uniformly across dimensions, we propose a novel approach to learn such distributed sparse embeddings via the use of a carefully constructed regularization function that directly minimizes a continuous relaxation of the number of floating-point operations (FLOPs) incurred during retrieval. Our experiments show that our approach is competitive to the other baselines and yields a similar or better speed-vs-accuracy tradeoff on practical datasets.
Motivation & Objective
- To address the computational inefficiency of high-dimensional dense embeddings in large-scale nearest-neighbor search.
- To improve retrieval speed without sacrificing representational capacity by leveraging sparsity and efficient sparse matrix multiplication.
- To directly minimize FLOPs during training through a differentiable regularization function that promotes even non-zero distribution across dimensions.
- To achieve a better speed-vs-accuracy trade-off than existing methods like LSH, PCA, PQ, and SDH.
- To demonstrate that sparsity alone is insufficient—uniform distribution of non-zeros is critical for maximal speedup.
Proposed method
- Proposes a continuous relaxation of the exact FLOP count for sparse matrix multiplication during retrieval, enabling gradient-based optimization.
- Introduces a novel regularizer, $\widetilde{\mathcal{F}}$, that penalizes uneven non-zero distribution across embedding dimensions.
- Combines the FLOP regularizer with a standard metric learning loss (e.g., contrastive or triplet loss) to preserve semantic similarity.
- Uses gradient descent to jointly optimize metric learning and FLOP minimization, favoring embeddings with uniform sparsity patterns.
- Employs an analytical expression for expected FLOPs based on sparsity and non-zero distribution, derived under uniformity assumptions.
- Evaluates the method on MegaFace and CIFAR-100 using ResNet and MobileNet backbones, comparing to LSH, PCA, PQ, and SDH.
Experimental results
Research questions
- RQ1Can we directly minimize FLOPs during embedding learning to improve retrieval efficiency?
- RQ2Does the distribution of non-zero entries in sparse embeddings significantly affect retrieval speed beyond sparsity level?
- RQ3Can a continuous relaxation of FLOPs be effectively used as a regularizer in end-to-end training?
- RQ4How does the proposed method compare to standard baselines (e.g., LSH, PCA, PQ, SDH) in terms of speed-accuracy trade-off?
- RQ5To what extent does uniform non-zero distribution across dimensions enhance retrieval performance?
Key findings
- The proposed $\widetilde{\mathcal{F}}$ regularizer achieves a sub-optimality ratio $R_{\text{sub}}$ closer to 1 than $\ell_1$ regularization, indicating more uniform non-zero distribution.
- On ResNet, $\ell_1$ regularization leads to highly sub-optimal non-zero distribution, while $\widetilde{\mathcal{F}}$ maintains balanced sparsity across dimensions.
- The method achieves up to 50× faster retrieval than dense embeddings with minimal accuracy loss, outperforming LSH, PCA, PQ, and SDH in speed-accuracy trade-off.
- The speed-up scales with sparsity and is maximized when non-zeros are uniformly distributed, confirming the quadratic reduction in FLOPs.
- The trade-off curves show that $\widetilde{\mathcal{F}}$-regularized models achieve higher recall at lower query times compared to baselines, especially at high sparsity levels.
- Even without re-ranking, the method maintains strong performance, confirming that the FLOP regularization improves intrinsic retrieval efficiency.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.