Embedding Table Compression for Memory-Efficient ML Lookup

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Machine learning models face challenges in efficiently storing and processing large embedding tables due to high memory and computational requirements, which limits their scalability and compatibility with devices having limited resources.

Innovation Solution

A system that compresses individual embeddings in an embedding table independently, allowing for decompression and lookup without loading the entire table into memory, enabling efficient storage and processing within machine learning models.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If embedding tables are stored in full size to ensure complete data availability, then data completeness is improved, but memory usage increases significantly

Engineering Contradiction:
Improvedata completenessVSAvoidmemory usage
Core Design Contradiction:
Loss of informationVSQuantity of substance

Solution Approach 1:

The embedding table is divided into multiple shards or partitions that can be stored separately. Only the necessary shards need to be loaded into memory at any given time, reducing peak memory usage while maintaining data completeness across all shards.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Embeddings are compressed by changing their parameter representation (e.g., reducing precision from 32-bit to 16-bit or 8-bit integers). This reduces the memory footprint of each embedding while preserving sufficient information for effective model operation.

Inventive Principle:
Principle #35Parameter changes

2Speed

If the entire embedding table is loaded into memory for fast access, then lookup speed is improved, but memory consumption increases

Engineering Contradiction:
Improvelookup speedVSAvoidmemory consumption
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

Embedding shards are pre-computed and pre-stored in a compressed format on disk. During inference, only the required shards are decompressed and loaded into memory, avoiding the need to load the entire embedding table while maintaining fast lookup performance.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system dynamically loads and unloads embedding shards based on the current query workload. Frequently accessed embeddings remain in memory, while less frequently accessed ones are stored on disk and loaded only when needed, optimizing the balance between speed and memory usage.

Inventive Principle:
Principle #15Dynamics

3Quantity of substance

If compression is applied to reduce storage size, then memory usage is reduced, but decompression complexity increases

Engineering Contradiction:
Improvestorage sizeVSAvoiddecompression complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

Simple, lossless compression algorithms (such as quantization to integer types or run-length encoding) are applied to embeddings. These compression methods use computationally inexpensive operations that can be quickly decompressed during inference, avoiding the need for complex decompression procedures.

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

4Reliability

If large embedding tables are used to improve model accuracy, then model performance is improved, but computational resources required increase

Engineering Contradiction:
Improvemodel accuracyVSAvoidcomputational resources
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The large embedding table is segmented into smaller manageable shards that can be processed independently. This allows the model to access only the necessary embeddings for each prediction, reducing the computational overhead of processing the entire embedding table while maintaining model accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The precision of embedding parameters is adjusted (e.g., from 32-bit floating point to 16-bit or 8-bit integers). This reduces the computational resources required for processing while preserving sufficient accuracy for most applications, enabling deployment on resource-constrained devices.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11892998B2Efficient embedding table storage and lookup
Publication Date: 2024.02.06 GOOGLE LLC
  • US11892998B2 patent drawing
  • US11892998B2 patent drawing
  • US11892998B2 patent drawing

AI summary

The present disclosure provides systems, methods, and computer program products for providing efficient embedding table storage and lookup in machine-learning models. A computer-implemented method may include obtaining an embedding table comprising a plurality of embeddings respectively associated with a corresponding index of the embedding table, compressing each particular embedding of the embedding table individually allowing each respective embedding of the embedding table to be decompressed independent of any other embedding in the embedding table, packing the embedding table comprising individually compressed embeddings with a machine-learning model, receiving an input to use for locating an embedding in the embedding table, determining a lookup value based on the input to search indexes of the embedding table, locating the embedding based on searching the indexes of the embedding table for the determined lookup value, and decompressing the located embedding independent of any other embedding in the embedding table.