Manuscript Offprint
arXiv:2609.05329Machine Unlearning as Private Retroactive Algorithms
Abstract
Machine unlearning typically aims to emulate retraining from scratch: upon a deletion request, the unlearning algorithm should produce an outcome that would have been obtained had the deleted point never been included. Recent work has shown that this emulation requirement carries no meaningful privacy semantics against an adversary who observes a sequence of releases. Machine unlearning is thus not a privacy question per se, but rather a data maintenance question, which is precisely the subject of retroactive algorithms. These are algorithms supporting modifications of past operations, guaranteeing that all subsequent answers reflect the revised history as if it had always been in force.
We put forward a definition of private retroactive algorithms, combining the retroactivity requirement with differential privacy under continual observation. We present constructions achieving both privacy and retroactivity at no asymptotic cost over privacy alone for linear statistics, clustering, and histograms, alongside impossibility results.
1 Introduction
Machine unlearning addresses the challenge of removing the influence of specific training data from an already trained model. Cao and Yang [CY15] defined a removal as successful if the resulting model's distribution is identical to that of a model retrained from scratch without the removed data (so-called perfect retraining). This ensures that the updated model harbors no statistical traces of the removed data, simulating a reality in which it was never part of the training set to begin with.
The primary motivation for machine unlearning stems from modern data privacy laws, such as the GDPR's "right to be forgotten". However, recent works [CZW+21, CJZ+22, CLZH25, CKNS26, FNZ+26] have shown that the privacy semantics of this simulation requirement are unclear. First, deleting points may potentially reveal more information about them via a differencing attack. Second, and perhaps more surprisingly, removing points can inadvertently degrade the privacy of the remaining data. Specifically, Cohen et al. [CKNS26] showed that there is a task solvable with differential privacy without deletions (so the task itself is "benign" from a privacy standpoint), yet executing just a few deletion requests unavoidably allows an adversary to reconstruct almost all of the remaining data.
The reason is definitional: perfect retraining constrains what the outputs are, whereas a privacy definition must constrain what the outputs reveal. We therefore propose to build the
*Tel Aviv University †Google Research ‡Georgetown University area on two foundations: a consistency guarantee (the answers coherently track the surviving data) and a leakage guarantee (the release sequence reveals little about any individual).
Stripped of its privacy motivation and reduced to its consistency requirement, machine unlearning is, fundamentally, a maintenance question. This question predates unlearning, and was studied in the context of dynamic algorithms. Specifically, when deleting a data point requires removing an operation from the middle of an order-sensitive history, the problem falls into the realm of retroactive data structures (in the sense of Demaine et al. [DIL07]): modify the past, query the present.
-
Privacy. Changing or removing a single update at any point in the execution has almost no effect on the joint distribution of the entire output sequence, as in [DNPR10].
-
Retroactivity. For any two input sequences that induce the same surviving data from some timestep onward (even if they differ by many updates in the prefix), the joint distributions of their answer suffixes from time coincide, as in [DIL07]. We also consider a weaker version of marginal approximate retroactivity in which we only require the distribution of the answers for each time step to approximately coincide.
These two requirements are of very different natures. Ignoring computational costs, retroactivity on its own is always achievable, with no error: simply recompute, releasing at every time step a fresh answer drawn as a function of the current data alone. Privacy, on the other hand, is highly restrictive even in isolation: it necessitates approximation errors; for instance, privately maintaining a counter requires error [DNPR10, HUU23, CLN24, BL26]. This asymmetry suggests measuring the cost of the combination against the cost of privacy alone, and we pose the following question.
Question 1.1. Is retroactivity free? That is, suppose that a task can be solved with error by a continually private algorithm. Can it always be solved with error , or comparable, by an algorithm that is in addition retroactive? Or is there a task that admits a private algorithm with small error, but for which every private and retroactive algorithm must incur a significantly larger error?
In this work, we demonstrate that there are many interesting cases where exact retroactivity is indeed free. Furthermore, we establish that weaker forms of retroactivity are often attainable generically. Conversely, retroactivity is not universally free: we prove that in certain settings, it strictly forbids instance-adaptive error. We next provide an informal survey of these results.
Exact retroactivity for oblivious-noise mechanisms. We begin with the class of functionalities where retroactivity is entirely free: real-valued linear statistics over the surviving data. As [BDKT12] showed, DP algorithms for many such functionalities can w.l.o.g. be transformed into oblivious-noise algorithms, i.e., with a noise distribution that is data-independent. This independence is perfectly suited for retroactivity, as it guarantees the noise itself carries no hidden traces of the erased history. Consequently, we demonstrate that the classical tree mechanism of Dwork et al. [DNPR10] naturally satisfies exact retroactivity with no asymptotic cost over privacy. As an application, we observe that the recent continually-DP algorithms for -means and -median clustering of [ITHS23] are exactly retroactive, essentially as is. This shows that our definition is not only attainable for free in certain settings, but is in fact already satisfied by a large family of existing algorithms in the literature.
Theorem 1.2 (Informal version of Theorem 3.2). Any one-shot differentially private mechanism for linear queries that relies on data-independent (oblivious) noise can be transformed into a dynamic algorithm that is exactly retroactive and differentially private under continual observation. This transformation incurs no asymptotic overhead in error compared to the standard non-retroactive transformation from the one-shot to the continual DP setting.
Stability-based histograms with non-oblivious noise. We next tackle the task of sparse histograms over a huge universe, for which oblivious-noise mechanisms do not exist. The standard differential privacy remedy (adding noise only to non-empty bins and thresholding [KKMN09]) is highly data-dependent, seemingly violating the retroactivity requirement. We overcome this by dynamically maintaining a noisy histogram with oblivious noise, and crucially delaying the non-linear thresholding step to the release moment. We show that this achieves exact retroactivity while maintaining an error independent of the universe size.
Theorem 1.3 (Informal version of Theorem 4.1). For any data universe , there exists an exactly retroactive and continually differentially private algorithm for maintaining histograms. At every time step, the algorithm outputs a sparse histogram with an error that scales only polylogarithmically with the time horizon , and is completely independent of the universe size .
Generic compilers. Beyond specific functionalities, we present two generic compilers turning DP algorithms into retroactive ones via black box transformations. The first transformation achieves marginal approximate retroactivity while keeping the error essentially the same as that of the base DP algorithm. The second transformation achieves exact retroactivity at the price of specializing to sliding-window functionalities and increasing the error.
Theorem 1.4 (Informal version of Theorems 5.2 and 5.7). Differentially private algorithms can be generically compiled to achieve retroactivity in two ways:
-
Marginal approximate retroactivity: Any continually differentially private algorithm with real valued answers can be transformed to satisfy marginal approximate retroactivity. The transformation increases the error by an additive term proportional to the algorithm's baseline accuracy.
-
Exact retroactivity for sliding windows: Any one-shot differentially private algorithm can be compiled into a continually private and exactly retroactive algorithm
for sliding-window functionalities, leveraging random sampling of the active window. The privacy cost of the resulting algorithm depends on the size of the window (a large window increases the privacy cost via composition) and the size of the sample (a small sample from a large window can amplify privacy).
The price of retroactivity. Finally, we illustrate a negative side of Question 1.1 by showing that retroactivity is not universally free. Specifically, prior work on the Count Distinct problem [JKR+23] showed that continually-DP algorithms can achieve instance-dependent error, with lower error on “easy” instances. We prove that retroactivity strictly forbids such instance-adaptive error guarantees, and that any private and retroactive algorithm must incur worst-case error even on the easiest instances.
Theorem 1.5 (Informal version of Theorem 6.4). For the Count Distinct problem, any algorithm that is both continually differentially private and retroactive must incur a worst-case polynomial error even on the easiest, insertion-only sequences. Consequently, retroactivity strictly precludes the instance-adaptive, polylogarithmic error guarantees that are achievable by algorithms satisfying privacy alone.
1.2 Related work
The concept of machine unlearning was pioneered by Cao and Yang [CY15], who formalized the goal of unlearning as updating a model so that its output distribution perfectly matches that of a model trained from scratch without the deleted data. Following this, a rich line of work has proposed efficient algorithms to achieve this “perfect retraining” ideal (or statistical approximations of it) without incurring the full computational cost of retraining. These approaches can broadly be divided into two categories. First, exact unlearning methods guarantee an outcome identically distributed to retraining from scratch, often by strategically partitioning the training data so that a deletion only requires retraining a small, isolated fraction of the model [BCC+21]. Second, a large body of work focuses on approximate unlearning, where the updated model is only required to be statistically close to the retrained model. This relaxation allows for much faster update procedures, typically by leveraging gradient steps, influence functions, or bounded statistical approximations [GGVZ19, GGHvdM20, ISCZ21, NRSM21, SAKS21]. In addition, several works have utilized techniques from the DP literature as a tool to achieve the approximate-retraining requirement, or to maintain the retraining guarantee across sequential and adaptive deletion requests [UMR+21, GJN+21]. In contrast, in this work privacy is not a tool but a requirement of its own, imposed jointly with retroactivity on the entire release sequence.
Retroactive data structures were introduced by Demaine, Iacono, and Langerman [DIL07]. Their motivation was to allow inserting or deleting an operation in the past, while maintaining at any time the data structure that would have been obtained by the current sequence of operations. Our definition is an adaptation of their definition to our setting. A related notion of history independent data structures was introduced by Micciancio [Mic97] and formalized by Naor and Teague [NT01]. This definition is stronger and requires the memory representation of the data structure to be blind also to the order in which the surviving elements were inserted.
2 The model and the definitions
Let be a data domain and a time horizon. An input sequence is a vector where each is a (possibly empty) multiset of updates arriving at time step : an update is either an addition (add, ) of a point or a deletion (del, ), which, as in [DIL07], names the addition it cancels via its time stamp . Input sequences are arbitrary: a deletion that names no existing addition (or one already outside its scope) simply has no effect. The current data at time is the multiset of surviving time-stamped additions. Formally, can be defined using the following process, starting from the empty multiset and processing in order. For every : first, for every (add, , add a copy of to ; then, for every (del, , if then delete one copy of from (and otherwise do nothing). We call an element of a stamped point: a pair whose stamp is its arrival round, counted with multiplicity. Two additions of the same value at the same round contribute two copies of the same stamped point, and a deletion removes one copy.
Example 2.1. The following sequence , with horizon and two values , exercises the conventions above and will illustrate the definitions below.
| 1 | |||
| 2 | the pair has multiplicity two | ||
| 3 | one copy removed | ||
| 4 | names a pair never added: no-op | ||
| 5 | multiplicity exhausted | ||
| 6 | exhausted: no-op |
Remark 2.2. For simplicity, one may imagine that a deletion (del, ) arrives only at time steps , after the addition it names, though this is not part of the formal definitions.¹ Time stamps induce a partial order on ; the relative order of additions sharing a time step is unspecified, and the algorithm is free to choose it. Appendix A discusses the extension in which additions, too, may reach into the past.
A dynamic algorithm is a (possibly stateful, randomized) algorithm that at every time step receives and outputs an answer . We write , a distribution over , and .
2.1 Privacy
The unit of protection is a single operation, an addition or a deletion, as formally defined below.
Definition 2.3 (Neighboring sequences). Input sequences are neighboring if one of them can be obtained from the other by inserting a single update into some : either an addition (add, ), or a deletion (del, ).
¹The process defining is well-defined on every input sequence. An addition deleted within its own time step never appears in any , since within each additions are processed before deletions; and a deletion naming a future addition is a permanent no-op, since the named point is not yet present when the deletion is processed and updates are never revisited.
Remark 2.4 (Lifecycle protection). One point's full lifecycle, an addition together with the deletion that later cancels it, differs by two operations, and is thus protected by group privacy.
Definition 2.5 (Indistinguishability). Random variables taking values in a common measurable space are -indistinguishable, denoted , if for every event ,
Definition 2.6 ((ε, δ)-privacy [DMNS06, DNPR10]). A dynamic algorithm is -private if for every pair of neighboring input sequences ,
Definition 2.6 quantifies over fixed pairs of sequences, guaranteeing privacy w.r.t. oblivious input streams. Appendix B defines the adaptive strengthening, in which the stream is chosen as a function of past answers.
2.2 Retroactivity
The second requirement is the distributional core of perfect retraining: histories that agree on the surviving data from some time onward must induce identically distributed answers from that time onward.
Definition 2.7 (Uniting sequences). Input sequences unite at time if as multisets, for every .
Note that could potentially differ by many additions/deletions, and can thus be very far from being neighboring as in Definition 2.3.
Definition 2.8 (Retroactivity, adapted from [DIL07]). A dynamic algorithm is retroactive if for every pair of input sequences that unite at time ,
i.e., the two blocks of answers are identically distributed.
In Example 2.1, the sequence with and all other rounds empty satisfies for and for no earlier , so and unite at 5: retroactivity requires to be identically distributed under and , so the answers from round 5 onward may not reveal that ever existed. With counting as the functionality, the true answer sequences are under and under , agreeing exactly on the united suffix.
Definition 2.9 (Approximate retroactivity). Let . A dynamic algorithm is -approximately retroactive if for every pair of input sequences that unite at time ,
and it is -marginally approximately retroactive if for every such pair and every ,
Retroactivity is exactly -approximate retroactivity, and -approximate retroactivity implies its marginal counterpart, since every single answer is a marginal of the suffix block. The converse direction fails: the marginal requirement constrains each answer in isolation and places no constraint on how the answers may jointly encode the pre-uniting history. Section 5 quantifies the gap.
2.3 Private retroactive algorithms
Our central definition combines the two requirements as follows.
Definition 2.10 (Private retroactive algorithm). A dynamic algorithm is an -private retroactive algorithm if it satisfies Definitions 2.6 and 2.8.
Note that Definition 2.10 is trivially satisfied by an algorithm that always outputs . Accuracy with respect to a functionality of interest is imposed separately, and the subject of this paper is the trade off between privacy, retroactivity, and accuracy.
3 Linear functionalities with oblivious noise
We begin with the class of functionalities for which the answer to Question 1.1 is affirmative in the most direct way: real valued linear statistics of the surviving data. The construction is the classical tree mechanism of [DNPR10], evaluated on the current data and carrying persistent, data independent additive noise, and the point of this section is that it is exactly retroactive as it stands, at no asymptotic cost over privacy under continual observation.
Throughout, denotes the histogram of the values of a multiset of stamped points (ignoring the stamps). That is, is the number of stamped points in with value . We also write to denote a query matrix with columns , where denotes the number of queries. The functionality of interest maps the current data to .
Definition 3.1 (Oblivious-noise mechanism [BDKT12]). A one shot mechanism for the query is an oblivious-noise mechanism if , where for a distribution on that does not depend on the input.
We will show that any such (one-shot) oblivious-noise mechanism can be transformed into a retroactive one. As Bhaskara et al. [BDKT12] showed, many mechanisms for answering linear queries can be turned into oblivious-noise mechanisms, and so this construction captures quite a few settings.
The construction. Consider a complete binary tree whose leaves correspond to single time steps in . Every node in this tree corresponds to the time interval spanned by its children (these are dyadic intervals). For let denote the canonical decomposition of into at most such dyadic intervals (at most one node/interval from every level of the tree), and recall that for every exactly one interval of contains .
Let be an oblivious-noise mechanism for a query matrix with noise distribution . Define to be the algorithm that maintains one persistent noise vector per node
of the tree, mutually independent. At every round , algorithm releases
Theorem 3.2. Algorithm satisfies:
-
is retroactive (as in Definition 2.8).
-
If is -DP then is -private (as in Definition 2.6), where .
-
At every round , the error is the sum of at most independent samples from .
Proof. Retroactivity. Fix uniting at time . The answer block , with the release defined in the construction above, is a randomized function of , and is otherwise independent of . As this is identical to , we have that .
Privacy. First recall that as is noise-oblivious -DP, then for any element it holds that , since for two datasets differing by adding/removing we have that differs by the column , and must hide this difference.
Now let be neighboring input sequences. There is a contiguous (possibly empty) time window throughout which the histograms and differ by the addition/removal of one fixed element ; these histograms are otherwise equal throughout the execution. For simplicity let us assume that the window ends at time , so that we only need to argue about the starting time of the window.
Now observe that the time step participates in exactly dyadic intervals/nodes, and denote these intervals as . Observe that in any time step , exactly one node from participates in (and thus its corresponding noise participates in the output, see Equation (1)). Hence, shifting every noise by makes the outputs of the two executions identical at every round. These are coordinates of a product measure, each shift -indistinguishable, so by composition the transcripts are -indistinguishable.
Utility. Immediate from Equation (1): and the noises are mutually independent.
For and the all ones row, instantiated with Laplace noise recovers the standard counter of [DNPR10], with error , matching the non-retroactive lower bound for private counting [DNPR10, HUU23, CLN, BL26]. As the construction is exactly the standard non retroactive one, retroactivity is free for linear queries. This is the affirmative side of Question 1.1 for the linear class.
Indeed, the differing operation changes the multiplicity of a single stamped point by one, and once the two multiplicities coincide they remain equal, so the differing rounds form an interval.
A general window is handled by additionally shifting, in the opposite direction, the nodes containing the first time step after the window (a node containing both endpoints is left unchanged), doubling the parameters to .
3.1 A case study: clustering under continual observation
In this section we show that the construction of Theorem 3.2 extends beyond linear queries. Specifically, we revisit a result by Dupré la Tour, Henzinger, and Saulpic [ITHS23] who presented algorithms for k-means and k-median clustering under continual observation, over streams of insertions and deletions of points from a bounded ball in . We observe that their construction is exactly retroactive as it stands, satisfying our Definition 2.10.
The model. Fix a dimension , a diameter , and let the value domain be . We consider a setting with at most one update per round: each update is either empty, or a single addition (add, ) of a point , or a single deletion (del, ) naming a previously added stamped point. As always, is the multiset of surviving stamped points, and multiplicities are allowed. The functionality releases at every round a set of centers , evaluated by the -means cost
and denotes the minimum of this cost over all sets of k centers. Neighboring sequences are as in Definition 2.3, with the inserted operation occupying a previously empty round.
In our proof, we will use the following closure to post processing property of retroactive algorithms.
Lemma 3.3 (Closure under memoryless post processing). Let be a retroactive dynamic algorithm, let be a random variable drawn once from a fixed, data independent distribution and independently of everything else, and let be the algorithm that at every round releases , where is the round answer of , the maps are fixed, and the coins are fresh and independent across rounds. Then is retroactive.
Note that consumes only the current answer . Post processing that also consults earlier answers does not preserve retroactivity in general, as it may correlate the answer block with the pre uniting past.
Proof. Fix uniting at . The block is a deterministic function of the block , of , and of the fresh coins . The three are mutually independent, the distribution of is the same under and by the retroactivity of , and the distributions of and of the coins are data independent. Hence the joint distribution of the inputs to the common deterministic function is the same under and , and so is the distribution of the block.
Theorem 3.4. In the k-means model above, for every there is an algorithm that is -private (Definition 2.6) and retroactive (Definition 2.8), hence a private retroactive algorithm (Definition 2.10), which at every round releases a set of centers, and which satisfies, with probability at least 0.99, simultaneously for all rounds : the k-means cost of the released centers on is at most
where and is the best approximation ratio of non private static k-means.
Proof. The algorithm is that of [ITHS23]. We begin with a simplified description of their algorithm.
The algorithm of [ITHS23], simplified. The algorithm runs in parallel instances of a greedy clustering procedure, each with privacy budget . Each instance succeeds at any given round with constant probability only; running many boosts this probability, and at every round the algorithm releases the answer of the instance that currently looks best.
-
Setup of an instance (data independent). First, apply a random projection to reduce the -dimensional space down to a smaller -dimensional space. Then, rigidly carve this projected space into a fixed, multi-layered grid of sub-regions (a net decomposition). Crucially for retroactivity, this entire spatial structure is generated completely blindly, without ever looking at the data.
-
Counters of an instance. For every region, three running counters are maintained via the binary mechanism: the number of surviving points in the region, the sum of their original dimensional coordinates, and the sum of their squared norms. Every arriving update is fed to all instances.
-
Releases (per round). Each instance computes candidate centers and an estimate of their cost by post-processing its current noisy region counts, current noisy sums, and current noisy norms (without re-accessing the data). The algorithm releases the solution of the instance with the smallest estimated cost.
Our proof uses only two properties of their algorithm, both visible in the description above and verified by inspection of their construction.
(P1) For each instance there is a matrix , determined by the instance's random projection and by the fixed family of regions, such that the instance's counter vector at round equals , where is the dyadic decomposition of as in Section 3 and the are the persistent independent noises of the instance's binary mechanisms.⁴
(P2) The releases at every round are post processing of the current counter vectors and the projections, with fresh and independent coins across rounds.
Retroactivity. By (P1), the joint counter block of all instances from any round onwards is a randomized function of , and is otherwise independent of : the noise index sets are determined by the round alone, and the projections are drawn once from fixed data independent distributions. By (P2) and Lemma 3.3, with , the same holds for the released centers, exactly as in the retroactivity part of Theorem 3.2.
⁴The counters are the region counts, the per region coordinate sums, and the per region sums of squared norms; each point lies in regions, so the columns of are sparse. Ineffective deletions, which our totality convention permits, are discarded on arrival and reach no counter.
Privacy and accuracy. These follow directly from the guarantees of [ITHS23] for their algorithm, which we run unchanged. (Technically, we need to run their algorithm with privacy parameter , as they have a slightly different notion for which sequences are neighboring, but this does not change anything.)
Corollary 3.5 (k-median). The k-median algorithm of [ITHS23], their Theorem 2, run with privacy parameter , is -private (Definition 2.6) and retroactive (Definition 2.8), with the accuracy guarantee stated there.
Proof. The algorithm is covered by the same argument, and is in fact simpler: it runs a single instance, with no boosting and no cost estimates, and its releases are again per round post processing of counters maintained over fixed regions. Properties (P1) and (P2) hold verbatim, so retroactivity and privacy follow exactly as in the proof of Theorem 3.4.
Remark 3.6 (Unknown horizon). In our model the horizon is fixed in advance, and the algorithm above uses it. As in [ITHS23], this dependence can be removed by starting more and more instances as time goes by, the th instance at round , initialized with the currently surviving points, at the cost of a slightly larger error. For retroactivity, a minor change to their initialization is then required, so that the noise structure remains independent of the past data.
4 Stability-based histograms
We now give a construction for the histogram functionality over a huge bin universe : each addition places an item in a bin, each deletion removes one, and at every round the algorithm releases a sparse approximate histogram of the surviving data, with error independent of . The bin counts form a linear statistic, so Theorem 3.2 applies; but applied as stated it instantiated a noise variable for every bin of the universe, so its release is dense and its error grows with . The offline remedy is the stability based histogram [KKMN09]: add noise only to the nonempty bins, release those whose noisy count crosses a threshold, and output exact zeros elsewhere. This keeps the histogram sparse (the vast majority of the bins remain empty) and makes the error independent of .
The difficulty is that with this remedy the noise is not oblivious anymore: which bins carry noise depends on the data, and, when run dynamically, on the history of activity. Noise of this data dependent kind breaks the retroactivity analysis of Section 3. We overcome this by delaying the nonlinear step of the computation to the release moment: informally, we maintain dynamically a noisy histogram with oblivious noise, and add a non linear post processing step that sparsifies the release before every round.
Throughout this section, updates are exactly as in Section 2: arbitrary multisets of additions and deletions, with no restriction. For a bin write for the number of copies with value in . We retain the dyadic notation of Section 3.⁵
⁵Recall: the nodes of the complete binary tree over are the dyadic intervals, is the canonical decomposition of into at most such intervals, at most one per level, and every lies in exactly one interval of .
The construction. Let be a privacy parameter and let be a threshold parameter. The algorithm stores the data, and maintains a table of noise variables , indexed by pairs of a dyadic interval and a bin , mutually independent, each instantiated the first time it is used and stored thereafter. At every round , for each bin with it computes
and it releases the sparse histogram
interpreted as assigning 0 to every other bin (so that a bin whose history was erased by deletions is indistinguishable from one never touched). Only finitely many noise variables are ever instantiated: at most per surviving bin per round, each drawn on first use and reused in all subsequent rounds.
Theorem 4.1. For every and , set . Then is retroactive (Definition 2.8), and it is -private (Definition 2.6) with .
Proof of retroactivity. Fix uniting at time . The answer block is a deterministic function of the counts (which are determined by ), together with the noise variables of intervals involving bins that are non-empty at some time , that is,
Note that the index set of is itself determined by and is the same for and . Each is an independent variable regardless of the round at which it was instantiated, which may precede . The noise variables of pairs outside , including those of bins whose entire activity was erased by deletions before round , do not influence the answer block, because bins with are released as exact zeros. So .
Proof of privacy. Let be neighboring input sequences. As established in the privacy analysis of Theorem 3.2, there are a bin and a contiguous (possibly empty) time window throughout which the counts and c'_b^*(\ell) of the two executions differ by one unit, all other bins having identical counts at all times. For simplicity let us assume that the window ends at time , so that we only need to argue about its starting time .^6
Now observe that the time step participates in exactly dyadic intervals, and denote these intervals as ; in any time step , exactly one interval from participates in . Hence, shifting every noise , , by , with the sign matching the difference, makes the noisy values of the two executions identical at every round, all other bins carrying identical values as well. The shift moves independent variables by 1 each, so it distorts probabilities by a factor of at most , in both directions.
^6A general window is handled as in Theorem 3.2, by additionally shifting, in the opposite direction, the intervals containing the first time step after the window (an interval containing both endpoints is left unchanged); this doubles the number of shifted variables to at most , and the distortion factor below becomes .
Under this coupling the two executions can differ only at rounds where one execution has a true count of 0 and the other has a true count of 1: The execution holding the extra unit releases its value if it crosses while the other releases an exact zero. By a union bound over the at most rounds and the summand noises,
Overall, for every event we have , as required.
Remark 4.2 (Accuracy). The released histogram never contains a bin with no surviving items, and at bins with its error is at most plus when the bin is thresholded away. With probability , simultaneously for all rounds and all released bins, every noise sum is at most in absolute value, where bounds the number of instantiated pairs; hence the error is with , independent of , and with exact zeros outside the true support. We do not optimize the polylogarithmic factors.
5 Generic compilers
In this section we present two generic constructions that, under certain conditions, allow us to transform differentially private algorithms into retroactive ones.
5.1 From continual privacy to marginal approximate retroactivity
In this section, we demonstrate that marginal approximate retroactivity can be achieved generically. Specifically, any accurate algorithm that satisfies continual DP can be transformed into one that additionally satisfies marginal retroactivity. More generally, this transformation guarantees that any block of consecutive answers remains approximately retroactive, with an approximation error that grows as .
Intuition. Suppose we have a (continual) DP algorithm , approximating some functionality of the input sequence. Now recall that once two input sequences unite, then the exact value of on them becomes identical. Hence, if the algorithm is highly accurate, then its outputs for both streams must be very close to this shared truth (say within an error margin ). Noisifying 's answers proportionally to masks this difference, thereby making it (marginally) retroactive.
For concreteness, throughout this subsection we assume that the target functionality is a mapping from multisets over to , and that the error of the base DP algorithm is measured via the Euclidean distance. See Remark 5.4 for an extension to other metric spaces.
Definition 5.1 (Accuracy). A dynamic algorithm is -accurate for if for every input sequence , with probability at least , simultaneously for all .
Given a dynamic algorithm and , the compiled algorithm runs , and at every round releases , where is the answer of and is fresh and independent across rounds. We use two standard facts about Gaussian noise [DKM06, DR14]: for , and , we have whenever , and except with probability .
Theorem 5.2 (Compiler). Let be -private (Definition 2.6) and -accurate for , let and , and let and be as above. Then:
-
is -private.
-
is -accurate for .
-
For every pair uniting at time , every block of length , and every ,
Proof. Part 1 (Privacy). Standard -privacy follows directly from the immunity of differential privacy to post-processing, since the compiled transcript is simply the raw transcript with independent Gaussian noise added to every answer.
Part 2 (Accuracy). This follows from the triangle inequality, a union bound over the rounds of the Gaussian norm tail, and the baseline accuracy assumption of .
Part 3 (Block Retroactivity). Fix uniting at and a block of length . Since the sequences unite at , the true answers coincide at every round of the block. Let be the set of answer vectors that are -accurate at every round of the block with respect to these true answers. By the accuracy of , and are both at least . For let denote the random vector , where the are independent. Note that any two are within distance at every round of the block. Thus, by the properties of the Gaussian mechanism [DKM06, DR14], composed across the rounds [DRV10], for every we have , where under basic composition and under advanced composition. Hence, for any event we have
The reverse inequality holds by symmetry.
Corollary 5.3. In the setting of Theorem 5.2, is -marginally approximately retroactive.
Remark 5.4 (Beyond ). We worked in for simplicity, but the argument generalizes to any answer metric space , provided that it admits a randomized map playing the role of Gaussian noise: whenever , and except with probability . Nothing else about the noise is used.
Remark 5.5 (An approximately retroactive median with deletions). As an example of Remark 5.4, consider the task of reporting the median of the current data (which undergoes insertions and deletions) over a huge ordered domain. Without retroactivity, this can be solved privately (in the continual-DP model) by maintaining two dyadic trees over , one for additions and one for deletions. Each node holds a one shot DP estimate of the empirical CDF of the points processed in its interval, with rank error depending on the domain only through [BNSV15]. At every round the algorithm releases the difference of the two estimates accumulated along , which produces an approximate CDF of the remaining data points (from which one could estimate the median by post-processing). This base algorithm handles arbitrary deletions and is private by the usual tree accounting. It is accurate with , in the metric of rank discrepancy between CDF estimates. Note that we cannot add real-valued noise to the “non-retroactive” median estimation, as we aim to approximate the median by rank. In the terminology of Remark 5.4, the map which we will use to noisify the non-retroactive CDF is the cumulatively differentially private median algorithm of [CLN23, Theorem 4.2]. Two CDF estimates within rank discrepancy induce inputs at cumulative distance , so running their algorithm with privacy parameter gives, by group privacy, the closeness that Remark 5.4 requires, with rank error . The result is an -private median with arbitrary deletions, rank error , and the retroactivity guarantees of Theorem 5.2.
5.2 Exact retroactivity for window functionalities: sampling with expiry
In this section we present a generic transformation that takes a one shot DP algorithm and produces an exactly retroactive private algorithm for the sliding window version of 's task. For linear window statistics, such a result follows directly from Theorem 3.2, so no transformation is needed. The motivation for this section thus comes from non-linear statistics. Let be a fixed window length. The construction is based on maintaining a uniformly random sample from the surviving points in the window, and running on this sample. Intuitively, the fact that we sample (only) from the surviving points guarantees retroactivity. Privacy will be enforced using the window, which caps every element's influence, amplified by the secrecy of the sample within the window.
Definition 5.6. A surviving stamped point is live at round if (note that for to be surviving at time ). So, every stamped point expires exactly rounds after its arrival. Let denote the multiset of live stamped points. Write .
The compiler. Let be an algorithm taking a multiset over to a distribution over answers, and fix a target sample size . The compiled algorithm draws at every
The non-retroactive estimate is a difference of two CDF estimates; before feeding it to the algorithm of [CLN23, Theorem 4.2] we transform it into a sanitized dataset via standard techniques.
round , with fresh coins, a uniformly random subset of size of , and releases , applied to the multiset of values of the sampled points, with fresh independent coins for as well.
Theorem 5.7 (Sampling compiler). Let be -differentially private with respect to adding or removing one record. Then the following hold for .
-
Retroactivity. is exactly retroactive (Definition 2.8).
-
Privacy. is -private (Definition 2.6); moreover, for every it is -private with
- Amplification by the secrecy of the sample. Let be an occupancy parameter, denote , and assume . Restricted to neighboring pairs in which both sequences satisfy for all , is, for every , -private with
Proof. Retroactivity. The sample is a fresh coin function of , which is determined by , and is a fresh coin function of . Hence the answer block from any round onward is per round post processing, with fresh coins, of , and Lemma 3.3 gives retroactivity.
Privacy. As in the privacy proof of Theorem 3.2, one of the two neighboring sequences, denote it and the other , holds one extra surviving copy of a stamped point on a contiguous set of rounds, the data agreeing otherwise; intersected with liveness, this leaves at most rounds at which exceeds by one copy of , the two windows agreeing elsewhere. At every other round the two samples have the same distribution. At each of the at most differing rounds, a uniformly random subset of of the required size can be drawn by first drawing a uniformly random subset of of the same size and then, with probability equal to the sample size divided by , replacing a uniformly random element of it by the extra copy (or, when the sample is the whole window, adding the extra copy). So the two samples differ by at most one removal and one insertion, and by group privacy of at distance two the round distributions are -indistinguishable. Since all coins are fresh, the two transcripts are product distributions differing in at most factors, and basic composition, respectively advanced composition [DRV10], gives the two claimed bounds.
Amplification. Under the assumption that for all , every sample has size , so at each differing round the coupling above replaces an element with probability , and with the remaining probability the two samples coincide. The round distributions are therefore versus , with and -indistinguishable, and such a mixture is -indistinguishable from , in both directions, by the standard argument for amplification by subsampling [BBG18]. Composing over the at most differing rounds as before gives the claim; the bound for follows from by convexity.
is a parameter of the guarantee, not of the algorithm.
The amplified privacy of part 3 holds only under the occupancy promise that for all . The next lemma removes it: the algorithm privately tests, using the machinery of Section 3, whether the window is large enough, and releases when it is not.
Lemma 5.8 (Removing the occupancy promise). Assume, as in part 3 of Theorem 5.7, that and , let , and let and be as defined there. Let , and let be the release of Theorem 3.2 applied to the window count with Laplace noise, calibrated to be -private. Define the gated algorithm that releases at rounds with and at all other rounds. Then the gated algorithm is exactly retroactive. Moreover, there is a universal constant such that if , then it is -private for every pair of neighboring sequences, and at every round with it releases , except with probability .
Proof. The window count is a linear window statistic, so the count release is exactly retroactive by Theorem 3.2 applied to the window histogram, and the gated releases are per round post processing, with fresh coins, of the count release and of ; Lemma 3.3 gives retroactivity. The count error is at most at all rounds, except with probability : the release at each round is a sum of at most Laplace variables of scale each, and a union bound over the rounds and the summands bounds all errors by , by the choice of .
For privacy, passing the gate at a round requires , hence unless the count fails, which happens with probability at most under either sequence. The count release is -private. Conditioned on its outcome, the set of passing rounds is fixed. The releases at these rounds are then exactly those of part 3 of Theorem 5.7, restricted to the passing rounds, and the per round amplified bound applies at each of them. Composing the count release with the gated releases, and adding the failure probability of the count, gives the claim. Finally, at a round with we have unless the count fails.
We conclude with a concrete instantiation: privately reporting a point that lies between the minimum and the maximum of the live points, the interior point problem, which is the basic primitive underlying private medians, quantiles, and learning of thresholds. Combining the compiler with the gate and with the one shot algorithm of yields the following.
Corollary 5.9 (A window interior point). Instantiate with the one shot interior point algorithm of , Theorem 1.1], run with , and set to its sample complexity, . Let , and let be as in Lemma 5.8 (growing as ). Then the gated algorithm of Lemma 5.8 is exactly retroactive, is -private for every pair of neighboring sequences, and at every round with releases, with probability , a value between the minimum and the maximum of the live points; at all other rounds it releases either such a value or .
Proof. Retroactivity and privacy follow from Lemma 5.8 with and . Whenever the gate passes, the sample has size (unless the count fails, passing implies ),
So here the algorithm itself depends on the occupancy parameter n, unlike in part 3 of Theorem 5.7.
These are the parameters of Lemma 5.8 with and , after plugging in and .
and an interior point of is an interior point of , so succeeds with probability ; at rounds with the gate passes except with probability .
Remark 5.10 (Persistent ranks). A natural variant attaches to each addition, upon arrival, a persistent secret rank drawn uniformly from , and takes as the live copies of smallest rank. The sample then changes only with the window's actual turnover, by at most one swap per arrival, expiry, or deletion. This can be helpful when the releases are used to estimate change over time, and when is expensive and is maintained incrementally on the sample. This variant is also exactly retroactive, and it satisfies part 2 (privacy) of Theorem 5.7. Its amplification guarantees, however, are weaker and somewhat more complicated. Appendix C gives the precise statements and proofs.
6 On the price of retroactivity
In this section we prove a negative result on the cost of retroactivity when enforced on top of privacy. Specifically, we show that retroactivity forbids instance adaptive error bounds for the counting distinct elements problem, of the type studied by Jain et al. [JKR+23]. Admittedly, our negative result provides only an instance adaptive separation, rather than a worst case separation, which we leave as an open question.
The CountDistinct task. Let be a large universe and suppose there is at most one update per round, as in Subsection 3.1. The functionality of interest is the number of distinct surviving values, i.e., for a multiset of stamped points ,
Definition 6.1 ([JKR+23]). For a sequence and a value , let indicate whether is present in , with . The flippancy of is the number of rounds at which the indicator changes, and the maximum flippancy is the largest flippancy of any value.
Note that is determined by the trajectory , and that every insertion only sequence has maximum flippancy 1. We say a dynamic algorithm is -accurate per round on a class of sequences if for every sequence in the class and every round , .
Jain et al. [JKR+23] presented a continually-DP mechanism for this problem that adapts to the data it actually sees by tracking how frequently items change (the flippancy, ). It increases its noise scale only when these changes double, guaranteeing an error of
on every stream, with no prior bound on (Theorem 1.5 in [JKR+23]). Because the error scales with actual changes, streams with very few changes (maximum flippancy ) have a much smaller, polylogarithmic error.
The algorithm of Jain et al. [JKR+23] guarantees a stronger notion of privacy, called item-level (continual) DP, allowing all events of a single item to change at once. Their guarantee implies the event level notion of privacy studied in this paper.
However, their mechanism is not retroactive. The amount of noise it adds is governed by the flippancy of the entire history, including flips of copies long since deleted, which is not a function of the surviving trajectory. The theorem below shows this is not an accident of their design, but a strict limitation of retroactivity itself.
We first record what retroactivity remembers, or rather what it is required to forget.
Lemma 6.2 (Amnesia). Let be a retroactive dynamic algorithm. Then for every round , the distribution of on input depends only on and on the stamped multiset . Consequently, if is -accurate per round on insertion only sequences, then it is -accurate per round on all sequences.
Proof. To see that the output distribution at round depends only on the current dataset , consider two sequences and that result in the exact same state at round , i.e., . We can bridge them using a hybrid sequence that takes its first updates from and its remaining updates from . Now,
-
Since the input sequences and are identical up to time , by causality, we have that .
-
Since the states of and agree from round onward, by retroactivity we have that .
This shows that the output depends only on the current data state. For the consequence, the state of any sequence at round is replicated by an insertion only sequence, placing at every round exactly the additions of the copies of carrying stamp . The output distributions at time are thus equal, and so accuracy on the insertion-only sequence implies accuracy on the insertion-deletion sequence.
We now leverage Lemma 6.2 to show our impossibility result. At a high level, our impossibility result is obtained as follows. Suppose towards contradiction that there is a private and retroactive algorithm for CountDistinct, with an input adaptive error bound depending on the flippancy , scaling as , in the spirit of Equation (2). So, on an insertion-only sequence (with flippancy 1) it guarantees a small error of polylog(). Then, by Lemma 6.2, it also guarantees this small error on any input sequence. This violates an impossibility result of Jain et al. [JKR], showing that any (event level) DP algorithm for CountDistinct, even non-retroactive, must have worst case error .
A technical issue with formalizing this proof sketch is that, as stated, the results of Jain et al. [JKR] only rule out DP algorithms that guarantee simultaneous accuracy across all time steps together. That is, algorithms guaranteeing that with constant probability all of their answers are accurate simultaneously. In contrast, Lemma 6.2 only guarantees per-round marginal accuracy. Fortunately, straightforward modifications to the negative result of Jain et al. [JKR] lift it also to marginally-accurate DP algorithms, as captured in the following theorem (the proof is given in Appendix D for completeness).
Theorem 6.3 (Marginal worst case bound [JKR]). There are constants such that for all sufficiently large , no dynamic algorithm for CountDistinct that is -private (Definition 2.6) is -accurate per round on the class of all input sequences.
We are now ready to state and prove our impossibility result.
Theorem 6.4 (Retroactivity forbids instance adaptive error). There are constants such that the following holds for all sufficiently large . Let be a dynamic algorithm for CountDistinct that is -private (Definition 2.6) and retroactive (Definition 2.8), and suppose that its error is bounded in terms of the maximum flippancy: for some function , for every input sequence and every round ,
Then .
In words, Theorem 6.4 states that the instance-adaptive bound is already at worst-case level on the easiest instances. In contrast, the mechanism of [JKR⁺23], which is private but not retroactive, satisfies the above with , which is polylogarithmic at .
Proof of Theorem 6.4. Every insertion only sequence has maximum flippancy 1, so is -accurate per round on insertion only sequences. By Lemma 6.2, the answer distribution at any round of any sequence coincides with the answer distribution at the same round of an insertion only sequence realizing the same state, so is -accurate per round on all sequences. Theorem 6.3 then gives .
Remark 6.5 (Forced budget amnesia). The result gives precise content to an intuition one might call budget amnesia. Instance-adaptive continual mechanisms, such as the flippancy tracker of [JKR⁺23], keep books: a data dependent account of the input’s past activity, which lets them spend noise only on the activity that actually occurred. Lemma 6.2 says a retroactive algorithm cannot keep such books: its answer distribution at each round is required to forget every flip that did not survive into the current data. The bookkeeping is not merely reset by deletions; it is forbidden by the definition, and Theorem 6.4 is the price.
References
[BBG18] Borja Balle, Gilles Barthe, and Marco Gaboardi. Privacy amplification by subsampling: Tight analyses via couplings and divergences. In NeurIPS, 2018.
[BCC⁺21] Lucas Bourtoule, Varun Chandrasekaran, Christopher A. Choquette-Choo, Hengrui Jia, Adelin Travers, Baiwu Zhang, David Lie, and Nicolas Papernot. Machine unlearning. In IEEE Symposium on Security and Privacy (S&P), 2021.
[BDKT12] Aditya Bhaskara, Daniel Dadush, Ravishankar Krishnaswamy, and Kunal Talwar. Unconditional differentially private mechanisms for linear queries. In STOC, 2012.
[BL26] Konstantina Bairaktari and Kasper Green Larsen. The binary tree mechanism is optimal for approximate differentially private continual counting, 2026. arXiv:2607.00876.
[BNSV15] Mark Bun, Kobbi Nissim, Uri Stemmer, and Salil Vadhan. Differentially private release and learning of threshold functions. In FOCS, 2015.
[CJZ⁺22] Nicholas Carlini, Matthew Jagielski, Chiyuan Zhang, Nicolas Papernot, Andreas Terzis, and Florian Tramèr. The privacy onion effect: Memorization is relative. In NeurIPS, 2022.
[CKNS26] Aloni Cohen, Refael Kohen, Kobbi Nissim, and Uri Stemmer. Protecting the undeleted in machine unlearning, 2026. arXiv:2602.16697.
[CLN+23] Edith Cohen, Xin Lyu, Jelani Nelson, Tamás Sarlós, and Uri Stemmer. Optimal differentially private learning of thresholds and quasi-concave optimization. In STOC, 2023.
[CLN+24] Edith Cohen, Xin Lyu, Jelani Nelson, Tamás Sarlós, and Uri Stemmer. Lower bounds for differential privacy under continual observation and online threshold queries. In COLT, 2024.
[CLZH25] Aobo Chen, Yangyi Li, Chenxu Zhao, and Mengdi Huai. A survey of security and privacy issues of machine unlearning. AI Magazine, 46(1), 2025.
[CY15] Yinzhi Cao and Junfeng Yang. Towards making systems forget with machine unlearning. In IEEE Symposium on Security and Privacy, 2015.
[CZW+21] Min Chen, Zhikun Zhang, Tianhao Wang, Michael Backes, Mathias Humbert, and Yang Zhang. When machine unlearning jeopardizes privacy. In CCS, 2021.
[DIL07] Erik D. Demaine, John Iacono, and Stefan Langerman. Retroactive data structures. ACM Transactions on Algorithms, 3(2):13, 2007.
[DKM+06] Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In EUROCRYPT, 2006.
[DMNS06] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam D. Smith. Calibrating noise to sensitivity in private data analysis. In TCC, volume 3876 of Lecture Notes in Computer Science, pages 265–284. Springer, 2006.
[DMT07] Cynthia Dwork, Frank McSherry, and Kunal Talwar. The price of privacy and the limits of LP decoding. In STOC, 2007.
[DN03] Irit Dinur and Kobbi Nissim. Revealing information while preserving privacy. In PODS, 2003.
[DNPR10] Cynthia Dwork, Moni Naor, Toniann Pitassi, and Guy N. Rothblum. Differential privacy under continual observation. In STOC, 2010.
[DR14] Cynthia Dwork and Aaron Roth. The algorithmic foundations of differential privacy. Foundations and Trends in Theoretical Computer Science, 9(3–4):211–407, 2014.
[DRV10] Cynthia Dwork, Guy N. Rothblum, and Salil Vadhan. Boosting and differential privacy. In FOCS, 2010.
[FNZ+26] Jie Fu, Nima Naderloui, Da Zhong, Yuan Hong, and Wendy Hui Wang. Revisiting privacy leakage in machine unlearning: Membership inference beyond the forgotten set, 2026. arXiv:2605.01129.
[GGHvdM20] Chuan Guo, Tom Goldstein, Awni Hannun, and Laurens van der Maaten. Certified data removal from machine learning models. In ICML, 2020.
[GGVZ19] Antonio Ginart, Melody Guan, Gregory Valiant, and James Y. Zou. Making AI forget you: Data deletion in machine learning. In NeurIPS, 2019.
[GJN+21] Varun Gupta, Christopher Jung, Seth Neel, Aaron Roth, Saeed Sharifi-Malvajerdi, and Chris Waites. Adaptive machine unlearning. In NeurIPS, 2021.
[HUU23] Monika Henzinger, Jalaj Upadhyay, and Sarvagya Upadhyay. Almost tight error bounds on differentially private continual counting. In SODA, 2023.
[ISCZ21] Zachary Izzo, Mary Anne Smart, Kamalika Chaudhuri, and James Zou. Approximate data deletion from machine learning models. In AISTATS, 2021.
[JKR+23] Palak Jain, Iden Kalemaj, Sofya Raskhodnikova, Satchit Sivakumar, and Adam Smith. Counting distinct elements in the turnstile model with differential privacy under continual observation. In NeurIPS, 2023.
[JRSS23] Palak Jain, Sofya Raskhodnikova, Satchit Sivakumar, and Adam D. Smith. The price of differential privacy under continual observation. In ICML, 2023.
[KKMN09] Aleksandra Korolova, Krishnaram Kenthapadi, Nina Mishra, and Alexandros Ntoulas. Releasing search queries and clicks privately. In WWW, 2009.
[ITHS23] Max Dupré la Tour, Monika Henzinger, and David Saulpic. Differential privacy for clustering under continual observation, 2023. arXiv:2307.03430.
[Mic97] Daniele Micciancio. Oblivious data structures: Applications to cryptography. In STOC, 1997.
[NRSM21] Seth Neel, Aaron Roth, and Saeed Sharifi-Malvajerdi. Descent-to-delete: Gradient-based methods for machine unlearning. In ALT, 2021.
[NT01] Moni Naor and Vanessa Teague. Anti-persistence: History independent data structures. In STOC, 2001.
[SAKS21] Ayush Sekhari, Jayadev Acharya, Gautam Kamath, and Ananda Theertha Suresh. Remember what you want to forget: Algorithms for machine unlearning. In NeurIPS, 2021.
[UMR+21] Enayat Ullah, Tung Mai, Anup Rao, Ryan A. Rossi, and Raman Arora. Machine unlearning via algorithmic stability. In COLT, 2021.
A A model with retroactive insertions
We describe the extension of the model of Section 2 in which additions, too, may reach into the past, recovering the full update generality of [DIL07]. An update is now either an addition (add, t, x), which retroactively inserts the point at time , or a deletion (del, t, x) as before. The model of Section 2 is the special case in which every addition arriving at time step carries the stamp .
The current data Data is again the multiset defined by processing in arrival order, starting from the empty multiset. For every : first, for every (add, with , add a copy of to Data (additions with , naming a future time, are ignored); then, for every (del, , if then delete one copy of from Data (and otherwise do nothing). As in Remark 2.2, the effect of an update is determined at its arrival and updates are never revisited; in particular, a deletion arriving before the addition it names is a permanent no-op, even if a matching addition arrives later.
The neighboring relation extends accordingly, still at the granularity of a single operation.
Definition A.1 (Neighboring sequences, with retroactive insertions). Input sequences are neighboring if one of them can be obtained from the other by inserting a single update into some : either an addition (add, ) with , or a deletion (del, ).
Definitions 2.6, 2.7, 2.8, and 2.10 extend verbatim to the richer update language. At time , after applying all deletions and retroactive insertions seen so far, the revised state of a past time is
Thus, partial retroactivity queries only the current state Data, whereas full retroactivity may also query any revised past state RevData; both are therefore analyzed under the same privacy definition. The main additional subtlety concerns uniting. A retroactive insertion does not affect any state before the round in which it arrives, but once it arrives, it changes every revised past state whose time is at least its time-stamp. Hence, it is not enough for two histories to contain the same current points: they must also agree on the revised time-stamps of all surviving retroactive insertions. For example, if the same surviving point has stamp 6 in one history and stamp 8 in the other, then their revised states differ for every , even though their current sets may be identical.
B Adaptive privacy
Definition 2.6 treats the input stream as fixed in advance: the stream is oblivious to the answers the algorithm releases. In this appendix we strengthen the definition to streams chosen adaptively as a function of past answers, in the spirit of the adaptive continual release model of Jain et al. [JRSS23], adapted to our update terminology and to our single operation neighboring relation. The adaptive adversary supplies the regular updates in every round and, once during the game, designates a challenge update: a single addition or a single deletion. The challenge is present in one world and absent in the other, and privacy requires that the adversary's view be insensitive to which world it is playing in.
Formally, for a dynamic algorithm , an adversary , and a bit , consider the following game, denoted .
- For :
(a) Based on and its internal randomness, the adversary outputs a multiset of updates. In addition, may output one of the following two declarations, each of which may be made at most once throughout the entire game:
i. a challenge addition () for a point of its choice; or
ii. a challenge deletion () naming a round and a point of its choice.
(b) If , let be together with the challenge update declared in this round (if any); if , let .
(c) Algorithm receives and returns an answer , which is given to .
- The view of the adversary is .
Definition B.1 ((, )-adaptive privacy). A dynamic algorithm is -adaptively private if for every adversary and every event ,
and symmetrically with the roles of the two worlds exchanged.
Definition B.2 (Adaptively private retroactive algorithm). A dynamic algorithm is an -adaptively-private retroactive algorithm if it is -adaptively private (Definition B.1) and retroactive (Definition 2.8).
In world the challenge update is simply omitted; the challenge deletion may name a regular addition, or nothing at all.
C The persistent ranks variant
In the standard sampling compiler of Theorem 5.7, the algorithm draws a fresh, independent sample at every round. In this appendix, we explain the persistent-ranks variant of Remark 5.10, using the notation of Subsection 5.2. In this variant, each addition receives a single secret rank upon arrival, which dictates its inclusion in the sample for its entire lifespan. This creates strict temporal correlation: an extra item's inclusion is no longer an independent coin flip at each round, meaning standard per-round amplification breaks down. To resolve this, the analysis shifts from a per-round perspective to a window-level analysis. The goal is to show that, during the window in which the two executions differ on this item, the entire transcript is affected only if its persistent rank falls in a low-probability range. For deletions, a cyclic rank-shifting argument lets us reduce the analysis to a single additional random rank, rather than having to track a changing collection of affected items over time.
The algorithm attaches to each addition, upon arrival, an independent rank drawn uniformly from , kept secret and persistent; when a deletion removes one of several copies of a stamped point, the copy instantiated last is removed. At every round it forms , the multiset of values of the live copies of smallest rank, and releases with fresh independent coins. Let be -differentially private, and let be as in Theorem 5.7.
Retroactivity. Fix uniting at time . The block of samples is a randomized function of , and is otherwise independent of : the sample at round is determined by , itself determined by , and by the ranks of its elements, which are i.i.d. uniform variables (regardless of the rounds at which they were instantiated). So, as the two trajectories coincide from on, the sample blocks during the two executions are identically distributed, and thus so are the answer blocks, which are per round post processing of them (see Lemma 3.3).
Privacy. Let be neighboring. As in the privacy proof of Theorem 3.2, one of the two neighboring sequences holds one extra surviving copy of a fixed stamped point on a contiguous set of rounds, the data agreeing otherwise. This extra point may influence the outcome only during a window of at most rounds, after which it expires. Now, for every fixing of the ranks and for every round in this window, the samples during the two executions may differ by at most one addition and one removal of stamped points. (This is because the extra stamped point, with its rank, may enter the sample and push another out of it.) By group privacy of at distance two, throughout the window, the per round distributions are -indistinguishable. Basic composition across the window gives -indistinguishability, while advanced composition [DRV10] gives . As this holds for every fixing of the ranks, this also holds without the fixing.
Amplification. The secrecy of the ranks improves these parameters on windows that are much larger than the sample. The following theorem quantifies this improvement.
Nitpicking: when deleting one of multiple copies of the same stamped point, in which case the algorithm has freedom in choosing which point to delete (see Remark 2.2), this choice must not depend on the ranks for them to remain independent. Deleting points by instantiation order, as our algorithm does, works.
Theorem C.1. Let be -differentially private, let and , and set . Assume and . Then for every pair of neighboring sequences in which both satisfy for all , the transcripts of are -indistinguishable.
Proof. Setup. As in the privacy proof of Theorem 5.7, one of the two sequences, denote it , holds one extra surviving copy of a stamped point at a contiguous set of rounds, the data agreeing otherwise. Intersecting this one-copy difference with the live window gives a set of at most rounds at which exceeds by one copy of , the two live windows agreeing elsewhere. To obtain amplification over the whole window, we would like the discrepancy between the two executions to be governed by a single random rank throughout . The difficulty is that, after common deletions, the copy that is unmatched between the two executions may change. If each such copy carried its own independent rank, different parts of the window could be governed by different random ranks. We therefore couple the ranks so that throughout the live-rank multisets differ by one fixed rank , with all remaining ranks matched between the two executions.
We couple the ranks of the two executions so that throughout the one-rank difference is a fixed rank , with all remaining ranks matched between the two executions. For a differing addition this is immediate: we place the added copy first among copies of the same stamped point, so its rank remains the one-rank difference under subsequent common LIFO deletions. For example, if before a common deletion the ranks are
then the common LIFO deletion removes from both executions, leaving
Since the ranks are persistent and may already affect the releases before the differing deletion, the coupling must be defined consistently already before that deletion; it is not enough to couple only the states that remain afterwards. For a differing addition, this is easy: the coupling can place the unmatched rank at one end, while subsequent common deletions proceed from the other end. For a differing deletion, however, the differing deletion and the subsequent common deletions act according to the same deletion rule, so under such a simple coupling the unmatched rank may change after a common deletion.
Thus, for a differing deletion, is the sequence without the extra deletion. Let be the number of surviving copies of immediately before the extra deletion, indexed by instantiation order. Under , we label their ranks . Under , we couple the ranks cyclically, assigning to the first copy and, for every , to the th. In both executions we designate as . Thus, immediately before the differing deletion, the ranks of these copies are coupled as
The differing LIFO deletion acts only in and removes its last copy, which carries . Hence, immediately afterwards,
Every subsequent common LIFO deletion, while the one-copy difference persists, removes the same rightmost rank from both executions, so the difference between their live rank multisets remains .
Inclusion patterns. The coupling above resolves the difficulty of keeping a single distinguished rank throughout the differing window. A separate issue remains. While in both the addition and deletion cases is uniform and independent of the ranks of all other copies, in the deletion case is present in both executions before the differing deletion, and may therefore already affect the released answers before the two executions diverge. To account for this dependence, we track the inclusion of over its entire lifespan, rather than only during the differing window.
Let be the full lifespan of this extra copy under (the set of rounds where it is live). Since items expire after rounds, . Note that fully includes (the critical window of rounds where the extra copy is live under but absent under ).
To determine if this extra copy enters the sample at a given round , we compare its rank to those of the other available items. Let be the -th smallest rank among all live copies excluding the extra copy. (Notice that at rounds , these other copies are exactly the items comprising ) .
Given the fixed ranks of all other items (denoted ), the threshold is a fixed value. The extra copy enters the sample at round if and only if its rank beats the threshold: . Consequently, the entire transcript of answers under depends on exclusively through the binary vector , which we call the inclusion pattern. Let denote the conditional distribution of the transcript given and a specific pattern .
Under the neighboring sequence , the extra copy is completely absent during . Therefore, its effective inclusion pattern, , is forced to zero across , but matches everywhere else in . The transcript under thus follows the conditional distribution .
As a general property, if any two arbitrary patterns differ at exactly rounds, their corresponding samples differ by one item substitution (one removal and one insertion) at each of those rounds. Because the base mechanism uses fresh coins each round, we can compose the privacy loss exactly as in Theorem 5.7, meaning these sample differences result in conditional distributions that are -indistinguishable. Since the lifespan , any two arbitrary patterns over have -indistinguishable conditional distributions via advanced composition.
Amplification. We now bound how much the probability of any arbitrary output event changes between the two universes. Fix , and let be the threshold the
This is a valid coupling because a fixed relabeling of i.i.d. ranks preserves each marginal distribution.
If fewer than other live copies are present, we set , so that continues to describe the inclusion decision exactly. This convention can arise only outside , since for there are at least other live copies.
extra item must beat to enter the sample at least once during the critical window. Since is drawn uniformly from , let be the probability that the random rank successfully beats this threshold (i.e., ).
Case 1 (): The extra item's rank is too high, meaning it never enters the sample during under . Because its pattern was already forced to zero during under , the two inclusion patterns are perfectly identical (), and the conditional transcripts coincide perfectly. Thus, .
Case 2 (): The extra item enters the sample at least once during under . In this case, applying our general pattern bound gives .
To relate this back to the overall probability of under , we must introduce a hypothetical "bad" rank . Under , the inclusion patterns and might differ (for example, at rounds outside of , since the two rank values may induce different inclusion decisions prior to the differing deletion). Fortunately, because any two patterns over are -indistinguishable, we can safely bound .
We choose to minimize this latter probability. Because the minimum over is always less than or equal to the conditional average over the same range, it is bounded by the conditional average of over all . This conditional average is at most . Substituting this bound back into our bound gives:
Next, we rearrange our initial Case 2 bound to isolate the difference between the two universes:
By plugging (3) into the right side of (4), we obtain a worst-case bound for the difference when . Because this difference is exactly zero in Case 1, taking the expectation over all possible values of simply multiplies our worst-case difference by (the probability of Case 2). Therefore:
We next show that with high probability. Since , it suffices to bound for each . Fix such a round . Since is the th smallest rank among the live copies other than the extra copy, the event occurs exactly when fewer than of these ranks fall below (less than successes). At rounds these copies are precisely those in , and by assumption . Therefore,
The assumption in the theorem ensures that . In particular, and . Hence, a Chernoff bound gives
Taking a union bound over the at most rounds in gives
Let . On , we have . Therefore, using , , , and in the preceding bound, we obtain
Thus, using ,
Finally, averaging over and using gives
The reverse direction follows by the same argument after interchanging and .
D Marginal worst case negative result for CountDistinct
This appendix proves the marginal worst-case lower bound for CountDistinct stated in Theorem 6.3, where “marginal” means that accuracy is required separately at each time step, rather than simultaneously over the entire output sequence; thus, the lower bound already holds under this weaker accuracy requirement. We first recall a foundational result of Dwork, McSherry, and Talwar [DMT07] on robust decoding, in the line of reconstruction attacks initiated by Dinur and Nissim [DN03].
Background: Robust LP Decoding. Suppose we have a secret dataset . The results of Dwork, McSherry, and Talwar [DMT07, Theorem 23] imply that there exists a universal constant such that, for every constant , there exist universal constants and such that the following holds. For every coefficient vector , define the linear query
Let , where , be sampled independently and uniformly at random. The corresponding linear queries are , and their possibly noisy answers form the answer vector , where corresponds to the query . With probability over the sampled query set, the following guarantee holds simultaneously for every : given the sampled queries and any answer vector for which at least a fraction of its coordinates satisfy , the linear programming decoder of [DMT07], followed by coordinate-wise rounding, reconstructs a database that differs from in at most coordinates, for universal constants . In particular, by taking for a sufficiently small universal constant , and fixing below the constant corruption threshold of [DMT07], for all sufficiently large the decoder recovers all but of the bits of .
Using this background, we state and prove the lemma.
Lemma D.1 (Reconstruction from marginally accurate answers). There are constants and such that for all sufficiently large there exist queries with for which no randomized algorithm mapping to can satisfy both:
(ii) is -differentially private with respect to changing one coordinate of .
Proof. Set , and choose sufficiently small so that . Suppose satisfies both conditions. We fix to be a sign-query set satisfying the robust reconstruction guarantee established above. Since the random construction above produces such a set with high probability, such a fixed set exists. To derive a contradiction, consider the experiment in which the secret dataset is sampled uniformly from , independently of the internal randomness of , and is run on this input.
Run the decoder described above on the answers produced by to obtain a reconstructed dataset . By condition (i), the probability that any single answer is corrupted (i.e., has error ) is at most . The corruption events across different answers need not be independent, so the number of corrupted answers is not necessarily binomial. Nevertheless, by linearity of expectation, the expected fraction of corrupted answers, , is at most . By Markov's inequality, the probability that the actual fraction of corrupted answers exceeds is at most . Therefore, with probability at least , all but a fraction of the answers are within of the truth.
By our choice of , this corrupted fraction is below the tolerance threshold established above. Conditioned on the corrupted fraction being below the threshold, the decoder errs on at most coordinates. Hence, in this experiment, the expected fraction of correctly guessed bits is bounded from below by the probability that the decoder succeeds multiplied by its accuracy when it does succeed:
On the other hand, let denote the decoder. Since is obtained by post-processing the output of , the mapping is also -differentially private. Therefore, differential privacy imposes an upper bound on the probability that the reconstructed bit correctly guesses the original bit . Fix an index and condition on the other coordinates . The two values of give neighboring inputs, so, writing and , the privacy guarantee applied to the events and in the corresponding directions gives and . Because is uniformly distributed over , the bit is uniformly distributed even after conditioning on , and the probability of correctly guessing is
Manipulating the privacy bounds, we can upper bound :
Plugging this into our success probability yields:
Since and , we obtain . Averaging over all coordinates , the expected fraction of correctly guessed bits permitted by differential privacy is at most .
However, since , the maximum accuracy permitted by differential privacy (<0.792) strictly contradicts the accuracy achieved by the LP decoder ( ). This contradiction proves that no such algorithm B can exist.
We now prove the marginal worst case bound.
Theorem 6.3 (Marginal worst case bound, restated). There are constants such that for all sufficiently large , no dynamic algorithm for CountDistinct that is -private is -accurate per round on the class of all input sequences.
Proof. Suppose is -private and -accurate per round on all sequences. Recall that denotes the exact CountDistinct value on a dataset , whereas denotes the possibly noisy answer released by at round . Let be a parameter, let , and fix the queries of Lemma D.1. For , let
Define the sequence over universe as follows. At round , add value if , and otherwise leave the round empty. Then, for every , use a block of rounds. During the first rounds of the block, add one copy of every value in , using empty rounds as needed. During the next rounds, delete exactly those copies, again using empty rounds as needed, with each deletion naming the stamp of the copy added in that block. Pad with empty rounds to horizon . The construction fits whenever , so we may take .
Two observations about this family are important. First, at round n, the set of values present is exactly Y, and hence
Let denote the last round of the first half of block , after all additions of that block have been processed and before any of its deletions occur. At round , the set of values present is exactly . Therefore,
Moreover,
Consequently, define . The difference between and the true answer to the query is
By the per-round accuracy of , each of the two errors on the right-hand side has absolute value at most , except with probability . Therefore, by a union bound, with probability at least both bounds hold, and in this event
Second, changing one coordinate changes only the update at round : one sequence contains the addition of value , whereas the other leaves that round empty. All updates in the query blocks are identical in the two sequences, and every block deletion names only a copy added within that same block. Hence, the two sequences differ by exactly one addition and are neighboring according to Definition 2.3. Since is obtained by post-processing the transcript of on , the mapping is -differentially private.
The two observations show that is -differentially private and that, for every and every ,
If , then satisfies both conditions of Lemma D.1, which is impossible. Hence,
where the last equality follows from . Choosing the constant in the theorem statement sufficiently small gives the claimed result.