Paper commentary
When Is Product Decoding of ECOC MAP-Consistent? Pair Structure and the n-vs-Rest Codes
Product decoding of ECOC is Bayes-consistent only for n-vs-Rest codes
- Problem Sum decoding of error-correcting output codes is known to match the Bayes class only on equidistant codes. Product decoding had no such condition, so it was unclear which codes it could safely use.
- Method The authors compare two classes only through the columns where their code words differ, treating those column votes as a sample. They then check whether that sample is symmetric under swapping the two classes or their complements.
- Results The authors prove that product decoding matches the Bayes class exactly when the code is a union of n-vs-Rest codes. Hadamard codes with M of at least 8 are equidistant but fail this condition.

Figure 2 : Disagreement rate with MAP in the noiseless setting (%, mean over four series). Left: sum; right: product. The sum decoder is0on all equidistant codes (all but logM), the product decoder only on codes with pair structure (1-vs-Rest, 2vR, half-vs-half, Hadamard withM= 4) (Proposition 1 and Theorem 1). n/c: not computed. Half-vs-half has ( M M/2 ) /2 columns (6435 atM= 16, about3×10 8 atM= 32), so only M≤8was computed; having pair structure, its rate is0by the theorem.
Original paper · CC BY 4.0 · Gendo Kumoi · When Is Product Decoding of ECOC MAP-Consistent? Pair Structure and the n-vs-Rest Codes · Original paper figure · Converted the paper's own image file from its arXiv HTML version to PNG.Why the product decoder needs its own answer
Error-correcting output codes turn a multi-class problem into binary ones, with one binary classifier per code column. A decoder then merges the column outputs into one class, and the sum decoder and the product decoder merge them in different ways. For the sum decoder the question already has an answer: it returns the Bayes class exactly when the code is equidistant.
The product decoder had no matching condition, so it was unclear which codes it could safely use.
The stakes are practical, because codes differ a great deal in how many classifiers they need. A 1-vs-Rest code has length M but distance only 2, while the Hadamard code reaches distance M/2 with M-1 columns. Which decoder can be trusted on such short, high-distance codes is therefore a real design question.
Votes turn a class pair into a one-dimensional sample
The key idea is to compare two classes only through the columns on which their code words differ. The product decoder instead passes each vote through artanh, so it behaves like an M-estimator with that influence function.
Let \( \beta = \pi_m - \pi_{m'} \) be the posterior gap between the two classes, and let \( T \) be the set of columns on which they differ. Each vote then equals the same gap plus a bias, \( z_j = \beta + a_j \), where \( a_j = \sum_{k \notin \{m,m'\}} \pi_k \tau_{kj} \). The bias depends only on the background classes, so it does not involve \( \pi_m \) or \( \pi_{m'} \) individually.
Summing the votes gives the sum-decoder difference \( V_m - V_{m'} = \sum_{j \in T} z_j \), while the product-decoder difference is \( L_m - L_{m'} = 2\sum_{j \in T}\operatorname{artanh}(z_j) \).
A background class pulls the sum decision toward whichever of the two classes is closer to it in Hamming distance. The distance identity is \[ V_m - V_{m'} = d(m,m')(\pi_m - \pi_{m'}) + \sum_{k \notin \{m,m'\}} \pi_k\,[d(k,m') - d(k,m)], \] Because artanh is steep near plus or minus 1, confident columns dominate the product decision.
Pair structure is the condition for the product decoder
The single-pair analysis reduces to the function \( \Psi_b(\beta) = \sum_{j \in T} \operatorname{artanh}(\beta + a_j) \), with the background \( b \) held fixed. If \( \Psi_b(0) = 0 \), the product decoder never reverses the MAP order on that pair. If \( \Psi_b(0) > 0 \), a reversal happens on an interval of \( \beta \) just below zero.
A column pairs with another when the second equals the first with the two class entries swapped, or its complement. In agreement-pattern terms, pair structure means the multiset of patterns is symmetric under a sign flip.
Theorem 1 states that the product decoder is MAP-consistent exactly when every class pair has pair structure. It also holds exactly when the code is a union of n-vs-Rest codes. The converse step expands \( \Psi_b(0) \) as a power series and shows that its vanishing for every background forces all odd moments to vanish.
Product consistency implies equidistance, so every product-consistent code is also sum-consistent. The converse fails, since Hadamard codes with M of at least 8 are equidistant but not product-consistent. The sum decoder requires balance only in its first moment, while the product decoder requires the whole vote distribution to be symmetric.
Why Hadamard codes fail the condition
Hadamard codes are the efficient case, and they have no pair structure once M is at least 8. The reason is orthogonality: two distinct columns of a Hadamard matrix have entrywise product summing to zero, so that product has M/2 entries equal to -1. A paired column would need 2 or M-2 such entries, and M/2 equals one of those only when M is 4.
Without pair structure, the product decoder can disagree with MAP on every class pair. For every class pair there exists a posterior at which the product decoder reverses the MAP order. The sum decoder stays MAP-consistent on these codes, because Hadamard codes are equidistant.
For the Sylvester type, the authors give a construction with a reversal margin of at least 0.018175 that does not depend on M. The construction places mass 1/5 on each element of a closed triple of background classes. Local search found worst margins between 0.017 and 0.025 for M from 8 to 64, but the exact worst case is still open.
Checking the theorems on noiseless posteriors
The authors sampled noiseless posteriors from Dirichlet and Gaussian-derived sources, with 200,000 samples per series for most codes. The sum decoder never disagreed on the equidistant codes, and the product decoder never disagreed on the codes with pair structure.
To test the theorem pair by pair, the authors checked 977 class pairs across 49 codes. These two counts give the clearest numerical support for the equivalence, within the codes that were checked.
The same deletion also broke equidistance, so the sum rate rose as well, to 5.26% and 4.48%.
Real classifiers: calibration decides the winner
In the real-classifier experiment, the authors trained logistic regression for each code column on six datasets. The scaling used either one common factor or column-specific factors, and the column-specific case was added after the common-scale runs were seen.
With calibrated columns, the product decoder was 0.3 to 0.4 points more accurate across codes. It was significantly better by McNemar's test in 24 of the 39 cells, and the sum decoder in none. When all logits were multiplied by a common factor of 4, the product advantage widened to 0.9 to 1.8 points, while the product decision stayed unchanged.
The authors link this to how the two decoders weight votes: the product decoder gives heavy weight to confident columns, while sum votes stay within [-1, 1].
Disagreements sat near ties, with the estimated margin about 7% of the overall mean (median). That margin was below the overall mean in 139 of the 156 conditions with at least 20 disagreements.
Limitations
The theory covers only the noiseless setting p = C^T π, so estimation error lies outside it. Under estimated probabilities, even 2vR gave different sum and product decisions, although both agree with MAP in the noiseless setting.
Paper info
- Authors
- Gendo Kumoi
- Venue
- arXiv · Preprint
- First published
- 2026-11-24
- Added
- 2026-11-26
- Updated
- 2026-11-24
- Version
- v1
- arXiv
- 2611.33044
- Category
- cs.LG · cs.IT
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
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.
Abstract
Error-Correcting Output Codes (ECOC) combine binary classifiers by the sum decoder, which totals probabilities, or the product decoder, which totals log-likelihoods. In the noiseless setting, where the binary classifiers output the true posteriors, we ask on which code matrices each decoder always agrees with the Bayes-optimal (MAP) class. For the sum decoder the answer is known: the code must be equidistant (James and Hastie, 1998). We answer the question for the product decoder. Two classes are compared through the votes of the columns on which they differ: the sum decoder decides by their sample mean, the product decoder by an M-estimator with influence function artanh, and each vote is the MAP margin plus a bias determined by the other classes alone. Our main theorem states that the product decoder is MAP-consistent if and only if, for every class pair, the columns on which the two classes differ are matched with the columns obtained by swapping the two classes (or their complements), and equivalently if and only if the code is a union of n-vs-Rest codes. Efficient equidistant codes are therefore excluded: Hadamard codes ($M\ge 8$), which meet the Plotkin bound with $M-1$ columns, have no such pairs, and for the Sylvester type the reversal margin can be at least a constant 0.0182 independent of $M$. All theorems are machine-checked in Lean 4. On six real datasets with estimated probabilities, the product decoder is slightly more accurate when each column is calibrated, and the sum decoder is better when the calibration error differs across columns; in either case the decoders disagree only near ties.
Quote from the paper
Gendo Kumoi (2026). When Is Product Decoding of ECOC MAP-Consistent? Pair Structure and the n-vs-Rest Codes. arXiv:2611.33044v1. https://arxiv.org/abs/2611.33044v1
BibTeX
@misc{kumoi2026when,
title = {{When Is Product Decoding of ECOC MAP-Consistent? Pair Structure and the n-vs-Rest Codes}},
author = {Gendo Kumoi},
year = {2026},
eprint = {2611.33044},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.33044v1}
}