SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.01877 · ICML · 2023

Fast Private Kernel Density Estimation via Locality Sensitive Quantization

Tal Wagner, Yonatan Naamad, Nina Mishra

arXiv · PDF · Open in the Atlas

Code that ran

1 of 3 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2307.01877.json · badge: /api/ran/2307.01877.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
talwagner/lsq canonical (classifier label)
classifier basis: classifier_2025
1 ran · 2 no recorded run
FunctionStatusWhere it lives
LSQ_RFF Ran
ran on a synthesized input
talwagner/lsq/lsq.py
code served (permissive licence) · get_code("323cf395adeba091")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class LSQ_RFF:

    def __init__(self, dataset, dimension, reps):
        self.n = None
        self.d = dimension
        self.reps = reps
        self.rff = np.sqrt(2) * np.random.normal(0, 1, (self.d, self.reps))
        self.rff_shift = np.random.uniform(0, 2 * np.pi, self.reps).reshape(1, -1)
        self.rff_kde = None
        self.sanitized_rff_kde = None
        self.sketch_dataset(dataset)

    def sketch_dataset(self, dataset):
        self.n = dataset.shape[0]
        self.rff_kde = np.mean(self.apply_rff(dataset), axis=0)

    def apply_rff(self, m):
        return np.sqrt(2) * np.cos(np.dot(m, self.rff) + self.rff_shift)

    def sanitize(self, epsilon):
        self.sanitized_rff_kde = self.rff_kde + np.random.laplace(0, np.sqrt(2) * self.reps * 1.0 / (epsilon * self.n), self.reps)

    def non_private_kde(self, queries):
        return 1.0 / self.reps * np.dot(self.rff_kde, self.apply_rff(queries).T)

    def private_kde(self, queries):
        return 1.0 / self.reps * np.dot(self.sanitized_rff_kde, self.apply_rff(queries).T)


# Create a small dataset: 5 samples, 4 features
dataset = np.random.randn(5, 4).astype(np.float32)

INIT_ARGS = {
    'dataset': dataset,
    'dimension': 4,
    'reps': 3
}

# Create query data: 2 samples, 4 features
queries = np.random.randn(2, 4).astype(np.float32)

ARGS = {
    'queries': queries
}

METHOD = 'non_private_kde'

# Construct and call
instance = LSQ_RFF(**INIT_ARGS)
instance.sanitize(epsilon=1.0)
result = instance.private_kde(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GaussianKDE Not yet run
unverified (harvested, no recorded run)
talwagner/lsq/lsq.py
code served (permissive licence) · get_code("88414eab841209ec")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

get_sqdistance_matrix Not yet run
unverified (harvested, no recorded run)
talwagner/lsq/lsq.py
code served (permissive licence) · get_code("a872a8e6b8bfeb1b")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We study efficient mechanisms for differentially private kernel density estimation (DP-KDE). Prior work for the Gaussian kernel described algorithms that run in time exponential in the number of dimensions d. This paper breaks the exponential barrier, and shows how the KDE can privately be approximated in time linear in d, making it feasible for high-dimensional data. We also present improved bounds for low-dimensional data. Our results are obtained through a general framework, which we term Locality Sensitive Quantization (LSQ), for constructing private KDE mechanisms where existing KDE approximation techniques can be applied. It lets us leverage several efficient non-private KDE methods-like Random Fourier Features, the Fast Gauss Transform, and Locality Sensitive Hashing-and "privatize" them in a black-box manner. Our experiments demonstrate that our resulting DP-KDE mechanisms are fast and accurate on large datasets in both high and low dimensions. Differential privacy (DP) (Dwork et al., 2006) is a rigorous and powerful notion of privacy-preserving computation, widely accepted in machine learning. Unfortunately, it often 1 Amazon.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2307.01877")
get_code_for_paper("2307.01877")
have("2307.01877")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2307.01877.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2307.01877.svg)](https://syntology.ai/paper/2307.01877)

Connect an agent — have() is free.