Are Synonym Substitution Attacks Really Synonym Substitution Attacks?
Paper · 2023 · Cheng-Han Chiang and Hung-yi Lee
Summary
A classifier assigns a news item to the right topic. After a few words are changed, it assigns the item to the wrong one. Has the classifier failed to recognize the same news in different words, or has it been given a different or garbled story? Chiang and Lee investigate this distinction in a widely used robustness test for text classification. A synonym substitution attack is supposed to change the classifier’s answer while leaving the text substantially unchanged for a reader. The authors examine both where the replacement words come from and what happens when automatic checks decide which edits to accept.
The first problem is that a synonym belongs to a particular sense of a word. An English dictionary can relate world to cosmos, but the relationship does little to justify the replacement in a news report about events around the world. In the main analysis of successful PWWS attacks on the AG-News test set, the authors report that 20.2% of the replaced words were synonyms for the sense identified in the original passage, while 75.4% were synonyms for a different sense. Generators based on word vectors or predictions from surrounding text yielded few same-sense synonyms either. In the candidate lists of 30 words drawn for positions that TextFooler had changed, the best of those generators offered an average of 0.22 candidates classified as same-sense synonyms.
The checks applied after proposing replacements had weaknesses of their own. Similarity between individual word vectors separated synonyms from antonyms much more readily than it separated synonyms for the intended sense from synonyms for another sense. Comparing representations of whole passages or short stretches of text also gave similar scores to edits with different effects on meaning. Grammatical changes could pass through both kinds of similarity check and escape the grammar checker. In a separate test on 1039 AG-News passages that LanguageTool initially accepted, the authors changed an average of 4.37 verb forms per passage. LanguageTool reported an average of 0.97 errors in the altered passages.
The paper’s conclusion concerns what an attack success rate can establish. A changed prediction records a reaction to the edited input. Calling that reaction a failure of robustness to paraphrase requires evidence that the edit preserved what the reader was being asked to classify. The authors show how common generation and filtering procedures can fall short of that standard. Whether well-formed, meaning-preserving substitutions can routinely change classifier decisions remains open.
Deep dive: Are Synonym Substitution Attacks Really Synonym Substitution Attacks?
Chiang and Lee examine whether synonym substitution attacks preserve meaning and grammar, and why common checks let flawed edits pass. · about 33 minutes to read
The problem and its context
What should survive a word change?
The paper draws its problem from work on adversarial examples in natural language processing. In the setting it studies, a classifier has already assigned the correct label to an original test item. An adversarial example is an edited version that receives the wrong label while remaining a fair instance of the original classification task. That second condition is what makes the test informative. The question is whether the decision survives a change in expression that a reader could reasonably regard as immaterial.
There are several ways for this interpretation to break down. An edit can change the event described in a news report while leaving it in the same broad topic. It can change the topic itself, in which case a new label may be appropriate. It can leave the event recognizable but turn the passage into something a reader must mentally repair. These outcomes bear on different properties of a classifier. Treating them all as interchangeable with a fluent rewording obscures what kind of failure has occurred.
The paper therefore works with a stronger standard than keeping the topic label alone. The edited passage should remain close in meaning to the original and should introduce no new grammatical errors. A high degree of word overlap ties the example to the original, and the changes should read naturally enough to avoid drawing attention to themselves. These conditions address different questions about the edit. A passage can share most of its words with the original while changing a consequential term. A reader can also recover what a sentence means even when its grammar is visibly damaged.
The appeal of synonym substitution is that it appears to offer a simple way to meet these conditions. It leaves most of the text in place and changes selected words to related alternatives. If a replacement works in the sentence, an evaluator can compare the two classifier decisions without having to assess a wholesale rewrite. The difficult part is determining what it means for a replacement to work. A pair of words can name related things, share an inflectional family, or occur in comparable contexts without serving the same purpose in a specific passage. That distinction is central to lexical semantics.
How earlier attacks handled the problem
The earlier approaches described in the paper divide the work between proposing a word and checking the resulting text. The authors call the proposal mechanism a transformation. A dictionary entry, a vector neighborhood, or a contextual prediction can each furnish a set of possible replacements. A constraint then tests some property of a proposed change, such as whether the two word vectors are sufficiently close or whether a grammar checker reports new errors. This division makes it possible to generate many candidates without requiring each source to guarantee that its candidates work.
Dictionary-based systems have a direct link to the idea of synonymy. PWWS uses synonym groups from a lexical database. A group relates words that share a sense. The same spelling can appear in several groups, and the set of all words across those groups covers several meanings. A method that retrieves the groups together has gained breadth at the cost of deciding which meaning the current sentence expresses. The paper traces this approach through PWWS and WordNet.
Other systems start from geometric proximity. In a space of word vectors, words that occur in related settings can lie near one another. The work Chiang and Lee discuss uses a variant in which synonym information draws certain words closer and antonym information moves certain words farther apart. That adjustment, which the paper calls counter-fitting, gives the neighborhood a stronger linguistic motivation. It still assigns each word a general representation, so proximity can reflect a relation other than the one the word expresses in the sentence under review. The underlying representation is GloVe.
Contextual prediction approaches start from another intuition. A predictor that sees the surrounding words should be able to propose something appropriate to the slot. Some approaches hide the source word and ask for plausible completions. Others leave it visible and collect alternative predictions at that position. The original word gives the latter approach more information about what is being expressed. In either case, fitting the surrounding text is a different objective from preserving what the author said. The paper uses earlier systems including BERT-ATTACK and BAE to illustrate this distinction.
The constraints in earlier work reflect related assumptions. A word-level distance is intended to exclude unrelated alternatives. A comparison of sentence representations is intended to capture the effect of the replacement in context. Approaches differ in whether they compare entire passages or just the region near the edit. They also differ in what serves as the reference. Comparing successive revisions answers how much the latest edit changed the immediately preceding text. Comparing with the original asks how far the current version has moved from its starting point. The paper uses these choices to frame what an automatic semantic similarity check can measure.
Why inspect the components separately?
Earlier human evaluations had already raised doubts about the resulting passages. As Chiang and Lee describe the work, Morris and colleagues found quality problems and investigated more demanding constraints, including an explicit grammaticality check. Hauser and colleagues used human judgments and probabilistic statements to question whether the original meaning survived. Another study by Morris examined sentence encoders directly, asking whether substitution with an antonym could leave the representation close to the original. These studies gave the authors a reason to look past the classifier’s published attack success rate.
Their own question is where the quality problem enters the process. A generator can offer many poor replacements without harming the final output if the checks reject them. A check can look selective against arbitrary words while accepting the mistakes a particular generator tends to make. Examining only successful outputs can reveal that something went wrong, but it gives limited evidence about these separate possibilities. The paper therefore looks at actual edits, unused candidates, and the behavior of individual checks on comparisons with known lexical categories.
This framing also explains the focus on word positions that an earlier attack actually modified. Similarity between an arbitrary sentence and an arbitrarily altered copy may say little about the words a classifier-based search tends to select. Conditioning the diagnostic on observed positions makes it more relevant to the methods at issue. It also narrows the inference. The selected positions are evidence about the benchmark and attack under study, and they may behave differently from positions that the attack rarely touches.
The method, step by step
From successful attacks to an audit of word changes
The research starts with an existing benchmark of original and edited texts. Yoo and colleagues generated the benchmark with the TextAttack framework. In the main analysis, both the PWWS and the TextFooler records come from attacks against a BERT classifier fine-tuned on AG-News. The benchmark supplies the observed classifier outcomes and, for the successful examples, the text before and after the edit. Chiang and Lee use those records to examine the lexical changes and to identify positions for controlled comparisons. The study is an audit of existing methods instead of the training of a new classifier. The paper identifies BERT as the basis of the classifier and as the contextual predictor in the candidate analysis.
The main audit has a repeated structure. The authors begin by asking which part of the text changed. They classify the replacement by its relationship to the original word, paying particular attention to which sense of that word is in use. They then ask what the proposal mechanisms tend to supply at comparable positions. Finally, they examine whether individual checks can distinguish the kinds of edits they care about. The grammar experiment takes a separate route through the AG-News test set, starting from material the checker itself accepted.
How the paper audits synonym substitutions
The steps in order.
The paper represents the original input as a sequence of tokens. A token here is a member of the sequence being compared, indexed by its place in the passage.
x_ori = {x₁, …, x_T}
The symbol x_ori denotes the original input. The prefix x refers to an input or a token of that input, and ori identifies the original version. x₁ is the first token, and x_T is the last. T is the length of the sequence. The ellipsis covers the intervening positions. Though the paper displays braces, the indices carry the order. The original comes from test data of the same kind as the classifier’s training data, denoted D_train, where D denotes a dataset and train identifies its training role.
x_adv = {x′₁, …, x′_T}
The symbol x_adv identifies the completed adversarial example in an original–edited pair, and adv marks its role in the test. A prime distinguishes a token in that version from the token at the corresponding original position. The endpoints and ellipsis describe the edited sequence through position T. An unchanged position has the same token value in both versions. The paper also uses x_swap, where swap indicates a passage containing replacements whose classifier outcome has yet to establish whether it qualifies as an adversarial example.
The original attack pipeline treats each position as having a set of alternatives. The paper denotes this by Sₓᵢ, where S stands for the candidate set, xᵢ is the original token at position i, and i indexes the token within the passage. Existing attacks use an order in which to consider positions and judge trial edits against their constraints. The paper treats search order as a separate part of the pipeline and leaves its contribution to validity outside the main study. The quantities it examines concern the available alternatives, the edits observed in the benchmark, and the scores or error reports a check produces.
Assigning a sense and a lexical category
For the PWWS analysis, the linguistic question is whether the replacement belongs to the synonym group for the meaning in the original news passage. A familiar dictionary example makes the distinction concrete. The paper describes uses of recommend in which the speaker gives a favorable opinion and uses in which the speaker urges a course of action. Commend belongs to the group for the favorable opinion in the paper’s example. Urge belongs to the group for advocating action. Listing the words under the same headword does not make them interchangeable in a film review. Selecting the meaning expressed on a particular occasion is word sense disambiguation.
The authors use NLTK to assign a WordNet sense to the original token in context. They also use LemmInflect and NLTK to identify forms related to that token through changes of inflection or derivation. An inflection changes a grammatical property such as tense or number, as when recommends becomes recommend. A derivation can create a related word with a different grammatical role, as when recommend becomes recommendation. These alternatives deserve a separate category because they can preserve a recognizable stem while altering how the word fits into the sentence. Both relationships belong to morphology.
For each changed token in the benchmark pair, the analysis gathers a same-sense class from the WordNet group for the assigned sense. It removes the original token and words already counted as morphological relatives. It also gathers synonyms for the other senses and removes forms already accounted for by the morphological and same-sense sets. The appendix pseudocode lowercases the compared forms and gives morphological membership precedence over synonym membership. That ordering makes it possible to count a form once when it qualifies under more than one lexical relationship.
The candidate analysis adds antonyms and a residual category. WordNet supplies the antonyms, and the paper pools antonyms associated with any sense of the original word. The study treats those as unsuitable evidence of synonymy regardless of which sense they oppose. The residual category contains words left after the lexical membership checks. It is defined by the reach of the categories, which is an important distinction when interpreting any count of “others.” A word in that category may have failed to appear in the appropriate list for several reasons. The category alone supplies no sentence-level human verdict about it.
Comparing the candidate sources on the same positions
The authors reconstruct candidate lists for positions TextFooler changed on the AG-News test set. At each position, they ask three sources for alternatives. Holding the positions fixed makes the candidate lists directly comparable. For instance, a difference in the supply of same-sense synonyms cannot be attributed simply to one source being tested on easier words. At the same time, the positions remain those selected by TextFooler, so the experiment does not recreate the full search that a system using another proposal mechanism would have performed.
The first candidate source returns nearest neighbors in the counter-fitted GloVe space. A vector represents a word, and the method uses words close to that vector as its potential substitutes. Counter-fitting incorporates synonym and antonym information into the space, but there is no step here that chooses a WordNet sense from the passage before retrieving the neighbors. The output remains a list derived from the representation of the word. The paper grounds this approach in GloVe: Global Vectors for Word Representation.
The second source uses BERT to predict a word hidden from the original passage. The predictor receives the words on either side of the position, so it can exploit context. If the context licenses several different statements, however, several quite different words may fit. The third source gives BERT the original passage with the word still visible and collects its predictions at that position. This is the reconstruction condition. The distinction between the two experiments is whether the candidate source can see the identity of the word it is being asked to replace.
The main comparison sets k to 30. Here k is the number of near neighbors from the vector space or the size of the ranked prediction set for the contextual source. For the BERT conditions, the analysis excludes punctuation and incomplete word pieces. The appendix also describes using lemmatization when comparing predicted forms with WordNet. This reduces an inflected word to its dictionary form, so a form such as defines can receive credit through define when the dictionary relationship warrants it. The procedure retains the predicted form if the lemma already occurs among the candidates or has already been placed in the revised list. This prevents the normalization from automatically collapsing every distinct form into a duplicate lemma. Normalization supports the counting procedure. It supplies no direct verdict about whether the original surface form agrees with the surrounding sentence.
Checking word vectors, passages, and grammar
The word-vector experiment tests the same counter-fitted space that serves as one candidate source. For each original word at an observed changed position, the authors collect alternatives from the lexical categories and compare each alternative’s vector with the original vector. Cosine similarity measures how closely the vector directions align. A score above a chosen cutoff is treated as a positive decision. The authors vary that cutoff to see how well the score can recognize same-sense synonyms when the comparison group consists of a particular type of alternative.
The experiment compares one alternative type at a time with the same-sense category. This gives five different tests of the same scoring rule. Four lexical relationships are involved across the positive and negative groups, and the two random-word groups add controls for vocabulary frequency. The random words come from frequency ranks calculated on the AG-News training set, so that part of the procedure uses a different split from the positions under study. The paper counts tokens with the BERT-base-uncased vocabulary. The frequent group runs from top-50 to top-550 after the authors set aside the most frequent items, which they say tend to be stop words. The infrequent group comes from top-10K to top-10.5K. The frequency comparison tests whether the scores behave differently for unrelated words at different levels of commonness. Its word units depend on the vocabulary’s tokenization.
The sentence-level analysis asks what happens when the same kinds of lexical choices are put back into passages. It uses positions observed in successful TextFooler examples. The notation for the starting collection of changed positions is:
I = {i | xᵢ ≠ x′ᵢ}
I is the set of changed positions, i is a position, xᵢ is the original token there, and x′ᵢ is its counterpart in the benchmark edit. The vertical bar means “such that,” and ≠ marks unequal token values. The appendix procedure checks availability of the lexical sets when retaining positions for the analysis. It then shuffles the retained indices to obtain O, an ordered list of positions. Shuffling breaks the connection between the order used in this experiment and the order followed by the original attack.
The paper writes xⁿ_swap for the diagnostic version of the original passage after edits at the first n positions of O. Here n is the number of edited positions and the superscript marks that count. Each edited position receives a randomly selected word from the same category for a given series. A series using antonyms, for example, uses antonyms throughout. Parallel series use same-sense synonyms, other-sense synonyms, morphological relatives, or the two random-word groups. The authors vary n from 1 to 10. The score for a series measures the effect of cumulative changes of a known type. The classifier does not have to change its decision for a constructed passage to contribute to this diagnostic.
In the main sentence experiment, the authors encode a local region centered on the word changed at the current stage. The paper illustrates the slicing convention for the original side as follows:
x_ori[i − w : i + w + 1]
x_ori is the original token sequence, i is the position of the current edit, and w is the number of positions the window can extend to either side. The brackets select a slice. The colon separates the starting position from the excluded end, so the + 1 makes the token at i + w part of the window. If the window extends beyond the passage, it stops at the passage boundary. The edited side uses the corresponding window of xⁿ_swap. The main experiment sets w to 7, and the paper describes this as a 15-word window when the full context is available. The compared texts are mapped to sentence vectors by the Universal Sentence Encoder.
The grammar experiment starts with AG-News test passages for which LanguageTool reports no errors. The authors use NLTK to identify verb forms and LemmInflect to obtain alternatives in the same inflectional family. They apply hand-written changes designed to create errors in verb form, such as loss of agreement or an inappropriate tense form, while keeping the lexical verb recognizable. The same checker is then run on the altered passages. Selecting the initial passages by LanguageTool’s verdict provides a zero-report starting point for the checker. The experiment asks how many reports it produces after the controlled changes and uses the number of altered verbs to indicate the scale of the intervention.
Experiments and results
The benchmark and the units of comparison
AG-News asks a classifier to choose among world, sports, business, and science or technology news. The test set contains 7.6K items. The main analyses use benchmark results for PWWS and TextFooler against BERT fine-tuned on that dataset. The benchmark contains 4140 successful PWWS attacks, with a reported success rate of 57.25%, and 5885 successful TextFooler attacks, with a reported success rate of 81.39%. These are the benchmark outcomes for the respective attackers. The test-set size describes the source split, while the successful-pair counts describe the material available for analyzing edits. The paper presents the rates as benchmark statistics, so the figures can be read directly without reconstructing the rate from the overall split size. The dataset is associated with Character-level Convolutional Networks for Text Classification.
The benchmark table lists an average length of 38.57 words per sample for each attack. It reports 17.63% as the average percentage of words perturbed by PWWS and 23.38% as the corresponding figure for TextFooler. Those figures describe edits in the benchmark and put the substitutions in perspective. A small change at one location is the basic operation, but the complete altered passage can accumulate many such changes. A passage can retain substantial overlap with the original even after more than one meaning-bearing word has been replaced.
The other results use different units. The PWWS sense audit counts actual changed words in successful pairs. The candidate experiment counts average entries per proposed list for positions that TextFooler changed. The vector experiments measure how a score behaves when given particular types of replacements. The grammar experiment counts altered verbs and diagnostic reports per passage. These units answer different questions. A candidate a generator proposes, a replacement an attack uses, a detected lexical distinction, and a classifier prediction are separate observations.
What PWWS actually replaced
In their main PWWS analysis, the authors inspect 4140 successful examples containing 26,600 changed words. They report 5398 same-sense synonym substitutions, or 20.2% of the edits, and 20,055 other-sense synonym substitutions, or 75.4%. They report about 3.8% as morphological substitutions. Those are the main-text figures for that audit. The percentages concern word changes in the successful outputs, so they do not establish the percentage of edited passages a reader would accept as a whole.
The dominant category is revealing precisely because PWWS starts from a synonym dictionary. The trouble in that category is not a lack of a dictionary relationship. It is that the relationship belongs to a different meaning of the source word. An AG-News example changes world to cosmos in a phrase describing the geographic scope of events. In another edit, blood becomes lineage in a report about a substance identified through analysis. A reader can trace the alternatives to meanings of the original words, yet the replacements direct the reader away from the geography and the physical sample the report was about. Staying within a general lexical association does not preserve the role the words play in the account.
The paper gives a separate breakdown in its supplementary results. There, the BERT column for PWWS on AG-News reports 4319 matched-sense replacements, or 16.2%, and 19,467 mismatched-sense replacements, or 73.2%. It also lists an “others” category of 1788 edits, or 6.72%. The paper gives different counts for the main and supplementary breakdowns and does not reconcile them. Both report that other-sense synonyms dominate, and the percentage for either breakdown should be quoted with its own analysis attached.
What the other transformations proposed
The comparison among GloVe neighbors, BERT mask-infilling, and BERT reconstruction concerns the supply of possible replacements. At positions already altered by TextFooler, each candidate source faces the same original word. The chart shows the average count of candidates classified as synonyms for the sense assigned to that original word.
Same-sense synonyms per candidate list at TextFooler edit positions on the AG-News test set
Counter-fitted GloVe leads the comparison, while every source offers few same-sense alternatives.
The numbers
| System or setting | mean candidate count |
|---|---|
| BERT mask-infilling | 0.08 |
| BERT reconstruction | 0.14 |
| Counter-fitted GloVe neighbors (this paper) | 0.22 |
The order is consistent with the paper’s distinction between visibility and contextual fit. When the contextual predictor sees the original word, its alternatives more frequently include a same-sense synonym than when the word is hidden. In both conditions the absolute supply of such synonyms is small in a list of 30. Counter-fitted GloVe provides the most same-sense synonyms of the tested sources. Its other-sense count is 1.01, however, compared with 0.36 for mask-infilling and 0.58 for reconstruction. The behavior of the vector neighborhood therefore resembles the dictionary problem in one respect. A source can offer more synonyms while still favoring ones attached to the wrong sense.
The lists also differ in their other lexical contents. GloVe averages 1.55 morphological alternatives, mask-infilling 0.57, and reconstruction 1.19. The antonym counts are 0, 0.06, and 0.09, respectively. These are averages across candidate lists in the AG-News diagnostic. A small antonym average establishes that this type of alternative appears in the contextual lists. It does not show how often an attack accepts an antonym, which requires evidence from its search, its constraints, or its final outputs.
The residual category is the largest for each source. It averages 27.22 candidates for GloVe, 28.93 for mask-infilling, and 27.99 for reconstruction. The examples help explain what those counts signify. In a news headline about a team, the list from geometric neighbors includes alternatives associated with machinery and tasks as well as words related to a group of people. For a position originally occupied by an adjective describing the team’s status, contextual predictions include words that might qualify a team in a plausible headline while changing the kind of team the reader would infer. Lexical relatedness and contextual plausibility each bring in words that could be useful for other purposes. Neither provides a direct test of fidelity to this headline.
The authors use such examples to argue that many of the residual candidates are inappropriate. The frequency count alone cannot show how many. It says that the alternatives fall outside the specified synonym, antonym, and morphology categories. The examples then give concrete cases where an alternative changes the statement or fits poorly. That distinction matters especially when comparing candidate sources. The chart ranks them by a defined lexical test and does not supply a ranking by human approval of completed edits.
Which differences a word-vector threshold can detect
The word-vector experiment reports area under the precision–recall curve, or AUPR. Precision asks how many accepted replacements are same-sense synonyms under the audit. Recall asks how many of the same-sense synonyms the threshold accepts. Moving the threshold changes the balance between those quantities. AUPR summarizes the curve across thresholds. The paper gives 1.0 as the perfect score and uses 0.5 as its random-detector reference. These are pairwise discrimination scores on the experiment’s selected categories, not the accuracy of a deployed filter on the full candidate mix.
Word-vector discrimination against each comparison category at TextFooler edit positions on the AG-News test set
Counter-fitted word vectors separate antonyms most clearly and struggle against morphological alternatives.
The numbers
| System or setting | AUPR |
|---|---|
| Morphological alternatives | 0.433 |
| Other-sense synonyms | 0.627 |
| Random high-frequency words | 0.900 |
| Random low-frequency words | 0.919 |
| Antonyms (this paper) | 0.980 |
The comparison with antonyms is the most successful. Counter-fitting explicitly uses antonym information to push some word pairs apart, so a strong result on that distinction is consistent with the construction of the space. Both random controls also yield high scores. A test that asked only whether the score can reject a randomly chosen word would therefore give a favorable impression of the constraint. Real candidate lists contain more difficult alternatives, including ones related to the source spelling or to another sense of the source word.
The score of 0.627 against other-sense synonyms shows that the distinction that matters most for WordNet-based changes is substantially harder for the vector score. The result against morphological forms is 0.433, below the random reference the authors give. They interpret this as evidence that morphological relatives tend to receive more favorable scores than same-sense synonyms. A cutoff that is stricter in numerical terms can consequently favor a problematic class. For example, close vector representations can reflect the shared lexical material in two forms even when the new form is impossible in the sentence.
These measurements identify an interaction between a candidate source and its checks. If a list yields unrelated words, the vector score can help reject them. If a list yields related forms with the wrong grammatical role, the same score has little reason to object. The overall quality of an edited passage depends on which kinds of alternatives the source produces and whether some other check catches the classes the vector score tends to accept.
What sentence vectors and the grammar checker register
The sentence experiment uses the earlier TextFooler positions but replaces the benchmark edits with controlled alternatives. The authors plot average cosine similarity to the original as the number of edits grows from 1 to 10. In the main Universal Sentence Encoder test, similarity generally declines as replacements accumulate. Frequent random words still leave average scores roughly above 0.80. The paper notes that earlier attack settings often use cutoffs around 0.85 or below, depending on the dataset and procedure. A high average for a random category explains the authors’ concern, although it does not determine the fraction of cases that pass any particular cutoff.
The more informative comparisons involve substitutions that exploit the difference between topic and meaning. Antonym substitutions follow a trend close to the synonym curves. Same-sense and other-sense synonyms also receive similar scores. Morphological substitutions produce the highest similarities in the main comparison. A sentence encoder can thus recognize a pair as closely related without registering that the replacement has reversed an important word or selected the wrong sense. Much of the original context is still present, and even a replacement with an opposing meaning can belong to the same subject matter.
The grammar experiment uses a different subset of the AG-News test data. LanguageTool initially reports no errors in 1039 passages. The controlled edit changes 4.37 verbs on average per passage, and the checker then identifies an average of 0.97 errors per passage. The first number measures interventions and the second measures reports. The paper does not align all reports to individual verb edits to estimate recall. What the gap establishes is that the checker produces far fewer reports than the number of verb changes under a procedure designed to introduce errors.
The example passages show why the authors consider this practical evidence instead of a purely numerical discrepancy. An altered verb can follow an infinitival marker in a form that normally cannot appear there. Another can cease to agree with the subject. These changes are easy to see once the reader knows where to look, yet the paper documents examples on which the checker issues no report. A high similarity score combined with a clean grammar report may therefore allow a visibly malformed sentence through.
What the ablations show
Keeping the positions fixed separates different explanations
The paper’s controlled comparisons vary the candidate source, the class of word inserted, the reference text for scoring, and the encoder. Since the authors study an evaluation pipeline, the question behind these comparisons is which part of it accounts for a misleading reading of the outputs. A candidate source can be compared on its supply of same-sense synonyms without rerunning the whole attack. An encoder can be compared on how it scores specific lexical changes without requiring the classifier to react in a particular way.
The mask-infilling and reconstruction conditions illustrate this design. Both draw alternatives from BERT at the same observed positions. Allowing BERT to see the original word improves the supply of same-sense synonyms relative to the hidden-word condition. The improvement is small enough that the candidate inventory remains dominated by other choices. This comparison supports the intuition that information about the original word helps. It also shows how much work remains for downstream checks when the prediction task itself only loosely corresponds to finding a synonym.
There is a complementary lesson in the comparison between same-sense and other-sense synonyms. Because the intended sense supplies the positive group, closely related words can be assessed according to whether they express the relevant meaning, even when both share a dictionary headword. Comparing those groups tests a difference that would disappear in a simple lexical-relatedness score. The vector result is strongest when the contrast is easiest for its training assumptions, as with counter-fitted antonyms. The evidence against its broader use comes from the cases where both terms have a legitimate language-level relationship but only one relationship suits the passage.
The sentence experiment narrows the contrast another way. Instead of comparing outputs from unrelated attacks, it replaces words in the same underlying text with alternatives from a selected category. In each series the edit count grows while the category stays fixed. The resulting curves show that cosine scores respond to accumulation, but the category comparisons reveal how weakly they respond to the specific distinction the audit cares about. A score can decrease as text changes and still provide little help in deciding whether a given change preserved the proposition.
Means and distributions answer different questions
An average curve tells a reader how the score behaves for a category in aggregate. A decision about an individual edit requires separation between the distributions. The paper plots Universal Sentence Encoder scores for different replacement types at n = 1 and n = 8, where n is the number of substitutions in the diagnostic passage. The distributions overlap substantially at both counts. This helps explain why shifting a threshold can admit widely different edit types even when their average curves are distinguishable.
Consider what a threshold must do in that setting. If a same-sense synonym and an other-sense synonym receive similar scores, a rule that sees only the scores has no access to the feature that distinguishes their effects. Moving the threshold upward excludes low-scoring acceptable examples along with low-scoring questionable ones. Moving it downward admits more examples of both types. The paper’s distribution plots are therefore more directly relevant to thresholding than simply noting which category has the highest mean.
The strongest interpretation is about discrimination with this score under these conditions. The encoder has detected considerable shared material between the two passages. For the robustness test, however, the consequential information can be concentrated in the few words that changed. In a news passage where nearly everything remains fixed, repeated details can give the two representations much in common even when an edited word changes what happened. High similarity can be a reasonable measure of broad relatedness and a poor gate for the stronger requirement of preserving the source claim.
Changing the comparison text or the encoder
The supplementary sentence analyses give the scoring rule two different kinds of context. One variation compares the full edited passage with the original rather than using the local window. The paper reports higher overall similarities with full passages and continued difficulty separating the categories. Under this setup, adding context includes more words untouched by the current edit. The result fits the idea that broad overlap can obscure the effect of a small number of consequential substitutions.
Another variation scores each edit against the preceding version of the passage. The appendix considers this reference with both local windows and entire passages. A comparison with the preceding version can assess the immediate change, but prior edits appear on both sides of the comparison. A sequence of small measured steps can therefore move further from the original than any single comparison reveals. The paper documents this reference choice to show how apparently similar constraints can ask different questions. It identifies the windowed comparison with the preceding version as an existing setting and includes its whole-passage counterpart as a supplementary comparison.
The encoder choice matters for some distinctions. The paper reports that a DistilBERT encoder fine-tuned on STS-B separates antonym swaps from synonym swaps better than the Universal Sentence Encoder in its corresponding comparison. It still struggles to separate synonyms that match the assigned sense from those that do not. DistilRoBERTa fine-tuned on STS-B also improves the average separation of antonyms and synonyms. This leaves room for training choices to affect how a score handles particular changes. The experiments do not establish which part of the training setup accounts for the difference. The relevant resources named in the paper include DistilBERT and SemEval Semantic Textual Similarity.
The paper also examines all-MiniLM-L12-v2 and all-mpnet-base-v2 from the sentence-transformer package. The former gives trends resembling those of the Universal Sentence Encoder. The latter still leaves invalid swaps difficult to filter using a cosine threshold. These tests are evidence against treating the choice of a more capable general-purpose encoder as sufficient for this particular check. Performance depends on sensitivity to the meaning of the changed word in context, which may be different from the distinctions rewarded by a sentence-similarity evaluation. The package is discussed in connection with Sentence-BERT.
What stricter checking leaves behind
TextFooler-Adj is a test of what happens when the checks become more demanding. The version discussed by the authors combines stricter similarity checks with LanguageTool. Morphological substitutions remain prominent in its successful outputs. In the supplementary AG-News statistics for the BERT classifier, 530 edits, or 43.2%, are morphological. The corresponding matched-sense count is 53, or 4.32%. The same table records morphological percentages of 42.0% for the CNN classifier, 38.9% for the LSTM classifier, and 41.5% for the RoBERTa classifier. These figures describe changed words in successful TextFooler-Adj outputs, not the chance that a particular candidate becomes a final edit. RoBERTa is among the architectures used for those comparisons.
The controlled checks give a reason for that pattern. Morphological relatives can have close word vectors. Passages containing them can receive very high sentence similarity. The independent grammar test shows that LanguageTool misses many problems of the kind these forms can introduce. Together, those observations explain how a stricter combination can still admit visibly poor edits. The output statistics cannot assign causal responsibility for each individual choice to a particular constraint. They are consistent with the behavior the authors observe when they test the checks separately.
The broader benchmarks extend the comparison beyond TextFooler-Adj and beyond a single classifier. In the supplementary AG-News TextFooler results, the BERT column assigns 90.9% of changed words to the residual category and 0.806% to same-sense synonyms. BAE on the same dataset and classifier has 89.4% in the residual category and 0.88% in the same-sense category. For TextFooler against BERT on the two sentiment datasets, the residual category accounts for 90.1% of changes on SST-2 and 88.3% on IMDB. The same-sense share is 0.945% on SST-2 and 1.43% on IMDB. These are statistics for actual replacements in the corresponding successful attacks. They complement the candidate-list averages, which characterize what was available before selection. IMDB is associated with Learning Word Vectors for Sentiment Analysis.
Limitations
Limits identified by the authors
The work examines English. Its categories depend on an English lexical database, the verb test depends on English inflections, and the grammar checker is examined through English news. The authors suggest that another language could show similar problems if it employed comparable transformations or constraints. They leave that suggestion open to language-specific analysis and human evaluation. The English results cannot establish that the same balance of sense errors, grammatical errors, and unchecked substitutions occurs in another language.
WordNet supplies the study’s reference for lexical senses. The authors acknowledge that the resource can contain imperfect annotations and that even a well-attested synonym for the appropriate sense can fail to fit the passage. Collocations matter. The neighboring words may favor the original expression strongly, and an alternative can read oddly in spite of sharing its core meaning. A word may also require a different grammatical construction. The study treats WordNet synonymy for the appropriate sense as a minimum test for a credible replacement, rather than a sufficient test for the full edited sentence.
The authors also state that they did not conduct human evaluation of the candidates assigned to the residual category. Their appendix illustrates the kinds of words that appear there, and earlier human studies motivate their expectation that many resulting edits are poor. The examples cannot determine the proportion of residual candidates that human readers would find valid. A contextual paraphrase could preserve a claim without having a direct match in the relevant WordNet entry. A misplaced same-sense synonym could fail the human test despite receiving a favorable category in the audit.
The paper leaves the word-selection order outside its main analysis. Earlier attacks frequently use a measure of importance to prioritize positions. The authors argue that similarities among those procedures make the audit relevant across attacks, but they do not compare different search orders or quantify how much an alternative order would change the observed categories. The paper therefore gives more evidence about the quality of alternatives and checks than about the consequences of changing which positions receive attention.
The main analysis also follows the earlier convention of reporting results from an attack run without estimating variance across fine-tuning seeds and hyper-parameters. Chiang and Lee cite the time required to run the attacks. Their preliminary comparison uses different fine-tuning settings for BERT on AG-News and examines attacks on 100 test items for each classifier. They report that the candidate and constraint observations persist across those settings. This check supports the qualitative patterns. It provides limited evidence about how much a numerical rate or percentage would vary across repeated runs.
Further limits of the experimental design
The candidate analysis holds the source positions constant by selecting positions TextFooler actually changed. This is a strength for comparing the generators on the same words. It means the paper does not measure each generator on the position distribution produced by its own search. A system that relies on contextual prediction might prefer words for which context constrains the alternatives more strongly. Looking at candidates for TextFooler’s positions answers what each method offers on those positions. Generalizing the resulting averages to all words or all outputs would require another comparison.
The same issue applies to successful-attack conditioning. The PWWS audit asks which substitutions occur in outputs that achieved the benchmark attack objective. It can show that a large share of accepted word changes in those outputs belongs to a problematic lexical category. It cannot say whether the search favors that category more than it appears in the full proposal inventory, or whether the same category is equally common in failed attempts. It also cannot quantify what fraction of attack successes would persist if one questionable substitution were reverted. A causal estimate of the contribution of particular edits would need a different experiment.
The single-word labels depend on an automatic sense assignment. A mistake at that stage can transfer a candidate from the matched to the mismatched category or in the opposite direction. Even with correct sense assignment, the categories describe lexical relations rather than whole passages. Multiple substitutions can interact, and a passage containing a same-sense synonym can fail on another edit. Similarly, one conspicuous change in a headline can dominate a reader’s judgment of the entire item. Counts of words are therefore insufficient for deriving a rate of valid adversarial examples at the passage level.
The AUPR results involve one negative category at a time. A practical filter faces a mixture of alternatives that includes the large residual class, and the balance of classes differs across generators. Performance against random words does not establish performance against that residual class, which contains everything left outside the taxonomy. Nor does an AUPR value specify the precision a particular fixed cutoff would achieve in a deployed system. The experiments characterize where the score can and cannot distinguish defined groups, while a claim about a complete filtering process would require evaluating its actual decisions on the relevant mixture.
The grammar test compares a known intervention with error reports on passages selected by the same checker. A zero-report original may still contain a mistake that the checker missed. Several changes can affect a single clause, and a checker may describe the effect of multiple changes in one report or flag something other than the altered verb. The averages thus give evidence of under-detection under controlled verb changes, while leaving exact per-edit detection performance unknown. They also leave open how the checker behaves on other failure types, including some derivational edits and defects unrelated to verbs.
The main and supplementary PWWS counts differ, which limits the precision with which a reader can quote a single estimated matched-sense share for that setup. The broader supplementary evidence is most useful for identifying recurring patterns across classifiers and datasets. It does not replicate every diagnostic across all of them. The work examines several ways in which an apparent robustness failure can arise from the construction of a test item. A classifier can still be genuinely sensitive to a fluent and faithful rewording. Establishing how frequently that happens would require final examples whose validity is independently verified.
What came after
The subsequent research record for this paper is still open. Chiang and Lee leave a concrete question for later studies to answer. Once candidate edits have been checked for the intended word sense, grammatical fit, and preservation of the passage’s meaning, how often does a classifier still change a correct decision? Their experiments explain why the attack success rates they audited cannot settle that question.
Cite
Cite as Cheng-Han Chiang and Hung-yi Lee. 2023. Are Synonym Substitution Attacks Really Synonym Substitution Attacks?. Findings of the Association for Computational Linguistics: ACL 2023.
@inproceedings{chiang2023are,
title = {{Are Synonym Substitution Attacks Really Synonym Substitution Attacks?}},
author = {Cheng-Han Chiang and Hung-yi Lee},
booktitle = {Findings of the Association for Computational Linguistics: ACL 2023},
year = {2023},
doi = {10.18653/v1/2023.findings-acl.117},
url = {https://doi.org/10.18653/v1/2023.findings-acl.117}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/chiang-2023-are-synonym-substitution-attacks-really/