# On the Algorithmic Implementation of Multiclass Kernel-based Vector Machines

This paper gives a compact multiclass SVM that trains by solving small subproblems

Crammer, Koby, Singer, Yoram · Journal of Machine Learning Research

- **Problem** Most multiclass SVMs train one binary classifier per class, so they lose the correlations between classes. Extensions that treat all classes jointly add constraints for every class, so the quadratic optimization grows with the number of categories.
- **Method** The authors score each class with its own prototype row and use one slack per example. They split the dual into one small subproblem per example and solve them in turn, picking the example that violates the KKT conditions most.
- **Results** The fastest version trained on MNIST in 3 hours and 25 minutes on a Pentium III at 600MHz.

## Why per-class binary SVMs fall short

Most multiclass SVM work splits the task into one binary classifier per class, each separating its class from all the others. That split is a special case of output codes, and it can't capture correlations between the classes. Every binary problem is solved in isolation, so the dependence between labels is lost before training starts. Extensions that treat the whole multiclass problem at once do exist, as proposed by Vapnik, Weston and Watkins, and others.

These extensions add constraints for every class, so the size of the quadratic optimization grows with the number of categories.

The authors start from a generalized notion of margin for multiclass problems. Earlier work had used this margin with output codes, but not in the context of SVMs. Their aim is a compact set of constraints that still lets kernels enter the method. The margin leads to a single compact quadratic optimization problem, which Section 3 develops.

The dual of that problem is then decomposed into many small reduced problems, one per example. This decomposition yields a memory and time efficient representation of multiclass problems.

## A margin that ranks classes against each other

A binary linear classifier is the special case with two rows, M1 equal to w and M2 equal to minus w. The authors note that this two-row form occupies twice the memory needed. With three or more classes the model stays parsimonious, because it keeps k prototypes and sets the label by the most similar row.

The margin requires the correct class score to beat every other class score by at least one. The piecewise linear bound is max over r of M\_r times x plus 1 minus delta, minus the correct row's score. That bound is zero when the margin holds, and otherwise it grows linearly with the gap to the best wrong score. Summing these bounds over the training set gives an upper bound on the empirical loss.

For separable data, the authors seek the matrix M with the smallest squared norm that satisfies all the margin constraints. They motivate the norm with earlier work showing that generalization depends on the l2-norm of M. Slack variables extend this to data that isn't separable, and the primal adds a weighted sum of slacks to half the squared norm scaled by beta.

Here beta is a regularization constant greater than zero, and the constraints for the correct label reduce to nonnegative slacks.

Solving the Lagrangian with the Karush-Kuhn-Tucker conditions shows that each row of M is a linear combination of the training instances. The dual is a quadratic in the tau vectors, with each tau\_i kept below the indicator of its correct label and summing to zero. Replacing inner products with a kernel gives the classifier H(x) equal to the argmax over r of the sum of tau\_{i,r} times K(x, x\_i), so prediction needs only kernel evaluations.

The classifier has no bias terms, and the authors suggest that adding one to the kernel acts as an equivalent substitute. With two classes the objective reduces to the standard SVM primal, and Weston and Watkins need m(k-1) slacks where this formulation uses only m.

## Splitting the dual into one-example subproblems

A standard QP over all the dual variables would need a matrix of size mk by mk, which the authors call intractable for large problems. Instead, the algorithm separates the constraints into m disjoint sets, one for each example. Each round picks one example p and optimizes only its vector τ\_p, holding the other vectors fixed.

Writing the objective in terms of τ\_p gives a reduced problem with constants A\_p = K\_{p,p} and B\_p = -β1\_{y\_p} + sum over i not equal to p of K\_{i,p} τ\_i. The reduced problem has k variables and k+1 constraints, so each subproblem stays small. The authors note that a standard QP solver is slower for this subproblem, especially when an approximate solution is enough.

The authors define ψ\_i as the largest F\_{i,r} minus the smallest F\_{i,r} over labels r where τ\_{i,r} is below δ\_{y\_i,r}. A vector is optimal when ψ\_i is zero, and in practice the loop stops once every ψ\_i is at most ϵ. The algorithm picks the example with the largest ψ\_p on each round, which is the greedy choice the authors favour. After each update the stored F\_{i,r} values change by Δτ\_{p,r}K(x\_p, x\_i), so the scores stay current without recomputing them from scratch.

## A fixed-point solver for the reduced problem

The reduced problem for one example is solved by a fixed-point iteration, because the authors had an earlier algorithm that is slow when k is large. That earlier algorithm, from their output-coding work, needs to sort k values on each iteration. The authors found empirically that the solution quality is insensitive to how tightly the Karush-Kuhn-Tucker condition is met.

So it is enough to find a vector that decreases Q noticeably, without reaching the optimal solution. They complete the square in the reduced objective and drop the pattern index p.

A change of variables shifts the vector by B over A, giving a new vector nu and a vector D that depends on B and the labels. The problem then asks for nu with each entry at most D\_r and a fixed sum, with the sum equal to the sum of D minus 1. The Karush-Kuhn-Tucker conditions force each entry to equal min of theta and D\_r for one scalar theta.

The sum constraint then fixes theta uniquely, because the sum of the minima is strictly monotone and continuous in theta. Theorem 1 shows that this theta star gives the solution with the smallest norm.

The authors replace each minimum with theta plus D\_r minus the maximum, which turns the constraint into a fixed-point equation. The fixed point of F(theta) equals one over k times the sum of max{theta, D\_r}, minus one over k. The algorithm starts from an initial theta and repeatedly applies F, stopping when successive values are close enough.

Theorem 2 states that if theta\_1 is at most the maximum of D\_r, each step shrinks the error by at most a factor of 1 minus 1/k. The proof splits into cases depending on whether u equals s, is larger, or is smaller. Starting from the minimum of the D\_r gives the best convergence, so the authors use it as the initial value.

Figure 3 gives the fixed-point procedure, which returns the vector tau as nu minus B over A. In the full algorithm, the fixed-point solver runs on each selected example, with the tau values reset to zero at the start. Each call updates the F values for all examples, so the next selection step sees the new state.

## Where the MNIST run time came from

The speed work uses the MNIST OCR dataset, which holds 60,000 training examples and 10,000 test examples. The authors note that many of these techniques were already used in prior implementations of two-class support vector machines. Their baseline cycles through the examples for a fixed number of iterations, solving each reduced problem and ignoring the KKT conditions for each example.

That baseline spends unnecessary time on patterns that are already classified correctly with a large confidence.

Choosing examples by KKT violation means the algorithm computes psi\_i for each example and picks the example p with the largest psi\_p. The accuracy parameter epsilon controls when the main loop stops, so a larger value ends the loop sooner. A moderate epsilon of 0.1 already yields good generalization, and smaller values raise the running time by 20 to 30 percent.

Because the algorithm stays rather robust to epsilon, the authors kept it large as long as generalization wasn't affected.

The active set holds the examples whose tau vectors are nonzero, and the algorithm searches it first for an example to update. A new example from the complement is added only when no example in the active set has psi above epsilon. With a fixed epsilon, the objective Q fell in a staircase shape, because the loop kept making tiny changes to active weights.

A decreasing accuracy schedule starting at 0.999 gave a smoother drop, and the logarithmic schedule worked best.

For small datasets the cache stores all kernel evaluations between each active example and every training example. For large problems with many support patterns, the cache uses least-recently-used replacement, as SVMlight does. Sparse inputs use linked lists, and the authors found that 20% sparseness was enough to save time and memory over a dense implementation.

The fastest version trained on MNIST in 3 hours and 25 minutes on a Pentium III at 600MHz with 2Gb of memory. Platt reported 8 hours and 10 minutes for one digit classifier, which the authors scale to over 80 hours for a set of 10 classifiers. Platt's results came from a Pentium II at 266MHz, so the machines and factors differ, and the authors present these times only as an indication.

## Multiclass training against one-vs-rest

The authors compared two ways of running the same multiclass SVM code on seven datasets. The first way trains one binary classifier per class, each separating its class from the rest. The second way uses the full multiclass formulation of this paper. Both runs used Gaussian kernels, with β and σ chosen by cross validation on the training set.

Five-fold cross validation was used for the large datasets and 10-fold for the small ones, and ϵ was fixed at 0.001. Six datasets came from the UCI repository and one was MNIST, and only glass lacked a separate test set.

Across the datasets, the multiclass version gave a lower error rate than one-vs-rest.

Schölkopf et al. reported 1.4% on MNIST and 4.2% on USPS with binary one-vs-rest SVMs, so the authors call their results comparable there. Dietterich reported 2.71% on Letter and 0.01% on Shuttle by boosting C4.5. On Shuttle the authors' method is 10 times worse, and they attribute this to most Shuttle instances sharing one class. Boosting algorithms cope with that kind of imbalance more easily, the authors say.

A polynomial kernel of degree 9 with the DeCoste and Schölkopf normalization reached 1.24% on the MNIST test set.

## What the large-norm examples reveal about the data

An example is a support pattern when its distribution over labels isn't concentrated on its correct label. The paper treats each row of eta for an example as a probability distribution over the k labels. Under that reading, the classifier is built from patterns whose labels are uncertain, and the rest are ignored. The vector tau-bar is defined as the point distribution on the correct label minus eta-bar.

So a large tau-bar norm marks an example whose label mass has moved onto other labels.

The authors inspected MNIST training images with a high norm of tau-bar. Each plotted image attains a margin below beta, and each carries its correct label with a sparse probability vector eta-bar. Those vectors list the confusable labels, which are the labels with non-zero entries in eta-bar. For one top image, the vector puts weight on 3, 7 and 9, so the example can be mistaken for any of them.

The confusion is correlated with the digit each example can actually be confused with.

In many cases, examples with a large norm of tau-bar are mislabeled examples or corrupted images. Therefore the authors suggest that the norm of tau-bar can serve as an aid for data cleaning. The paper makes this claim from visual inspection of the high-norm images, not from a separate cleaning experiment. Those images are shown in Figure 9, which the authors built from the MNIST dataset.

## Where the claims stop

The authors explain the gap by noting that most Shuttle instances belong to the same class, a setting that boosting algorithms cope with more easily. So the paper claims comparability on the first three large datasets, but it doesn't claim a win on Shuttle.

The speed comparison with Platt is weaker evidence than the sentence about running time suggests. The authors say many factors influence running time, so the 80-hour estimate is an indication, not a controlled result.

The experiments are on a fixed set of datasets with Gaussian kernels, so the accuracy claims don't extend beyond them. The authors didn't test ranking or regression, which they leave for future research. They also didn't run the parallel single-example reduction, which they only mention as possible. The online multiclass predictors are likewise proposed in the paper but not evaluated.

## Paper info

- **Authors**: Crammer, Koby, Singer, Yoram
- **Venue**: Journal of Machine Learning Research · Published
- **Added**: 2026-11-12
- **Original paper terms**: [Check in the original ↗](https://www.jmlr.org/papers/v2/crammer01a.html)
- **What we show**: Paper info and commentary

[Original paper ↗](https://www.jmlr.org/papers/v2/crammer01a.html) · [PDF ↗](https://www.jmlr.org/papers/volume2/crammer01a/crammer01a.pdf)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Crammer, Koby, Singer, Yoram (2001). On the Algorithmic Implementation of Multiclass Kernel-based Vector Machines. Journal of Machine Learning Research. https://www.jmlr.org/papers/v2/crammer01a.html

**BibTeX**

```
@article{koby2001algorithmic,
  title = {{On the Algorithmic Implementation of Multiclass Kernel-based Vector Machines}},
  author = {Crammer, Koby and Singer, Yoram},
  year = {2001},
  journal = {Journal of Machine Learning Research},
  url = {https://www.jmlr.org/papers/v2/crammer01a.html}
}
```

## Other paper commentary

- [Super-Convergence: Very Fast Training of Neural Networks Using Large Learning Rates](https://refivu.com/en/papers/6770e9ca-a3e2-40e5-bf7e-fd1daf28cf68-super-convergence-very-fast-training-of-neural-networks.md)
- [BloombergGPT: A Large Language Model for Finance](https://refivu.com/en/papers/2dae70a1-3c88-432c-b934-14abfe8cc431-bloomberggpt-a-large-language-model-for-finance.md)
- [Exploiting Unintended Feature Leakage in Collaborative Learning](https://refivu.com/en/papers/422f8c4a-b03f-4b77-a90a-48be0d614527-exploiting-unintended-feature-leakage-in-collaborative.md)
- [Learning from Simulated and Unsupervised Images through Adversarial Training](https://refivu.com/en/papers/932cb1b6-f4a0-43ce-8dda-320fa18f82a5-learning-from-simulated-and-unsupervised-images-through.md)
- [Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection](https://refivu.com/en/papers/8c7ef054-dbb9-4dbc-aa5f-7f764d2b0d6b-not-what-you-ve-signed-up-for-compromising.md)
- [Making Pre-trained Language Models Better Few-shot Learners](https://refivu.com/en/papers/58cbc07a-35f5-4401-ada0-4d09082241d1-making-pre-trained-language-models-better-few-shot.md)
- [Libra R-CNN: Towards Balanced Learning for Object Detection](https://refivu.com/en/papers/c37a17a8-6ca9-466b-8cf2-8b63070f36bc-libra-r-cnn-towards-balanced-learning-for-object.md)
- [Evaluating Object Hallucination in Large Vision-Language Models](https://refivu.com/en/papers/994f787c-7b50-4945-8065-0d6a2ea146e6-evaluating-object-hallucination-in-large-vision-language.md)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/c14ddd70-8724-4233-88ef-83845f1432c5-on-the-algorithmic-implementation-of-multiclass-kernel-based)
