ER-AE: Differentially Private Text Generation for Authorship Anonymization
Paper · 2021 · Haohan Bo, Steven H. H. Ding, Benjamin C. M. Fung et al.
Summary
An anonymous review can still carry clues about who wrote it. A reviewer may favor certain expressions, organize sentences in a recognizable way, or repeatedly use the same small set of function words. Removing the name leaves those habits in place. ER-AE, short for Embedding Reward Auto-Encoder, rewrites text to make such clues less useful while keeping the result readable and faithful enough to serve the purpose of the original. It learns from ordinary text without author labels or a collection of originals paired with anonymized rewrites.
ER-AE first learns to reconstruct sentences. This teaches it which words fit a position when it has access to the source sentence. A second training objective uses word embeddings to give useful alternatives more weight. At release time, the system uses its predictions to draw a small group of likely candidates and puts the remaining vocabulary in a second group. It makes a randomized choice between the groups, then draws a word from the selected group. The authors give a differential privacy bound for this procedure. The bound applies to the distribution of possible releases, with the vocabulary size and sequence length both contributing to the privacy cost.
The experiments use Yelp reviews and academic peer reviews from NeurIPS and ICLR. With a sampling parameter of 3, ER-AE reports a sentence similarity score of 0.75 on Yelp and 0.74 on peer reviews, the highest semantic preservation scores described for the compared systems. The version trained only to reconstruct the input scores around 0.61. For Yelp, where reviewer identities are available, the reported success of an authorship classifier falls from 55% on original text to lower than 10% after ER-AE rewriting. The version without the embedding reward and the SynTF baseline also reach that lower range. ER-AE’s main advantage in this comparison is how much meaning it retains while impairing attribution.
The two objectives can still pull in different directions. A substitution can preserve the shape of a sentence while making a particular claim less accurate, and some released examples contain awkward or unrelated words. The formal guarantee is defined for text records, so it does not directly describe how much protection an author gets when several of their reviews are released together. The authors also identify long texts as a weakness because the privacy cost accumulates across generated positions.
Deep dive: ER-AE: Differentially Private Text Generation for Authorship Anonymization
ER-AE rewrites reviews to conceal writing style, using differential privacy and an embedding reward to preserve as much of the original meaning as possible. · about 38 minutes to read
The problem and its context
Why an unsigned review can still identify its writer
A review contains at least two kinds of information a publisher may care about. The first is what was reviewed and what the reviewer thought. The second is evidence about the person who wrote it. The same words can contribute to both. A way of introducing a qualification can make the argument clear and also be a habit that distinguishes the writer from other people. An authorship anonymizer has to change enough of the second kind of information while keeping enough of the first for the review to remain useful.
Stylometry measures characteristics of writing that can support attribution. Some characteristics are apparent to a reader, such as recurrent turns of phrase. Others are easier to detect by aggregating measurements, such as counts of function words or patterns involving length. Words whose main job is to connect parts of a sentence can contribute to a recognizable profile even if they reveal little about its subject. The paper cites a study showing attribution from a pool of 10,000 candidates and discusses related work on articles, online posts, emails, and reviews. The concern is that an attacker can compare an unsigned text with known examples and find a plausible match from regularities the writer never meant to disclose.
The paper uses academic reviewing to make the distinction concrete. A public review can omit the reviewer’s identity and still express recommendations, objections, and qualifications in a personal way. A reader comparing the review with familiar writing has more to work with than the presence or absence of a signature. A publisher can suppress the signature easily. Removing evidence carried by the prose requires changing the prose itself.
Earlier approaches to text sanitization, as the authors describe them, mostly concentrated on sensitive content. A system might replace explicit identifiers or remove phrases that expose information about a patient. That addresses a disclosure problem where the sensitive item can be located in the document. Stylistic evidence is more dispersed. A name might occur at a particular position. A pattern of phrasing can be distributed across the whole sentence or document. The paper’s motivating distinction is between taking sensitive expressions out of a text and changing the way the remaining information is expressed.
What earlier approaches made possible
The paper situates text release alongside earlier applications of differential privacy to relational records, networks, and transactions. Those applications help motivate the use of a formal guarantee for publication. The challenge here is the type of object that has to be released. A reader needs a sequence that makes sense, with each word agreeing enough with its neighbors for the underlying statement to survive. The authors discuss work on private queries over relational data as part of this background. Towards practical differential privacy for SQL queries
SynTF is the closest earlier approach in the paper’s account. It uses randomized substitutions and an exponential mechanism to produce a private representation suitable for term-frequency analysis. A frequency vector records which vocabulary entries occur and how frequently. That produces a useful input for analyses organized around counts. Word order and the connections between words matter much less to that purpose than they do to a person trying to read the result. The standard SynTF release is such a vector. ER-AE takes on the additional obligation of releasing natural-language text that can still be read as a review.
The distinction matters even if both approaches substitute tokens. A token is an individual unit of text as represented by the system, for example a word or a punctuation mark. A choice can contribute a plausible vocabulary item to an aggregate vector while producing a poor sentence at the exact position where it was inserted. A sentence generator can use contextual predictions to give preference to terms that belong near each other. ER-AE tries to retain the benefits of private randomized selection while using those predictions to make substitution more context-sensitive.
The authors also discuss semi-automatic obfuscation. Anonymouth uses stylistic attributes and reference collections to suggest changes. The writer decides which suggestions to follow and performs the final edits. Such a design gives the person revising the text control over what the changes do to their meaning. It depends on having suitable reference material and a person available to make those decisions. The paper is concerned with cases where a publisher wants to handle an existing collection automatically and lacks the reference data or author involvement that such a workflow assumes.
Work on style transfer offered ways to generate text with controlled attributes. The paper describes research on changing sentiment, tense, or politeness, as well as work that renders modern English in a Shakespearean style. A desired target attribute supplies a direction for the rewrite in these cases. Authorship anonymization has a different success condition. A publisher wants the result to be less revealing of the original writer, and there may be no reason to assign the text someone else’s style or change the writer’s attitude toward the subject. Controlling Politeness in Neural Machine Translation via Side Constraints · Shakespearizing Modern Language Using Copy-Enriched Sequence to Sequence Models
The controlled generation work discussed by the authors also makes clear why an attribute such as sentiment would be an awkward stand-in for personal style. Changing a positive review to a negative one can alter the substance of the review. Changing how a positive assessment is phrased can leave that assessment in place. Similarly, a system trained to imitate a designated author would be solving a problem with a specified target, whereas the review collection may contain writers whose identities are unknown even to the publisher. Toward Controlled Generation of Text · Style Transfer from Non-Parallel Text by Cross-Alignment
A4NT is closer to the authorship problem because it rewrites writing style with anonymity in mind. The authors describe it as requiring examples labeled with known identities. They also point to differences in meaning between some of its source and generated examples and observe that it lacks a formal differential privacy guarantee. These points shape the requirements for ER-AE. The rewrite procedure should be learnable from unlabeled reviews, its releases should remain useful as language, and the privacy argument should apply to the randomization itself.
Which object the privacy claim covers
The paper distinguishes privacy for generated text from privacy for the training data of a released system. An earlier private autoencoder cited in the related work is designed to protect records used to learn its parameters. In ER-AE, the object being published is the rewritten text. The privacy question the authors formalize is how much the release distribution can change when the source text being rewritten changes. This distinction matters because the encoder and generator are learned from data and because releasing either their parameters or their internal predictions would be a different release.
The authors start with a standard notion of adjacency, under which datasets are neighbors if replacing one record turns either into the other. They then treat a piece of text as the whole record in a one-record input. Any pair of source texts in the input domain can therefore serve as neighbors. Changing just a name or a single word is a narrower test than the one intended here. The authors want the randomization to account for differences between entire records, including differences in wording that could have come from different writers.
This framing separates the proposed guarantee from the standard attribution experiment. In the experiment, an attacker has reference passages from a known group and tries to match a text to a member of that group. The formal definition instead concerns the distributions induced by different source texts and applies at the level of output events. The publisher need not enumerate the set of suspects to state that definition. The empirical experiment still matters because the size of the bound and the behavior of a particular classifier answer different questions.
The method, step by step
From a source sentence to a randomized rewrite
The authors build ER-AE around an autoencoder, a system that learns to reconstruct its own input. It has an encoder that compresses the source into a numerical representation and a generator that uses that representation to predict words. During reconstruction training, the source itself supplies the desired output. This is how the authors can use unlabeled reviews. They need the text, while the identity of the person who wrote it and a human-written substitute are unnecessary as training targets.
A reconstruction system has a strong reason to favor the original word at each position. That preference is useful while learning sentence structure. It becomes a problem if the next operation sometimes replaces the original word with another candidate. If all sensible probability is concentrated on copying, the rest of the ranking provides little guidance when a substitute must be found. ER-AE adds an objective that uses relationships between words in an embedding space. The objective changes the distribution of plausible substitutes before the private sampling procedure uses it.
There are two levels of random choice in the release procedure. The first draws a small group from the vocabulary based on the generator’s predictions. The second stage decides probabilistically whether to use that group or its complement. The system draws a member of the selected group and uses it as the output at that position. The predictor is therefore responsible for putting useful alternatives within reach. The randomizer controls how directly the output can reflect the preferences of that predictor.
How ER-AE produces a rewritten text
The steps in order.
What an adjacent pair means in the guarantee
The paper states differential privacy as a bound on the probability of releasing any event when the input is changed to a neighboring dataset.
Pr[A(D₁) ∈ Z] ≤ e^ε · Pr[A(D₂) ∈ Z]
Here A is the randomized release algorithm, D₁ and D₂ are adjacent inputs, and Z is a set of possible releases. The notation ∈ indicates that the observed release belongs to that set. Pr is probability over the algorithm’s random choices, ε is the privacy parameter, and e is the base of the natural exponential. The inequality ≤ is an upper bound and · denotes multiplication. Since the relation between neighbors is symmetric, the same definition can be applied with the inputs exchanged.
A possible event can consist of a particular output string or a group of strings, such as outputs that retain a phrase of interest. The definition concerns how the probabilities of the event compare across inputs. With a smaller privacy parameter, the permitted multiplicative change is tighter. The definition does not require the release to look identical on any specific run. The probability of observing it under alternative inputs is the quantity at issue.
For ER-AE, one source text is a record, and the privacy calculation considers replacing it with another source text. The paper sets a maximum sequence length and analyzes the generation of successive positions. Its preliminary definition describes accumulation in terms of a per-position allowance. The actual allowance derived for the two-group procedure includes an additional term for vocabulary size. This is the distinction between the parameter supplied to the selection rule and the claimed guarantee for a released text.
How the encoder represents the source
The input is first segmented using the NLTK tokenizer. Each token is mapped to a vector. An embedding is a numerical representation in which relationships between vectors can serve as evidence about relationships between words. ER-AE uses pretrained BERT embeddings. This gives the system numerical information learned outside the review collection and supplies a basis for comparing a proposed substitute with the source token. Tokenization · BERT
The encoder uses gated recurrent units, or GRUs. A recurrent unit updates an internal state as it processes a sequence. Its gates regulate what it retains from the earlier state and what it takes from the current input. The encoder traverses the sequence in both directions. This gives the final representation access to information accumulated from either end of the review sentence. The paper then combines the last states from both passes and applies a learned linear transformation. On the Properties of Neural Machine Translation: Encoder-Decoder Approaches
E(x) = Wₕ × concat(s_f, s_b)
x is the source token sequence, and E(x) is the resulting latent vector, the numerical representation passed to the generator. s_f and s_b are the final forward and backward states. The function concat joins them end to end. Wₕ is the learned projection matrix, and × denotes matrix multiplication. Each state has dimension m, the GRU state width. The matrix has shape h × 2m, where h is the width of the projected representation and 2m is the width of the joined states.
This vector gives the generator information about the entire source sentence before it predicts any particular word. The authors describe it as carrying semantic features, although the computation itself does not separately label features as meaning or style. How the vector is used follows from training. Reconstruction rewards retaining details that help explain the actual sequence. The embedding objective addresses which alternatives the generator should also consider.
How the generator assigns probabilities to words
The generator is another recurrent network. At an output position it has access to the source representation, the previous recurrent state, and the embedding of the preceding token in the original sequence. The word “original” is important here. The equations and the privacy argument describe predictions conditioned on the source token at the preceding position. They do not describe a decoder whose only word-level context is its own preceding randomized output.
zᵢᵥ = wᵥᵀ GRU(E(x), Em(xᵢ₋₁), sᵢ₋₁) + bᵥ
i indexes the position being generated and v denotes a candidate vocabulary token. zᵢᵥ is its logit, an unnormalized score. wᵥ is the learned weight vector for v, with ᵀ indicating transpose so the product with the recurrent state is a dot product. GRU returns the generator state from its indicated inputs. E(x) is the encoded source, Em is the embedding lookup, xᵢ₋₁ is the preceding source token, and sᵢ₋₁ is the preceding generator state. bᵥ is the learned bias for candidate v, added to the dot product.
A softmax converts the scores across the vocabulary into probabilities. It assigns a larger share to tokens with higher scores and normalizes across all candidates at the position.
Pr[x̃ᵢ = v] = exp(zᵢᵥ) / ∑ᵥ′∈V exp(zᵢᵥ′)
x̃ᵢ is the token-valued random variable at position i under the generator’s predictive distribution. v is the candidate whose probability is of interest, V is the vocabulary, and v′ runs through the entries of V in the sum ∑. exp is the natural exponential, zᵢᵥ and zᵢᵥ′ are the corresponding logits, and / denotes division by the total weight. Pr refers here to the predictive probability before the privacy procedure.
Picking the top-scoring token would use these scores in the most direct way. The result would also respond directly to a change in the input. Sampling from the predictive distribution on its own does not supply the bound the authors seek. ER-AE uses the distribution as an intermediate object. It provides evidence about which words could fit, which the subsequent mechanism turns into a different distribution for release.
Why the exponential mechanism works on groups
The exponential mechanism is a way to randomize a choice over discrete candidates while preferring candidates that receive higher ratings. The rating can depend on the source. A sensitivity term accounts for how much the rating of a candidate can change when the input is replaced by a neighbor. The selection rule assigns exponential weight to the rating and divides by the total weight over possible choices.
Pr[ε₍ε,ρ₎(m) = n] = exp((ε / (2∆)) · ρ(m, n)) / ∑ₙ′∈N exp((ε / (2∆)) · ρ(m, n′))
ε₍ε,ρ₎ denotes the randomized mechanism with parameter ε and rating function ρ. Its input m belongs to the set of possible inputs, and n is an output candidate from N, the set of choices. n′ ranges over that set in the denominator. ∆ is sensitivity, the maximum difference in the rating for a fixed candidate across adjacent inputs. Pr is probability, exp is the natural exponential, ∑ sums the weights, and ∈ means membership. The factor 2 is part of the mechanism’s scaling, · denotes multiplication, and / denotes division.
For a vocabulary-sized choice, even candidates with little stylistic or semantic value can collectively carry substantial weight. In the paper’s setting there are 20,000 vocabulary entries per dataset. A relatively high rating for a suitable replacement has to compete with weights spread across all those entries. The authors motivate their two-set mechanism by the difficulty of obtaining a useful word in this setting without raising the sampling parameter. They draw on earlier work on sub-sampling but use probabilities derived from the input to construct the preferred group.
At each position, the mechanism samples candidate members using the predictive distribution. The draws are made with replacement. A word may therefore be drawn repeatedly while contributing a single distinct member to the preferred set, S. The rest of the vocabulary belongs to O. The paper denotes the draw setting by k and uses 5 in its experiments. The roles of the groups are asymmetric. A candidate drawn into S competes with a small set of other drawn candidates if that group is selected. A candidate in O competes with the many other words that were left out.
ρ(C) = ∑ᵥ∈C p(v) / ∑꜀′∈𝒩 ∑ᵥ′∈C′ p(v′)
C is a candidate group and 𝒩 is the collection containing S and O. C′ ranges over both groups, v ranges over members of C, and v′ ranges over members of the group C′. p is the predictive probability at the current position. ρ(C) is the group’s rating, ∑ denotes summation, ∈ denotes membership, and / divides the group’s probability mass by the combined mass. The denominator covers the full vocabulary because the groups are disjoint and together contain every entry.
The group’s rating measures how much of the current prediction is represented by its members. A preferred set with a few highly scored words can carry much of the probability mass despite its small size. The mechanism applies the exponential choice to the ratings of the two groups. The candidates for that choice are now groups, with probabilities controlled by their ratings, rather than all vocabulary entries given their own exponential weights.
Pr[T = C] = exp((ε / (2∆)) · ρ(C)) / ∑꜀′∈𝒩 exp((ε / (2∆)) · ρ(C′))
T is the group selected for the current position. C is the group whose selection probability is being calculated, and C′ ranges over 𝒩, the pair of possible groups. ρ gives each group’s rating, ε is the sampling parameter, and ∆ is the sensitivity in the exponential rule. Pr, exp, ∑, ∈, ·, and / denote probability, natural exponentiation, summation, group membership, multiplication, and division. The probability is calculated for the groups already constructed at that position.
The output is then drawn randomly within the chosen group. The proof treats this as a uniform choice. A word’s predictive score can affect which group it joins and how likely that group is to be selected. Once a group has been chosen, the words inside it have equal chances conditional on membership in that particular group. The preference for plausible words enters before the final draw.
Pr[w ∈ O] = (1 − p(w))ᵏ
w is a fixed vocabulary word, O is the complement, and p(w) is the predictive probability of drawing w on a candidate draw. Pr is probability, ∈ denotes membership, 1 is the total probability of a draw, − is subtraction, and k is the number of draws with replacement. Exponentiation by k expresses the probability of missing the word on every draw. In that case it stays in the complement.
Pr[Y = w] = Pr[w ∈ S] · Pr[T = S | w ∈ S] · Pr[Y = w | T = S, w ∈ S] + Pr[w ∈ O] · Pr[T = O | w ∈ O] · Pr[Y = w | T = O, w ∈ O]
Y is the released token at this position, and w is the candidate being considered. S is the group of sampled candidates, O is its complement, and T is the selected group. Pr denotes probability, ∈ denotes membership, | means “conditional on,” · multiplies probabilities along each route, and + combines the two mutually exclusive routes. Each term first accounts for membership, then for selection of the group containing the word, then for drawing the word from that group.
The expression explains why the groups can change the odds for a suitable candidate. A word with a substantial predictive probability has more chance to appear in the compact group. If the compact group is selected, that word benefits from having fewer candidates alongside it. A less plausible word can still be released through the complement. Keeping that route available is part of how the procedure limits the information exposed by membership in the preferred group.
From sampling one token to releasing a sequence
The privacy proof compares the probability of a fixed token under two adjacent sources. Under any outcome of group construction considered in the proof, one group contains that token. The mechanism assigns each group a chance of being selected, including the group that contains the token in question. Across the two inputs, the proof bounds the change in this part of the probability using the exponential rule. It then bounds the contribution of the final uniform draw by comparing the possible group sizes.
exp(ε) · s = exp(ε + ln(s))
ε is the parameter for the exponential choice, s is the vocabulary size, exp is the natural exponential, and ln is the natural logarithm. The multiplication dot combines the bound for group choice with the factor s for within-group sampling. + adds the corresponding contributions in the exponent. The paper states the single-position guarantee as differential privacy with parameter ε + ln(s).
The vocabulary factor is important because even when ratings are close enough to allow a privacy argument for the selection between groups, their members and sizes can vary. For instance, a word can be confined to a broad complement for one source and be available through a much smaller group for another. Conditional uniform selection only fixes the rule inside whichever group is chosen. Its effect on the odds of a particular word can still change substantially. The proof uses the size of the whole vocabulary to bound that effect for the configurations it considers.
x̃_dp[i] ∼ Random(Tᵢ), i ∈ [1, l]
x̃_dp[i] is the released token at position i in the private output sequence, Tᵢ is the group selected at that position, and Random is the uniform choice from its members. ∼ means that the token is drawn according to that choice. ∈ places the index in the range from 1, the first position, to l, the length used in the sequence bound.
The authors apply sequential composition to the releases at successive positions. In the argument, the generator produces the predictive distribution using the original source and the source-conditioned recurrent state. The bound is then charged again for another sampled token. The total reflects the possible accumulation of evidence from all the tokens in the released sequence.
ε_sequence = (ε + ln(s)) × l
ε_sequence denotes the bound for sampling the sequence, ε is the parameter for group selection at a position, s is vocabulary size, ln is the natural logarithm, and l is sequence length. + adds the vocabulary term to the selection parameter, and × multiplies the per-position bound by the number of positions. The paper uses a bounded length in defining the release problem. The distinction between that accounting length and the observable number of emitted tokens matters when applying the argument to texts of different lengths.
Learning to reconstruct, then learning which words to favor
The first training objective rewards reconstruction. At each source position it favors assigning high predictive probability to the original token. Collecting this objective across the training texts teaches the generator to use the representation of the source together with its local word context.
L_recon = −∑ₓ∈D ∑ᵢ log Pr[x̃ᵢ = xᵢ]
L_recon is the reconstruction loss. D is the set of training texts, x is an individual text in D, and i ranges over its token positions. xᵢ is the original token at position i and x̃ᵢ is the generator’s predictive random variable at that position. Pr is the probability that it matches the source token. log is the logarithm, ∑ sums over positions and texts, ∈ denotes membership, and the leading minus sign turns high probability of the source word into a lower loss.
Reconstruction supplies a definite target at every position. A source phrase establishes that the observed words can occur together, and fitting many such contexts teaches regularities that help reproduce them. The loss gives the original word a distinguished role. A suitable synonym receives no direct credit simply because it would also make sense. This is tolerable for a copier whose main job is to recover the observed sequence. It leaves the private sampler with a ranking that may deteriorate sharply outside the first choice.
The authors use a word similarity reward to make that ranking more useful. The comparisons are between embeddings for a candidate and for the source token. The reward caps the largest similarity values. That limits the extra advantage of an exact match under this objective, since very close alternatives can receive the same maximum reward as the original token.
γ(w, v) = min(cosine(Em(w), Em(v)), 0.85)
γ is the reward function for a pair of vocabulary words w and v. Em returns the embedding of each word, and cosine measures how closely the two vectors point in the same direction. min returns the smaller of the cosine similarity and 0.85, the cap specified by the paper. In training, one argument is the original word at the current position and the other is a candidate.
The policy-gradient-inspired objective includes a term for highly ranked candidates and a term that draws comparison candidates from the vocabulary. This gives the training process a way to bring word relationships beyond the current shortlist into the calculation. It is a reward on candidate scores, applied during training. The candidate groups at release time still follow their own sampling rule.
L_embed = ∑ₓ∈D ∑ᵢ [−∑ᵥ∈Eₖ(x̃ᵢ) log Pr[x̃ᵢ = v] · γ(xᵢ, v) + ∑𝓌∼Vₖ log Pr[x̃ᵢ = w] · γ(xᵢ, w)]
L_embed is the embedding reward loss, D is the training collection, x ranges over its texts, and i indexes positions in each text. xᵢ is the actual token and x̃ᵢ is the token-valued prediction at that position. Eₖ(x̃ᵢ) is the list of the k highest-ranked candidates under the predictive probabilities, with v ranging over that list. Vₖ denotes the vocabulary sampling used for the comparison candidates w, and ∼ denotes sampling. Pr is predictive probability, log is the logarithm, γ weights each term by the embedding reward, and · multiplies the reward by the log probability. The summation signs collect the contributions, ∈ indicates membership, and the signs − and + distinguish the two terms as written in the paper.
For positively rewarded shortlist words, the negative log probability term makes an increase in their probability favorable to the objective. The randomly drawn terms enter with the opposite sign in the written loss, so the entire expression cannot be read as giving both sets the same kind of positive boost. The authors describe the shortlist as using strong candidates already known to the predictor and vocabulary sampling as bringing less frequently considered words into the comparison. The observed examples of changed shortlist probabilities test the overall objective. They do not isolate how much each part contributes.
Training begins with reconstruction using Adam, the optimizer that adjusts the learned parameters. The authors then bring in the embedding reward and optimize a weighted combination. The reconstruction term continues to supply the original sequence as a target while the embedding term alters the incentives for alternatives.
L = λ_recon × L_recon + λ_embed × L_embed
L is the combined loss, L_recon is reconstruction loss, and L_embed is embedding reward loss. λ_recon and λ_embed control the importance of those terms, × denotes multiplication, and + adds their weighted contributions. The reported weights are 1 for reconstruction and 0.5 for the embedding term.
The encoder and generator each use stacked GRUs with two layers and 512 cells per layer. The pretrained embeddings have dimension 768. The authors build a separate vocabulary of 20,000 entries for each dataset and specify a maximum input length of 50. Training uses a learning rate of 0.001 and a batch size of 128. The training reward uses a k setting of 5, and the candidate draw setting inside the private sampler is also 5. These settings belong to different operations. The reward uses its shortlist to learn scores, while the sampler draws a group based on those scores when generating a release.
The system is implemented in TensorFlow, and the authors make the authorship anonymization code and data available for reproducing the experiments. TensorFlow
Experiments and results
Two review collections with different evidence about identity
The Yelp collection contains 76,241 reviews and 200,940 sentences from 100 authors. It brings together reviews and tips from the 100 reviewers with the most contributions. The known identities make it possible to ask whether an attribution classifier can recover the author of a held-out example. The selection criterion also means the experiment is built around particularly active reviewers, whose writing is available in quantities that support attribution training.
Public reviews from NeurIPS for 2013 through 2018 and from ICLR for 2017 are part of the academic collection. It has 17,719 reviews and 268,253 sentences. The authors construct it using the earlier review data and crawler associated with PeerRead. The reviewers’ identities are unknown, which makes this collection a practical example of why author labels cannot be assumed. It also changes what the evaluation can establish. The source and rewrite can be compared directly for meaning and measurable style, while true author identity is unavailable as an attribution target. PeerRead
Both datasets use a 70/10/20 split for training, development, and evaluation. The authors use training text to learn the rewrite system, and the reported result comparisons concern the held-out evaluation. The authorship classifier is also trained on the training split and tested on held-out Yelp data. This setup tests whether the rewrites interfere with applying what it learned from the reference writing. It leaves a separate question about a classifier trained specifically to attribute rewritten passages.
What the comparison systems test
Random Replacement, abbreviated Random-R, draws substitutions from the vocabulary without using the contextual predictions of an encoder and generator. It is a useful control because preventing an attribution classifier from recognizing the author becomes easy if enough information is destroyed. The question for an anonymizer is whether the output can remain recognizable as an expression of the original review. Random-R helps show what poor utility looks like when changes ignore the words’ roles in a sentence.
AE-DP uses the autoencoder and the proposed two-set sampler but omits the embedding reward. Its role is to test the value of the added training objective. Both ER-AE and AE-DP are subject to the same kind of final randomization. Their difference is the way the predictor is trained to distribute probability across candidates before randomization. A comparison between them is more informative about the reward than a comparison with a system using a different selection rule at release.
SynTF supplies a published private text-processing baseline. The authors take its sampled tokens directly, before assembling a frequency vector, to compare the resulting text with the source and with the other outputs. This choice makes the comparison possible at the sentence level. SynTF’s normal release serves applications that use frequencies, so poor performance as a readable ordered sequence does not establish poor utility for the purpose it was designed to serve.
How the paper measures utility and privacy
The semantic measure is based on the Universal Sentence Encoder, which produces a vector for a sentence. The authors compare the vector for a source sentence with the vector for its rewrite using cosine similarity. This gives credit for sentences that occupy similar positions in the representation even if their words differ. It gives the study a consistent score for comparing systems over many examples. It is still a similarity check. A high score on an individual pair can coexist with an inaccurate qualifier, an awkward construction, or a substitution that changes the claim.
The authorship measure asks a classifier to identify the author of held-out text. An increase in error or a fall in identification success can be read as an empirical privacy benefit for the tested setup. The classifier learns from original writing in the training split. The assessment asks how much its ability to recognize that writing carries over after rewriting. It does not use the semantic score as evidence of anonymity or use anonymization success to infer anything about meaning.
The third measure uses Stylo-Matrix to combine stylistic features. The authors give word counts for function words and text length as examples of the kinds of evidence captured. They compare source and generated features using an L2 measure, which summarizes how far apart the feature vectors are. A larger stylistic change shows movement in the features counted by this representation. It can be measured without knowing each reviewer’s identity. For the same reason, it addresses a different question from classification and cannot establish whether the new features still reveal a writer.
These measures put checks on different failure modes. An unchanged sentence should preserve meaning, but offers no stylistic disguise. A sequence of unrelated replacements can substantially change style and frustrate attribution while becoming useless as a review. A system can also change the measured stylistic features while leaving other recognizable habits. The paper evaluates all three dimensions because any one of them on its own could make an unsuitable release look successful.
Sentence similarity and attribution
For Yelp and the academic reviews, the paper reports USE similarity scores around 0.2 for SynTF and Random-R. The authors’ examples accompany this result with strings that contain isolated words related to the input but lack a readable rendition of the review. The reported similarity for AE-DP is around 0.61. The full ER-AE with a sampling parameter of 3 achieves 0.75 on Yelp and 0.74 on peer reviews. These are scores for similarity between the original and the generated sentences under the USE measure.
The relative positions of the systems in this comparison help explain why reconstruction and the embedding reward both appear in ER-AE. AE-DP already uses context and learns from observed sequences, and it obtains better sentence similarity than the two low-utility baselines described in the paper. Adding the embedding reward gives the sampler a distribution whose alternatives can be more useful when the original word is not drawn. The full ER-AE obtains the strongest stated utility results while retaining randomization at release.
For the Yelp evaluation, the paper reports authorship identification success of 55% on the original text. The reported success falls to lower than 10% for text generated by AE-DP, SynTF, and ER-AE. The common threshold describes the range for those systems. It does not give an exact ranking among them. The paper also describes stronger privacy performance for Random-R in the empirical comparison, with its low usefulness as text. The combination ER-AE demonstrates has more to do with preserving utility at a low observed attribution success rate than with producing the lowest attribution rate among all substitutions.
On peer reviews, the numerical discussion reports a change of more than 10 in the stylometric measure for the competitive private rewriting methods. That is evidence of movement in the feature representation used by the study. Direct identification success for those reviews cannot be calculated as it can for Yelp because the true reviewer identities are unknown. The academic evaluation can say that sentences are closer in meaning under USE and that measured styles change. It cannot establish how frequently a known pool of academic reviewers would be correctly identified from the output.
A closer look at what the sampler chooses
The authors also compare the ordinary exponential mechanism with their two-set mechanism using the intermediate predictions for particular words in a Yelp review. One of the reported words is several, from a sentence about the choice of hot dog dishes. The value under each mechanism is an estimated probability of sampling that token at its position, based on the intermediate predictions. This is a local comparison of sampling rules. It is distinct from a USE score or an aggregate measure of choosing suitable replacements across the Yelp evaluation set.
Estimated sampling probability for “several” in a Yelp review example
The two-set sampler assigns the selected word much more probability in this example.
The numbers
| System or setting | probability |
|---|---|
| Exponential mechanism | 0.0017 |
| Two-set exponential mechanism (this paper) | 0.7411 |
The same calculation for unique gives 0.00091 under the ordinary mechanism and 0.6794 under the two-set mechanism. The paper uses these examples to illustrate how a high-scoring word can have little absolute chance of being drawn when the exponential mechanism weighs the entire vocabulary directly. Grouping makes membership in a compact set matter to the eventual draw. Both examples concern particular words judged useful in context by the authors. They provide estimates from a worked case, while the sentence-level experiments show how the full rewriting system behaves on broader collections.
Reading the privacy and utility trade-off
The paper compares USE similarity, Yelp attribution error, and stylometric distance at different sampling parameter settings. Larger values allow the sampler to favor high-rated choices more strongly. The benefit is improved utility in the paper’s account. The cost is weaker formal privacy and less empirical obscuration as the outputs become more dependent on the source. The figure relates metrics with different meanings, so they are read alongside one another. The same setting can improve the fidelity of the review and preserve more of the evidence that helps an attribution system.
The discussion contrasts the value of 42.5 used for SynTF with a value around 13 for ER-AE under the paper’s comparison on the same dataset. This comparison belongs to the authors’ discussion of vocabulary size and meaningful sampling. The paper also reports 3 as the input sampling parameter for its highest USE results and gives a formula that adds the vocabulary term and accounts for length. The quoted values have to be read with their scope. A setting for the group selection rule, a comparison of token sampling costs, and a bound for the release of a whole sequence answer different questions.
What the ablations show
What changes when the embedding reward is removed
AE-DP provides the main component ablation. It uses reconstruction training and the two-set privacy sampler. ER-AE adds the embedding reward while keeping that sampler in place. The semantic scores favor the full system on both collections. Since AE-DP also impairs the Yelp classifier, the cleaner interpretation of the comparison is that adding the reward improves the available replacements and the resulting utility. The private sampling procedure can already achieve the reported attribution range without the added reward.
The intermediate prediction examples show how this can happen. For a Yelp review mentioning assorted hot dog dishes, AE-DP assigns several a predictive probability of 0.98 at its original position. Its other displayed candidates have little probability available to them. ER-AE assigns many 0.55, some 0.20, and several 0.14 at the same position. This is an example of the original word losing its dominant share to alternatives that still describe an assortment. These values come from the generator’s predictions, before the randomized selection between candidate groups.
Predictive probability of “several” at its source position in a Yelp review example
The embedding reward reduces the probability concentrated on copying the source word at this position.
The numbers
| System or setting | probability |
|---|---|
| AE-DP | 0.98 |
| ER-AE (this paper) | 0.14 |
Here the direction reflects the specific diagnostic of concentration on copying in this example. It is useful because the accompanying candidates show where the probability went. A decrease in the probability of the source word, considered by itself, could come from assigning weight to irrelevant words. In this case, the result shifts substantial weight to words that can play a similar role in the clause.
The prediction for unique exposes a difference between broadening a shortlist and preserving an exact claim. AE-DP predicts the original word with probability 0.99. ER-AE assigns it 0.37, with great at 0.21 and amazing at 0.15. The alternatives could be natural adjectives in a favorable restaurant review. A reader would still distinguish a claim about unusual dishes from a claim that the dishes are especially good. The reward encourages candidates with useful associations, and those associations can maintain the broad tone while changing the specific attribute being asserted.
Together these positions show why the authors examine the softmax distribution before sampling. The AE-DP predictor learns the task of recovering the source word and can do it with high confidence. Its second choices may have tiny absolute weight. ER-AE moves useful probability into alternatives, giving semantically related words more opportunity to enter the preferred group. The local examples are evidence for the authors’ explanation of the aggregate improvement. A few plausible shortlists do not measure how frequently every part of a rewritten review is factually faithful.
What the different choices reveal
The comparison of ordinary and two-set sampling looks at a different part of the system. It uses the paper’s intermediate probabilities to estimate how likely the mechanisms are to produce selected words. The improvement in those estimates is about how the sampler allocates probability once there is a ranking to use. The reward ablation changes that ranking. The sampling comparison changes the rule through which a ranking becomes an output. These are separate interventions, and both matter when the best word is one candidate in a large vocabulary.
The contrast with Random-R illuminates the need for contextual scores. Random substitutions can be sufficiently disruptive to defeat the tested attribution classifier. They can also make a sentence difficult to associate with its original subject or conclusion. This is a meaningful control because it shows how a privacy metric can improve when an output ceases to do its job. A useful change has to preserve enough of the review for its eventual reader. The AE-DP comparison then narrows the question from whether scores matter to whether training for alternatives improves an already context-sensitive system.
The paper’s sample rewrites make the same point in terms a reader can examine directly. In the restaurant example about ordering a tamarind margarita, ER-AE keeps the item being discussed and changes the verb for requesting it, while introducing an agreement error later in the sentence. A peer-review example retains a favorable assessment of a manuscript and the idea that it offers insight, while changing words that describe the writing and the assessment. These outputs explain why aggregate similarity can be relatively high even in the presence of local grammatical errors.
A less successful case changes exactly to occult in a comment about getting what one pays for. The resulting expression does not make sense in context. The authors use examples of this kind to acknowledge how poor substitutes can still enter the generated text. The shortlist can fail to represent the right sense of a word, and the private release procedure preserves a route for words outside the preferred group. A readable-looking sentence can therefore contain a failed substitution even when much of its source structure survives.
The parameter sweep provides a further controlled comparison. Holding the general design in place and changing ε changes the balance between utility and protection. The paper reports the trend through semantic similarity, attribution error where labels are available, and the stylometric measure. This analysis concerns the strength of randomization. It does not isolate the contribution of varying the number of draws, the reward cap, or the different terms in the reward. The experiments that remove the full reward, change the sampling rule in a worked case, and vary the privacy parameter therefore illuminate particular mechanisms rather than every design choice independently.
Limitations
Limits the authors identify
The authors identify long-text generation as an unresolved issue. The stated privacy cost grows with the number of released positions, so applying the same per-token allowance to a longer review increases the sequence bound. Tightening the per-token setting to compensate can reduce the preference for contextually useful candidates. Their proposed direction for future work is better allocation of the privacy budget across longer outputs. The current experiments use a maximum input length of 50, and the paper’s strongest evidence concerns generation and evaluation at the sentence level.
The paper also acknowledges irregular output quality. Word embeddings supply an external source of relationships, but the available information can yield poor candidates in context. The example involving occult shows a change severe enough to interrupt the meaning of the sentence. Another output shows that preservation of broad structure is compatible with an agreement error. The authors demonstrate improved quality over their baselines. Their own examples establish that the generator can still undermine particular statements or produce prose that would need editing.
The discussion suggests incorporating information about authorship or utility, such as topics, into the privacy formulation as a possible way to lower the bound. The authors acknowledge that this would restrict the datasets for which the approach is applicable. The broader problem is already visible in the two evaluation collections. Yelp supplies writer identities. The peer reviews demonstrate a use case where those identities are missing. Adding a data requirement tied to identity could change which parts of the study’s motivation a revised approach can address.
In their ethical discussion, the authors identify the possibility of using generation to produce fake reviews. They mention fake-review detection as a way to address that misuse. Such detection is outside the experiments. The demonstrated capability is rewriting review content with some preservation of meaning and a change in identifiable style, without requiring the author’s participation.
Limits that follow from the setup
The proof is stated for the random draws that produce a sequence of a specified length. The generation procedure also describes iterating over the length of the original text. Under adjacency that allows replacing an entire source with a different-length source, an observable release length can distinguish some inputs directly if it always equals source length. A public cap on length bounds the number of steps. It does not by itself make the output lengths overlap. The stated composition argument covers the sampled positions for the length being analyzed. Extending that argument to unrestricted adjacency across lengths would require a public output length, a length-hiding treatment of padding, or randomness for the stopping decision with its own accounting. The paper does not establish such a guarantee for its source-length loop.
The text-level guarantee also concerns one record at a time. The authors discuss a conservative pairwise choice of adjacency in which any two texts can be compared. That answers a question about alternatives for the source of a given release. A person can contribute several records, as reviewers in the Yelp setting do. Joint release can supply a reader with evidence across those records, and author-level accounting would need to address the collection that can change together. The paper reports per-sequence accounting. A similar scope issue applies if several independently randomized versions of the same input are released.
The proof analyzes generation from a predictor and vocabulary in use at release time. It gives a bound on how sampled outputs react to replacing the current source. A separate question is what happens to the learned parameters or to the vocabulary if records in the training collection change. The paper describes separate vocabularies built for the datasets, training on text, and the release of generated text. The proof supplied for the two-set sampler does not constitute a private training procedure or protect the release of intermediate vectors, token scores, or learned parameters.
The practical strength of the formal claim depends on the bound for the object being compared. The stated bound includes a vocabulary term at each position and adds costs across length. A low classifier success rate does not tighten this mathematical bound. It gives complementary evidence about the classifier and data under the conditions tested. Likewise, quoting the input setting used to produce strong sentence similarity does not by itself state the privacy parameter for a released sequence. Both issues matter when interpreting a phrase such as “the privacy budget” in discussions of the results.
The tested classifier is only one empirical attack procedure. Training it on original writing and evaluating it on rewrites checks whether the learned signals survive this particular transformation. It does not establish what a classifier would learn from labeled rewrites, whether it would benefit from seeing several outputs by the same person, or how other kinds of reference evidence would affect its results. The Yelp pool is also defined by heavy contributors and a known set of authors. Peer reviews confirm that the method can be trained and applied in an unlabeled collection, but supply no identification rate to settle these questions in the academic setting.
The semantic evaluation is similarly limited by what it measures. Similarity between whole-sentence vectors can credit retention of the subject and tone when a local substitution changes a specific judgment. The reported examples are useful for observing that distinction, though the paper does not give a systematic human assessment of grammaticality, fidelity, or fitness for release. The review’s topic, entities, and specific details may also offer identity clues independently of the stylistic features measured. ER-AE is meant to preserve much of the review’s content, which leaves this form of disclosure as a separate concern when evaluating an actual publication.
The baselines narrow some causal questions while leaving others open. AE-DP supports attributing the utility improvement to the embedding reward as a whole. Random-R anchors what happens when replacement ignores context. SynTF tests sampled tokens from a published private representation approach in a setting that values readable order. The paper’s comparison does not provide a controlled ranking against every style-transfer or paraphrasing approach discussed in the related work. Its detailed evidence supports the comparison with the systems it actually runs and the metrics it reports.
What came after
Keep it Private takes up the broader problem of privatizing online text using an unsupervised approach. The connection to ER-AE lies in treating the usable text as the object to be transformed and avoiding dependence on labeled examples for learning that transformation. ER-AE addresses this problem through authorship obfuscation in reviews. The later work frames its subject more broadly as the privatization of online text. Its citation places ER-AE in that line of research, while the title alone leaves open which operations it adopts and how it evaluates privacy. Keep it Private
PrivacyRestore brings privacy transformation into inference, with an approach organized around removing private information and restoring it. The relationship to ER-AE is the shared problem of changing language to control disclosure while retaining utility. The intended use of the transformed text differs. ER-AE produces a rewrite intended for release as a readable artifact. In PrivacyRestore, removal and restoration belong to a procedure for performing inference. The citation connects those privacy problems without establishing that PrivacyRestore uses ER-AE’s particular grouping rule or embedding reward. PrivacyRestore
DP-IPI applies differential privacy to rewriting clinical text, with indirect personal identifiers as its stated target. This is close to ER-AE in treating the readable rewrite as the place where a formal privacy mechanism can operate. It changes what the privacy-sensitive evidence consists of. ER-AE focuses on regularities that may identify the author, while DP-IPI focuses on indirect identifiers in clinical text and describes its rewriting mechanism as hybrid. The citation shows how the problem of private rewriting extends from stylistic evidence in reviews to sensitive information carried indirectly by clinical prose. DP-IPI
Cite
Cite as Haohan Bo, Steven H. H. Ding, Benjamin C. M. Fung and Farkhund Iqbal. 2021. ER-AE: Differentially Private Text Generation for Authorship Anonymization. Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies.
@inproceedings{bo2021er,
title = {{ER-AE: Differentially Private Text Generation for Authorship Anonymization}},
author = {Haohan Bo, Steven H. H. Ding, Benjamin C. M. Fung and Farkhund Iqbal},
booktitle = {Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
year = {2021},
doi = {10.18653/v1/2021.naacl-main.314},
url = {https://doi.org/10.18653/v1/2021.naacl-main.314}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bo-2021-er-ae-differentially-private-text/