arXiv:2610.30687cs.AROct 2026

Manuscript Offprint

arXiv:2610.30687

HDLouvain: High-Throughput Incremental Clustering for Hyperdimensional Data

Beenish Gul, Mahbod Afarin, Farhat Ahmed, Sumukh Pinge, Tsung-Han Lu, Tajana Rosing, Kevin Skadron

Beenish Gul 1^{1}, Mahbod Afarin 2^{2}, Farhat Ahmed 2^{2}, Sumukh Pinge 2^{2}, Tsung-Han Lu 2^{2}, Tajana Rosing 2^{2}, Kevin Skadron 1^{1}

1^{1}University of Virginia, Charlottesville, USA

2^{2}University of California, San Diego, San Diego, USA

{bg9qq, skadron}@virginia.edu

{mafarin, f3ahmed, springe, tsl012, tajana}@ucsd.edu

Abstract—Modern shotgun proteomics generates tens of thousands of tandem mass spectra per hour, producing hundreds of gigabytes of acquisition data that strain conventional clustering pipelines. Existing approaches face a fundamental tradeoff. DBSCAN and hierarchical clustering (HAC) enable flexible density-based and multi-resolution similarity search respectively, but DBSCAN is unstable across varying data densities, HAC costs O(n2)O(n^{2}), and both yield poor cluster quality. Graph-based methods such as Louvain produce high-quality clusters but scale poorly on streaming data. We observe that Louvain's clustering quality and its poor scalability are not fundamentally at odds, and that the latter can be resolved without sacrificing the former. This observation motivates a framework that integrates Louvain's high-fidelity community detection with the lightweight, bit-parallel similarity computation of hyperdimensional computing (HDC). HDLouvain achieves this by partitioning an initial bootstrap fraction of the stream into precursor-mass buckets and applying Louvain to each bucket's k-NN similarity graph, condensing every resulting community into a single binary hypervector through bitwise-majority bundling rather than the iterative centroid recomputation used by k-means or HAC. New data is then assigned through a fast, GPU-accelerated Hamming-distance lookup, matching each spectrum against representatives in its mass bucket or seeding a new cluster when no match meets the similarity threshold τ\tau, allowing the partition to grow incrementally without re-clustering the full dataset. We evaluate HDLouvain on five PRIDE datasets spanning 0.99 M to 21.13 M spectra, sweeping the bootstrap fraction α\alpha from 0.2 to 0.9, and find that it exposes an explicit and monotonic throughput-fidelity trade-off rather than a single operating point. On PXD003258, the largest dataset in the runtime sweep, speedup ranges from 4.5×4.5 \times at α=0.3\alpha = 0.3 to 1.65×1.65 \times at α=0.7\alpha = 0.7. Across the swept datasets, modularity rises monotonically from 0.75–0.76 at α=0.2\alpha = 0.2 to 0.95–0.97 at α=0.9\alpha = 0.9, and never falls more than 8% below full static recomputation. Independently of α\alpha, the Louvain community-detection stage scores 0.86–0.93 normalized mutual information (NMI) on LFR benchmark networks with planted ground truth from 30k to 2M nodes, whereas DBSCAN and HAC degrade to 0.57.

Index Terms—Hyperdimensional computing, incremental clustering, streaming data, community detection

I. INTRODUCTION

Mass spectrometry (MS)-based proteomics has become indispensable for drug discovery, biomarker identification, and personalized medicine [1]. Modern mass spectrometers produce tens of thousands of tandem mass spectra per hour, and public repositories such as MassIVE and PRIDE now host hundreds of terabytes of raw spectral data, with submission rates growing by an order of magnitude over the past decade [2]–[5]. Spectral clustering is the standard strategy for taming this redundancy. It groups highly similar spectra together and represents each group with a single consensus spectrum. Clustering shrinks the dataset, speeds up database search, and lets unidentified spectra be identified by association with similar spectra in the same group [6]. However, as data generation outpaces available compute resources, clustering itself has emerged as the primary bottleneck.

This is a big-data problem rather than a modeling one, since the algorithmic ingredients are standard and what breaks at repository scale is data management. Volume rules out exact clustering, as the dense distance matrix over the 21 million spectra of a single PRIDE submission holds 4.46×10144.46 \times 10^{14} entries, some 446 TB at one byte each. Velocity is even more problematic, because a method whose per-spectrum cost grows with the volume already ingested accumulates Θ(n2)\Theta(n^2) work against a Θ(n)\Theta(n) time budget and so falls irrecoverably behind acquisition. Sustained ingestion demands a per-item cost independent of cumulative volume.

Challenge 1 – The scalability-quality trade-off in static clustering. Existing MS clustering tools occupy opposite ends of a quality-speed spectrum. Graph-based and hierarchical methods such as MaRaCluster [7] and hierarchical agglomerative clustering (HAC) [8] cluster well but scale poorly, since exhaustive all-pairs comparison is O(n2)O(n^{2}) and even accelerated variants take hours to days at repository scale [9], [10]; approximate methods such as msCRUSH [9] and Falcon [11] trade fidelity for runtime. Hyperdimensional computing (HDC) offers a middle ground, encoding each spectrum as a binary hypervector so that similarity reduces to a bit-parallel XOR and popcount, which sustains high throughput on GPUs and FPGAs [10], [12]. Its known weakness is that cluster quality depends heavily on prototype initialization, and random seeding yields unstable partitions [13]. In short, fast HDC methods lack a principled way to discover clusters, while high-quality graph methods cannot keep pace with streaming data.

Challenge 2 – The absence of incremental clustering for continuous acquisition. A second, largely unaddressed limitation is that every scalable HDC-based MS tool to date (HyperSpec [10], SpecHD [12], RapidOMS [5], and SmartMS [1]) operates in a static, batch-oriented mode that requires the entire dataset up front, whereas spectra arrive continuously from the instrument and re-clustering from scratch on every batch is prohibitively expensive. The classical alternatives do

Figure

Fig. 1: The HDLouvain pipeline. Offline (①–④): spectra are HD-encoded into binary hypervectors, bucketed by precursor mass, and clustered per bucket by Louvain on a k-NN graph; each community is then bundled once into one representative hypervector. Online (⑤): each new spectrum is bucketed by Eq. (2), encoded, and matched by XOR/popcount against that bucket's representatives only, or seeds a new cluster when no match is found.

not help, since DBSCAN [14] and HAC [8] were designed for static datasets and their naive online adaptations drift in quality as clusters grow. Louvain is likewise a batch algorithm, because modularity optimization assumes a fixed graph and sweeps repeatedly over all nodes. Incorporating new spectra therefore means either rebuilding the k-NN graph and re-running Louvain at full offline cost, or using dynamic variants that hold quality only under modest perturbations and still recompute per batch. Neither sustains the arrival rate of a running instrument.

We propose HDLouvain, a hybrid incremental clustering framework that decouples cluster discovery from cluster assignment. Discovery is a single upfront investment made with Louvain [15], a modularity heuristic that runs in near-linear time and needs neither a predefined cluster count nor density parameters [16], [17]. HDLouvain treats the offline/online split as a tunable parameter α\alpha rather than a fixed design choice, and we evaluate α∈{0.3,…,0.7}\alpha \in \{0.3, \ldots, 0.7\} for runtime and α\alpha from 0.2 to 0.9 for clustering quality to characterize the trade-off between upfront discovery cost and online assignment quality. Each discovered community is then bundled into a single binary representative hypervector in one pass at the end of the offline phase. This is the only prototype computation HDLouvain performs; unlike k-means or HAC-based pipelines [18], the representative is never recomputed as the stream grows, so per-spectrum online cost is set by the bucket's representative set rather than by the volume already ingested.

Fig. 1 summarizes the pipeline as five stages across an offline and an online phase. Offline, spectra (①) are encoded into binary hypervectors by ID-Level HD encoding (②), sorted by precursor m/z, and partitioned into buckets (③) that confine pairwise comparisons to mass-compatible candidates and avoid the global O(n2)O(n^{2}) cost; within each bucket a k-NN graph is built, Louvain recovers high-modularity communities (④), and each is condensed into one representative hypervector. Online (⑤), each new spectrum is mapped to its bucket by Eq. (2), encoded, and compared against the representatives of that bucket only by Hamming distance, joining the closest one within threshold τ\tau or else seeding a new cluster. Novel spectra, for example, peptides absent from the offline partition, are therefore absorbed without a re-run of Louvain, and because assignment touches only bucket-local representatives, per-spectrum cost scales with the size of that representative set rather than with the dataset.

In summary, our contributions are as follows:

• A hybrid algorithm that unifies community detection and HDC. To our knowledge, HDLouvain is the first framework to seed an HDC clustering pipeline for mass spectrometry with Louvain community detection. Louvain supplies the cluster membership HDC lacks a principled way to discover, and bundling turns it into a bit-parallel prototype in a single pass over the bootstrap data.

• An incremental clustering design for streaming spectra. A bucket-local scheme confines Louvain to a one-time offline phase and performs all online assignment by GPU XOR/popcount against cluster representatives, with bit-packing cutting per-spectrum cost 32-fold and no full re-clustering.

• A characterization of the throughput–fidelity trade-off. On five MS proteomics datasets spanning 0.99 M to 21.13 M spectra, HDLouvain reaches 3.21×3.21 \times over static Louvain at 50/50 bootstrap/incremental and 4.5×4.5 \times at 30/70 on the four evaluated datasets, with the bootstrap fraction α\alpha acting as a single monotonic knob on the trade-off. Its Louvain stage scores 0.86–0.93 NMI (Normalized Mutual Information) on benchmarks, while DBSCAN and HAC collapse to 0.57 beyond 30k nodes and fall three orders of magnitude below Louvain under ARI (Adjusted Rand Index). Measured on the MS data rather than only on synthetic graphs, modularity climbs from 0.75–0.76 at a 20% bootstrap to 0.95–0.97 at 90% and never falls more than 8% below full static recomputation, bounding the fidelity cost of the decomposition.

References (38)