Elamur Research

On Flat versus Hierarchical Classification in Large-Scale Taxonomies

Paper · 2013 · Rohit Babbar, Ioannis Partalas, Eric Gaussier et al.

Summary

A text classification system can use a taxonomy to narrow its search for the right label. It first chooses a broad category, then makes more specific choices until it reaches a leaf. Each choice considers relatively few alternatives, but a mistake near the top can send the document down a branch that never reaches the right label. A flat classifier compares all the final labels directly. That removes the risk of taking a wrong turn, while asking the classifier to distinguish a much larger set of categories, including some with very few training examples. Babbar and colleagues study when each of these strategies is preferable and whether selectively flattening a taxonomy can improve on both.

The paper develops a bound on prediction error that separates the classifier’s performance on its training examples from a term that reflects the complexity of its possible decisions. A hierarchy reduces the complexity term by breaking a wide comparison into smaller ones. Its successive decisions can, however, increase the training loss. The balance was different across the collections the authors tested. Fully hierarchical classifiers had lower test error than their flat counterparts on the reported DMOZ splits, where the authors point to the prevalence of rare classes. In the more balanced International Patent Classification collection, the flat support vector machine had the lowest reported error for that classifier family, at 0.446.

A separate analysis asks when a multiclass logistic regression classifier trained on a finite sample is likely to make the same choice as its counterpart with unlimited training data. The analysis identifies conditions that make that choice unstable, including scant information for estimating some parameters and a small probability gap between the leading categories. The authors use these observations to describe proposed pruning decisions with features such as category sizes and similarities. They train a classifier to predict whether removing an intermediate node and promoting its children will improve end-to-end accuracy.

Learned pruning gave the lowest reported test errors for both classifier families on the DMOZ test splits. On IPC it gave the lowest reported error for logistic regression, at 0.544, while the flat support vector machine retained its lead. The results give a reason to distinguish the value of a label hierarchy from the value of making every decision that its original structure requires. Even where having a hierarchy helped, some of its intermediate decisions could be removed to improve classification.

Deep dive: On Flat versus Hierarchical Classification in Large-Scale Taxonomies

Babbar and colleagues explain when flat or top-down classification works better in large taxonomies and test a method for learning which branches to flatten. · about 35 minutes to read

The problem and its context

Why the route to a label matters

Large collections of documents can have many target categories. The paper studies systems in which these categories occupy the leaves of a taxonomy. An internal category groups more specific categories beneath it. A hierarchy may already exist as part of the way a collection is organized, so the designer can use it to divide the prediction task into smaller decisions. The central question is whether those decisions make prediction more reliable on new documents.

A top-down classifier starts at the root. At each internal node it scores the available children and commits to the highest-scoring one. The remaining candidates are the leaves beneath that child. This procedure repeats until it reaches a target label. The paper refers to this style of prediction as a Pachinko machine. The name describes the commitment made at each branch. The subsequent decisions operate completely within the selected subtree.

For a document whose correct label lies in another subtree, an incorrect branch choice has already settled the outcome. The classifier may make good decisions for the rest of the route and still reach the wrong leaf. This is error propagation. The concern is especially clear for an error near the root, where a branch choice can exclude a large part of the taxonomy. The final outcome depends on the classifier retaining the correct label among its candidates throughout the descent.

Flat classification makes the entire leaf set available in a single decision. Evidence that distinguishes a document’s correct category from other leaves can affect the final choice directly. The flat classifier also faces all the competing categories at once. When many of them have only a handful of examples, the classifier has little direct evidence for how their documents differ from those of larger classes. A hierarchical classifier can use documents across a subtree to learn a broader distinction before it reaches the fine-grained decision. The rare class still has few examples of its own, but its documents can benefit from evidence shared at earlier stages of the route.

How helpful that pooling is depends on the structure of the taxonomy and the distribution of examples. A broad category may collect enough examples to be easier to recognize than its individual leaves. It may also combine classes whose documents differ enough that distinguishing the entire group from its siblings becomes difficult. The taxonomy says which categories belong together. The training set determines what evidence a classifier has for recognizing those groupings.

The balance between these effects is the paper’s problem. Looking only at the number of labels hides the differences between structures. Looking only at the number of decisions overlooks how many alternatives each decision must distinguish. Looking only at the frequency of rare labels leaves open whether the hierarchy groups those labels in a way that makes useful distinctions. The authors seek a theoretical account that can connect these properties to what earlier comparisons had observed.

What earlier approaches had tried

The paper describes flat and fully top-down classification as common choices in large taxonomies. It also discusses methods that incorporate the hierarchy directly into the training objective. In such approaches, relationships among categories influence the optimization used to fit the classifier. The authors describe these approaches as costly in practice. This helps explain the interest in systems that use conventional classifiers, either with the full hierarchy or with a simplified version of it.

Earlier work had already explored flattening. One option was to remove an entire layer, saving a set of intermediate decisions in one operation. The paper also mentions a method that embeds categories and documents in a common space, and another that changes the influence of taxonomy edges using a cost-sensitive loss. These approaches intervene at different points. An embedding changes the representation in which categories and documents can be compared. Edge costs change how the training objective treats parts of the hierarchy. Explicit pruning changes which choices a classifier will face at prediction time.

The earlier empirical literature, as characterized by the authors, gave no universal choice between flat and hierarchical classification. Some studies considered large taxonomies in which many leaves had very little training data. Other studies examined settings in which the categories were more balanced. The paper treats that distinction as relevant to understanding why different studies favored different approaches. It asks what statistical properties make the wide decision of a flat classifier difficult, and what costs a hierarchy introduces in solving smaller pieces of the same task.

Why pruning is a separate prediction problem

A taxonomy need not be used at its original depth. Removing an intermediate node promotes its children to the level of its siblings. A document that belongs beneath the removed node can then reach the relevant child without first passing through a separate decision about the parent. At the same time, those promoted children must now compete directly with categories that the old classifier considered at a different stage. A shorter route comes with a wider local choice.

The useful unit of analysis is therefore a proposed change to the competing categories. The classifier operating above the node sees a different set of alternatives after pruning. The classifier that previously operated immediately below the node is no longer needed there. Elsewhere, the tree can retain its original arrangement. This gives the authors a way to study a continuum from narrow successive decisions to much wider ones.

Finding useful changes by trial and error would be expensive on a large taxonomy. Measuring the effect of removing a node entails fitting classifiers for the changed structure and evaluating their predictions. Once a node has been removed, nearby choices change, so the earlier evaluation of another candidate may no longer answer the same question. The paper accordingly separates a theoretical comparison of architectures from the practical task of estimating which local changes are worth making. Its pruning classifier learns from observed changes in accuracy on training taxonomies, then uses features of candidate nodes to make decisions on other taxonomies.

The method, step by step

Turn the taxonomy into a sequence of comparisons

The theoretical setup assumes a rooted tree, with a unique parent for every node below the root. A document is represented by a feature vector. Its target for prediction is a leaf, and the probability distribution that generates documents and labels is fixed but unknown. Internal categories are useful intermediate destinations. Their role is to keep the document on a path that still contains the correct leaf.

H = (V, E)

Here H is the hierarchy, V is the set of its nodes and E is the set of edges directed from parents to children. The root is denoted by ⊥. The function π gives the parent of a nonroot node.

Y = {y ∈ V : there is no v ∈ V with (y, v) ∈ E}

Here Y is the target set, y is a candidate target node and v ranges over the nodes in V. The symbol ∈ means membership in a set. An ordered pair in E describes an edge from its first node to its second, so membership in Y requires a node to have no children. In the flat setup, the leaf labels are considered together without drawing on their ancestry.

S(v) = {u ∈ V ∖ {⊥} : u ≠ v and π(u) = π(v)}

Here S(v) is the set of siblings of a nonroot node v. The variable u ranges over other nodes, ∖ removes the root from the candidate set, and ≠ excludes v itself. Equality of the two parent values makes u and v siblings.

D(v) = {u ∈ V ∖ {⊥} : π(u) = v}

Here D(v) is the set of children of v. The variable u denotes a possible child, and π(u) gives its parent. The D used with an argument in this notation is a child set. The probability distribution over documents and labels will be denoted by 𝒟.

Prediction begins with the children of the root and repeats the same kind of score comparison at successive internal nodes. The classifier’s confidence in the complete route can be represented by the smallest margin along it. A local margin measures how far the score for a node on the correct route lies above the strongest score for a competing sibling. The minimum identifies the weakest comparison. A strong branch choice cannot compensate for a loss at another branch, since continuing through the winning sibling would take the document away from its target.

Bound the loss of the whole route

The paper starts its analysis with kernel-based scoring functions. A kernel represents an inner product in a feature space, and the score for a category is an inner product between its weight vector and the transformed document. The authors bound the combined size of the weight vectors so that the allowed scoring functions form a restricted family.

F_B = {f : f(x, v) = ⟨Φ(x), wᵥ⟩, W = (wᵥ)ᵥ∈V, ‖W‖𝓗 ≤ B}

Here F_B is the family of allowed scoring functions and f(x, v) is the score for document x at node v. The mapping Φ sends x to the kernel’s feature space 𝓗. The vector wᵥ contains the weights for v, and the angle brackets denote the inner product. W collects the weight vectors for the nodes in V, and B is the upper limit on their group norm.

‖W‖𝓗 = (∑ᵥ∈V ‖wᵥ‖²)¹⁄²

Here ‖W‖𝓗 is the group norm, ‖wᵥ‖ is the feature-space norm of the weight vector at node v, and the sum runs over the set V. The squares are added before taking the square root. This constraint applies across the family of category scores used by the classifier.

g_f(x, y) = minᵥ∈P(y) [f(x, v) − maxᵤ∈S(v) f(x, u)]

Here g_f is the route margin for document x and target y under scoring function f. The paper uses P(y) for path nodes associated with y, v is a node on that path, and S(v) is the sibling set at v. The maximum picks the strongest sibling u and the minimum picks the weakest of the route’s margins. For the paper’s stated prediction rule, the comparison that selects the terminal leaf is part of the route. Its formal description of P(y) lists the ancestors below the root and omits y itself. Read literally, that list would omit the terminal comparison and would leave the flat special case without a comparison. The rule used to explain the bound is the complete sequence of sibling choices, including the one that selects the leaf.

E(g_f) = 𝔼₍ₓ,ᵧ₎∼𝒟 [𝟙{g_f(x, y) ≤ 0}]

Here E(g_f) is the generalization error of the margin-based classifier and 𝔼 denotes expectation over a fresh document and label pair (x, y) drawn from 𝒟. The indicator 𝟙 equals one when the condition inside braces holds and zero otherwise. A positive margin means the correct route wins every comparison. The loss in the bound counts a margin of zero as an error along with negative margins.

The paper uses empirical Rademacher complexity to bound how far behavior on a training sample can differ from behavior on new examples. The idea is to measure the capacity of a family of functions by assessing how well it can follow random signs assigned to the sample. A family with enough flexibility to track those signs closely can fit patterns that need not recur outside the sample. The bound also uses a Lipschitz loss that lies above the zero-one loss. A Lipschitz constant limits how fast that loss can change as the margin changes.

K(x, x) ≤ R²

Here K is the positive semidefinite kernel, x is any input document and R is a positive bound on the feature-space norm of the document. Evaluating K at the same input twice gives its squared feature-space norm.

E(g_f) ≤ (1/m) ∑ᵢ₌₁ᵐ A(g_f(x⁽ⁱ⁾, y⁽ⁱ⁾))
       + (8BRL/√m) ∑ᵥ∈V∖Y |D(v)|(|D(v)| − 1)
       + 3√(ln(2/δ)/(2m))

Here E(g_f) is the generalization error for the classifier derived from f. The training sample contains m independently drawn pairs, and x⁽ⁱ⁾ and y⁽ⁱ⁾ are the document and label of sample item i. The function A is the loss applied to the route margin, and L is its Lipschitz constant. B bounds the group norm of the weights, and R comes from the kernel condition. The sum over V∖Y covers all internal nodes, including the root, and |D(v)| is the number of children of node v. The symbol √ denotes the square root and ln is the natural logarithm. The theorem holds simultaneously for the permitted scoring functions with probability at least 1 − δ over the draw of the training set, where δ lies strictly between zero and one.

The structure of the tree enters through the sum of products of child counts. Each product counts ordered pairs of different children at one node. An internal node with many children contributes many possible comparisons. In the flat special case, the root has every target as a child and all these comparisons are concentrated there. In a deeper tree, decisions at different nodes concern smaller groups of alternatives. The paper uses the quadratic dependence on group size to explain why splitting a wide choice can reduce the structural term.

The training-loss term captures a different effect. Every additional branch choice is another opportunity for the correct route to lose. Even a single weak comparison matters because the loss is applied to the minimum margin. A reduction in complexity can therefore accompany an increase in training loss. The bound gives these effects a place in the same inequality, with the confidence term accounting for the finite sample.

The two terms have different relationships to imbalance. The branching term depends on the counts of children and the size of the training sample, along with the weight, kernel and loss constants. The distribution of documents across the leaf labels does not occur as a separate count in that branch sum. Imbalance matters through the difficulty of learning the decisions and the loss they produce. The authors argue that some of the difficult comparisons in a very imbalanced flat problem become easier to learn when they are divided across a hierarchy. A lower complexity term may then compensate for the extra loss along the route. In a more balanced set of leaves, a single flat comparison can be easier to learn, and the training loss from repeated branch choices can be more consequential.

This bound motivates selective flattening. Removing a node can improve the weakest margin by taking a decision off the route, while increasing the number of competitors at the parent. For a given structural change, the change in the branching term can be determined from the tree. The corresponding training loss depends on fitting and evaluating the changed classifier. That is why the authors turn to a second analysis to find quantities that could be estimated without retraining classifiers at every candidate node in a new taxonomy.

Ask when a local decision is stable

The second line of analysis concerns multiclass logistic regression, abbreviated MLR. This classifier assigns a posterior probability to each possible category for a given input. The probability depends on a score built from the feature vector and an intercept. The classifier picks the largest probability. The authors use one category as a reference, or pivot, and express the remaining scores relative to it.

aᵧ(x) = β₀ʸ + ∑ⱼ₌₁ᵈ βⱼʸ xⱼ

Here aᵧ(x) is the linear score for category y other than the pivot y★. The intercept for y is β₀ʸ. The feature indexed by j is xⱼ, its weight for y is βⱼʸ, and d is the dimension of the feature space. The full collection of intercepts and weights is denoted by β.

P(y | x; β) = exp(aᵧ(x)) / (1 + ∑ᵤ∈Y∖{y★} exp(aᵤ(x))),  y ∈ Y∖{y★}

Here P(y | x; β) is the probability assigned to a nonpivot category y for document x with parameters β. The function exp is the exponential, u runs through the nonpivot categories in Y, and aᵤ(x) gives each category’s score. The constant in the denominator is the pivot’s contribution.

P(y★ | x; β) = 1 / (1 + ∑ᵤ∈Y∖{y★} exp(aᵤ(x)))

Here P(y★ | x; β) is the probability for the pivot y★, and all other symbols have the same roles as in the preceding probability. Every category uses the same denominator. That normalization makes the assignments a probability distribution over the candidate set Y.

hₘ(x) = argmaxᵧ∈Y P(y | x; β̂ₘ)

Here hₘ is the prediction rule fitted to m training examples, and β̂ₘ is the maximum-likelihood estimate of β from those examples. Maximum likelihood selects parameters by how much probability they assign to the observed training labels. The operation argmax returns a category y from Y that attains the largest posterior probability for document x.

h∞(x) = argmaxᵧ∈Y P(y | x; β̂∞)

Here h∞ is the limiting prediction rule, β̂∞ is the parameter value approached as the training set grows without limit, and argmax again chooses a category y with maximal probability. The comparison is between a finite-sample classifier and a limiting classifier in the same logistic regression family. If the family’s limiting classifier makes some errors, a stable finite-sample classifier can share them.

The analysis starts with a bound on the deviation of posterior probabilities estimated from finite data. The argument invokes asymptotic normality of maximum-likelihood estimates and uses a diagonal Fisher information assumption. Fisher information describes how much the observations tell the estimator about the parameters. A large inverse-information entry corresponds to a parameter with relatively little information and substantial uncertainty on the scale used by the analysis. The bound uses the largest such entry.

σ₀ = maxⱼ,ᵧ σⱼʸ

Here σ₀ is the largest of the diagonal entries of the inverse Fisher information at β̂∞. The entry σⱼʸ concerns the parameter indexed by j for nonpivot class y, with j covering the intercept as well as the feature coefficients. The maximum represents the least precisely informed parameter on this diagonal account.

|P(y | x; β̂ₘ) − P(y | x; β̂∞)| < d√(R|Y|σ₀/(δm))

Here the left side denotes the magnitude of the difference between the estimated and limiting probabilities for the same document x and category y. The right side uses the feature dimension d, the category count |Y|, the largest inverse-information entry σ₀ and the training size m. In this analysis R is the positive constant for the bound on the exponentiated logistic scores, distinct from the kernel bound above. The parameter δ controls the probability guarantee, which is at least 1 − δ under the assumptions of the lemma. The magnitude is the form of deviation used by the decision-stability argument.

The proof sketch starts with uncertainty in individual coefficients. Chebyshev’s inequality is used to control the probability of a large deviation in a coefficient. The authors then use expansions of the exponential and reciprocal terms in the posterior formula to relate parameter deviations to probability deviations. Finally, they combine failure possibilities across categories with a union bound. A union bound adds upper bounds on the probabilities of the individual failures. This permits a joint statement even when the failures being combined are dependent, though it can make the result loose.

Closeness of probabilities helps classification when it preserves the ordering of their largest values. For a document whose limiting probabilities assign a clear lead to one category, modest estimation errors cannot change the leading category. If the lead is small, the finite-sample probability for the leader could move down while the runner-up’s probability moves up. Even small deviations then leave room for the decision to change.

f∞¹(x) = maxᵧ∈Y P(y | x; β̂∞)

Here f∞¹(x) is the largest limiting posterior probability for document x. The maximum runs over categories y in Y, and β̂∞ supplies the limiting parameters.

f∞²(x) = maxᵧ∈Y∖{h∞(x)} P(y | x; β̂∞)

Here f∞²(x) is the limiting probability of the runner-up for x. The set inside the maximum removes the category h∞(x) selected by the limiting classifier. If a second category shares the highest probability, the runner-up can have the same value as the winner.

G_Y(τ) = ℙ₍ₓ,ᵧ₎∼𝒟 (|f∞¹(x) − f∞²(x)| < 2τ)

Here G_Y is the confusion function for category set Y, and τ is a positive tolerance for probability deviations. The symbol ℙ denotes probability over document and label pairs from 𝒟, although the event itself depends on x through the highest and runner-up probabilities. The threshold is twice τ because the probability of one category can rise while the probability of its competitor falls.

E(hₘ) ≤ E(h∞) + G_Y(d√(R|Y|σ₀/(δm)))

Here E(hₘ) and E(h∞) are the generalization errors of the finite-sample and limiting classifiers. The argument to G_Y is the deviation tolerance from the probability bound, with d the feature dimension, R the logistic score-bound constant, |Y| the number of categories, σ₀ the inverse-information term, m the training size and δ the failure-probability parameter. The theorem gives this upper bound with probability at least 1 − δ under its assumptions.

The difference in errors is bounded through cases where the limiting classifier makes the right prediction and the finite-sample classifier makes the wrong one. Such a case requires their predictions to differ. On the event where the deviations in the probabilities are small enough, a change of decision requires a sufficiently small limiting probability gap. The confusion function measures how often that circumstance occurs. It gives a reason to care both about the amount of training evidence and about whether the competing classes are easy to distinguish when their probability estimates are well determined.

Describe the decision before and after pruning

The authors apply the local analysis to a candidate intermediate node v. Before pruning, one comparison concerns v and its siblings. If the classifier chooses v, a further comparison concerns its children. After pruning, the children of v are promoted and compete directly with v’s former siblings. The old decision about selecting v disappears. Its descendant leaves are still available.

S′(v) = S(v) ∪ {v}

Here S′(v) is the category set at the parent before pruning. S(v) gives the siblings of v, {v} is the set containing that node, and ∪ joins the sets. The other original comparison uses D(v), the children of v.

F(v) = S(v) ∪ D(v)

Here F(v) is the category set at the parent after pruning. It contains v’s former siblings and its promoted children. The comparison among these alternatives takes the place of the original local sequence for documents that would have gone through v.

For the unpruned configuration, the paper combines the local error bounds for the sibling-group classifier and the child-group classifier. Its calculation adds their finite-sample error bounds and adds the failure-probability allowances. The sum gives a way to reason about the cost of successive decisions. The exact error of a full traversal also depends on whether documents reach each local decision and on how the errors at different stages overlap.

E(hₘˢ′) + E(hₘᴰ) ≤ E(h∞ˢ′) + E(h∞ᴰ) + G_S′(v)(ε) + G_D(v)(ε)

Here hₘˢ′ and hₘᴰ are the finite-sample classifiers for S′(v) and D(v). Their training sizes are local to those category sets. The symbols h∞ˢ′ and h∞ᴰ denote their limiting classifiers, and E denotes generalization error for the corresponding local problem. The confusion functions for S′(v) and D(v) are written G_S′(v) and G_D(v), and ε is the common positive deviation tolerance.

1 − [Rd²|S′(v)|σ₀ˢ′/(m_S′ ε²) + Rd²|D(v)|σ₀ᴰ/(m_D ε²)]

This is the lower bound on the probability of the combined inequality. The constant R controls the exponentiated scores, d is the dimension and ε is the shared tolerance. The quantities |S′(v)| and |D(v)| count categories, m_S′ and m_D count training examples in the respective local problems, and σ₀ˢ′ and σ₀ᴰ are their largest diagonal inverse-information entries. The terms in brackets express the failure allowances for the two local comparisons.

The paper compares the unpruned configuration with the single fused decision using two conditions. One concerns the mass of documents with a small probability gap. The other concerns the quantities that control the finite-sample tolerance at a fixed probability of failure.

G_F(v)(ε) ≤ G_S′(v)(ε) + G_D(v)(ε)

Here G_F(v) is the confusion function for the fused category set F(v), while G_S′(v) and G_D(v) describe the two original sets. The symbol ε is the positive tolerance in each function. The comparison asks whether the fused decision has at most the combined ambiguity allowance of the original decisions.

|F(v)|σ₀ᶠ/m_F ≤ |S′(v)|σ₀ˢ′/m_S′ + |D(v)|σ₀ᴰ/m_D

Here |F(v)|, |S′(v)| and |D(v)| count the available categories in the fused, sibling and child sets. The quantities σ₀ᶠ, σ₀ˢ′ and σ₀ᴰ are the corresponding maxima from the diagonal inverse-information matrices. The quantities m_F, m_S′ and m_D are the local training sizes. The inequality compares the sample-size and information factors for the fused decision with those for the original pair of decisions.

The authors use these conditions to identify relevant properties of the candidate sets. The conditions concern the allowances for finite-sample error around different limiting classifiers. As a result, favorable values are evidence about the stability of the changed decision, while the limiting classifiers’ own errors also matter to whether pruning improves accuracy. The authors treat the inequalities as a guide to feature design and turn to measured pruning outcomes to learn the decision.

Learn to recognize changes that help

For each of the three category sets, the pruning classifier receives the number of categories, the number of training examples in the set, and the sizes of its largest and smallest classes. The authors relate the extreme class sizes to the amount of information available for estimating the logistic regression parameters. A category with few examples can leave some of those parameters poorly determined. The extreme counts summarize aspects of that problem without requiring the pruning procedure to estimate the limiting Fisher information for every proposed tree.

The confusion function is also unavailable directly, since it depends on limiting probabilities. The authors use two quantities based on pairs of categories as substitutes. The first is average cosine similarity, which measures similarity in direction between class representations. The second is average symmetric Kullback–Leibler divergence between class-conditional multinomial distributions. This divergence measures differences between the distributions associated with the two classes. Symmetrizing it gives the pair a single comparison regardless of the order in which the classes are considered. These features describe the typical resemblance of candidate categories. The theoretical confusion function instead concerns the leading scores for each document.

Learning and applying node pruning

The steps in order.

Learning and applying node pruningStep 1: Describe the original and fused category sets1. Describe the original and fused category setsStep 2: Measure accuracy changes from candidate prunings2. Measure accuracy changes from candidate pruningsStep 3: Label nodes by the direction of change3. Label nodes by the direction of changeStep 4: Train a binary classifier on node features4. Train a binary classifier on node featuresStep 5: Score candidate children in the new taxonomy5. Score candidate children in the new taxonomyStep 6: Prune the strongest positive candidate6. Prune the strongest positive candidateStep 7: Recompute candidates and continue down the tree7. Recompute candidates and continue down the tree

The training examples for this binary classifier are candidate nodes. To obtain a label, the authors compare classifier accuracy with the original local structure and with the candidate node pruned. They use the resulting change in final accuracy and retain cases that meet their thresholds for a positive or negative example. A positive label means the operation improved the end-to-end result by enough to count as beneficial. A negative label means it worsened the result by enough to count as harmful. The classifier learns a mapping from the node features to those labels.

When the authors apply the learned classifier to a new taxonomy, they examine children of the root first. They form a feature vector for each candidate and choose the child with the strongest predicted support for pruning among the positive candidates. After removing it, they compute the candidate features again. The set of siblings has changed, so the fused choices for nearby candidates have changed with it. They continue at that parent until the classifier proposes no more removals there. They then proceed down the tree and apply the same process to its children.

The procedure preserves the ordering of ancestors and descendants among the surviving nodes. A former grandchild can be promoted into direct contact with an ancestor. The operation leaves the surviving nodes on their original sides of the larger tree and keeps the target labels available. The search is greedy. Each choice responds to the tree after previous changes, and the procedure does not try every combination of removals.

Experiments and results

The collections and the split between training and testing

The experiments draw on DMOZ documents from the Large Scale Hierarchical Text Classification challenge, referred to as LSHTC2, and the International Patent Classification collection, referred to as IPC. Both collections assign documents to leaves. IPC is single-label. LSHTC2 is multilabel, and the paper reports an average of 1.02 category assignments, using wording that leaves the denominator imprecise. The theoretical discussion uses a document and a leaf label at a time. The distinction matters when reading reported test error alongside that setup.

The authors describe forming LSHTC2 subsets by partitioning the original hierarchy’s first-layer nodes into disjoint groups. This gives hierarchies with their own branches to train and evaluate on, alongside the separate patent taxonomy. LSHTC2-1 and LSHTC2-2 supply the node examples used to train the pruning classifier. The main classification results are reported on LSHTC2-3, LSHTC2-4, LSHTC2-5 and IPC. The split separates the taxonomies used to teach the pruning rule from those used to test it. Within each collection, the document-level classifiers also use training and test examples.

CollectionDocument training examplesDocument test examplesLeaf classesFeature dimensionsTree depth
LSHTC2-125,3106,4411,789145,8596
LSHTC2-250,55813,0574,787271,5576
LSHTC2-338,72510,1023,956145,3546
LSHTC2-427,9247,0262,544123,9536
LSHTC2-568,36717,5617,212192,2596
IPC46,32428,9264511,123,4974

The document problem differs along several dimensions at once. IPC has fewer leaf categories and a shallower tree than the DMOZ collections, as well as a larger feature space and more test examples than any of the listed DMOZ splits. The authors also characterize its label distribution as relatively balanced. In explaining the DMOZ results, they cite earlier work that found that 80% of the target categories in the hierarchies studied there had fewer than 5 documents. That figure describes the earlier rare-category analysis. It gives context for the comparison, while the experimental table describes the size and structure of the splits used here.

What was fitted and compared

The document classifiers are MLR and support vector machines, abbreviated SVM. According to the paper, the L2-regularized variants use the LibLinear library. L2 regularization penalizes the squared size of the weights. The strength of the penalty is controlled by C, which the authors select by cross-validation. In cross-validation, fitted settings are evaluated on held-out portions of the training data before the final comparison on the test data.

For the node-level training labels, a change receives +1 if pruning raises accuracy by at least 0.1, and −1 if pruning lowers it by more than 0.1. The paper describes the threshold as a way to avoid noisy labels for small changes. It gives the cutoff as 0.1 on its accuracy-change scale without detailing a conversion to the decimal scale in the final error table. The node-training collections have 119 examples with 19 positive and 100 negative cases, 89 examples with 34 positive and 55 negative cases, and 94 examples with 32 positive and 62 negative cases. These counts refer to candidate nodes, while the much larger counts in the collection table refer to documents.

The authors use AdaBoost for the binary pruning classifier, with random forests as base classifiers. A random forest combines decision trees. AdaBoost combines successive classifiers, giving more emphasis during fitting to cases that earlier classifiers handled poorly. The reported selected forest sizes are 20, 50 and 50 trees. The paper describes cross-validation on LSHTC2-1 and LSHTC2-2 for selecting among forest sizes, tree depths and numbers of boosting iterations. The selection considers both accuracy and the false-positive rate. A false positive in this task means recommending a removal whose observed effect was harmful, so this rate has a direct bearing on how the learned procedure changes the taxonomy.

The document-level comparison has four settings. The flat setting, FL, puts every target leaf in the same decision. The fully hierarchical setting, FH, descends the original hierarchy. Random pruning, RN, changes the hierarchy without using the learned pruning decisions. Proposed pruning, PR, changes it by applying the trained node classifier.

In the random baseline, only candidates from the first two levels can be removed, and the authors prune four times, matching the reported average for the learned procedure. They run random pruning independently 5 times per dataset and record the best performance. Selecting the best run gives the baseline the benefit of a favorable random draw. The comparison asks whether the learned selection of nodes improves on that outcome, as well as on classification in the original taxonomy.

Errors on the DMOZ test splits

The main table reports test error as a decimal, with lower values indicating better classification. Its significance symbols use a micro sign test, a paired comparison based on which classifier succeeds on the same examples. In the paper, a single downward arrow denotes a p-value below 0.05, and a double downward arrow denotes a p-value below 0.01. The reported error values give the size and direction of the observed differences. The significance annotations concern the evidence from the paired outcomes.

Logistic regression test error by taxonomy setting on LSHTC2-3

Learned pruning has the lowest error, followed by the original hierarchy.

Logistic regression test error by taxonomy setting on LSHTC2-3Flat: 0.528Flat0.528Random pruning: 0.493Random pruning0.493Fully hierarchical: 0.484Fully hierarchical0.484Learned pruning (this paper): 0.480Learned pruning (this paper)0.480
The numbers
System or settingtest error
Flat0.528
Random pruning0.493
Fully hierarchical0.484
Learned pruning (this paper)0.480

On LSHTC2-3, MLR in the learned taxonomy gave a test error of 0.480. The same classifier family gave 0.484 in the original hierarchy and 0.528 in flat classification. Its best random-pruning run gave 0.493. For SVM on that split, the learned taxonomy gave 0.493, the original hierarchy gave 0.498, and the flat setting gave 0.535. Random pruning reached 0.517. The order is the same for the two classifier families. In this split the original structure beat random pruning, and the learned structure improved on the original.

On LSHTC2-4, the MLR test error was 0.469 with learned pruning and 0.473 with the original hierarchy. The random setting gave 0.478 and the flat setting gave 0.497. For SVM, learned pruning reached 0.472, the original hierarchy gave 0.476, random pruning gave 0.484 and the flat classifier gave 0.501. These results again place the original hierarchy ahead of the flat treatment, with the lowest error coming from the selectively pruned hierarchy.

On LSHTC2-5, learned pruning yielded 0.522 for MLR and 0.523 for SVM. The corresponding errors on the unmodified hierarchy were 0.526 and 0.527. Random pruning produced 0.532 for MLR and 0.536 for SVM, while flat classification gave 0.542 and 0.547. The SVM improvement over the original hierarchy on this split has no significance marker in the table. The numerical ordering favors learned pruning, and the paired comparison is more qualified here than for the corresponding MLR result.

Across the DMOZ test splits, the flat baseline had the highest reported error in each column. The gain from preserving hierarchical decisions is therefore visible before the learned pruning method is applied. Learned pruning then improves the lowest observed error while preserving many of those decisions. This ordering is compatible with the authors’ explanation that a large and imbalanced leaf set benefits from dividing the classification task, while some specific branch choices introduce failure opportunities that can be removed.

Errors on International Patent Classification

Logistic regression test error by taxonomy setting on IPC

Learned pruning has the lowest error, with flat classification close behind.

Logistic regression test error by taxonomy setting on IPCFlat: 0.546Flat0.546Random pruning: 0.547Random pruning0.547Fully hierarchical: 0.552Fully hierarchical0.552Learned pruning (this paper): 0.544Learned pruning (this paper)0.544
The numbers
System or settingtest error
Flat0.546
Random pruning0.547
Fully hierarchical0.552
Learned pruning (this paper)0.544

Support vector machine test error by taxonomy setting on IPC

Flat classification has the lowest error, followed by learned pruning.

Support vector machine test error by taxonomy setting on IPCFlat (this paper): 0.446Flat (this paper)0.446Random pruning: 0.458Random pruning0.458Fully hierarchical: 0.465Fully hierarchical0.465Learned pruning: 0.450Learned pruning0.450
The numbers
System or settingtest error
Flat (this paper)0.446
Random pruning0.458
Fully hierarchical0.465
Learned pruning0.450

IPC changes the ordering. With MLR, flat classification reached 0.546 and the unmodified hierarchy reached 0.552. Learned pruning gave the lowest error, 0.544, and random pruning gave 0.547. The numerical advantage of learned pruning over the flat MLR result is small, and the table gives no significance marker for that comparison. The original hierarchy had higher error than every alternative in this MLR column.

With SVM, the strongest IPC result was the flat classifier’s 0.446. Learned pruning reached 0.450, random pruning reached 0.458, and the original hierarchy reached 0.465. The learned changes thus improved the top-down classifier while leaving flat classification ahead on the reported metric. This matters to the paper’s overall claim. A learned structure can be better than the original one even in a collection where the best choice for a particular classifier is to make the decision directly at the leaves.

What the ablations show

The paper has no feature-removal ablation of the pruning classifier. Its analyses compare complete taxonomy settings and examine two quantities from the generalization discussion, allowing narrower conclusions about the role of classifier structure and the choice of nodes.

Training error and tree structure favor different choices

The authors tabulate a complexity ratio by taking the branching contribution for the hierarchical setting and dividing it by the corresponding flat contribution. They use the same constants for both sides. They also report a ratio of hierarchical to flat empirical error with a linear SVM. The former is a structural diagnostic from the bound. The latter is an observed training quantity. Neither is the final test error, and the empirical error ratio does not by itself reproduce the surrogate margin loss in the bound.

CR = [∑ᵥ∈V∖Y |D(v)|(|D(v)| − 1)] / [|Y|(|Y| − 1)]

Here CR is the complexity ratio, v ranges over the internal nodes V∖Y, and |D(v)| counts the children of v. The quantity |Y| is the number of target leaves. The denominator is the branching contribution of the flat root, where every target is a child. The factors shared between the hierarchical and flat complexity terms cancel in this ratio.

The ratios reveal why looking at one term alone leads to an incomplete account. On LSHTC2-3 the complexity ratio is 0.004, while the hierarchical-to-flat empirical error ratio is 2.65. On LSHTC2-4 the corresponding values are 0.005 and 1.8. On LSHTC2-5 they are 0.002 and 2.12. The structural term favors hierarchy on all these splits, while the training error ratio favors flat prediction. On those same test splits, the original hierarchy achieves lower error than the flat classifier.

IPC also has a structural advantage for the hierarchy, with a complexity ratio of 0.02. Its empirical error ratio is 12.27. That larger training disadvantage accompanies the reversal in the comparison of the original hierarchy with flat classification on the IPC test set. Read together, the ratios illustrate the competition between the terms. Their different denominators and scales prevent interpreting them as values to be directly subtracted or using either as a threshold for architecture selection.

The comparison supports the proposed explanation without isolating class imbalance as a cause. IPC differs from the DMOZ splits in depth, label count, feature dimension and labeling setup as well as balance. The earlier evidence about rare categories helps explain why the authors emphasize imbalance. A controlled change to balance within a fixed taxonomy would address a different question from the one these comparisons answer.

Node selection matters beyond shortening paths

The comparison with the original tree asks whether the learned modifications are beneficial as a group. The comparison with random pruning asks whether choosing the removals is useful when a similar number of intermediate decisions are removed. On the DMOZ splits, the original hierarchy consistently beats random pruning. Removing intermediate decisions can therefore sacrifice a valuable grouping of candidates. The learned changes give lower errors than the original structure in those same experiments. The ordering indicates that the choice of nodes matters in this setup.

Random pruning fares better relative to the original hierarchy in IPC. For both classifier families, the randomly shortened tree has lower error than the full tree, and the learned pruning setting has lower error still. In this collection, a reduction in the required intermediate decisions can help even under a random selection of candidate nodes. The flat SVM result shows how far that observation can be taken here. The learned method improves the hierarchical route, while making all IPC target labels available in a single decision gives the lowest SVM error.

The random baseline is controlled in the approximate number of operations and is restricted to early levels. It represents the best of the random runs, rather than their average. The paper consequently shows how the learned rule compares with a favorable random outcome under that procedure. It gives little evidence about the variability of random pruning or whether a learned rule’s advantage is concentrated in choices near the root.

The results also leave open which pruning features matter most. The procedure is trained with category counts, class sizes and similarity measures together. Success across held-out hierarchies shows that the combined representation and classifier can be used to select helpful changes in those cases. The comparisons cannot identify whether the same ordering would arise from the size features alone, whether both similarity measures contribute, or whether the thresholds used to label pruning examples are important to the resulting tree. The theory motivates those features by identifying quantities associated with decision instability. The experimental comparison evaluates them as part of a single selection procedure.

Limitations

Limits identified by the authors

The authors describe the kernel-based generalization bound as impractical for picking nodes individually. Evaluating the relevant training loss for each alternative would require fitting many classifiers in large taxonomies. The result offers an account of a tradeoff and a way to characterize a tree’s structural contribution to it. Applying that result directly as a search objective would still require knowing how well the classifier fits after each change.

The authors also caution that the local logistic regression bounds rely on a union bound and are unlikely to be tight enough for direct use. Adding failure allowances is convenient when several decisions can go wrong, but it can overstate the combined probability when the failure events overlap. The practical method therefore uses class sizes rather than the inverse information quantities and similarities rather than the theoretical confusion functions. The experiments assess a learned approximation built from those proxies.

The final discussion suggests that the analysis could help grow a hierarchy from a large category set. The method evaluated in the paper starts with a known hierarchy and removes nodes. It can expose a child to new competitors by promoting it, but the experiment does not test how to choose parents and branches from an initially unstructured set of categories.

Limits of the theoretical setup

The first bound is a high-probability upper bound. A lower bound value for one classifier family under particular conditions does not establish an ordering of the classifiers’ actual errors. The training term involves the margin and the chosen surrogate loss, and the complexity term contains both constants and the branching contribution. The ratios in the experiments illustrate the two forces. Using them to predict the winner on another dataset would require evidence on how the resulting losses behave there.

The treatment also assumes a rooted tree and a top-down rule that commits to one branch at a time. The introduction recognizes that taxonomies can have a more general directed acyclic graph structure. A category with multiple parents can be reached through several routes, changing how correctness depends on intermediate decisions. The tree analysis likewise leaves open what happens if a classifier retains several plausible branches or makes decisions that can revise an earlier choice. Those variants change the role of the route margin and of an early error.

The analysis of logistic regression depends on the bounded scores, maximum-likelihood behavior, asymptotic assumptions and diagonal information treatment used in the derivation. The finite-sample excess term is relative to the limiting classifier within that family. Stability around that reference leaves open whether the family adequately represents the task. There is also a difference between a small probability-gap term for a particular local classifier and an improvement when its decisions are substituted into an entire route. In the experimental SVM setting, the pruning features carry over as empirical descriptors inspired by logistic regression. The paper does not derive the same posterior analysis for SVM.

The published conditions for a beneficial pruning compare finite-sample terms. The limiting errors also appear in the comparison and can change when the candidate sets change. Suppose the removed node had reliably grouped documents whose children are difficult to distinguish from the node’s former siblings. The fused decision could be stable in the finite-sample sense while still making systematic mistakes. This is a reason to regard the learned rule and its observed accuracy changes as essential to the method, even when the proposed bounds are informative about the relevant variables.

Limits of the empirical evidence

The conclusions concern the taxonomies actually studied and comparisons with earlier results characterized in the paper. The held-out DMOZ splits still come from DMOZ, so their usefulness as tests is strongest for branch groups from the same collection. IPC provides evidence on a different taxonomy and a different kind of document. It is one such test of transfer. The experiments do not vary class balance while holding other structural and dataset properties fixed. That limits the strength of a general rule based on balance alone.

The reported main metric is aggregate error. There is no result broken down by leaf frequency or path position. The authors connect their results to rare categories, but the table cannot reveal how much of the gain comes from those categories, whether it comes from fewer early errors, or whether pruning changes performance unevenly across the surviving branches. The paper also leaves the multilabel scoring convention for LSHTC2 underdescribed. Its results can be compared within the reported evaluation, while a reader trying to reproduce them would need the precise rule for how several acceptable or assigned leaf labels were handled.

Some additional details of the experimental report limit reconstruction. The text describes creating 4 LSHTC2 datasets, while the collection table lists splits from LSHTC2-1 through LSHTC2-5. The table identifies the splits used in the comparison, but the relationship between the stated number created and all the listed splits is unclear. The training discussion reports three node datasets and three selected forest sizes, while the main results table presents MLR and SVM columns. The counts and settings can be quoted as reported. The mapping of every node dataset and setting to the individual columns is underdescribed.

Finally, the prose characterizes the improvements over the original and random hierarchies as statistically significant in broad terms. The table marks specific comparisons and leaves at least one numerical gain over the full hierarchy unmarked, as with SVM on LSHTC2-5. The most precise reading follows the individual results. Learned pruning improves the reported errors over the original hierarchy throughout the table, with statistical evidence that varies by comparison and with the flat SVM ahead on IPC.

What came after

A later citing paper, Learning Taxonomy Adaptation for Large-Scale Classification, takes learning to adapt a taxonomy as its subject. That is the problem the earlier paper formulates through node pruning. It treats the arrangement of intermediate decisions as something to learn from classification outcomes, while the leaf categories continue to define the prediction target. The citation and the later title establish that connection in scope. They leave the later work’s particular adaptation operations, training procedure and measured results unspecified.

Cite

Cite as Rohit Babbar, Ioannis Partalas, Eric Gaussier and Massih-Reza Amini. 2013. On Flat versus Hierarchical Classification in Large-Scale Taxonomies. NIPS 2013.

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{babbar2013flat,
  title = {{On Flat versus Hierarchical Classification in Large-Scale Taxonomies}},
  author = {Rohit Babbar, Ioannis Partalas, Eric Gaussier and Massih-Reza Amini},
  booktitle = {NIPS 2013},
  year = {2013},
  url = {https://papers.nips.cc/paper/2013/hash/cbb6a3b884f4f88b3a8e3d44c636cbd8-Abstract.html}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/babbar-2013-flat-versus-hierarchical-classification-taxonomies/