Binary Matrix Nearest Neighbor Search for Neural Network Classification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Deep learning classification models face computational bottlenecks due to high complexity in matrix-vector multiplication, particularly in natural language processing tasks with large numbers of classes, leading to inefficiencies in computing resources.

Innovation Solution

Implementing a fast nearest-neighbor search algorithm in the last layer of neural networks instead of full matrix-vector multiplication, which generates a binary matrix and identifies top-k values to determine class associations, significantly reducing computational time without compromising accuracy.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If full matrix-vector multiplication is used in the last layer of neural networks, then classification accuracy is maintained, but computational complexity increases significantly

Engineering Contradiction:
Improveclassification accuracyVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent extracts only the essential information needed for classification by using binary matrices to represent class relationships. Instead of computing all matrix-vector products, the method extracts top-k nearest neighbors from the binary representation, obtaining sufficient classification information with reduced computation.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent transforms the continuous mapping matrix into a binary matrix representation, changing the parameter space from continuous values to discrete binary values. This parameter transformation enables the use of efficient bitwise operations and nearest-neighbor search algorithms, dramatically reducing computational complexity while preserving classification accuracy.

Inventive Principle:
Principle #35Parameter changes

2Loss of information

If full matrix-vector multiplication is performed in the last layer, then complete class probability distribution is obtained, but computing time increases

Engineering Contradiction:
Improveclass probability informationVSAvoidcomputing time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The patent applies partial action by computing only the necessary portion of the classification result. Instead of calculating the complete class probability distribution, the method computes only the top-k nearest neighbors that are sufficient for accurate classification, eliminating redundant computations for lower-probability classes.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent performs preliminary action by pre-processing the mapping matrix into a binary representation and organizing it in a way that enables efficient nearest-neighbor search. This preliminary transformation allows the system to quickly identify top-k classes without performing full matrix-vector multiplication during inference.

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If conventional matrix multiplication is used for large number of classes, then accurate classification is achieved, but computational resources are inefficiently utilized

Engineering Contradiction:
Improveclassification accuracyVSAvoidcomputational efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent substitutes the conventional mechanical matrix-vector multiplication operation with a different computational approach based on binary representation and nearest-neighbor search. This substitution replaces the computationally intensive dot product calculations with efficient bitwise operations and sorting, dramatically improving computational efficiency for large-scale classification.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS11720789B2Fast nearest neighbor search for output generation of convolutional neural networks
Publication Date: 2023.08.08 APPLE INC
  • US11720789B2 patent drawing
  • US11720789B2 patent drawing
  • US11720789B2 patent drawing

AI summary

In one embodiment, a method includes receiving an input vector corresponding to a query at a neural network model comprising a plurality of layers, wherein the plurality of layers comprise a last layer associated with a mapping matrix, generating a binary matrix based on the mapping matrix, an identity matrix, and one or more Gaussian vectors, generating an integer vector based on the binary matrix and a binary vector associated with the input vector, identifying a plurality of indices corresponding to a plurality of top values of the integer vector for the integer vector, generating an output vector based on the input vector and a plurality of rows of the mapping matrix, wherein the plurality of rows is associated with the plurality of identified indices, respectively, and determining the query is associated with one or more classes based on the output vector.