NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Optimal Dynamic Parameterized Subset Sampling

Junhao Gan, Seeun William Umboh, Hanzhi Wang, Anthony Wirth, Zhuo Zhang

TL;DR

This paper introduces the first optimal algorithm for Dynamic Parameterized Subset Sampling (DPSS), achieving linear preprocessing time, constant-time updates, and optimal query times. The authors also reveal a fascinating complexity divide: while the problem is optimally solvable with integer weights, extending it to floating-point weights makes it fundamentally harder—equivalent to solving the long-standing open problem of linear-time integer sorting.

What Problem Does This Paper Address?

Subset sampling is a foundational tool in big data processing, used to reduce data size while preserving statistical properties for tasks like anomaly detection and local clustering. In standard Dynamic Subset Sampling (DSS), items are added or removed, but their sampling probabilities are fixed and independent.

However, real-world applications often require probabilities to change dynamically based on global parameters. This paper defines the Dynamic Parameterized Subset Sampling (DPSS) problem. Here, each item $x$ has a weight $w(x)$, and a query provides parameters $(\alpha, \beta)$ on the fly. The probability of picking an item is globally scaled by the total weight of the set:

$$p_x(\alpha, \beta) = \min \left\{\frac{w(x)}{\alpha\sum_{x\in S} w(x)+\beta}, 1 \right\}$$

This parameterization introduces a major challenge: inter-correlation. Because the denominator depends on the sum of all weights, inserting or deleting a single item alters the sampling probability of every other item in the dataset. Existing optimal DSS algorithms degrade to a sluggish $\Omega(n)$ time per update under these conditions.

Methods

To solve DPSS optimally in the Word RAM model, the authors propose a novel data structure called HALT (Hierarchy + Adapter + Lookup Table). It consists of three main pillars:

  1. Three-Level Sampling Hierarchy: Items are grouped into buckets based on their weights (where weights in a bucket vary by at most a factor of two), and buckets are recursively grouped into higher-level instances. This structure shrinks the effective problem size logarithmically at each level (from $n$ to $\log n$ to $\log \log n$).
  2. Dynamic Adapters: Because queries happen on the fly, adapters dynamically translate the parameterized query instances into a standardized, canonical form at query time. The authors design a "compact representation" for these adapters to ensure they consume only $O(1)$ words of space.
  3. Static Lookup Table: For the final, ultra-small level of the hierarchy, the algorithm uses a precomputed lookup table to answer queries in $O(1)$ time.

To bridge the gap between the standardized probabilities in the lookup table and the actual target probabilities, the framework relies heavily on rejection sampling.

A Key Technical Tool

As a crucial building block for HALT, the authors developed a new, exact algorithm for generating Truncated Geometric random variates in $O(1)$ expected time and $O(n)$ worst-case space. This addresses a frequent oversight in prior sampling literature, which often took fast bounded geometric generation for granted in the Word RAM model.

Datasets

Not discussed in the paper. This is a purely theoretical paper focused on algorithmic design, complexity analysis, and mathematical proofs; no empirical evaluations or datasets were used.

Key Insights and Ideas

  • The Ripple Effect of Updates: The core insight of DPSS is that data updates are globally coupled. The paper elegantly tames this ripple effect by using weight-based bucketing, ensuring that global weight shifts affect buckets predictably rather than chaotic individual items.
  • The Integer vs. Float Divide: The paper exposes a stark computational boundary based on data types. Integer weights allow for bit-manipulation tricks (like finding the highest non-zero bit in $O(1)$ time) that make $O(1)$ updates possible. Floating-point weights break these techniques, fundamentally altering the problem's complexity class.
  • Reduction to Sorting: Proving hardness by reducing Integer Sorting to a deletion-only float DPSS problem is a clever twist. It shows that a truly optimal float-based DPSS sampler is structurally barred by one of computer science's most famous open hurdles.

Key Results

  • Optimal Complexity Bounds: For integer weights, the HALT data structure achieves:
  • Preprocessing Time: $O(n)$ worst-case.
  • Update Time: $O(1)$ worst-case for insertions and deletions.
  • Query Time: $O(1 + \mu_S(\alpha, \beta))$ expected time, where $\mu$ is the expected size of the sampled subset.
  • Space Consumption: Linear, $O(n)$ words.
  • Hardness Proof: The authors proved that if an optimal algorithm existed for deletion-only DPSS with floating-point weights, it would imply an $O(N)$ expected-time algorithm for sorting $N$ integers—a breakthrough that remains an open problem.

Limitations and Future Work

The primary limitation of the proposed optimal algorithm is its strict reliance on non-negative integer weights. If an application inherently demands high-precision floating-point weights, HALT cannot be directly applied without confronting the integer sorting bottleneck.

For future work, the authors suggest exploring approximation algorithms for float-weight DPSS that might bypass the sorting hardness barrier. Additionally, they note that their $O(1)$ truncated geometric random variate generator could have independent utility in fields outside of sampling, such as cybersecurity encryption protocols.

Summary updated

BibTeX
@article{gan2024optimal,
  author = {Junhao Gan and Seeun William Umboh and Hanzhi Wang and Anthony Wirth and Zhuo Zhang},
  title = {{Optimal Dynamic Parameterized Subset Sampling}},
  journal = {Proc. ACM Manag. Data},
  year = {2024},
  doi = {10.1145/3695827},
}
Figure