Skip to content
#data science Preprint

Efficient Clustering with Provable Guardrails for LLM Inference at Scale

Jul 2026 · 0 citations · 32 references
Computer Science Mathematics

TL;DR

This work proposes a two-stage algorithm that generates initial clusters with Mini-batch K-Means, then greedily selects representatives within each initial cluster -- a step equivalent to the Johnson-Chvatal heuristic for Set Cover over alpha-balls in embedding space.

Abstract

Scaling LLM-based applications to millions of users is bottlenecked by the inference cost and latency of modern foundation models. A natural fix is to cluster the inputs and call the LLM only on cluster representatives, letting other members inherit the output -- but this is only safe if each member is measurably close to its representative. Existing clustering methods do not offer such per-sample quality control at scale: none jointly guarantee a minimal within-cluster similarity, exact matching of categorical attributes, and scalability to tens of millions of samples. We propose a two-stage algorithm that generates initial clusters with Mini-batch K-Means, then greedily selects representatives within each initial cluster -- a step equivalent to the Johnson-Chvatal heuristic for Set Cover over alpha-balls in embedding space. The algorithm enforces the similarity and attribute guardrails exactly by construction, and runs in $O(nd + n^2 d/K)$ time and $O(nd + n^2/K^2)$ memory for $n$ samples, feature dimension $d$, and $K$ initial clusters -- linear in $n$ when $K$ grows proportionally with $n$. We provide benchmarks against common clustering methods on internal and public datasets: our method not only delivers per-sample guardrails but also runs 10-1000x faster and scales to data sizes where most standard methods become intractable. Deployed on 38 million customers for a persona-based recommender, the clustering method cut downstream cost and latency by 50-fold while preserving personalization and unblocked the production launch.

View source

Similar papers

Preprint Aug 2026

The Cost of Adaptivity: Matching Lower Bounds Across Learning Problems

A finite-horizon composition law for Gaussian certification from M independent coordinates, a familywise certifier protecting every coordinate and time up to T pays optimal normalized squared half-width of order log(eM) + log log(e^eT), within the sample-mean-centered rectangular class.

Ibne Farabi Shihab, Adria Binte Habib · 0 citations
Preprint Aug 2026

CoRun: Padding is Simple and Efficient for Deterministic LLM Inference

CoRun is presented, a scheduling-based system that achieves deterministic inference without requiring batch invariance, and employs isolated prefill and fixed-shape batched decode to handle the two stages of LLM inference, respectively, leveraging CUDA graphs for efficient execution and simplified implementation.

Shiju Zhao, Jiacheng Yang, Qi-Hang Chen et al. · 2 citations
Preprint Aug 2026

Shape Mutating Expert Compression:LorExperts and BTExperts

LorExperts is introduced, a router-preserving compression method that clusters experts, keeps one full-precision dominant per cluster, and represents the remaining members as low-rank corrections to their local dominant, and BTExperts is introduced, a tree organization of dominants and corrections that enables inferenc...

Inesh Chakrabarti, Sourjya Roy, B. Bao et al. · 0 citations
Preprint Aug 2026

Online Differentially Private Consistent Clustering

A generic reduction is given that transforms the (sensitive) input stream into a private stream, which is a semi-coreset of the input stream, which implies that any (non-private) online clustering algorithm, run as a post-processing step, can achieve good utility for the original clustering objective.

Edith Cohen, Vadym Doroshenko, Badih Ghazi et al. · 0 citations
Preprint Aug 2026

DIME: Query-Efficient Framework for Membership Inference on Diffusion Models

DIME (Denoiser Ideal Membership Error), a theoretically grounded and query-efficient framework for membership inference on diffusion models, is introduced, which reveals that membership leakage is governed by the denoiser's implicit reconstruction error.

Tue Do, Daniel Alabi · 0 citations
Preprint Aug 2026

Ranked spreadness and sample-based testing

In this note, we introduce the notion of ranked spreadness, a strengthening of the usual spread condition in which the elements of each member can be ordered so that their one-coordinate marginals decay geometrically with their rank. This additional structure removes the dependence on the maximum set size in random-con...

Gaia Carenini · 0 citations

Related blog posts

Microsoft Research Blog Oct 15, 2026

Proof-based general-purpose computing with Magnetar

Zero-knowledge proofs can verify computing results without rerunning workloads or exposing sensitive data. Magnetar helps bring them into the mainstream with support for standard programming languages, major speed gains, and quantum-resistant security. The post Proof-based general-purpose computing with Magnetar appeared first on Microsoft Research.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.