Download paper/pisces.tex from Nabidnur/PISCES: direct link, hf CLI and curl.
- Browser
- Download file 46.9 kB
-
https://huggingface.co/Nabidnur/PISCES/resolve/main/paper/pisces.tex
- Command line
-
hf download hf://Nabidnur/PISCES/paper/pisces.tex
-
curl -L -o pisces.tex https://huggingface.co/Nabidnur/PISCES/resolve/main/paper/pisces.tex
46.9 kB
| \documentclass[10pt]{article} | |
| \usepackage[a4paper,margin=2.2cm]{geometry} | |
| \usepackage[T1]{fontenc} | |
| \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} | |
| \usepackage{microtype} | |
| \usepackage{amsmath,amssymb,amsthm,bm} | |
| \usepackage{booktabs,multirow,array} | |
| \usepackage{graphicx,subcaption} | |
| \usepackage{xcolor} | |
| \usepackage{tikz,pgfplots} | |
| \usetikzlibrary{arrows.meta,positioning,shapes.geometric,shapes.misc,calc,fit,backgrounds,decorations.pathreplacing,patterns,3d,quotes} | |
| \usepackage{Box,Ball}% PlotNeuralNet layer styles (MIT, H. Iqbal), see PLOTNEURALNET_LICENSE | |
| \usepgfplotslibrary{groupplots,fillbetween} | |
| \pgfplotsset{compat=1.18} | |
| \usepackage{algorithm} | |
| \usepackage[noend]{algpseudocode} | |
| \usepackage[numbers,sort&compress]{natbib} | |
| \usepackage[colorlinks=true,linkcolor=pblue,citecolor=pteal,urlcolor=pblue]{hyperref} | |
| \usepackage{cleveref} | |
| \usepackage[section]{placeins} | |
| \definecolor{pnavy}{HTML}{16233F} | |
| \definecolor{pteal}{HTML}{0E8C8C} | |
| \definecolor{plight}{HTML}{9FD3D1} | |
| \definecolor{pmid}{HTML}{3FA7A5} | |
| \definecolor{pblue}{HTML}{3567D6} | |
| \definecolor{porange}{HTML}{DD7A1E} | |
| \definecolor{pred}{HTML}{C4413A} | |
| \definecolor{pgrey}{HTML}{8A94A6} | |
| \definecolor{pbg}{HTML}{EEF2F7} | |
| \newtheorem{lemma}{Lemma} | |
| \newtheorem{proposition}{Proposition} | |
| \theoremstyle{remark}\newtheorem{remark}{Remark} | |
| \input{macros.tex} | |
| \IfFileExists{data/negatives.tex}{\input{data/negatives.tex}}{\def\negrows{}} | |
| \newcommand{\getv}[1]{\ifcsname #1\endcsname\csname #1\endcsname\else\textbf{??}\fi} | |
| \newcommand{\figwhen}[2]{\IfFileExists{#1}{#2}{\fbox{\parbox{0.8\linewidth}{\centering\small figure pending: \detokenize{#1}}}}} | |
| \newcommand{\pct}[1]{$\getv{#1}$\,\%} | |
| \newcommand{\E}{\mathbb{E}} | |
| \newcommand{\R}{\mathbb{R}} | |
| \newcommand{\PISCES}{\textsc{Pisces}} | |
| \title{\vspace{-0.6cm}\textbf{\PISCES: Principal-Axis Splitting Makes Mini-Batch $k$-Means\\Faster and Better than e-means}\\[4pt] | |
| \large ARIES Series --- Technical Report No.\,1} | |
| \author{Aryan\\[2pt]\small ARIES: Aryan's Iterative Efficiency Series} | |
| \date{November 2026} | |
| \begin{document} | |
| \maketitle | |
| \begin{abstract} | |
| e-means (Bessa et al., Meta FAIR, 2026) replaces Lloyd's full-pass updates with exponential moving averages of | |
| per-cluster sufficient statistics, sets its batch size and step from fitted scaling laws, and re-seeds dead clusters | |
| by splitting busy ones; it matches Lloyd's 25-epoch loss in one tenth of the epochs. | |
| We present \PISCES{} (\emph{Principal-axis Informed Splitting with Consistent closing, Early revival and Sparse | |
| assignment}), which keeps the e-means engine and changes the parts a closed-form analysis says can be improved. | |
| Dead clusters are re-seeded at the two Gaussian half-means of the donor along its top principal axis, | |
| $c\pm\sqrt{2\lambda_1/\pi}\,u_1$, and the donor is the cluster whose split removes the most distortion, | |
| $\tfrac{2}{\pi}N\lambda_1$; both quantities are tracked online by an EMA power iteration at $O(Bd)$ cost. | |
| Splits keep the closing statistics consistent, revival is front-loaded, rows are assigned through an inverted | |
| file over the centroids, and a fused statistics kernel with 8-bit scans and exact re-ranking removes most of the | |
| remaining overhead without changing the algorithm. On the e-means paper's own benchmark (DEEP$^*$\,1M, $k=16{,}384$, | |
| the paper's fingerprint-checked test rows, official \texttt{faiss} code as the baseline), \PISCES{} lowers test | |
| MSE by \pct{dPOne}, \pct{dPThree} and \pct{dPFive} at 1, 3 and 5 epochs and takes | |
| $\getv{tPThree}\times$ and $\getv{tPFive}\times$ the time at 3 and 5 epochs; at 3 epochs it beats e-means at 5 epochs | |
| in $\getv{tPThreeVsFive}\times$ the time. On two held-out datasets never used during development it wins every seed | |
| in $\getv{tPSV}\times$ and $\getv{tPSS}\times$ the time; over all \getv{stripN} paired runs it is better on | |
| \getv{stripWinsP}. Giving e-means the same approximate assignment makes it \emph{worse}, so the gain is not an | |
| engineering shortcut. A full-scale leave-one-out ablation, a scaling study over $k=1{,}024$--$65{,}536$, a downstream | |
| IVF-index evaluation and a mechanism analysis map out where this holds: every algorithmic component pays (two of them only marginally); the | |
| quality gain peaks at tens of rows per cluster and nearly vanishes at $k=65{,}536$, where \PISCES{} still | |
| takes only $\getv{scSixtyFourKT}\times$ the time; the trained IVF index is as good as e-means' at equal search cost; | |
| \cref{lem:gain} predicts the split gain of real clusters; and the \PISCES{} codebook admits $\getv{mechSwapRatio}\times$ | |
| fewer profitable split--merge moves than e-means'. | |
| \end{abstract} | |
| % ------------------------------------------------------------------------------------------------ | |
| \section{Introduction} | |
| Clustering a billion vectors into a million centroids is a daily operation for vector search, data deduplication | |
| and tokenizer training. e-means~\cite{bessa2026emeans} made it an order of magnitude cheaper by streaming | |
| mini-batches, keeping an exponential moving average (EMA) of every cluster's mass $N_j$ and sum $S_j$, setting | |
| batch size and step from power laws fitted on DEEP, and re-seeding clusters whose mass collapses. | |
| Its ablation shows that this \emph{revival} is the single most important component: removing it costs | |
| $+2.97\%$ training MSE, more than the cosine schedule, finalization or $k$-means++ seeding. | |
| Yet revival itself is a heuristic: a donor sampled in proportion to its mass is copied twice with a relative | |
| nudge of $10^{-4}$, so the two copies start on top of each other. | |
| \PISCES{} asks what the \emph{right} split is. For a Gaussian cluster the answer has a closed form | |
| (\cref{sec:math}): the two children belong at the half-Gaussian means along the top principal axis, and the donor | |
| should be the cluster with the largest $N\lambda_1$. The name follows the picture: two fish swimming in opposite | |
| directions along one axis (\cref{fig:geometry}). Our contributions: | |
| \begin{enumerate}\itemsep0pt | |
| \item \textbf{Principal-axis, gain-ranked revival} with an online EMA power iteration (\cref{sec:split}). | |
| \item \textbf{Consistent closing statistics}: splits in the final epoch also split the closing sums (\cref{sec:closing}). | |
| \item \textbf{A revival schedule and re-fitted step law} for the stronger revival (\cref{sec:schedule}). | |
| \item \textbf{Sparse assignment} through an inverted file over the centroids, which helps only | |
| together with principal-axis revival (\cref{sec:sparse}), and two engineering changes that leave the algorithm | |
| unchanged but make it faster: a fused statistics kernel and 8-bit scans with exact re-ranking | |
| (\cref{sec:engineering}). | |
| \item A matched, pre-declared evaluation on the e-means benchmark with 10 seeds, a time-to-quality study, | |
| two held-out datasets and a fairness ablation; then a full-scale leave-one-out ablation, a $k$-scaling study | |
| ($1{,}024$--$65{,}536$), a downstream IVF-index evaluation, a mechanism analysis that tests \cref{lem:gain} on real | |
| clusters, and 24 logged development iterations including every negative result (\cref{sec:analysis}). | |
| \end{enumerate} | |
| \begin{figure}[!htb] | |
| \centering | |
| \resizebox{\linewidth}{!}{\input{figs/arch_cards.tex}} | |
| \caption{\textbf{e-means and \PISCES, side by side.} Inputs at the bottom, the repeated mini-batch block in colour, | |
| zoom-in callouts on the right. Every teal box is a change made by \PISCES; everything grey is the official | |
| e-means recipe, unchanged (batch law, EMA update, cosine schedule). The callouts give the exact rules and their | |
| justification (\cref{lem:half,lem:gain}, \cref{prop:closing}).} | |
| \label{fig:arch} | |
| \end{figure} | |
| % ------------------------------------------------------------------------------------------------ | |
| \section{Background: the e-means recipe} | |
| Given a batch $\mathcal B_t$, e-means assigns each row to its nearest centroid, forms per-cluster counts $n_j$ and | |
| sums $s_j$, and updates mass and centroid with step $\alpha_t$: | |
| \begin{equation} | |
| N_j \leftarrow (1-\alpha_t)N_j + \alpha_t n_j,\qquad | |
| c_j \leftarrow c_j + \frac{\alpha_t n_j}{N_j}\Big(\frac{s_j}{n_j}-c_j\Big). | |
| \end{equation} | |
| The batch is $B=0.035\,k^{0.13}n^{0.88}T^{0.81}$ and the initial step | |
| $\alpha_0=0.824\,k^{-0.46}B^{0.90}n^{-0.45}T^{-0.11}$, annealed by a cosine to $0.1\alpha_0$. Every five batches, | |
| clusters with $N_j<\tau\bar N$ ($\tau=0.1$) are re-seeded by splitting donors sampled $\propto N_j$; the final | |
| centroids are the means of the last epoch's assignments (``closing means''). | |
| % ------------------------------------------------------------------------------------------------ | |
| \section{Method}\label{sec:math} | |
| \subsection{Where should a split put the two children, and who should donate?}\label{sec:split} | |
| \begin{lemma}[Half-Gaussian children]\label{lem:half} | |
| Let $X\sim\mathcal N(\mu,\Sigma)$, $u$ a unit vector and $\sigma_u^2=u^\top\Sigma u$. Splitting by the hyperplane | |
| $u^\top(x-\mu)=0$ gives halves with means | |
| \[ | |
| m_\pm=\E[X\mid \pm u^\top(X-\mu)>0]=\mu\pm\sqrt{\tfrac{2}{\pi}}\;\frac{\Sigma u}{\sigma_u}. | |
| \] | |
| If $u$ is an eigenvector with eigenvalue $\lambda$, then $m_\pm=\mu\pm\sqrt{2\lambda/\pi}\,u$. | |
| \end{lemma} | |
| \begin{proof} | |
| $Z=u^\top(X-\mu)\sim\mathcal N(0,\sigma_u^2)$ and $\E[X\mid Z]=\mu+\Sigma u\,Z/\sigma_u^2$ (Gaussian conditioning). | |
| Hence $m_+=\mu+\Sigma u\,\E[Z\mid Z>0]/\sigma_u^2$ with $\E[Z\mid Z>0]=\sigma_u\sqrt{2/\pi}$; $m_-$ by symmetry. | |
| For an eigenvector $\Sigma u=\lambda u$ and $\sigma_u=\sqrt\lambda$. | |
| \end{proof} | |
| \begin{lemma}[Distortion removed by a split]\label{lem:gain} | |
| For a cluster of $N$ points from $\mathcal N(\mu,\Sigma)$, replacing $\mu$ by the two half-means of | |
| \cref{lem:half} lowers the expected sum of squared distances by | |
| \[ | |
| \Delta(u)=N\,\|m_\pm-\mu\|^2=\frac{2}{\pi}\,N\,\frac{u^\top\Sigma^2u}{u^\top\Sigma u}\;\le\;\frac{2}{\pi}\,N\,\lambda_1, | |
| \] | |
| with equality if and only if $u$ is a top eigenvector $u_1$. | |
| \end{lemma} | |
| \begin{proof} | |
| By the parallel-axis decomposition, the sum of squared distances to $\mu$ equals the sum within each half (to its own | |
| mean) plus $\sum_\pm N_\pm\|m_\pm-\mu\|^2$, with $N_\pm=N/2$; the second term is the reduction. Substituting | |
| \cref{lem:half} gives $\Delta(u)=\tfrac{2}{\pi}N\,\|\Sigma u\|^2/\sigma_u^2$. Writing $u$ in the eigenbasis, | |
| $u^\top\Sigma^2u/u^\top\Sigma u$ is a weighted mean of the eigenvalues with weights $\propto w_i\lambda_i$, hence | |
| $\le\lambda_1$, with equality iff all weight is on the top eigenspace. | |
| \end{proof} | |
| \Cref{lem:half,lem:gain} give both halves of \PISCES' revival rule: split \emph{along} $u_1$ to | |
| $c\pm\sqrt{2\lambda_1/\pi}\,u_1$, and give the free centroid to the cluster with the largest $N\lambda_1$, because | |
| that split removes the most distortion. The placement coincides with the child initialization of | |
| G-means~\cite{hamerly2003gmeans} and the principal-direction splits of PDDP~\cite{boley1998pddp} and | |
| LBG codebook design~\cite{linde1980lbg}; what is new is doing it inside a streaming EMA engine, online, and ranking | |
| donors by the gain of \cref{lem:gain}. | |
| \paragraph{Online axis estimation.} | |
| For every cluster we keep $V_j\in\R^d$ and a scalar $P_j$. For each assigned row with residual $e=x-c_j$ and | |
| projection $p=e^\top u_j$ the batch accumulates $\sum p\,e$ and $\sum p^2$, and with the same step as the centroids | |
| \begin{equation} | |
| V_j\leftarrow(1-\alpha_t)V_j+\alpha_t\textstyle\sum p\,e,\qquad u_j\leftarrow V_j/\|V_j\|,\qquad | |
| P_j\leftarrow(1-\alpha_t)P_j+\alpha_t\textstyle\sum p^2,\qquad \lambda_j\approx P_j/N_j . | |
| \end{equation} | |
| Since $\sum p\,e=(\sum ee^\top)u_j$, each update is one step of power iteration on the cluster's EMA scatter | |
| matrix~\cite{oja1982}; for a stationary cluster $u_j$ converges to $u_1$ at the usual rate $\lambda_2/\lambda_1$. | |
| The cost is $O(Bd)$ per batch, against $O(Bkd)$ for exact assignment, and one extra $k\times d$ array. | |
| \subsection{Consistent closing statistics}\label{sec:closing} | |
| e-means' final centroids are the means of the last epoch's assignment sums $\Sigma_j$ over counts $\nu_j$. When a | |
| donor splits during that epoch, the default keeps $(\Sigma,\nu)$ entirely with the donor, whose position has moved | |
| by $+\delta$, while the child starts from nothing. \PISCES{} splits the closing statistics with the cluster: | |
| $\nu_\pm=\nu/2$ and $\Sigma_\pm=\tfrac{\nu}{2}(\Sigma/\nu\pm\delta)$. | |
| \begin{proposition}\label{prop:closing} | |
| Under the Gaussian model, if the rows accumulated before the split would have been assigned to the two children by the | |
| splitting hyperplane, these are their expected closing statistics: the children's closing means are unbiased for | |
| the new partition, whereas the default biases the donor's closing mean by $-\delta$ and leaves the child's | |
| based only on post-split rows. | |
| \end{proposition} | |
| \begin{proof} | |
| Each half receives $\nu/2$ rows in expectation, with mean $m_\pm=\mu\pm\delta$ by \cref{lem:half}; their sum is | |
| $\tfrac{\nu}{2}(\mu\pm\delta)$ with $\mu=\Sigma/\nu$. | |
| \end{proof} | |
| \subsection{Revival schedule and step law}\label{sec:schedule} | |
| With better splits, more aggressive revival pays off: \PISCES{} uses $\tau=0.2$, checks every batch during the | |
| first 30\% of the steps (then every five), and multiplies e-means' fitted step $\alpha_0$ by $1.4$. The larger step | |
| does \emph{not} help official e-means (\cref{sec:ablation}), so this is an interaction with the new revival, not a | |
| mis-fit of the published law. | |
| \subsection{Sparse assignment}\label{sec:sparse} | |
| In every epoch but the last, rows are assigned through an inverted file (IVF) over the current centroids: | |
| $L=\sqrt k$ coarse cells from a 20-iteration $k$-means on the centroids at the start of each epoch, and $p=\sqrt k/8$ | |
| probes; the last epoch, which builds the closing means, uses $p_{\text{last}}=\sqrt k/4$ probes. A row is then compared | |
| with about $p\,k/L=k/8$ centroids instead of $k$. | |
| \begin{proposition}[Per-batch cost]\label{prop:cost} | |
| Exact assignment costs $O(Bkd)$. Sparse assignment costs $O(BLd+Bpkd/L+kLd)$, i.e.\ $O(Bkd/8)$ for | |
| $L=\sqrt k$, $p=\sqrt k/8$ and $B\gg L$; the index rebuild ($kLd$) is $0.2$\,GFLOP at $k=16{,}384$, $d=96$, against | |
| $12.9$\,GFLOP for the sparse search of a $65{,}536$-row batch. | |
| \end{proposition} | |
| Sparse assignment is not a free win for e-means: given the same index, e-means gets worse (\cref{tab:fair}). With | |
| principal-axis revival it gets better than exact assignment, and probing more cells makes it worse again | |
| (\cref{tab:probes}). We read this as annealing-like noise in the early epochs; this is a hypothesis, not a proven | |
| mechanism. | |
| \begin{figure}[!htb] | |
| \centering | |
| \resizebox{\linewidth}{!}{\input{figs/tensor_flow.tex}} | |
| \caption{\textbf{One \PISCES{} batch as tensors} (PlotNeuralNet style). A batch of $65{,}536$ rows probes 16 of | |
| the 128 coarse cells built over the centroids; the teal slab is the $B\times k/8$ distance tensor \PISCES{} | |
| computes, the faint block around it the $B\times k$ tensor of exact e-means. One fused pass turns labels into the | |
| cluster sums and the axis statistics; the EMA updates centroids and axes, and revival sends the two children of the | |
| best donor back into the next batch's centroids.} | |
| \label{fig:tensors} | |
| \end{figure} | |
| \subsection{Engineering that leaves the algorithm unchanged}\label{sec:engineering} | |
| After sparse assignment, a profile of a 3-epoch run shows 76\% of the time in the IVF scan and 22\% in NumPy | |
| bookkeeping (scatter-adds for the cluster sums, segment sums for the axis statistics, residual gathers). | |
| \textbf{Fused statistics.} One parallel Numba pass over the batch, rows grouped by label, computes e-means' $n_j,s_j$ | |
| and \PISCES' $\sum(e^\top u_j)e$ and $\sum(e^\top u_j)^2$ together: the same quantities (unit-tested), in a different | |
| floating-point summation order. \textbf{8-bit scans with exact re-ranking.} The IVF lists hold 8-bit | |
| scalar-quantized centroids; the 4 best candidates of every row are re-ranked with exact float32 distances. On a | |
| full-scale batch this returns the float32 IVF answer for 100.000\% of rows (99.988\% with 2 candidates). | |
| This matters because approximations that \emph{change} the answer hurt \PISCES{} (fp16 lists, HNSW, \cref{tab:neg}). | |
| Over the 10 report seeds, the final \PISCES{} takes $\getv{engT}\times$ the time of \PISCES{}~v1.0 (the same algorithm | |
| without these two changes), with a paired quality difference of \pct{engD}. Two other ideas returned identical | |
| results without a speed-up (sorting rows by coarse cell; one BLAS product per IVF list): the scan is | |
| compute-bound at the 25--30\,GFLOPS this CPU sustains. \Cref{fig:time} shows where the time goes. | |
| \begin{figure}[!htb] | |
| \centering | |
| \figwhen{data/time_breakdown.dat}{\input{figs/time_breakdown.tex}} | |
| \caption{\textbf{Where the time goes} in one 3-epoch run (cProfile, seed 1, same machine): assignment search | |
| dominates e-means ($\getv{tbOSearch}$\% of $\getv{tbOWall}$\,s). \PISCES{} v1.0 cuts the search with the IVF over the | |
| centroids; the final \PISCES{} removes most of the remaining bookkeeping with the fused kernel and cheapens the scan | |
| with 8-bit codes ($\getv{tbPWall}$\,s in total).} | |
| \label{fig:time} | |
| \end{figure} | |
| \begin{figure}[!htb] | |
| \centering | |
| \input{figs/split_geometry.tex} | |
| \caption{\textbf{The \PISCES{} split.} Two fish swimming in opposite directions: the children of every revival | |
| are placed symmetrically along the donor's principal axis, at the positions that remove the most distortion.} | |
| \label{fig:geometry} | |
| \end{figure} | |
| \begin{figure}[!htb] | |
| \centering | |
| \figwhen{data/splitex0_pts.dat}{\input{figs/split_real.tex}} | |
| \caption{\textbf{The two fish on real data.} Three of the largest clusters of a final \PISCES{} codebook on | |
| DEEP$^*$\,1M, rows projected on their top two principal axes. Red: where e-means puts both children (on the | |
| centroid). Teal triangles: \PISCES' children $c\pm\sqrt{2\lambda_1/\pi}\,u_1$ (\cref{lem:half}). Orange crosses: an | |
| unrestricted 2-means of the cluster (5 restarts). Where one axis dominates (right, $\lambda_2/\lambda_1=\getv{splitexRC}$) both | |
| put the cut across $u_1$; where the cluster is nearly round in its top two axes (left, middle) many cuts are about equally | |
| good and 2-means may pick another direction. The closed form costs no assignment pass at all.} | |
| \label{fig:splitreal} | |
| \end{figure} | |
| \begin{algorithm}[t] | |
| \caption{\PISCES{} (one batch); grey lines are unchanged e-means}\label{alg:pisces} | |
| \begin{algorithmic}[1] | |
| \State \textcolor{pgrey}{draw batch $\mathcal B_t$ of size $B$; step $\alpha_t$ from the fitted law $\times1.4$, cosine-annealed} | |
| \State assign $\mathcal B_t$: IVF, $\sqrt k$ cells, $\sqrt k/8$ probes ($\sqrt k/4$ in the last epoch), 8-bit scan, exact top-4 re-rank | |
| \State \textcolor{pgrey}{$n_j,s_j\leftarrow$ counts and sums per cluster} | |
| \State $a_j\leftarrow\sum_{i\to j}(e_i^\top u_j)e_i$,\quad $q_j\leftarrow\sum_{i\to j}(e_i^\top u_j)^2$\Comment{$e_i=x_i-c_j$; fused with line 3} | |
| \State \textcolor{pgrey}{EMA update of $N_j$, $c_j$}; \quad $V_j\leftarrow(1-\alpha_t)V_j+\alpha_t a_j$, $P_j\leftarrow(1-\alpha_t)P_j+\alpha_t q_j$, $u_j\leftarrow V_j/\|V_j\|$ | |
| \If{revival check (every batch in the first 30\% of steps, then every 5)} | |
| \State $\mathcal D\leftarrow\{j: N_j<0.2\,\bar N\}$; donors $\leftarrow$ the $|\mathcal D|$ largest $P_j$ $(\propto N_j\lambda_j)$ | |
| \For{each (donor $s$, dead $t$)} | |
| \State $\delta\leftarrow\sqrt{2P_s/(\pi N_s)}\,u_s$;\quad $c_s\leftarrow c_s+\delta$,\ $c_t\leftarrow c_s-2\delta$;\quad $N_s,N_t\leftarrow N_s/2$ | |
| \State split closing statistics if in the last epoch (\cref{sec:closing}); copy $u$, halve $V,P$ | |
| \EndFor | |
| \EndIf | |
| \end{algorithmic} | |
| \end{algorithm} | |
| % ------------------------------------------------------------------------------------------------ | |
| \section{Experimental protocol} | |
| \textbf{Benchmark.} The e-means paper's own: DEEP$^*$\,1M (first $10^6$ rows of Deep1B), $k=16{,}384$, test MSE on | |
| the paper's 5{,}000 test rows. Train, validation and test rows are checked byte-for-byte against the SHA-256 | |
| fingerprints shipped in \texttt{faiss/benchs/e\_means/paper\_splits}. Held-out: SPACEV\,1M and SimSearchNet++\,1M | |
| with the paper's held-out rows, never used during development. \textbf{Baseline.} The official | |
| \texttt{faiss.contrib.e\_means.NumpyEmeans} (faiss 1.16.0); \PISCES{} subclasses it and reproduces it bit for bit | |
| with its components switched off (unit test). \textbf{Matching.} Identical starting centroids (the first $k$ rows of a | |
| seeded permutation), same batch law, 4 CPU threads, float32, same machine; every number in | |
| \cref{sec:results,sec:analysis} comes from one session (\texttt{benchmarks/run\_final.sh}), so time ratios are | |
| same-machine, same-load. \textbf{Development discipline.} Every design | |
| decision used validation rows or a proxy (250k rows, $k=4096$); test rows were used only for the reported runs on | |
| report seeds 10--19. \textbf{Statistics.} Paired relative change per seed, bootstrap 95\% CI, Wilcoxon signed-rank. | |
| \textbf{Differences from the paper:} CPU float32 instead of H100 bfloat16, and NumPy instead of CUDA for drawing | |
| the shared starting rows. | |
| % ------------------------------------------------------------------------------------------------ | |
| \section{Results}\label{sec:results} | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{DEEP$^*$\,1M test rows}, $k=16{,}384$, 10 seeds. Change is paired vs official e-means | |
| (negative is better); time ratio is \PISCES{} / official.} | |
| \label{tab:main} | |
| \begin{tabular}{lcccccc} | |
| \toprule | |
| epochs & official MSE & \PISCES{} MSE & change & 95\% CI & wins & time ratio\\ | |
| \midrule | |
| 1 & \getv{mseOOne} & \textbf{\getv{msePOne}} & \pct{dPOne} & [$\getv{loPOne}$, $\getv{hiPOne}$] & \getv{wPOne}/\getv{nPOne} & $\getv{tPOne}\times$\\ | |
| 3 & \getv{mseOThree} & \textbf{\getv{msePThree}} & \pct{dPThree} & [$\getv{loPThree}$, $\getv{hiPThree}$] & \getv{wPThree}/\getv{nPThree} & $\getv{tPThree}\times$\\ | |
| 5 & \getv{mseOFive} & \textbf{\getv{msePFive}} & \pct{dPFive} & [$\getv{loPFive}$, $\getv{hiPFive}$] & \getv{wPFive}/\getv{nPFive} & $\getv{tPFive}\times$\\ | |
| \midrule | |
| \multicolumn{3}{l}{\PISCES{} 3 epochs vs official 5 epochs} & \pct{dPThreeVsFive} & & \getv{wPThreeVsFive}/\getv{nPThreeVsFive} & $\getv{tPThreeVsFive}\times$\\ | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| \begin{figure}[!htb] | |
| \centering | |
| \input{figs/quality_vs_time.tex} | |
| \caption{\textbf{Quality vs wall-clock} on DEEP$^*$\,1M test rows (mean $\pm$ sd over seeds; markers are 1, 3, 5 | |
| epochs). \PISCES{} moves the whole curve down and to the left.} | |
| \label{fig:qvt} | |
| \end{figure} | |
| \paragraph{Main benchmark.} \Cref{tab:main} and \cref{fig:qvt}: \PISCES{} is better than official e-means at every | |
| budget and on every paired seed (\getv{wPOne}/\getv{nPOne}, \getv{wPThree}/\getv{nPThree} and \getv{wPFive}/\getv{nPFive} at | |
| 1, 3 and 5 epochs), in $\getv{tPOne}\times$, $\getv{tPThree}\times$ and $\getv{tPFive}\times$ the time. At 3 epochs it | |
| is better than e-means at 5 epochs on \getv{wPThreeVsFive} of \getv{nPThreeVsFive} seeds, in $\getv{tPThreeVsFive}\times$ | |
| the time. | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{Development history} (DEEP$^*$\,1M test rows, 3 epochs; each version paired with official e-means run | |
| in the same session; v1 to v1.0 from earlier sessions).} | |
| \label{tab:history} | |
| \begin{tabular}{lcc} | |
| \toprule | |
| version & change vs official & time ratio\\ | |
| \midrule | |
| v1: principal-axis, gain-ranked revival & \pct{histOneD} & $\getv{histOneT}\times$\\ | |
| v2: + consistent closing, $\tau=0.2$, step $\times1.4$ & \pct{histTwoD} & $\getv{histTwoT}\times$\\ | |
| v3: + early revival, sparse early epochs & \pct{histThreeD} & $\getv{histThreeT}\times$\\ | |
| \PISCES{} v1.0: + sparse last epoch & \pct{histTenD} & $\getv{histTenT}\times$\\ | |
| \midrule | |
| \PISCES{} v1.0, final session & \pct{histTenNowD} & $\getv{histTenNowT}\times$\\ | |
| \textbf{\PISCES{} (final): + fused kernel, 8-bit scans} & \textbf{\pct{histFinalD}} & $\mathbf{\getv{histFinalT}\times}$\\ | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| \paragraph{Time to quality (validation rows).} Measured against official e-means at 5 epochs: | |
| \PISCES{} at 2, 3 and 4 epochs changes validation MSE by \pct{ttqDTwo}, \pct{ttqDThree} and \pct{ttqDFour} in | |
| $\getv{ttqTTwo}\times$, $\getv{ttqTThree}\times$ and $\getv{ttqTFour}\times$ the time. | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{Held-out datasets} (paper's rows, never used during development), 3 epochs, 5 seeds.} | |
| \label{tab:heldout} | |
| \begin{tabular}{lcccc} | |
| \toprule | |
| dataset & \PISCES{} vs official & wins & time ratio & e-means + same sparse assignment\\ | |
| \midrule | |
| SPACEV\,1M ($d=100$) & \pct{dPSV} & \getv{wPSV}/\getv{nPSV} & $\getv{tPSV}\times$ & \pct{dESV} \\ | |
| SimSearchNet++\,1M ($d=256$) & \pct{dPSS} & \getv{wPSS}/\getv{nPSS} & $\getv{tPSS}\times$ & \pct{dESS} \\ | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| \paragraph{Held-out datasets.} \Cref{tab:heldout}: \PISCES{} wins every seed on both held-out sets and is faster. | |
| The quality gain is large on SPACEV and small on SimSearchNet++, whose 256-dimensional embeddings leave little | |
| room at 3 epochs. | |
| \begin{figure}[!htb] | |
| \centering | |
| \input{figs/ttq_and_seeds.tex} | |
| \caption{\textbf{(a) Time to quality} (validation rows, 5 seeds; \PISCES{} markers are 1, 2, 3, 4 epochs from left to right, e-means markers are 3 and 5 epochs): \PISCES{} reaches e-means' | |
| 5-epoch quality in about a quarter of the time; e-means given the same sparse assignment is faster but worse. | |
| \textbf{(b) Every seed of every evaluation}: \PISCES{} (teal) is left of zero (better) on \getv{stripWinsP} of | |
| \getv{stripN} paired runs; e-means with the same sparse assignment (orange) is right of zero (worse) on | |
| \getv{stripLossE} of \getv{stripNE}.} | |
| \label{fig:ttq} | |
| \end{figure} | |
| \subsection{Is the gain just the sparse assignment?}\label{sec:ablation} | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{Fairness ablation} (DEEP$^*$\,1M test rows, 3 epochs). e-means given the identical sparse | |
| assignment gets worse; \PISCES' advantage over it is larger than over official e-means.} | |
| \label{tab:fair} | |
| \begin{tabular}{lccc} | |
| \toprule | |
| method & change vs official & wins & time ratio\\ | |
| \midrule | |
| official e-means & -- & -- & $1.00\times$\\ | |
| e-means + \PISCES' sparse assignment & \pct{dEAThree} & \getv{wEAThree}/\getv{nEAThree} & $\getv{tEAThree}\times$\\ | |
| \PISCES{} & \pct{dPThree} & \getv{wPThree}/\getv{nPThree} & $\getv{tPThree}\times$\\ | |
| \midrule | |
| \PISCES{} vs e-means + sparse assignment & \pct{dPvsEAThree} & \getv{wPvsEAThree}/\getv{nPvsEAThree} & \\ | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{Component ablations} (full scale, validation rows, 3 epochs; proxy rows marked $\dagger$). | |
| Changes are vs official e-means. Full logs: \texttt{docs/ABLATIONS.md}.} | |
| \label{tab:probes} | |
| \begin{tabular}{lcc} | |
| \toprule | |
| variant & change vs official & time\\ | |
| \midrule | |
| v1: principal-axis gain-ranked revival & $-0.22\%$ & $1.12\times$\\ | |
| v2: + consistent closing, $\tau=0.2$, step $\times1.4$ & $-0.23\%$ (8 seeds) & $1.09\times$\\ | |
| v3 with exact assignment & $-0.17\%$ & $1.14\times$\\ | |
| v3 + sparse assignment, 8 probes & $-0.21\%$ & $0.60\times$\\ | |
| v3 + sparse assignment, 16 probes (\PISCES{} early epochs) & $\mathbf{-0.34\%}$ & $0.66\times$\\ | |
| v3 + sparse assignment, 32 probes & $-0.12\%$ & $0.85\times$\\ | |
| \PISCES{} last epoch sparse, 32 / 64 probes & $-0.30\%$ / $-0.31\%$ & $0.46\times$ / $0.63\times$\\ | |
| \midrule | |
| child offset $\times0.5$ / $\times1.5$ (\cref{lem:half} optimum is $\times1$)$^\dagger$ & $-0.23\%$ / $-0.22\%$ (vs $-0.26\%$) & \\ | |
| donor score $N\,\mathrm{tr}\Sigma$ instead of $N\lambda_1$ (\cref{lem:gain})$^\dagger$ & $-0.09\%$ (vs $-0.26\%$) & \\ | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| \Cref{tab:fair} answers the obvious question: e-means given exactly \PISCES' sparse assignment is \emph{worse} | |
| than official e-means. Sparse assignment alone makes e-means faster but worse; only together with principal-axis | |
| revival does it also help quality, so the quality gain is not a side effect of the faster assignment. \Cref{tab:probes} shows that both lemmas are confirmed | |
| empirically (the theoretical child offset and donor score beat their alternatives) and that sparse assignment has a | |
| sweet spot at $\sqrt k/8$ probes. | |
| % ------------------------------------------------------------------------------------------------ | |
| \section{Analysis: why and when \PISCES{} works}\label{sec:analysis} | |
| \subsection{Every component, removed one at a time, at full scale} | |
| \Cref{fig:loo} removes each component from the frozen \PISCES{} and reruns the full benchmark (DEEP$^*$\,1M, | |
| $k=16{,}384$, validation rows, 3 epochs, 3 seeds); \cref{fig:loo} shows the paired cost of each removal | |
| relative to \PISCES{} itself (positive = worse). | |
| \begin{figure}[!htb] | |
| \centering | |
| \figwhen{data/ablation_seeds.dat}{\input{figs/loo_bars.tex}} | |
| \caption{\textbf{What each component is worth} (full scale, validation rows, 3 epochs; bars: mean paired cost of | |
| removing the component, dots: seeds). Exact numbers, including the change vs official e-means and time ratios, are in | |
| \cref{tab:loo} (appendix).} | |
| \label{fig:loo} | |
| \end{figure} | |
| Three components carry most of the gain: the gain-ranked donor (removing it costs \pct{ablNoGainC}), the | |
| principal-axis split (\pct{ablNoSplitC}) and sparse assignment (exact assignment everywhere costs | |
| \pct{ablExactC} and takes $\getv{ablExactT}\times$ e-means' time instead of $\getv{ablFullT}\times$). The early | |
| revival (\pct{ablNoEarlyC}), the threshold $\tau=0.2$ (\pct{ablTauLowC}) and the re-fitted step (\pct{ablStepOneC}) | |
| each pay about a tenth of a percent, with visible seed-to-seed spread. Two components are within noise | |
| in quality: consistent closing (\pct{ablNoCloseC}; it is kept because it is the correct bookkeeping, | |
| \cref{prop:closing}) and the sparse last epoch (\pct{ablExactLastC}), which is kept for speed ($\getv{ablFullT}\times$ | |
| vs $\getv{ablExactLastT}\times$). Removing the two engineering changes changes MSE by \pct{ablNoEngC}, a single-seed | |
| tie-break effect (\cref{sec:engineering}), at $\getv{ablNoEngT}\times$ the time. | |
| \subsection{Scaling with the number of centroids} | |
| \begin{figure}[!htb] | |
| \centering | |
| \figwhen{data/scaling.dat}{\input{figs/kscaling.tex}} | |
| \caption{\textbf{Scaling in $k$} at $n=10^6$ (validation rows, 3 epochs): (a) paired change in MSE vs official | |
| e-means (up is better), (b) speed-up. Teal: \PISCES{} exactly as frozen for the main benchmark, every setting | |
| unchanged across $k$. Orange: the released defaults, which add two regime rules chosen on these validation runs: | |
| exact assignment below $k=4{,}096$ and no every-batch revival when $B<2k$ (\cref{sec:smallclusters}). Numbers in | |
| \cref{tab:scaling} (appendix).} | |
| \label{fig:kscaling} | |
| \end{figure} | |
| \Cref{fig:kscaling} gives an honest picture with two regimes. \textbf{Speed:} the speed-up grows with $k$, as | |
| \cref{prop:cost} predicts (the exact search grows as $k$, the sparse one as $\sqrt k$): \PISCES{} takes | |
| $\getv{scOneKT}\times$ the time of e-means at $k=1{,}024$ (it is \emph{slower} there; the whole run takes seconds and the | |
| fixed per-batch costs of building the index dominate), $\getv{scFourKT}\times$ at $4{,}096$, $\getv{scSixteenKT}\times$ at | |
| $16{,}384$ and $\getv{scSixtyFourKT}\times$ at $65{,}536$. \textbf{Quality:} the gain grows from \pct{scOneKD} at | |
| $k=1{,}024$ to \pct{scSixteenKD} at $16{,}384$ and then nearly vanishes at $65{,}536$ (\pct{scSixtyFourKD}, | |
| \getv{scSixtyFourKW} of \getv{scSixtyFourKN} seeds). At $k=65{,}536$ and $n=10^6$ a cluster holds about 15 rows and | |
| sees about one row per batch (a Poisson count with relative standard deviation 1), so the EMA counts that decide which | |
| clusters are dead are noisy, and \PISCES' every-batch revival re-seeds \getv{scSixtyFourKSP} clusters against \getv{scSixtyFourKSpO} for e-means. \Cref{sec:smallclusters} | |
| diagnoses this regime. At $k=1{,}024$ the reverse holds: clusters hold about 1{,}000 rows, few die (e-means revives | |
| \getv{scOneKSpO}), and there is little for a better revival to do. There the sparse index does not pay either: | |
| with exact assignment (fused kernel kept) \PISCES{} changes MSE by \pct{scOneKRuleD} in $\getv{scOneKRuleT}\times$ | |
| e-means' time (\getv{scOneKRuleW}/\getv{scOneKRuleN} seeds). The released code therefore applies the $\sqrt k$ sparse | |
| rule only from $k=4{,}096$ on (iteration 23b). This threshold was chosen on these validation runs, so the | |
| $k=1{,}024$ number with the rule is not a held-out result; every other result is unaffected by it. | |
| \subsection{When clusters are small: the limit of every-batch revival}\label{sec:smallclusters} | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{The small-cluster regime} ($k=65{,}536$, $n=10^6$, about one row per cluster per batch; | |
| validation rows, 3 epochs, 3 seeds, paired vs official e-means; iteration 24).} | |
| \label{tab:smallclusters} | |
| \begin{tabular}{lcc} | |
| \toprule | |
| variant & change vs official & revivals\\ | |
| \midrule | |
| \PISCES{} as frozen & \pct{scSixtyFourKD} & \getv{scSixtyFourKSP}\\ | |
| threshold $\tau=0.1$ & \pct{scSixtyFourKTauD} & \\ | |
| no every-batch phase & \textbf{\pct{scSixtyFourKRuleD}} (\getv{scSixtyFourKRuleW}/\getv{scSixtyFourKRuleN}) & \getv{scSixtyFourKRuleSP}\\ | |
| both & \pct{scSixtyFourKBothD} & \getv{scSixtyFourKBothSP}\\ | |
| \midrule | |
| official e-means & -- & \getv{scSixtyFourKSpO}\\ | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| Every-batch revival decides from a cluster's EMA count which clusters are dead. That count is informative only if | |
| a batch carries a few rows per cluster: $B/k=4$ at $k=16{,}384$, but $B/k=1$ at $k=65{,}536$, a Poisson count | |
| with relative standard deviation 1. \Cref{tab:smallclusters} isolates the cause. Revival is not simply too | |
| frequent: the variant that revives least is not better. What hurts is the every-batch phase acting on | |
| one-row counts; without it \PISCES{} gains \pct{scSixtyFourKRuleD} at $k=65{,}536$, on every seed. The released | |
| code therefore enables the every-batch phase only when $B\ge2k$ (iteration 24). Every reported run at | |
| $k\le16{,}384$ has $B/k\ge2$ (the 1-epoch runs sit exactly at 2), so the rule changes nothing else; it was chosen on | |
| these validation runs, so the $k=65{,}536$ number with the rule is not a held-out result. | |
| \subsection{Downstream: the centroids as an IVF index} | |
| e-means exists to train coarse quantizers. We build an \texttt{IndexIVFFlat} with the $k=16{,}384$ centroids over | |
| the same $10^6$ rows and search the 10{,}000 public DEEP1B queries (exact ground truth on the $10^6$ rows; | |
| \getv{ivfSeeds} seeds each, 3 epochs). The cost of an IVF search is the number of distance computations, the | |
| sum of the probed list sizes. | |
| \begin{figure}[!htb] | |
| \centering | |
| \figwhen{data/ivf_official.dat}{\input{figs/ivf_and_sizes.tex}} | |
| \caption{\textbf{(a) Downstream ANN search at equal cost}: recall@1 of the \PISCES{} index minus that of the | |
| e-means index, both read at the e-means index' search cost (log-linear interpolation; probes 1--128, | |
| \getv{ivfSeeds} seeds, 10K DEEP1B queries). \textbf{(b) Starved clusters}: share of the $k=16{,}384$ clusters with | |
| fewer than $s$ training rows (seed 10).} | |
| \label{fig:ivf} | |
| \end{figure} | |
| \Cref{fig:ivf}a: the two indexes are equally good. At the same number of probes the \PISCES{} index has slightly | |
| higher recall (up to \getv{ivfRecGainMax} points), but its probed lists are also 1--3\% longer. At equal search cost | |
| the difference averages \getv{ivfMatchedMean} points (range \getv{ivfMatchedMin} to \getv{ivfMatchedMax} over seeds | |
| and probe settings), and reaching recall@1 $=0.9$ takes $\getv{ivfNdisNineRatio}\times$ the distance computations of | |
| the e-means index. The downstream value of \PISCES{} is therefore an index of the same quality trained in a | |
| fraction of the time, not a better index. The list-imbalance factor $k\sum n_i^2/n^2$ is \getv{ivfImbP} for | |
| \PISCES{} and \getv{ivfImbO} for e-means. Where the codebooks do differ is the starved tail (\cref{fig:ivf}b): e-means | |
| leaves \getv{mechTinyO}\% of its clusters with fewer than 10 rows, \PISCES{} \getv{mechTinyP}\%, because a | |
| starved cluster is exactly what \PISCES' early, every-batch revival re-seeds. Those clusters hold too few rows to | |
| move recall, but they are wasted codebook capacity. | |
| \subsection{Mechanism: what the revival does, and is Lemma 2 true on real data?} | |
| \begin{figure}[!htb] | |
| \centering | |
| \figwhen{data/splits_official.dat}{\input{figs/mechanism.tex}} | |
| \caption{\textbf{(a)} Cumulative revivals during training (DEEP$^*$\,1M, seed 10; dashed line: end of the | |
| every-batch phase). \textbf{(b)} For 400 random \PISCES{} clusters ($\ge20$ rows), the distortion actually removed by | |
| the best split along the top principal axis (teal) and by an unrestricted 2-means (orange), against the | |
| prediction of \cref{lem:gain}.} | |
| \label{fig:mech} | |
| \end{figure} | |
| \Cref{fig:mech}a: \PISCES{} re-seeds \getv{mechSplitsP} clusters in a 3-epoch run against \getv{mechSplitsO} for | |
| e-means, almost all in the first 30\% of the steps, when the codebook is still far from any local optimum. | |
| \Cref{fig:mech}b tests \cref{lem:gain} on real DEEP clusters: the prediction tracks the realized gain of the | |
| principal-axis split (log--log correlation \getv{mechLemCorrP}; median realized/predicted | |
| \getv{mechLemRatioP}; the realized split is a little better than predicted because its cut is refined by a 1-D | |
| Lloyd step and real clusters are not exactly Gaussian). The principal-axis split is also not a compromise: it removes a median | |
| $\getv{mechLemFreeP}\times$ as much distortion as an unrestricted 2-means with five random restarts. Ranking donors | |
| by $N\lambda_1$ therefore ranks them by what a split can actually remove. | |
| \paragraph{How far from swap-optimal is the result?} After training we audit the codebooks for global | |
| split--merge moves: delete cluster $t$ (its rows go to their runner-up centroid; exact cost | |
| $\sum(d_2-d_1)$) and split cluster $j$ along its axis (gain $\tfrac2\pi N_j\lambda_{1,j}$). The e-means codebook | |
| admits \getv{mechSwapsO} profitable moves; the \PISCES{} codebook \getv{mechSwapsP} | |
| ($\getv{mechSwapRatio}\times$ fewer), worth \getv{mechSwapGainP}\% of its MSE. \PISCES' revival does during training | |
| what a post-hoc split--merge search would do afterwards, which is why applying such moves after \PISCES{} gains | |
| almost nothing (iteration 20). | |
| \subsection{Optional: a closing Lloyd polish} | |
| One extra Lloyd step after training (re-assign every row to the closing means with $\sqrt k/8$ probes, recompute | |
| the means) lowers \PISCES' validation MSE by \pct{polOne}, \pct{polTwo}, \pct{polThree} and \pct{polFour} at 1--4 | |
| epochs (every seed). It costs about half an epoch, and in a same-session timing check the polished runs lie on | |
| \PISCES' own time-quality curve: the polish buys what the same time spent training buys. It is therefore an | |
| option (\texttt{polish=1}) for fixed-pass comparisons, not part of the method. | |
| \subsection{Is the Gaussian assumption a weakness?} | |
| \Cref{lem:half,lem:gain} assume Gaussian clusters. We tested two distribution-free replacements, tracked online at the | |
| same $O(Bd)$ cost: the exact half-mean split, children at $c\pm\E[\mathrm{sign}(p)\,e]$ with score | |
| $N\|\E[\mathrm{sign}(p)\,e]\|^2$ (one exact 2-means step of the hyperplane split for any symmetric distribution), | |
| and the empirical axis half-mean $c\pm\E|p|\,u_1$ with score $N(\E|p|)^2$. Both are worse than the closed form | |
| (\cref{tab:neg}, iteration 21). The closed form needs only the second moment along the axis, which the EMA power | |
| iteration estimates with low variance; first-moment estimates mix sign flips of a still-moving axis. On real DEEP | |
| clusters the Gaussian prediction is also accurate (\cref{fig:mech}b), so the assumption costs nothing here. | |
| \subsection{What we tried and did not adopt} | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{Ideas tested and not adopted}, recomputed from the development logs (proxy: DEEP 250k, | |
| $k=4{,}096$, validation rows, 3 epochs, 5 seeds). ``Reference'' is the version the idea was added to; both columns are | |
| paired vs official e-means. Full diagnoses in the experiment log.} | |
| \label{tab:neg} | |
| \begin{tabular}{p{7.2cm}cccc} | |
| \toprule | |
| idea & iter. & reference & with the idea & seeds worse\\ | |
| \midrule | |
| \negrows | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| \Cref{tab:neg}: momentum, threshold and mass schedules, coarse-to-fine growth and other approximate assignments | |
| (HNSW, fp16 lists, probe schedules, explicit annealing) are worse; graph-pruned assignment is equal only because its | |
| self-verification falls back to exact search; streaming swaps do not help consistently and need a 2-NN search. | |
| The pattern behind several of these: the particular errors of float32 IVF with $\sqrt k/8$ probes are part of why | |
| \PISCES{} works, and approximations with \emph{higher} recall (HNSW, more probes, exact search) are worse. | |
| % ------------------------------------------------------------------------------------------------ | |
| \section{Related work} | |
| \textbf{Mini-batch and streaming $k$-means}: online $k$-means~\cite{macqueen1967}, mini-batch $k$-means~\cite{sculley2010}, | |
| EMA codebooks in VQ-VAE~\cite{vandenoord2017}, and e-means~\cite{bessa2026emeans}, which added scaling-law schedules | |
| and revival. \textbf{Splitting}: LBG~\cite{linde1980lbg}, PDDP~\cite{boley1998pddp}, G-means~\cite{hamerly2003gmeans}; | |
| \PISCES{} brings the half-Gaussian split and a distortion-ranked donor into the streaming setting. \textbf{Fast | |
| assignment}: IVF and product quantization in faiss~\cite{douze2024faiss}; the e-means paper itself uses IVF assignment at | |
| billion scale. \textbf{Seeding}: $k$-means++~\cite{arthur2007}, which e-means' ablation shows matters little at scale. | |
| \section{Limitations} | |
| The optimality arguments assume roughly Gaussian clusters. All runs are on CPU float32; the paper's numbers are on an | |
| H100 with bfloat16, so absolute times are not comparable, only ratios on the same machine. The held-out evaluation | |
| uses 5 seeds and 3 epochs; SimSearchNet++'s quality gain is small. The benefit of sparse assignment is an empirical | |
| finding without a proven mechanism. | |
| \section{Conclusion and the ARIES series} | |
| \PISCES{} shows that a classical question, where to put two children when a cluster splits, still pays off inside | |
| a 2026 state-of-the-art clusterer: answered in closed form and estimated online, it makes e-means both better and | |
| faster on e-means' own benchmark. \PISCES{} is the first report of the ARIES series (\emph{Aryan's Iterative | |
| Efficiency Series}); the next ones apply the same discipline (official baselines, the original benchmark, held-out | |
| data, every negative result kept) to robust clustering and IVF partition learning. | |
| {\small | |
| \begin{thebibliography}{12} | |
| \bibitem{bessa2026emeans} S.~Bessa, P.-E.~Mazar\'e, G.~Szilvasy, H.~Touvron, D.~Picard, M.~Douze, H.~J\'egou. | |
| \newblock e-means: outperforming $k$-means (in one-tenth the epochs). \newblock arXiv:2611.09501, 2026. | |
| \bibitem{hamerly2003gmeans} G.~Hamerly, C.~Elkan. \newblock Learning the $k$ in $k$-means. \newblock NeurIPS, 2003. | |
| \bibitem{boley1998pddp} D.~Boley. \newblock Principal direction divisive partitioning. \newblock Data Mining and Knowledge Discovery, 1998. | |
| \bibitem{linde1980lbg} Y.~Linde, A.~Buzo, R.~Gray. \newblock An algorithm for vector quantizer design. \newblock IEEE Trans.\ Communications, 1980. | |
| \bibitem{oja1982} E.~Oja. \newblock A simplified neuron model as a principal component analyzer. \newblock J.\ Mathematical Biology, 1982. | |
| \bibitem{macqueen1967} J.~MacQueen. \newblock Some methods for classification and analysis of multivariate observations. \newblock 1967. | |
| \bibitem{sculley2010} D.~Sculley. \newblock Web-scale $k$-means clustering. \newblock WWW, 2010. | |
| \bibitem{vandenoord2017} A.~van den Oord, O.~Vinyals, K.~Kavukcuoglu. \newblock Neural discrete representation learning. \newblock NeurIPS, 2017. | |
| \bibitem{douze2024faiss} M.~Douze et al. \newblock The Faiss library. \newblock arXiv:2401.08281, 2024. | |
| \bibitem{arthur2007} D.~Arthur, S.~Vassilvitskii. \newblock $k$-means++: the advantages of careful seeding. \newblock SODA, 2007. | |
| \end{thebibliography}} | |
| \appendix | |
| \section{Exact numbers for the analysis figures} | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{Leave-one-out ablation at full scale} (validation rows, 3 epochs, seeds 1--3). Change and time | |
| ratio are paired vs official e-means; ``removal costs'' is paired vs \PISCES.} | |
| \label{tab:loo} | |
| \begin{tabular}{lcccc} | |
| \toprule | |
| configuration & change vs official & removal costs & wins & time ratio\\ | |
| \midrule | |
| \textbf{\PISCES{}} (all components) & \textbf{\pct{ablFullD}} & -- & \getv{ablFullW}/\getv{ablFullN} & $\getv{ablFullT}\times$\\ | |
| \midrule | |
| $-$ principal-axis split (official $10^{-4}$ nudge) & \pct{ablNoSplitD} & \pct{ablNoSplitC} & \getv{ablNoSplitW}/\getv{ablNoSplitN} & $\getv{ablNoSplitT}\times$\\ | |
| $-$ gain-ranked donor (official mass sampling) & \pct{ablNoGainD} & \pct{ablNoGainC} & \getv{ablNoGainW}/\getv{ablNoGainN} & $\getv{ablNoGainT}\times$\\ | |
| $-$ consistent closing statistics & \pct{ablNoCloseD} & \pct{ablNoCloseC} & \getv{ablNoCloseW}/\getv{ablNoCloseN} & $\getv{ablNoCloseT}\times$\\ | |
| official threshold $\tau=0.1$ (instead of 0.2) & \pct{ablTauLowD} & \pct{ablTauLowC} & \getv{ablTauLowW}/\getv{ablTauLowN} & $\getv{ablTauLowT}\times$\\ | |
| official step law ($\times1.0$ instead of $\times1.4$) & \pct{ablStepOneD} & \pct{ablStepOneC} & \getv{ablStepOneW}/\getv{ablStepOneN} & $\getv{ablStepOneT}\times$\\ | |
| $-$ early revival (every 5 batches throughout) & \pct{ablNoEarlyD} & \pct{ablNoEarlyC} & \getv{ablNoEarlyW}/\getv{ablNoEarlyN} & $\getv{ablNoEarlyT}\times$\\ | |
| exact last epoch & \pct{ablExactLastD} & \pct{ablExactLastC} & \getv{ablExactLastW}/\getv{ablExactLastN} & $\getv{ablExactLastT}\times$\\ | |
| exact assignment in every epoch & \pct{ablExactD} & \pct{ablExactC} & \getv{ablExactW}/\getv{ablExactN} & $\getv{ablExactT}\times$\\ | |
| float32 scans, unfused statistics (\PISCES{} v1.0) & \pct{ablNoEngD} & \pct{ablNoEngC} & \getv{ablNoEngW}/\getv{ablNoEngN} & $\getv{ablNoEngT}\times$\\ | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| \begin{table}[!htb] | |
| \centering\small | |
| \caption{\textbf{Scaling in $k$} at $n=10^6$ (DEEP$^*$, validation rows, 3 epochs; $k=16{,}384$ from the | |
| time-to-quality runs, 5 seeds; other $k$, 3 seeds). The sparse-assignment rule ($\sqrt k$ cells, $\sqrt k/8$ and | |
| $\sqrt k/4$ probes) and every other setting are unchanged.} | |
| \label{tab:scaling} | |
| \begin{tabular}{rcccc} | |
| \toprule | |
| $k$ & official val MSE & \PISCES{} change & wins & time ratio\\ | |
| \midrule | |
| 1{,}024 & \getv{scOneKMO} & \pct{scOneKD} & \getv{scOneKW}/\getv{scOneKN} & $\getv{scOneKT}\times$\\ | |
| 4{,}096 & \getv{scFourKMO} & \pct{scFourKD} & \getv{scFourKW}/\getv{scFourKN} & $\getv{scFourKT}\times$\\ | |
| 16{,}384 & \getv{scSixteenKMO} & \pct{scSixteenKD} & \getv{scSixteenKW}/\getv{scSixteenKN} & $\getv{scSixteenKT}\times$\\ | |
| 65{,}536 & \getv{scSixtyFourKMO} & \pct{scSixtyFourKD} & \getv{scSixtyFourKW}/\getv{scSixtyFourKN} & $\getv{scSixtyFourKT}\times$\\ | |
| \bottomrule | |
| \end{tabular} | |
| \end{table} | |
| \section{Reproduction} | |
| All code, data-preparation scripts with fingerprint checks, raw per-run results and the experiment log accompany | |
| this report. \texttt{bash benchmarks/run\_final.sh DATA\_ROOT 4} reruns every number in | |
| \cref{sec:results,sec:analysis} on a 4-core CPU (about six hours); \texttt{python paper/make\_data.py} regenerates every number and figure in this document from the | |
| raw results. | |
| \end{document} | |