---
title: 'KABC: Bandit Clustering & Kaczmarz Acceleration'
url: https://www.emergentmind.com/topics/kabc-algorithm
type: topic
---

# KABC: Bandit Clustering & Kaczmarz Acceleration

The acronym KABC refers to distinct algorithms in two research domains: (1) **Kernel-based Adaptive Bandit Clustering** for nonparametric clustering with bandit feedback, and (2) **Kaczmarz Algorithm Based on Clustering** for accelerating iterative solvers for linear systems. Both methods exploit clustering structure—either of probability distributions or matrix rows—to improve statistical or computational efficiency. The following sections distinguish these two frameworks, detail their methodologies, formal properties, and elucidate core contributions.

## 1. Problem Setting and Motivation

### 1.1 Nonparametric Kernel Clustering with Bandit Feedback

The task is to partition the arms of an $N$-armed stochastic bandit according to their underlying distributions, grouping two arms if and only if they share the same distribution. At each round $t$, the learner selects arm $A_t \in [N]$ and observes $X_t \sim P_{A_t}$. The goal is to output a clustering $\mathcal{C}_\tau$ after $\tau$ samples such that, with probability at least $1-\delta$, $\mathcal{C}_\tau$ equals the true partition $\mathcal{C}^*$ (the $\delta$-PAC guarantee). The objective is to minimize the total number of samples $\tau$ while making no parametric assumptions on the $P_i$ [2601.07535].

### 1.2 Accelerating Kaczmarz for Linear Systems via Clustering

Given a consistent linear system $Ax = b$ with $A \in \mathbb{R}^{n \times p}$, the randomized Kaczmarz algorithm (RKA) projects the iterate $x_k$ onto hyperplanes defined by randomly selected equations. When $A$'s rows cluster directionally, exploiting this structure can accelerate convergence. KABC clusters rows and uses this partition to improve both block Kaczmarz procedures and single-row selection strategies, with demonstrated speedups in high-dimensional Gaussian data [1511.05362].

## 2. Algorithmic Methodology

### 2.1 Kernel Mean Embedding and MMD for Bandit Clustering

A characteristic, bounded kernel $g: \mathcal{X}\times \mathcal{X} \rightarrow \mathbb{R}$ induces a reproducing kernel Hilbert space (RKHS) $\mathcal{H}$. The kernel mean embedding (KME) for each arm $i$ is $\mu_i = \mathbb{E}_{X \sim P_i}[\varphi(X)] \in \mathcal{H}$. The maximum mean discrepancy (MMD) between $P_i, P_j$ is $\|\mu_i - \mu_j\|_{\mathcal{H}}$, with $P_i = P_j$ iff $\mu_i = \mu_j$ for characteristic kernels. Thus, clustering $P_i$'s reduces to clustering KMEs in $\mathcal{H}$ [2601.07535].

### 2.2 Signal-to-Noise Ratio and Thresholding

For reliable clustering, within-cluster variance and between-cluster separation must be balanced. Define arm-wise RKHS variance as $\mathcal{V}_i^* = \mathbb{E}_{X \sim P_i}[\|\varphi(X) - \mu_i\|^2]$ and the minimal signal-to-noise ratio as
$$
\Delta = \min_{i\neq j,\, \mu_i \neq \mu_j} \frac{\mathrm{MMD}(P_i, P_j)}{ \max_{\ell \in \{i,j\}} \sqrt{\mathcal{V}_\ell^*} }.
$$
Empirical quantities for sampling-based confidence bounds are assembled into variance-aware thresholds for two-sample testing [2601.07535].

### 2.3 Clustering in Kaczmarz Methods

KABC for linear systems begins with clustering (e.g., k-means) of the rows $A_i$ into $c$ clusters $C_1, \dots, C_c$. Two implementation variants are developed:

- **Cluster-JL:** Within each iteration, the furthest cluster center (in residual sense) is identified, rows are sampled from this cluster using Johnson–Lindenstrauss (JL) projections to estimate high-residual candidates, and the update proceeds along the maximally violating row.
- **Cluster-Block:** Blocks are formed by selecting one row per cluster. Each block is used as an update direction, and blocks are chosen uniformly at random [1511.05362].

## 3. Formal Algorithmic Description

### 3.1 KABC for Nonparametric Bandit Clustering

The KABC routine employs an adaptive, round-based schedule:

- At each round $k$, per-arm sample size $n_k = \lceil 2^k \ln(8(N^2-N)/\delta_k) \rceil$ and error tolerance $\delta_k = \delta/(4k^2)$.
- For each pair $(i, j)$, empirical KMEs and MMDs are computed, and a variance-aware threshold $B_{ij}(n_k, \delta_k)$ is derived.
- Edges are placed in a similarity graph based on $D_{ij} \leq B_{ij}$; connected components provide a clustering.
- The process terminates when exactly $K$ clusters are found [2601.07535].

### 3.2 KABC for Accelerated Kaczmarz

**Pseudocode:**

*Cluster-JL*:
1. Cluster $\{A_i\}$ into $C_1,\ldots,C_c$.
2. For each iteration, identify the most violating center, sample $s$ rows from the associated cluster using projected norms via JL mapping, and update $x_k$ with the row of maximal projected residual.

*Cluster-Block*:
1. Cluster $\{A_i\}$, sample blocks with one row from each cluster.
2. Iterate updates $x_{k+1} = x_k + A_\tau^{\dagger}(b_\tau - A_\tau x_k)$, with block index $\tau$ chosen uniformly at random [1511.05362].

## 4. Theoretical Properties

### 4.1 Correctness and Sample Complexity for Bandit Clustering

KABC is $\delta$-PAC: with probability at least $1-\delta$, it outputs the correct clustering $\mathcal{C}_\tau = \mathcal{C}^*$. The sample complexity $\tau$ satisfies
$$
\tau \leq 8N \left[ \frac{128}{s_*^2} \vee 1 \right]\ln\left(32(N^2-N)k_*^2/\delta\right)
$$
with $s_*^2$ a variance-aware squared SNR and $k_* = \lceil \log_2(128/s_*^2)\rceil$. The method is adaptive: no prior estimate of $\Delta$ or $\{\mathcal{V}_i^*\}$ is needed [2601.07535].

### 4.2 Acceleration and Convergence for Kaczmarz Variants

In the block Kaczmarz context, the contraction per iteration improves upon random partitions. Specifically, block spectral norm $\beta\leq 1 + c\epsilon$ and minimum eigenvalue $\alpha \geq 1 - \epsilon$ for clustering-based blocks, where $\epsilon$ controls within-block coherence. The contraction factor per iteration $1-\sigma_{\min}^2(A)/((1+\epsilon c)m)$ is strictly smaller than in randomly formed blocks, leading to faster convergence. Empirically, Cluster-JL and Cluster-Block variants halved iteration counts or improved CPU time by 30–40% in synthetic Gaussian problems [1511.05362].

## 5. Computational Complexity and Implementation

### 5.1 Nonparametric Clustering

Time per round for KABC is $O(N n_k)$ for sampling and $O(N^2 n_k)$ for pairwise distance calculations; dominant cost arises for $k\approx k_*$, giving total time $O(N^2/s_*^2)$. Memory requirements are $O(N^2)$, mainly for dot-products and statistics; streaming architectures are feasible. Translation-invariant kernels such as Gaussian RBF meet the required criteria [2601.07535].

### 5.2 Kaczmarz with Clustering

Clustering cost is $O(np c)$ for $n$ rows and $p$ dimensions. Each Cluster-JL or Cluster-Block iteration matches the per-iteration costs of standard Kaczmarz but achieves lower per-iteration contraction by exploiting cluster structure, markedly reducing total iterations for well-clustered data [1511.05362].

## 6. Applications, Limitations, and Practical Remarks

### 6.1 Applications

For kernel-based bandit clustering, target domains include recommendation systems (clustering user distributions), adaptive grouping in medical trials, and other settings where cluster membership is defined by identity of distributions and sampling is expensive [2601.07535].

Clustering-accelerated Kaczmarz methods target high-dimensional linear systems arising in compressed sensing, large-scale regression, or applications where matrix rows exhibit structural redundancy or coherence [1511.05362].

### 6.2 Limitations and Assumptions

- For kernel-based bandit clustering, the number of clusters $K$ must be known, and kernel $g$ must be bounded and characteristic. If between-distribution MMD separation $\Delta$ is arbitrarily small, no finite-time clustering is possible.
- For Kaczmarz with clustering, acceleration critically depends on the presence of cluster structure; otherwise, benefits may be nominal. The analysis assumes block spectral norms and within-block incoherence can be bounded via clustering [2601.07535, 1511.05362].

## 7. Summary Table: Distinctions Between KABC Algorithms

| Domain                                 | Clustering Object                   | Main Technique         |
|-----------------------------------------|-------------------------------------|-----------------------|
| Nonparametric bandit clustering [2601.07535] | Arms/distributions via kernels       | Kernel mean embedding, adaptive MMD tests |
| Accelerated linear solvers [1511.05362]    | Rows of matrix $A$                   | Clustering-guided block/sampling for Kaczmarz |

Both methods demonstrate that pre-clustering and adaptively exploiting cluster structure yield provable and empirical benefits for high-dimensional inference and optimization.

Source: https://www.emergentmind.com/topics/kabc-algorithm