NLP Model Compression Using Hashing and Variable-Length Codes

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current natural language processing (NLP) models for speech recognition systems have large memory footprints, leading to high latency and inefficiencies in devices with limited resources, such as those without persistent internet access, and require significant computational resources for probabilistic machine learning.

Innovation Solution

The implementation of compression techniques for NLP models, including quantization of weights, perfect hashing, and variable-length fingerprint coding, reduces the memory footprint and latency by storing and processing NLP models locally on devices, allowing for efficient execution of NLU tasks without relying on cloud-based systems.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If NLP models are stored and processed locally on devices, then latency is reduced and offline functionality is enabled, but memory footprint and computational resource requirements increase

Engineering Contradiction:
ImprovelatencyVSAvoidmemory footprint
Core Design Contradiction:
Loss of timeVSQuantity of substance

Solution Approach 1:

The NLP model is segmented into multiple components: a compressed model portion stored in memory and a full model portion stored in storage. The system dynamically loads only the necessary segments during operation, reducing the memory footprint while maintaining low latency for common operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

A nested data structure is implemented where an inner hash table stores frequently accessed model data for immediate processing, while an outer hash table stores the complete model data. This nested arrangement allows the system to access common operations from the compact inner structure while having full model capability available in the outer structure when needed.

Inventive Principle:
Principle #7Nested doll (Nesting)

2Adaptability or versatility

If NLP models are stored and processed locally on devices, then cloud dependency is reduced and offline functionality is enabled, but device complexity increases

Engineering Contradiction:
Improveoffline functionalityVSAvoiddevice complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

An intermediary data structure (the nested hash table system) is introduced between the storage medium and the processing unit. This intermediary manages the complexity of model loading and access, providing a simplified interface for the processor while handling the complex task of managing compressed and full model data in storage.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Quantity of substance

If compression techniques are applied to NLP models, then memory footprint is reduced, but model accuracy may deteriorate

Engineering Contradiction:
Improvememory footprintVSAvoidmodel accuracy
Core Design Contradiction:
Quantity of substanceVSManufacturing precision

Solution Approach 1:

Different quality levels are applied to different parts of the model system. The compressed model portion uses aggressive compression for common operations, while the full model portion maintains complete accuracy for less frequent but more demanding operations. This local quality differentiation optimizes the balance between memory usage and accuracy.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system implements partial loading of the model, where only the essential compressed portion is loaded into memory for routine operations. The full model is loaded only when higher accuracy is required, implementing partial action that balances resource usage with performance needs.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS10558738B1Compression of machine learned models
Publication Date: 2020.02.11 AMAZON TECH INC
  • US10558738B1 patent drawing
  • US10558738B1 patent drawing
  • US10558738B1 patent drawing

AI summary

Devices and techniques are generally described for compression of natural language processing models. A first index value to a first address of a weight table may be stored in a hash table. The first address may store a first weight associated with a first feature of a natural language processing model. A second index value to a second address of the weight table may be stored in the hash table. The second address may store a second weight associated with a second feature of the natural language processing model. A first code associated with the first feature and comprising a first number of bits may be generated. A second code may be generated associated with the second feature and comprising a second number of bits greater than the first number of bits based on a magnitude of the second weight being greater than a magnitude of the first weight.