- Rating
- 5
- Clarity
- 3
- Confidence
- 4
- Originality
- 3
- Quality
- 3
- Significance
- 3
Read review
Summary
This paper proposes geometric methods (based on the distance bounds from the triangle inequality) that can be used to accelerate the Hartigan-Wong clustering algorithm. The paper uses these distance bounds to prove when some computations which are sequential in the original algorithm can be provably parallelized, allowing faster computations via matrix multiplications. The approach works, and gives significant speedup compared with the sequential Hartigan algorithm as well as Lloyd's algorithm and some of its accelerated variants.
Strengths and weaknesses
-
Strengths
- This opens a new approach on accelerating a classic algorithm for optimizing the k-means criterion. It already seems to work well and may improve as others look at the topic, as Hartigan's algorithm tends to have fewer iterations (which is beneficial for overall efficiency).
- The paper appears to provide plenty of detail so that a practitioner could implement the algorithms described.
- The experimental evidence
- The paper reads fairly well.
-
Weaknesses
- Equation 2 defines the Hartigan cost. In that paragraph, it would be helpful to the reader to explain that the Hartigan algorithm (Algorithm 1) chooses the cluster reassignment that minimizes this quantity (over all point/center pairs). The last sentence (line 80) hints at this but is not clear how Equation 2 fits.
- Line 101 claims that there is a slowdown of 3-10x of Hartigan's algorithm compared to Lloyd's algorithm despite having the same asymptotic complexity. Two comments: first, it strikes me as strange to give a specific numeric speedup factor for "large k and/or high D" without specifying those ranges. Second, couldn't the matrix multiplication algorithm be faster due to fast matrix algorithms (not just finely tuned, but asymptotically faster)? In this case, they do not actually have the same asymptotic complexity; Lloyd's would be faster by a non-constant amount.
- Algorithm 2 uses a number of variables before defining or explaining what they are for.
- On line 120, the notation "/B/ = {1,...,B}" does not make sense (here I'm using /B/ to represent "curly B"). I think B is the cardinality of /B/, but the values of /B/ are not 1 to B, right? Otherwise each batch is just the first B points of the dataset.
- Line 123 refers to the "Hartigan cost" without referring to equation 2 where it is defined as the "Hartigan weighted distance". This is confusing.
- Lemma 4.1 assumes that the reader knows that m is the currently assigned cluster. That is clear if the reader looks at Algorithm 3, but the Lemma should be self-contained (just define what m is).
- Algorithm 3 has a variable on line 17 ("changed") that is set to TRUE, but never initialized or used elsewhere.
- This phrase (line 177) is unclear: "despite technically doing equal or greater work in all cases (bounded by doing 2×the calculations, the batch set and re-calculating all individually).". The "equal or greater work" -- is that an asymptotic measurement? If so, please say that. And the parenthetical note does not really parse for me; I'm not sure what it is saying (e.g. re-calculating all what individually?).
- Definition 4.3 refers to "Algorithm 1, lines 8-22", but there are only 11 lines in Algorithm 1.
- Lines 207-209 refer to L as "leave decisions" and J as "move decisions". It makes more sense to call J "join decisions" (for the letter J, but also because L also represents moves).
- On line 212, since S^- is a strict subset of C_j, it's not necessary to point out that n_j - |S^-| >= 1.
- The lemmas given without proofs in the body of the paper leaves the reader wondering why these are true. The paper could give guidance on why these are true and refer to the appendices for full proofs.
- In Lemma 4.3, it's unclear what "T(b) touches C_j" means. The term "touch' has not been defined. (Indeed, it's still unclear what T(b) means exactly, as Definition 4.3 refers to lines of Algorithm 1 that don't exist.)
- The following terms are used but not defined:
- GEMM
- EMA
- m(i)
- Line 272 - why is "(64-256)" the minimum GEMM size worth calling? Give some justification for these numbers.
- Line 288: shouldn't this be per-batch updates? (It's O(N) across the dataset, but the term "per-batch" implies the cost of one batch, which is of size B.)
- For the results in Figure 1 (on the number of iterations compared to Lloyd's algorithm), do all algorithms begin with the same initialization?
- The results in Table 1 probably use too much precision. I doubt these experiments were run 10^6 times to support 6 digits after the decimal. I
- Timing results given as exponential notation (2^0.9, 2^-5.1) in Table 2 is hard to read and compare. Why not just give decimal or scientific notation?
- It would be good to report not only the wall-clock running time of the proposed algorithm, but also experimental statistics on how often each of the different pruning methods were effective in the proposed algorithm.
- According to Andrew Moore (and others), it is "hardest" to accelerate clustering on data that has a uniform distribution (no natural clusters). Did you try this as a worst-case scenario?
Questions
The questions I posed are listed in the strengths/weaknesses section.
Limitations
Yes
Paper formatting concerns
- Don't use a citation to begin a sentence. This happens in several places.
- Typos:
- Line 50: Hammerly => Hamerly
- Line 60: paralleization => parallelization
- Line 126: "cluster's"
- Line 127 ends a sentence with a colon.
- Line 172: s/deffer it's/defer its/
- Line 308: "...on an Apple M4 Pro"
- Line 322: s/Hartigran's/Hartigan's/
- There are math mode markers in the references ("")
- "Better designing triangle-inequality pruning..." does not parse easily; please reword.
- Several of the algorithm listings have lines that wrap (including comments), making the code harder to read.
- Making the text columns narrow to fit the algorithms means that the text columns can be difficult to read (especially when the math wraps lines).
We thank the reviewer for their careful reading and constructive suggestions. Below we address each point with the specific changes made.
"explain that the Hartigan algorithm chooses the cluster reassignment that minimizes this quantity"
Added after Eq. 2: "Algorithm 1 reassigns xᵢ to the cluster j* = argmin_j Δ²_H(xᵢ, Cⱼ) whenever Δ²_H(xᵢ, Cⱼ*) < Δ²_H(xᵢ, Cₘ), i.e., the greedy move that maximally decreases the k-means objective (Eq. 1)."
"strange to give a specific numeric speedup factor for 'large k and/or high D' without specifying ranges"
Clarified to "k ≥ 32, D ≥ 50" with citation to our Table 3 empirical data.
"couldn't the matrix multiplication algorithm be faster due to fast matrix algorithms?"
Sub-cubic algorithms (Strassen, Coppersmith-Winograd) have large constant factors and are numerically unstable — no production BLAS library uses them (that we are aware of). The constant-factor advantage of GEMM over sequential scalar operations comes entirely from cache-blocking and SIMD vectorization, not asymptotic improvements. We clarify this distinction.
"Algorithm 2 uses a number of variables before defining or explaining what they are for"
We add a notation reference table (Table 2) directly before Algorithm 2, and add inline comments marking where each variable is defined in subsequent subsections.
"the notation 𝓑 = {1,...,B} does not make sense... the values of 𝓑 are not 1 to B, right?"
Correct — 𝓑 indexes positions within the batch, not dataset indices. The batch is a subsequence of [N]; we relabel as 1…B for notational convenience within each batch. Clarified: "𝓑 denotes the ordered set of B point indices selected for the current batch; we index within the batch as b = 1,…,B for notational simplicity."
"Line 123 refers to 'Hartigan cost' without referring to equation 2"
Added explicit "(Eq. 2)" cross-reference. Both "Hartigan cost" and "Hartigan weighted distance" now point to the same definition.
"Lemma 4.1 assumes the reader knows that m is the currently assigned cluster"
Added "where m denotes the index of xᵦ's currently assigned cluster" to the lemma statement.
"Algorithm 3 has a variable 'changed' that is set to TRUE, but never initialized or used elsewhere"
This was a typo/artifact — the
changedflag is used by the outer loop (Algorithm 2) to detect convergence but was incorrectly shown in Algorithm 3's scope. Removed from Algorithm 3; the return value (number of moves) already communicates this to Algorithm 2."'despite technically doing equal or greater work in all cases (bounded by doing 2× the calculations)'"
Rewritten: "The sequential kernel performs at most 2× the arithmetic of a plain Hartigan sweep: once for the batch GEMM distances (O(BkD)), and at most once more for exact recomputation of ambiguous points. In practice <5% of points require recomputation, so overhead is negligible."
"Definition 4.3 refers to 'Algorithm 1, lines 8-22', but there are only 11 lines"
Typo — should reference lines 4–9 (the inner loop computing Δ²ⱼ and argmin). Fixed.
"It makes more sense to call J 'join decisions'"
Agreed. Changed "move" to "join" throughout.
"since S⁻ is a strict subset of Cⱼ, it's not necessary to point out that nⱼ - |S⁻| ≥ 1"
Correct — strict subset already guarantees the denominator is nonzero. Removed the redundant statement.
"The lemmas given without proofs leaves the reader wondering why these are true"
We add a one-sentence proof sketch after each lemma in the main text, e.g., "Proof sketch: follows from repeated application of the triangle inequality to the telescoping sum of centroid displacements (full proof in Appendix C)."
"it's unclear what 'T(b) touches Cⱼ' means"
Defined explicitly: "'T(b) touches Cⱼ' means T(b) either removes b from Cⱼ (b ∈ Lⱼ) or adds b to Cⱼ (b ∈ Jⱼ)."
"The following terms are used but not defined: GEMM, EMA, m(i)"
All now defined at first use:
"why is '(64-256)' the minimum GEMM size worth calling? Give some justification"
Below B ≈ 64, the fixed overhead of a GEMM call (memory allocation, dispatch, thread synchronization) exceeds the arithmetic time for small matrices. Our ablation (Table 5) confirms: fixing B = 64 produces 1.4–9× slowdown from excessive per-batch overhead. The 64–256 range balances GEMM efficiency against drift accumulation.
"Line 288: shouldn't this be per-batch updates?"
Reviewer is correct. The per-batch centroid update cost is O(BD); the O(N) figure refers to the full-epoch aggregate. Clarified: "O(BD) per batch, O(ND) across all batches in one epoch."
"do all algorithms begin with the same initialization?"
Yes — all algorithms share identical k-means++ initial centers per trial (selected externally and shared via intial conditions).
"I doubt these experiments were run 10⁶ times to support 6 digits"
Reduced to 4 significant figures. The 6-digit precision was an artifact of automated CSV export, not meaningful.
"Timing results given as exponential notation (2^0.9, 2^-5.1) is hard to read"
Replaced with decimal seconds. Original motivation was log-scale compression for the wide dynamic range across datasets, but readability suffers — changed.
"report experimental statistics on how often each pruning method was effective"
Added to the ablation appendix. Summary: cross-batch screening eliminates 50–95% of points after epoch 2; of the remainder, the parallel safety path resolves 70–99.9% via bulk GEMM certification. The sequential fallback handles <5% of points in steady state.
"it is 'hardest' to accelerate clustering on data that has a uniform distribution. Did you try this?"
We did not include uniform data in the original experiments. Uniform distributions degrade all triangle-inequality methods equally (Elkan, Hamerly, and ours) because no points can be pruned when all clusters are equidistant — this is well-known in the literature. Our method's relative advantage versus Elkan should be preserved since the parallel safety certification and screening operate on the same bounds. We are happy to add a synthetic uniform experiment in the appendix if the reviewer considers it essential.