Abstract
Given a database of bit strings $A_1,\ldots,A_m\in \{0,1\}^n$, a fundamental data structure task is to estimate the distances between a given query $B\in \{0,1\}^n$ with all the strings in the database. In addition, one might further want to ensure the integrity of the database by releasing these distance statistics in a secure manner. In this work, we propose differentially private (DP) data structures for this type of tasks, with a focus on Hamming and edit distance. On top of the strong privacy guarantees, our data structures are also time- and space-efficient. In particular, our data structure is $\epsilon$-DP against any sequence of queries of arbitrary length, and for any query $B$ such that the maximum distance to any string in the database is at most $k$, we output $m$ distance estimates. Moreover, for Hamming distance, our data structure answers any query in $\widetilde O(mk+n)$ time and each estimate deviates from the true distance by at most $\widetilde O(k/e^{\epsilon/\log k})$; for edit distance, our data structure answers any query in $\widetilde O(mk^2+n)$ time and each estimate deviates from the true distance by at most $\widetilde O(k/e^{\epsilon/(\log k \log n)})$. For moderate $k$, both data structures support sublinear query operations. We obtain these results via a novel adaptation of the randomized response technique as a bit flipping procedure, applied to the sketched strings.
Introduction
In fields ranging from computational biology to natural language processing, the ability to compare a query string against a massive database is a foundational operation. These comparisons typically rely on Hamming distance (counting bit mismatches) or edit distance (the minimum number of insertions, deletions, and substitutions required for transformation). However, when these databases contain sensitive information—such as genomic sequences or private medical records—releasing distance statistics poses a significant privacy risk.
Traditional Differential Privacy (DP) mechanisms, such as adding Laplace noise to query outputs, are often insufficient for interactive data structures. An adversary could repeatedly query the same string and average the results to "cancel out" the noise, eventually reconstructing the sensitive underlying data. This paper addresses this vulnerability by introducing the first time- and space-efficient data structures for string distance estimation under the function release model, ensuring $\epsilon$-DP even against an infinite number of queries.
The Challenge of Private String Matching
The core difficulty in privatizing string distances lies in the trade-off between utility, efficiency, and privacy. Standard DP techniques often result in error bounds that grow linearly with the number of coordinates. Furthermore, achieving sublinear query time (faster than a naive scan of the entire database) is notoriously difficult when privacy constraints are introduced.
To overcome these hurdles, the authors move away from output-perturbation and instead focus on privatizing the data structure itself. By ensuring the stored representation of the database is inherently private, any subsequent query—no matter how many times it is performed—remains secure.
Methodology: Sketching and Bit-Flipping
The proposed solution rests on two primary pillars: compact sketching and a novel application of randomized response.
1. String Sketching
Rather than storing the full strings $A_1, \dots, A_m$, the data structure stores "sketches." These are compact representations proportional to a distance threshold $k$. These sketches are designed to preserve enough information to estimate distances up to $k$ while discarding irrelevant global data.
2. Randomized Response (Bit-Flipping)
The "aha" moment of the research is the method used to privatize these sketches. Instead of adding additive noise (like Laplace or Gaussian noise), the authors apply a bit-flipping procedure. Each bit of the sketch is flipped with a specific probability determined by the privacy parameter $\epsilon$. This approach yields an error that is exponentially small relative to the privacy parameter—specifically $O(k/e^{\epsilon/\dots})$—which is a significant improvement over standard mechanisms.
3. Private Longest Common Prefix (DP-LCP)
For the more complex edit distance, the authors develop a private Longest Common Prefix (LCP) subroutine. This uses a tree-based structure where each node contains a private Hamming sketch of a specific string interval. This allows the algorithm to perform binary searches for matching segments privately, facilitating efficient edit distance estimation.
Key Results and Performance
The paper provides two primary algorithms with provable guarantees for privacy, time complexity, and error bounds:
| Metric | Hamming Distance | Edit Distance |
|---|---|---|
| Privacy | $\epsilon$-DP | $\epsilon$-DP |
| Query Time | $\tilde{O}(mk + n)$ | $\tilde{O}(mk^2 + n)$ |
| Error Bound | $O(k/e^{\epsilon/\log k})$ | $O(k/e^{\epsilon/(\log k \log n)})$ |
For moderate values of the distance threshold $k$, these data structures support sublinear query operations. This means they are significantly faster than the naive approach of checking every character in the database, while maintaining rigorous privacy.
Theoretical Insights
- Robustness to Adaptive Adversaries: Because the privacy is "baked into" the sketches during the preprocessing phase, the system does not leak additional information as more queries are made. This makes it robust against adaptive adversaries who might use previous query results to inform future ones.
- The "Nearness" Assumption: The efficiency and utility gains are optimized for cases where the query string is within a distance $k$ of the database strings. This aligns with fine-grained complexity theory, which suggests that significantly faster algorithms for exact or "far" distances are likely computationally impossible under the Strong Exponential Time Hypothesis (SETH).
Limitations and Future Directions
While this work represents a major step forward in private string algorithms, several challenges remain:
- The $k$ Constraint: The current utility guarantees are most effective when the query is "near" the database strings. Estimates for very distant strings may be less reliable.
- Biased Estimators: The bit-flipping procedure produces a biased estimator. While the error is proven to be small, developing unbiased private estimators for these distances is a potential area for future research.
- Space Complexity: The edit distance structure requires $\tilde{O}(mn)$ space, which is higher than the Hamming version's $\tilde{O}(mk)$. Reducing the memory footprint for private edit distance remains an open problem.
Summary updated