{'fraction_non_alphanumeric': 0.030985241869363214, 'fraction_numerical': 0.012879201967750751, 'mean_word_length': 5.064429252123472, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Reproduction and Replication of an Adversarial Stylometry Experiment

Maintaining anonymity while communicating using natural language remains a challenge. Standard authorship attribution techniques that analyze candidate authors' writing styles achieve uncomfortably high accuracy even when the number of candidate authors is high. Adversarial stylometry defends against authorship attribution with the goal of preventing unwanted deanonymization. This paper reproduces and replicates experiments in a seminal study of defenses against authorship attribution (Brennan et al., 2012). We are able to successfully reproduce and replicate the original results, although we conclude that the effectiveness of the defenses studied is overstated due to a lack of a control group in the original study. In our replication, we find new evidence suggesting that an entirely automatic method, round-trip translation, merits re-examination as it appears to reduce the effectiveness of established authorship attribution methods.

In this context, it is a matter of some urgency to develop and refine techniques to defeat or frustrate stylometric fingerprinting. Adversarial stylometry aims to prevent involuntary deanonymization by "apply [ing] deception to writing style to affect the outcome of stylometric analysis" (Brennan et al., 2012).
Past research on adversarial stylometry such as Brennan et al. (2012) has focused on manual interventions, making a wager that a motivated individual may be able to alter their prose style in a new document to a sufficient degree that standard authorship attribution methods will struggle to associate the document with the individual's previous writing. Manual interventions to obscure one's style deserve attention even if manual interventions ultimately prove less effective than machine-supported style obfuscation methods because they can be used when no trusted computational resources are available. Such a setting is easy to imagine in the case of whistleblowing. For example, a whistleblower at a financial firm seeking to expose wrongdoing while maintaining anonymity may lack immediate access to an unmonitored computer.
Contribution In this paper, we report on a reproduction and, separately, a replication of the experiment described in Brennan et al. (2012). First, we carefully reproduce the experiment using the materials and methods described in the original paper. We perform this reproduction in order to double-check the original findings. We are motivated here by the recommendation, found in numerous academic communities, that reproduction of previous studies should be regarded as an essential practice (Stodden et al., 2014). Second, we replicate the experiment using a new population of writers. In our replication, we correct for oversights in the original design, chief among them the absence of a control group. The contributions of this work are as follows: • We confirm the usefulness of two manual adversarial strategies. Both techniques reduce the accuracy of standard authorship attribution models to around 20% accuracy given ten candidate authors. • Our study confirms that an automatic intervention, round-trip machine translation appears to be useful in obscuring one's writing style, although less effective than the two manual interventions. • We contribute a new corpus, assembled to perform the replication, that can be used in adversarial stylometry research, the Riddell-Juola corpus.

Related Works
Following Brennan et al. (2012), we refer to techniques that aim to frustrate authorship attribution as using adversarial stylometry. The goal of adversarial stylometry is to hide distinguishing elements of one's writing style while still communicating successfully. Ideally, the use of style obfuscation techniques should not leave conspicuous traces (Potthast et al., 2016).
In their seminal study, Brennan et al. (2012) examine three strategies for obscuring an author's writing style. Two of the strategies count as manual, one as automated. The obfuscation strategy simply instructs an author to write differently than they ordinarily would. The imitation strategy tells an author to write differently by imitating the idiosyncratic writing style of a different author. The round-trip translation (or "back translation") strategy takes advantage of machine translation software and translates the original prose to one or multiple intermediate language(s) before returning to the original language. The effectiveness of these three strategies were evaluated on a corpus derived from a field experiment (described in Section 4.1). Brennan et al. (2012) report that the two manual interventions make authorship attribution more difficult. Round-trip translation, although less effective, also frustrates authorship attribution to some extent.
Round-trip translation is widely tested with different intermediate languages (Brennan et al., 2012;Mack et al., 2015;Day et al., 2016). Overall, general-purposed round-trip translation alters an author's writing style to some extent without degrading fluency or distorting the semantic content of the author's prose. Although studies find that translation target languages used in the round-trip translation and the count of iterations can be guessed (Caliskan and Greenstadt, 2012;Day et al., 2016), this knowledge poses no immediate threat to author identity. Notably, most studies using machine translation, including that of Brennan et al. (2012), use statistical machine translation. More recent research using neural machine translation demonstrates that round-trip translation can effectively alter style in a way that makes guessing demographic characteristics more difficult Xu et al. (2019); Adelani et al. (2021).
Instead of injecting unpredictable noise, another automatic intervention attempts to obscure an author's stylistic fingerprints in a given document by taking a foreign source style and "transferring" that style to the document. Shetty et al. (2018) use an adversarially trained neural machine translation model to obscure an author's identity as well as other demographic features such as gender and age. This kind of approach generally requires a large amount of writing samples written using the foreign source style.
Manual circumvention attempts to inject unpredictable variation into an individual's writing style by prompting the author to consciously make an attempt to disguise their writing, either via writing differently or by mimicking a pre-existing style. Brennan et al. (2012) use a carefully-designed online field experiment to show that manual interventions degrade the performance of standard authorship attribution models.
Manual approaches are less studied despite the impressive performance reported by Brennan et al. (2012). In addition to their independence from computational resources, manual approaches are attractive for two additional reasons. First, an individual author's tendency to write prose with author-identifying stylistic fingerprints appears to be variable, suggesting that there is considerable "room" for an intervention to work. Changes in topic can alter author-identifying fingerprints (Sapkota et al., 2014;Altakrori et al., 2021), as can changes in document genre (Kestemont et al., 2012;Overdorf and Greenstadt, 2016). Even how a writer inputs a text into the computer can make a difference (Wang et al., 2021). Notably, Almishari et al. (2014) ask individuals from Amazon Mechanical Turk (MTurk) to rewrite a given text, and find the user-generated adversarial samples are better than round-trip samples in terms of semantic preservation and circumventing fingerprinting. In short, untrained writers seem to have the capacity to modify texts in ways that are relevant to authorship attribution.
Second, software maintenance is another significant practical problem preventing the general use of computer-assisted techniques. For example, Anonymouth (McDonald et al., 2012) is software that can analyze a user's writing and then offer words that should be used at a higher or lower rate in order to frustrate authorship attribution. Even though Anonymouth is open source and available for download, it is unmaintained and essentially unusable in its current form on a computer purchased today. There is, to our knowledge, no source of ongoing support for the maintenance of computer-assisted writing obfuscation software which is usable by individuals who are not computer experts.

Research Question
We investigate how well standard authorship attribution models perform when a defensive strategy is used. In this paper, we reproduce the study of Brennan et al. (2012) using the original corpus (the Extended Brennan-Greenstadt Corpus). The reproduction is described in Section 4. We also replicate the experiment on our new corpus, the Riddell-Juola corpus. Section 5 describes the replication. We measure the effectiveness of an intervention by calculating how much the intervention reduces the performance of a standard authorship attribution classifier. This reduction is measured relative to an estimate of how well the same classifier would have performed had the defensive technique not been used.

Reproduction
In this section, we report on a reproduction of the study conducted by Brennan et al. (2012) using its methods and corpus, the Extended Brennan-Greenstadt corpus.

Extended Brennan-Greenstadt Corpus
The Extended Brennan-Greenstadt corpus (EBG) contains writing from 45 individuals solicited from MTurk no later than 2012. Two distinct types of writing were collected from participants: pre-existing samples and responses to writing prompts.
For the pre-existing samples, each participant uploaded at least 6,500 words of formal writing. The participants were instructed not to upload writing containing too many "dialog/quotations" or samples "less than 500 words, laboratory and other overly scientific reports, Q&A-style samples such as exams, and anything written in another person's style" (Brennan et al., 2012).
After uploading writing samples, each participant is asked to write two short essays responding to two different writing prompts. Accompanying each prompt is an instruction on how to modify one's writing style in order to frustrate someone trying to identify the essay's author on the basis of their writing style. The first prompt asks the participant to write ca. 500 words describing their neighborhood to someone who has never been there. The prompt is prefaced with the instruction that the participant should try to hide their identity by changing their style of writing. No suggestions are given to the participant regarding how they should go about changing their writing style. This strategy is labeled the "obfuscation" strategy.
For the second prompt, participants were asked to describe a day in their life using third-person narration. To conceal their writing style, they are instructed to imitate the distinctive writing style of the novelist Cormac McCarthy. This is labeled the "imitation" strategy. Participants were given a 2,500-word excerpt of McCarty's writing from The Road.
Participants were told to read the excerpt before composing their response.  10, 15, 20, 25, 30, 35, and 40. For each set, authorship attribution models are trained using the candidates' pre-existing writing samples as training data. The models are then asked to predict the author of essays composed in response to the prompts. In other words, the elicited essays form the test sets. The performance of the classifier on the test set is compared with a baseline: classifier accuracy on the pre-existing writing samples where performance is measured using 10-fold cross validation.
The setup in the reproduction is the same as in Brennan et al. (2012) except we used random sampling instead of "unique sets." That is, we use sampling with replacement whereas they used sampling without replacement. The mean accuracy across the 1,000 sets-the only statistic reported-has an identical expectation. 1 The effectiveness of round-trip translation strategy was evaluated briefly in Brennan et al. (2012) with a completely different corpus (the Brennan-Greenstadt corpus). The translated texts and implementation details cannot be recovered. Therefore, we abandoned examining the round-trip translation strategies in the reproduction study. We revisit the strategy in the replication study. We also take the liberty of reporting results obtained using two additional authorship attribution models, one using a simpler feature set and another using a recently-developed neural network classifier.

Writeprints-static and Support Vector Machine Classifier
Brennan et al. (2012) measured the effectiveness of authorship attribution using three models. A support-vector machine (SVM) model with a polynomial kernel using the "Writeprints-static" feature set proved by far the most successful. This was not unexpected: the other models considered were unorthodox and have seen limited use by other researchers. Because the SVM model has been widely used and because it proved most successful in the study, we use this model in the reproduction study.
Writeprints-static feature set The Writeprints-static feature set is a simplified version of the "Writeprints" feature set from Abbasi and Chen (2008). The feature set includes 557 fixed ("static") lexical and syntactic features. The feature set includes, among others, frequent character bi-and tri-grams, part-of-speech tags, and 403 function words.
We carefully re-implemented the Writeprints-static feature set in Python by consulting Jstylo's GitHub repository (McDonald et al., 2012 We chose an SVM model using a polynomial kernel with the following parameters: degree (d) equal to 3, regularization ("C") equal to 0.01, γ equal to 0.001, and constant bias r equal to 100. Many sets of parameters performed roughly as well. The chosen polynomial SVM has an average accuracy of 83.0% in attributing authorship given 45 candidates (10-fold cross validation)-virtually identical to the accuracy reported in the original study.
Most of the Writeprints-static features are counts (e.g., of POS tags, of function words). Because documents differ in length, we normalize each document's feature vector by the sum of its elements. Each feature is then standardized by dividing by the standard deviation after deducting the mean.

Koppel-512 with Logistic Regression
The "Koppel-512" function word list contains 512 function words adopted from the widely-cited authorship attribution experiment described in Koppel et al. (2009). Function words are typically free of obvious meaning (e.g. "the", "and", "or", "this", ...) and have been extensively used in authorship attribution research (Juola, 2008;Kestemont, 2014). Logistic regression is a familiar classification technique. We use standard multi-class logistic regression with quadratic regularization (λ = 1.0). Function word frequencies are normalized and standardized using the same preprocessing we use for the Writeprints-static features. The classifier performance is roughly similar to that of the Writeprints-static-based SVM model. We include this model chiefly because we anticipate that future researchers interested in reproducing our results will have no difficulty extracting features from the texts which match those used here. In particular, extracting features using the Koppel-512 feature set should be considerably easier than extracting features using the Writeprints-static feature set.

RoBERTa
We further adopt a RoBERTa model (Liu et al., 2019) pretrained with five large corpora (the Book Corpus, English Wikipedia, Common Crawl-News, Open Web Text, and Stories corpora). The model ("roberta-base") is provided by Wolf et al. (2019). 4 We adapt the model for classification by continuing to train using our data, updating only the parameters in a final layer for classification. We use a low learning rate (3 × 10 −5 ) and all samples are padded or truncated to 512 tokens, as the model requires. During training, we hold out the first training example from each of the candidates to make a validation set. The model is trained until validation loss rises (is greater than its lowest value for 50 epochs). In general, this occurs after no more than 200 epochs. We use parameters associated with the lowest validation loss.
Note that we use this model slightly differently than we do the other models. First, with RoBERTa, we refrain from running cross validation on the training data because cross validation is not a standard practice when using deep learning models. Second, to reduce computational cost, we only consider ten (instead of 1,000) runs at each candidate size. Code is available at https://codeberg.org/lab2124/ reproduction-and-replication-adversarial-stylometry.

Results
The results of the reproduction study are summarized in Figure 1. The three panels correspond to Figures 6-8 in Brennan et al. (2012). For comparison with the original, we show the accuracy statistics reported in the original paper side-by-side with our results.
The left panel of Figure 1 shows classifier accuracy on the training data measured using 10-fold cross validation. The middle and right panels show the accuracy of authorship attribution classifier when the subject uses the indicated defensive strategy. As we saw in the original paper, classifier performance drops dramatically when either defensive strategy is used. As in the original paper, the imitation strategy is more successful than the obfuscation strategy at confusing the Writeprints-static-based SVM classifier.

Replication
To further increase confidence in the original result, we replicate the study in Brennan and Greenstadt (2009), re-running the experiment with new participants. We label the new corpus of writing samples-analogous to the Extended Figure 1: Reproduction of the adversarial stylometry experiment in Brennan et al. (2012). The left panel shows the accuracy of a 10-fold cross validation using the training data. The middle and the right panels indicate the accuracy of the classifier when the indicated authorship attribution circumvention strategy is used. Each bar indicates the mean accuracy of the models with samples randomly sampled 1,000 times from the pool of 45 candidates. Error bars show 95% confidence intervals. 10-fold cross validation is not performed with the RoBERTa model.
Brennan-Greenstadt corpus-Riddell-Juola corpus. In our replication we correct two conspicuous flaws in the original experiment design. The first flaw is the lack of a control group. The second flaw is the non-random assignment of writing prompts. We resolve the first flaw by introducing a control condition. We resolve the second flaw by using a single writing prompt, collecting, as a result, one rather than three essays from each participant.
In addition to the formal replication, we also informally explore the round-trip translation defense discussed in the original study.

Riddell-Juola Corpus
The Riddell-Juola Corpus (RJ) was gathered using essentially the same procedure as the one used to collect the samples in the Extended Brennan-Greenstadt corpus (Brennan et al., 2012). The obfuscation and imitation strategy instructions from the original study were reused, as was the describe-your-neighborhood writing prompt. 5 As in the original study, participants were recruited on MTurk. About 6,500 words of pre-existing formal writing were solicited with the same instruction used in the original study. These writing samples comprise the training data for the authorship attribution classifier.
For the ca. 500-word essay, participants were instructed to respond to the describe-your-neighborhood writing prompt. The beginning of all the writing prompt reads "You are asked as part of a college application to describe your neighborhood to someone who has never been there before." In contrast to the original study, participants were randomly assigned to receive no additional instruction (control), the obfuscation strategy instruction, or the imitation strategy instruction. Each participant only submitted a single 500-word essay in response to the describe-your-neighborhood prompt. This design eliminates concerns about order effects and concerns that certain circumvention strategies may be easier (or harder) to "execute" with particular writing prompts. 6 In the control group, participants were given the writing prompt without any additional instruction about changing their writing style. This control condition was not present in the original study.
The instructions given to participants on how to hide their writing style remain the same as those used in the original study.
As in the original study, the authorship attribution model must predict the authorship of these ca. 500-word essays.

Round-trip translation
In the replication study, we leverage the essays composed in the control condition to evaluate how well round-trip translation conceals participants' writing style. We use the Google Translate API to translate between languages. 7 We use the intermediate language choices from Brennan et al. (2012): two single-step translations are English-German-English and English-Japanese-English; and one two-step translation is English-German-Japanese-English. Note that, before 2016, when the original study (Brennan et al., 2012) was performed, Google was using statistical machine translation. The current system uses neural machine translation. Responses were collected between March 29th and June 1st, 2019. Respondents completed a demographic questionnaire, reporting their gender and age bracket ( Table 2). Responses that were not in English or which seemed very likely to be inauthentic were excluded. The pre-existing writing samples were further processed in order to remove personally identifying information. Lengthy quotations, headings, tables, and figures were also removed. See Table 1 for statistics describing the corpus.

Method
In replication, we adopted the same feature set, model, and setup as used in the reproduction.

Results
The replication study generally confirms the effectiveness of the circumvention techniques reported in the original paper. The results of the replication experiment using the new Riddell-Juola corpus are summarized in Figure 2.
The upper-left panel of Figure 2 shows the accuracy of 10-fold cross validation on the training data. Model performance slowly decreases as candidate size increases. However, with cross validation, authorship attribution models can leverage topical information in documents in making predictions. (Submitted pre-existing writing samples often concern similar subjects.) The accuracy measured using the control group (bottom-left panel) is a more appropriate baseline. Recall that participants in the control group responded to a fixed topic. No suggestion was made that they should modify their style. Because every participant in the control group writes on the same topic, the risk that topics overlap with topics in pre-existing writing samples is negligible.
The upper-middle and upper-right panels indicate the performance of the models when the corresponding strategy is used. Due to random assignment in the Riddell-Juola corpus, the number of writers using each strategy varies. When an authorship attribution circumvention strategy is used, classifier accuracy suffers relative to the control group. In contrast to the results obtained using the Extended Brennan-Greenstadt corpus, the obfuscation strategy appears to be more effective than the imitation strategy.
The results concerning the round-trip translation strategies are shown in the bottom-middle and bottom-right panels of Figure 2. We omit plotting German as the intermediate language because the strategy performs as well as the strategy The bottom-middle and bottom-right panels show the accuracy of two round-trip translation strategies. Each bar indicates the mean accuracy with candidate sets randomly sampled 1,000 times from the pool of participants who used the indicated strategy.
using two intermediate languages. The round-trip through Japanese performs best among the round-trip translation strategies. The accuracy reduction achieved by the round-trip translation strategy is roughly the same as that achieved by the imitation strategy.

Examination of Translated Samples
We examined the translated samples to make sure that the meaning of the original was preserved. In general, the meaning of sentences is preserved. Poor translations were often attributable to unconventional language use and misspellings in the original prose. Drastic changes in meaning were rare. See Table 3 for examples of typical and infelicitous translations. When using one intermediate language, semantics tend to be more faithfully preserved. Perfect reproduction of the original text is occasionally observed, especially for the short sentences (e.g., Sample No. 5 in Table 3). We found using Japanese as the intermediate language tended to produce fewer perfect round-trip translations, something desirable in the present context.
Misspellings hurt the performance of the round-trip translation defense. Misspellings can be copied verbatim to the translated samples ( In short, this strategy appears to work well when original sentences are relatively simple and grammatical. There are countless cafés that were home to many hours of caffeine fueled cramming.

EN-DE-EN
There are countless cafés in which many hours of caffeine were founded.

7
The lawns are kept in decent condition. Nobody has leaves piled up from fall time.

EN-JA-EN
The lawn is kept in a decent state. Nobody has piled up since the fall time.
Unacceptable semantic loss 8 She was from a town in which the grocery store was a 5 minute walk from her house...

EN-DE-JA-EN
She came from her house 5 minutes from her house...

9
...but I ended up getting close to someone who lives two houses down from me and another guy that lives on my street.
EN-JA-EN ...but I approached me from another man who lived on my street.

Miss-spelling copying 11
The people don't feel as optomistic as they used to...

EN-DE-EN
People don't feel as optomistic as before...

Downstream mistranslation 12
The streets are wide and the kids usually play footbal...

EN-DE-EN
The streets are wide and the children usually play foot bales...

13
The streets are wide and the kids usually play footbal...

EN-DE-JA-EN
The street is large, and the children usually play the BA on the feet...

Discussion
One discrepancy in our replication is that the relative performance of the obfuscation and imitation strategies is reversed relative to the original study.
We speculate this may be due to one or both of the following two factors. First, the quality of the manual intervention samples are highly viable due to the diversity of participants on MTurk. Individuals may simply vary in their ability to use the defense effectively. Second, the prompts used for eliciting writing samples using the imitation defense are different. It may be easier in some sense to use the defense when writing about one's day from a third-person perspective than when writing about one's neighborhood.
Further study of the round-trip translation strategy-or some similar language-model-based technique such as Lewis et al. (2020) and Raffel et al. (2020)-is warranted for three reasons. First, the technique merits attention because it requires no human intervention. This means it can be used in settings where the writer is unavailable or lacks time to perform a manual defense. Second, existing flaws such as mishandling of misspellings seem correctable given advances in language modeling. Third, because the defense is automatic it may be combined with a manual intervention, delivering, potentially, an incrementally more potent defense.
If it proves effective, the round-trip translation must be usable offline. Relying on an online API, as we do here, would be an unacceptable risk for a whistleblower attempting to conceal their identity from a government or multinational firm that closely monitors IP traffic.

Conclusion
This study investigated the effectiveness of three adversarial stylometry strategies: obfuscation, imitation, and round-trip translation. We estimated how much each strategy reduces the performance of a standard authorship attribution models. This study generally confirms the findings of Brennan et al. (2012): asking an individual to try to conceal their writing style yields prose that is more difficult for an authorship attribution model to link with the writer's preexisting writing. For example, in the setting where a classifier must predict the author of a text given ten candidates, a writer's performing either manual strategy reduces classifier accuracy from ≈40% to ≈20%. This is a meaningful reduction. If these results generalize, an adversary using standard techniques to identify an individual who has used one of the manual defenses will learn less about the likely author of an unsigned text than they otherwise would. An adversary committed to acting based on the classifier's prediction will have a higher risk of incorrectly fingering a writer who is not the author of the unsigned text.