[Paper Review] On the Dimensionality of Embeddings for Sparse Features and Data
This paper challenges the common assumption that embeddings always reduce dimensionality, showing instead that embedding dimensionality should be guided by information entropy rather than heuristic rules. It provides entropy-based upper bounds and precise guidelines for selecting embedding dimensions, demonstrating that sparse features may not benefit from dimensionality reduction and that optimal size depends on the sparsity and distribution of input data.
In this note we discuss a common misconception, namely that embeddings are always used to reduce the dimensionality of the item space. We show that when we measure dimensionality in terms of information entropy then the embedding of sparse probability distributions, that can be used to represent sparse features or data, may or not reduce the dimensionality of the item space. However, the embeddings do provide a different and often more meaningful representation of the items for a particular task at hand. Also, we give upper bounds and more precise guidelines for choosing the embedding dimension.
Motivation & Objective
- To challenge the widespread belief that embeddings inherently reduce dimensionality of sparse features.
- To provide a principled, information-theoretic approach to selecting embedding dimensions based on entropy.
- To derive upper bounds and practical guidelines for embedding size selection in real-world models.
- To demonstrate that embeddings offer a more meaningful representation than raw indices, even when dimensionality is not reduced.
Proposed method
- Uses information entropy as a measure of dimensionality to evaluate the information-carrying capacity of sparse feature vectors.
- Derives entropy formulas for different lookup signatures (e.g., k non-zero entries in n-sized vector) using combinatorial approximations.
- Applies asymptotic approximations (e.g., Stirling's formula) to estimate entropy of sparse distributions and derive bounds.
- Compares the entropy of input lookups (H) with the information capacity of embeddings (d × s, where s is bits per element) to determine required embedding size.
- Proposes a roofline model based on entropy to set upper bounds on embedding dimensionality for given input sparsity.
- Validates the model with tabulated examples across varying n (vocabulary size), k (non-zero entries), and s (bit precision), showing required d for information equivalence.
Experimental results
Research questions
- RQ1Does embedding always reduce the dimensionality of sparse feature representations?
- RQ2What determines the minimal embedding dimension required to preserve the information in sparse input vectors?
- RQ3How can information entropy be used to guide the selection of embedding size in practice?
- RQ4To what extent does the sparsity pattern (k) and vocabulary size (n) affect the required embedding dimension?
Key findings
- Embeddings do not necessarily reduce dimensionality when measured by information entropy; the dimensionality of the embedding space can exceed that of the input if the input is highly structured or sparse.
- For a 1M-vocabulary lookup with k=100 non-zero entries, the entropy is approximately 1324.1 bits, requiring an embedding of at least 168 dimensions with 8-bit precision.
- When k=1000 and n=100M, the entropy reaches ~16,603.3 bits, requiring an embedding of at least 2076 dimensions with 8-bit precision.
- The choice of k (number of non-zero entries) has a significantly larger impact on entropy than n (vocabulary size), as shown in the logarithmic plots of entropy vs. k.
- For a 32-bit embedding with 8-bit precision per element, the required embedding dimension d can be as low as 1 for k=1 and n=1M, but grows to 1248 for k=1000 and n=1M.
- Mini-batch training does not affect the entropy or dimensionality calculation, as each embedding lookup is treated independently.
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.