This NeurIPS 2018 paper from researchers at The Technion introduces a flexible and highly accurate approach to "extreme classification"—machine learning tasks where an algorithm must choose the correct label from thousands or even millions of possibilities.
By introducing Wide-LTLS (W-LTLS), the authors present a framework that represents massive label sets as paths through a trellis graph. Combining efficient graph-based inference with "loss-based decoding," W-LTLS achieves high accuracy and logarithmic scaling ($O(\log K)$) in both time and space, offering practitioners a tunable tradeoff between model size and performance.
The Challenge of Extreme Classification
In extreme classification (e.g., tagging a webpage with a few categories out of millions), standard approaches like One-vs-Rest (OVR) become computationally prohibitive. OVR trains one classifier for every single label, requiring massive memory to store and excessive time to run during inference.
Recent "log-time" methods like LTLS (Log-Time Log-Space) attempted to solve this scaling issue by mapping labels to paths in a compact graph. However, LTLS often suffers from lower accuracy. The binary classification subproblems it creates are "hard" for the model to learn, and its decoding process—choosing the right path—is somewhat rigid.
Bridging ECOC and Trellis Graphs
The authors bridge the gap between two existing concepts: Error Correcting Output Coding (ECOC) and Trellis Graphs, resulting in their novel W-LTLS framework.
- Graph-as-Code: The authors demonstrate that the LTLS approach is actually a specific type of ECOC, where each edge in a graph represents a "bit" in a label's binary code.
- Efficient Loss-Based Decoding: Standard ECOC uses "Hamming decoding" (counting how many bits match). "Loss-based decoding" is more accurate because it considers the confidence of each binary classifier. Usually, loss-based decoding is slow ($O(K)$). However, the authors prove that by using a Viterbi-style algorithm on their trellis graphs, they can perform this superior decoding in just $O(\log K)$ time.
- Wide-LTLS (W-LTLS): The framework introduces a "slice width" parameter ($b$). By making the trellis graph "wider," the internal binary classification tasks become easier for the model to learn, moving them closer to the simplicity of One-vs-Rest.
This width parameter allows users to dynamically increase the model's width to gain accuracy or decrease it to save memory.
Key Insights
- The Viterbi Shortcut: The most significant technical contribution is the realization that finding the "minimum loss" class doesn't require checking every class. Because the classes are paths in a trellis, dynamic programming can find the best path, keeping the complexity logarithmic.
- The "Hardness" of Balance: In traditional coding theory, "balanced" codes (where each bit splits the data 50/50) are ideal. In machine learning, however, balanced splits are often much harder to learn than "unbalanced" ones (like 1-vs-99). W-LTLS allows the user to tilt the balance toward easier subproblems by widening the graph.
- Sparsity as a Feature: The authors found that wider graphs actually produce sparser models. Even though a wider graph has more parameters, many can be pruned (set to zero) without losing accuracy, leading to highly efficient storage.
Experimental Results
The authors evaluated W-LTLS on five standard extreme multiclass benchmarks characterized by high dimensionality and varying sparsity: Sector, aloi_bin, imageNet, Dmoz, and LSHTC1.
- Accuracy vs. Size: W-LTLS significantly outperformed the original LTLS. On the Dmoz dataset (approx. 12,000 classes), it achieved accuracy competitive with One-vs-Rest while being 200x smaller in model size.
- Inference Speed: Despite being implemented in Python, W-LTLS showed inference speeds competitive with FastXML, a state-of-the-art C++ implementation.
- Optimal Decoding: The study found that using exponential loss for the decoding step consistently yielded the best accuracy across all datasets compared to squared or hinge loss.
Limitations and Future Work
While highly effective, the authors note a few limitations. The "minimum Hamming distance"—a measure of how distinct the label codes are—remains low in this architecture ($\rho=4$). Future work could focus on designing graphs that increase this distance to improve error correction. Additionally, if the graph width ($b$) is scaled too high (e.g., $b \approx \sqrt{K}$), the method loses its strictly sublinear efficiency, though experiments suggest high accuracy is reached well before that point. Finally, the current model treats every edge's contribution to the total loss equally; exploring "weighted" coding matrices could further boost performance.
Summary updated