[Paper Review] Deep Networks With Large Output Spaces
This paper proposes a locality-sensitive hashing (LSH)-based method to accelerate training and inference in deep neural networks with millions of output classes by approximating the computationally expensive dot product in the final classification layer. By hashing weight vectors and only computing dot products with top-k nearest neighbors, the approach achieves faster convergence and higher accuracy than standard softmax and hierarchical softmax, especially on high-cardinality tasks like video identification.
Deep neural networks have been extremely successful at various image, speech, video recognition tasks because of their ability to model deep structures within the data. However, they are still prohibitively expensive to train and apply for problems containing millions of classes in the output layer. Based on the observation that the key computation common to most neural network layers is a vector/matrix product, we propose a fast locality-sensitive hashing technique to approximate the actual dot product enabling us to scale up the training and inference to millions of output classes. We evaluate our technique on three diverse large-scale recognition tasks and show that our approach can train large-scale models at a faster rate (in terms of steps/total time) compared to baseline methods.
Motivation & Objective
- To address the computational bottleneck of training and inferring deep networks with millions of output classes.
- To enable scalable deep learning for large-scale recognition tasks such as image classification, video identification, and recommendation systems.
- To reduce the time complexity of the final classification layer without significant accuracy loss.
- To explore the feasibility of using hashing to approximate matrix-vector products in deep networks.
- To demonstrate that top-k hashing can outperform traditional softmax and hierarchical softmax in terms of training speed and model accuracy.
Proposed method
- Proposes a hashing-based approximation of the dot product between input activations and output weights in the final layer.
- Computes binary hash codes for each output weight vector and stores them in hash tables for fast lookup.
- During inference, computes hash codes for the input activation and retrieves only the top-k nearest output nodes based on hash similarity.
- Performs exact dot products only with the retrieved top-k nodes, setting all others to zero to reduce computation.
- Applies the same hashing technique during training to accelerate gradient updates via top-k parameter updates.
- Uses a WTA (Winner-Takes-All) softmax variant that approximates the full softmax using only the top-k most relevant output nodes.
Experimental results
Research questions
- RQ1Can locality-sensitive hashing be effectively used to approximate the dot product in the final layer of deep networks with large output spaces?
- RQ2How does the proposed hashing-based method compare to standard softmax and hierarchical softmax in terms of training speed and model accuracy?
- RQ3Does the method scale effectively to problems with millions of classes, such as video identification or large-scale image classification?
- RQ4Under what conditions does the top-k approximation via hashing outperform full softmax or hierarchical softmax?
- RQ5How does feature compactness (in-class variance) of the dataset affect the performance of the hashing-based approach?
Key findings
- The WTA softmax model achieved higher precision@50 (16.5%) and precision@100 (18.5%) than hierarchical softmax on the skipgram dataset, despite processing fewer training examples.
- On the Sports 1M video identification task, the WTA model trained 4 times faster per step than standard softmax and achieved higher accuracy than both baselines.
- The WTA model achieved 4x lower step time than standard softmax, though it was 4x slower than hierarchical softmax due to higher per-step computation, yet still outperformed it in final accuracy.
- The in-class variance of features was significantly lower in the Sports 1M dataset than in ImageNet-21K, explaining why the top-k approximation worked better on video data.
- The method enabled training of large-scale models with millions of classes by reducing the number of required dot products from O(N) to O(K), where K << N.
- The approach is particularly effective when the feature space is compact (low in-class variance), as in video or sequential data, where nearest neighbors are more representative.
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.