Neural Network Embedding Weight Measurement via Masking
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for reducing the size of embedding matrices in neural network models, such as those used in natural-language-processing, knowledge-graph-based inference, and recommender systems, do not effectively consider the importance of individual entities, leading to inadequate performance and inappropriate results depending on the task.
Innovation Solution
A method that calculates the weight of each discrete entity in a neural network model by generating a masked vector through element-wise multiplication between a mask vector and an embedding vector, using a floor operation and a gate function to learn the weight value, and trains the model based on a loss calculated from the difference between the output and a correct answer, as well as the target sparsity of the masking vector.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Volume of moving object
If existing matrix approximation methods or quantization methods are used to reduce embedding matrix size, then the model size is reduced, but the importance of individual entities is not considered leading to inadequate performance
Solution Approach 1:
The patent applies local quality by assigning different importance weights to different entities within the embedding matrix. Instead of uniform quantization or approximation, the method identifies specific entities that are more important for the task and preserves their precision while allowing less important entities to be compressed. This is achieved through gradient-based optimization that learns entity-specific importance scores, enabling differential treatment of embedding elements based on their local significance to model performance.
2Device complexity
If lightweight methods using simple heuristics like frequencies are used as weights, then the computation is simplified, but the methods do not exhibit effective performance and are occasionally inappropriate depending on the task
Solution Approach 1:
The patent applies preliminary action by pre-computing and storing importance weights for each entity in the embedding matrix before the actual inference process. These importance weights are learned during a training phase using gradient descent, and once computed, they remain fixed or are updated sparingly. This preliminary computation of importance scores allows the model to quickly apply learned importance-based compression during inference without complex real-time calculations, achieving both efficiency and task-specific performance.
3Measurement precision
If gradient descent is used to optimize the mask vector with continuous values, then the importance measurement is accurate, but the mask values cannot be directly used for lightweight inference requiring binary decisions
Solution Approach 1:
The patent applies dynamics by implementing a two-stage approach where the mask vector evolves from continuous values during training to binary values during inference. During the training phase, the mask vector contains continuous values that are optimized via gradient descent to accurately reflect entity importance. At inference time, a thresholding operation converts these continuous values to binary decisions (keep or prune). This dynamic transformation allows the system to enjoy the benefits of continuous optimization during learning while producing discrete, actionable results during deployment.
Data Source
AI summary
Disclosed herein is a method for measuring the weight of a discrete entity, performed in a neural network model configured with multiple layers, the method including receiving data configured with the indices of discrete entities, converting the data into embedding vectors corresponding to respective indices through an embedding layer, generating a masked vector through element-wise multiplication between a mask vector and the embedding vector, calculating a loss using output based on the masked vector, and training the model based on the loss.


