Online Classification on a Budget

Koby Crammer, Jaz S. Kandola, Yoram SingerNeurIPS 2003

Kernel-based learning methods, such as Support Vector Machines (SVMs), are the heavy hitters of classical machine learning. They are highly prized for their ability to handle complex, high-dimensional data. However, they possess a glaring weakness: they are memory hogs. In an "online" setting—where data arrives continuously in a stream—standard kernel algorithms grow linearly with the number of prediction errors. Eventually, the model becomes too large to fit in memory or too slow to provide real-time predictions.

In this paper, Crammer, Kandola, and Singer introduce a "budget-conscious" approach to online classification. By intelligently pruning redundant information on the fly, they demonstrate that it is possible to maintain high accuracy with only a fraction of the memory.

TL;DR

This paper proposes a method to keep online kernel classifiers sparse using an "insertion and deletion" process. By discarding redundant past examples (support patterns) that no longer contribute to the decision boundary, the algorithm maintains a small memory footprint and achieves accuracy competitive with batch SVMs in just a single pass over the data.

The Problem: Computational Complexity of Kernel Methods

The core challenge addressed by this research is the computational complexity inherent in kernel methods. In online learning, the model $w$ is updated every time a mistake is made. With kernels, this model is represented as a weighted sum of past "misclassified" examples.

As the stream of data continues, the number of these "support patterns" grows, leading to two primary issues:

  1. Memory Exhaustion: The system eventually runs out of RAM to store the accumulated examples.
  2. Latency: To classify a new point, the system must compute a kernel function against every stored support pattern. More patterns inherently mean slower predictions.

The authors seek a way to enforce sparsity—keeping the number of support patterns low—without sacrificing the predictive power that makes kernel methods so useful.

Methods: The Distillation Phase

The authors introduce a framework that modifies standard online additive algorithms (like the Perceptron or MIRA) by adding a "distillation" phase.

DistillCache Algorithm
  1. Insertion Phase: When the algorithm makes a mistake (or fails to meet a margin requirement $\beta$), it adds the new example to its "cache" of support patterns and updates the weight vector.
  2. Deletion (Distillation) Phase: Immediately after adding a new point, the algorithm scans its cache for redundant examples. An example is considered redundant if the other patterns in the cache already satisfy the required margin for that point. If such a point is found, it is "distilled" (deleted) from the model.

This approach comes in two algorithmic flavors:

  • Variable-size Cache (Adaptive): The algorithm automatically decides how many patterns to keep based on redundancy.
  • Fixed-size Cache: A "hard budget" version where, if the cache is full, the algorithm forces the deletion of the example that currently has the highest margin (the most "settled" point).

The authors also provide a theoretical bound, proving that the number of support patterns in their adaptive cache is inversely proportional to the square of the data's margin ($\gamma$). This significant result links the physical memory requirements of the algorithm directly to the geometric difficulty of the classification task.

Datasets

The researchers evaluated their approach on three well-known benchmarks, representing a mix of high-dimensional image data and lower-dimensional feature data:

  • MNIST: 60,000 training images of handwritten digits (10 classes, 784 attributes).
  • USPS: 7,291 training images of handwritten digits (10 classes, 256 attributes).
  • Letter: 16,000 training examples of English letters (26 classes, 16 attributes).

Key Insights

  • Redundancy is Temporal: Early in training, an algorithm might save an example because it is the only "evidence" it has for a certain region of the feature space. As more data arrives, newer examples might define the decision boundary more precisely, making those early "pioneer" examples obsolete.
  • The "Aha!" Moment on Margin: The paper shows that you don't just delete the oldest points; you delete the points that are "safest" (deepest within the correct side of the margin). This ensures the model stays focused on difficult "borderline" cases.
  • Online vs. Batch: Surprisingly, the online "budget" version of the MIRA algorithm performed as well as—and sometimes better than—a full batch SVM. This is impressive because the online version only sees each training point once, whereas the SVM iterates over the entire dataset multiple times.

Key Results

Performance vs. Budget Size
  • Efficiency: On the MNIST and USPS datasets, the adaptive algorithm found a "sweet spot" for cache size that yielded lower test error than the standard, non-budgeted version of the same algorithm.
  • Competitive Accuracy: For MNIST, the budget-constrained online algorithm achieved a test error of ~1.1%, which was nearly identical to the gold-standard batch SVM, but with significantly less computational overhead.
  • Automatic Selection: The variable-size (adaptive) method proved to be a viable "automatic size-selection" tool. It consistently converged to a support pattern count that balanced memory and accuracy without requiring the user to guess the budget in advance.

Limitations and Future Work

  • The "Letter" Dataset Exception: The results were slightly less impressive on the letter dataset. The authors hypothesize this is because the dataset has fewer examples per class, giving the algorithm fewer opportunities to find and prune redundant patterns.
  • Pruning Criteria: The current deletion logic is based purely on the margin. The authors suggest that future work could incorporate the "weight" ($\alpha$) of examples, as points with very small weights might be better candidates for deletion.
  • Prior Knowledge: There is an opportunity to incorporate domain-specific prior knowledge into the insertion/deletion process to make the "budgeting" even smarter.

Summary updated

BibTeX
@inproceedings{crammer2003online,
  author = {Koby Crammer and Jaz S. Kandola and Yoram Singer},
  title = {{Online Classification on a Budget}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2003},
}
Figure