[Paper Review] Log-time and Log-space Extreme Classification
This paper introduces LTLS, a novel log-time and log-space method for extreme multiclass and multilabel classification that embeds large output spaces into a structured prediction framework using a directed acyclic graph (DAG) with $O(\log C)$ edges. By applying dynamic programming (Viterbi algorithm) on this DAG, LTLS achieves $O(k\log k \log C)$ inference time and $O(\log C)$ model size, outperforming baseline methods in speed and memory while maintaining competitive accuracy on multiple datasets.
We present LTLS, a technique for multiclass and multilabel prediction that can perform training and inference in logarithmic time and space. LTLS embeds large classification problems into simple structured prediction problems and relies on efficient dynamic programming algorithms for inference. We train LTLS with stochastic gradient descent on a number of multiclass and multilabel datasets and show that despite its small memory footprint it is often competitive with existing approaches.
Motivation & Objective
- To address the high time and space complexity of extreme classification when the number of output classes $C$ is very large.
- To design a method that achieves truly logarithmic time and space complexity for both training and inference.
- To enable efficient training and prediction using stochastic gradient descent while maintaining model compactness.
- To support integration with deep learning models and existing optimization techniques like L1 regularization.
- To provide a structured prediction framework that generalizes well across diverse multiclass and multilabel datasets.
Proposed method
- LTLS constructs a directed acyclic graph (DAG) with $O(\log C)$ edges, where each path from source to sink corresponds to a unique class.
- Each edge in the DAG is associated with a learnable scoring function $h_e(x; w)$, and the path score is the sum of edge scores.
- The model uses dynamic programming (Viterbi algorithm) to compute the highest-scoring path in $O(E)$ time, where $E$ is the number of edges.
- Top-$k$ predictions are computed using a modified list-Viterbi algorithm for efficient ranking.
- The DAG structure is designed to handle arbitrary $C$ by connecting the sink to states based on the binary representation of $C$.
- The method supports any model trainable via stochastic gradient descent, including deep neural networks, and allows for L1 regularization to mitigate overfitting.
Experimental results
Research questions
- RQ1Can a multiclass and multilabel classification method achieve $O(\log C)$ time and space complexity for both training and inference?
- RQ2How does the performance of LTLS compare to existing approaches like OVA, FastXML, and LEML in terms of accuracy, speed, and model size?
- RQ3In what scenarios does LTLS perform comparably to a One-Vs-All classifier despite its compact model size?
- RQ4How effective is LTLS on large-scale datasets with long-tail label distributions and sparse labels?
- RQ5What impact do design choices like the DAG topology and edge scoring functions have on generalization and overfitting?
Key findings
- LTLS achieves $O(k\log k \log C)$ inference time and $O(\log C)$ model size, making it the first method to provide truly log-time and log-space complexity for extreme classification.
- On the LSHTC1 dataset, LTLS achieved a precision@1 of 0.0950, outperforming the naive baseline (0.0966) and matching the performance of more complex models despite its minimal size.
- On the ImageNet dataset, LTLS achieved a precision@1 of 0.0075 with a model size of 390 MB, significantly smaller than FastXML (914 MB) and LOMtree (35 MB), though accuracy was low due to overfitting.
- On the LSHTCwiki dataset, LTLS achieved a precision@1 of 0.2240 with a model size of 769 MB, outperforming FastXML (0.7828) in prediction time (5.43s vs. 164.80s) and LEML (2896s), while maintaining a much smaller footprint.
- For the rcv1-regions dataset, LTLS achieved a precision@1 of 0.8964, surpassing both the naive baseline (0.6576) and FastXML (0.9328), demonstrating strong performance on large-scale multilabel tasks.
- With L1 regularization, LTLS improved performance on overfitting-prone datasets like LSHTC1 and Dmoz, achieving 0.0950 and 0.2304 precision@1 respectively, showing robustness to data sparsity.
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.