Impact of Adversarial Training on Robustness and Generalizability of Language Models
Paper · 2023 · Enes Altinisik, Hassan Sajjad, Husrev Sencar et al.
Summary
A review classifier may recognize sentiment reliably until an attacker substitutes a few carefully chosen words. Training with difficult variants can make such failures less common, but that improvement leaves other questions unanswered. Does the classifier still perform well on ordinary reviews? Does it transfer to reviews from another source? What changes inside the network? Enes Altinisik and colleagues investigate these questions by comparing ways of introducing additional or perturbed examples into the training of language models. Their study shows that the answer depends on where the intervention occurs, how the difficult example is constructed, and which kind of reliability is measured.
The experiments start from BERT and compare three training families. One prepares additional text before training. Another generates adversarial substitutions while training proceeds. The third modifies continuous representations rather than words. The main application is sentiment classification: training and familiar-distribution testing use movie reviews, while YELP supplies a separate transfer evaluation. Word-substitution attacks test resistance to deliberate interference. Adversarial text training generally strengthens protection against those attacks, with reduced accuracy on untouched reviews. Advance augmentation often preserves accuracy more effectively, and BackTranslation achieves the strongest average attack resistance in the IMDB evaluation.
Continuous-representation training produces a different pattern. PGD-AT, which teaches the network to retain the correct label in spite of a difficult embedding perturbation, exceeds ordinary BERT accuracy in every reported sentiment evaluation condition. Its IMDB test accuracy is 93.80, compared with 93.49 for BERT; after MR training, its YELP accuracy is 88.16, compared with 87.06. LDS uses a consistency objective instead: it discourages disagreement between predictions before and after perturbation. Its results are mixed. In particular, strong MR test accuracy does not carry over to the MR-to-YELP transfer condition. Neither embedding approach supplies the strongest overall protection against the evaluated textual attacks.
The authors also examine part-of-speech tagging to investigate linguistic information within individual neurons. Some selected neurons become more selective for grammatical categories after embedding-space adversarial training. A prediction procedure restricted to highly ranked neurons also performs better for the adversarial alternatives than for baseline BERT. These observations support an interpretation involving more useful linguistic representations, although the category-level evidence includes substantial reversals. The study therefore establishes a comparative result more firmly than a causal explanation: training procedures can improve ordinary prediction, attack resistance, and internal selectivity in different combinations. Its scope remains BERT-small, selected review datasets, and word-substitution attacks; the connection between a small numerical embedding change and an acceptable change in language remains unresolved.
Deep dive: Impact of Adversarial Training on Robustness and Generalizability of Language Models
How adversarial training changes BERT’s resistance to word substitutions, accuracy on unseen reviews, and grammatical specialization. · about 36 minutes to read
The problem and its context
Reliability has several meanings
The paper concerns a gap between successful prediction and dependable behavior. A classifier can learn enough from its training collection to perform well on previously unseen examples, yet remain vulnerable to deliberate alterations. An attacker exploits that gap by finding a modification that changes the predicted label while attempting to preserve the task-relevant content.
For sentiment classification, the intended distinction is straightforward. A positive review should continue to receive a positive label when a substitution preserves its favorable judgment. If the classifier changes its answer because of that substitution, the failure reveals sensitivity that an ordinary test collection may not expose. However, if the substitution changes the review’s judgment, retaining the old label would itself be questionable. The difficulty involves both the prediction mechanism and the validity of the altered example.
The authors use generalization to describe performance beyond the training examples. Their experiments examine this under different conditions. Testing on the held-out portion of the training dataset asks whether learning extends to new examples from a familiar source. Testing on another dataset asks whether that learning survives a change in distribution. Adversarial evaluation asks another question: can a purposeful search find a nearby example that defeats the classifier?
These conditions should remain separate throughout the study. A YELP review can be difficult because it differs from the movie reviews used during training, without anyone having modified it maliciously. An attacked movie review can be difficult because an optimization procedure selected its wording, even though it still resembles the training domain. Neither evaluation substitutes for the other.
The introduction motivates this distinction with earlier findings about YELP. It describes an accuracy reduction of nearly 90% when ordinary testing was replaced with adversarial testing. That number belongs to the background literature discussed by the authors. It establishes why resistance to carefully selected modifications deserves attention alongside conventional accuracy.
The paper asks how defensive training changes these different outcomes together. It also asks whether a better score accompanies an intelligible change in linguistic representation. This second question matters because accuracy alone provides little information about what the network has learned or how its internal organization has changed.
Why language complicates adversarial search
The authors situate their work within research on adversarial examples, including Intriguing properties of neural networks. In the general formulation, an attacker seeks a small intervention that changes a prediction. The intervention is constrained, but its direction is chosen to exploit the system.
Continuous inputs allow a particularly direct strategy. Derivatives indicate how the loss responds to an input change, so an attacker can move towards a higher-loss region. The paper describes the fast gradient sign method from Explaining and Harnessing Adversarial Examples as an example of such input-directed perturbation. Iterative procedures make several movements while enforcing a bound on the total intervention.
Text does not provide the same freedom. A visible word cannot ordinarily be shifted by an arbitrarily small numerical amount. An edit chooses among discrete strings. Changing a letter can create another word, damage spelling, or produce a form with no useful interpretation. Choosing a synonym can preserve part of the meaning while changing emphasis, grammatical compatibility, or sentiment.
The paper uses “robust” to illustrate this difficulty. Altering one of its letters and replacing the whole word with a related expression are both conceivable interventions. Neither operation automatically follows the direction that a derivative identifies as most harmful. Mathematical convenience and linguistic validity are different requirements.
Tokenization creates another complication. The network may process a visible word through smaller pieces, so the relationship between an edit to the sentence and a change to the numerical input is indirect. The related-work discussion therefore treats differential input attacks as difficult to apply directly to ordinary language.
Measuring the acceptability of a substitution is also challenging. An attack should ideally preserve the relevant meaning and fit the surrounding context. Similarity between word vectors offers one signal, but the paper does not treat that signal as a complete guarantee. This uncertainty later becomes important when the authors explain why adversarial text training can reduce ordinary accuracy.
Substitution attacks combine candidate generation and search
The earlier NLP attacks described by the authors commonly replace words until a prediction fails. Such an attack needs to decide both which locations matter and which replacements are plausible. Those decisions can use different sources of information.
One approach obtains candidates from word embeddings, numerical representations that position words relative to one another. Another uses synonym relationships. A further approach masks text and asks a language predictor to suggest replacements that fit the surrounding words.
The authors associate these traditions with work including TextFooler, Probability Weighted Word Saliency, and BERT-ATTACK. These references establish the attack mechanisms available to the comparison. Their descriptions concern how candidate substitutions are proposed and prioritized, rather than a claim that any candidate source perfectly preserves meaning.
Searching all possible combinations quickly becomes impractical. A sentence contains several potential edit locations, and each may admit several alternatives. Trying replacements independently also misses interactions: an edit that appears harmless on its own can matter when combined with another.
The paper describes several ways earlier work reduces this search burden. Greedy methods pursue a promising choice without exhaustively exploring every continuation. Generating Natural Language Adversarial Examples supplies a genetic-search approach in the authors’ account. Particle swarm optimization offers another strategy. Importance estimates derived from gradients or word deletion help focus computational effort on influential locations.
This search problem explains much of the later timing comparison. Generating a difficult sentence is an optimization task of its own. Repeating that task throughout classifier training creates a recurring cost, especially when the search must inspect many discrete alternatives.
Defense can change the data or the representation
The related-work discussion distinguishes several defensive practices. The most direct adds adversarial examples to training. A classifier encounters variants selected to exploit its current weaknesses and is then updated to handle them.
A separate practice expands the training collection without requiring the new examples to fool anything. Easy Data Augmentation exemplifies simple operations such as replacement, deletion, insertion, and rearrangement. The paper also discusses generating text through translation or masked-word prediction. Such examples can be useful even when they are not adversarial.
Back translation takes text through another language and returns it to the original language. In the authors’ account, the purpose is to obtain alternative wording while retaining the message. Unsupervised Data Augmentation for Consistency Training is among the cited work associated with this broader augmentation tradition.
A third practice applies adversarial changes directly to continuous representations. This permits gradient-based optimization without repeatedly converting each candidate into a sentence. Earlier methods described in the paper vary the initialization, the perturbation constraints, or the objective used to encourage stability.
The authors also mention contrastive objectives, connecting that line of work to Representation Learning with Contrastive Predictive Coding. In their discussion, such objectives provide another way to shape the relationship between ordinary and adversarial representations. The present comparison does not evaluate every variant from this literature.
The unresolved issue is that a numerical neighborhood and a linguistic neighborhood need not coincide. Embedding perturbations can be easy to optimize while having no obvious textual interpretation. Conversely, a natural word substitution can produce a representation change that the training constraint does not cover.
Empirical defense is the chosen scope
The paper also reviews defenses that aim to provide certificates rather than only observed attack resistance. Interval Bound Propagation propagates ranges through network layers to bound possible outputs. Randomized smoothing uses predictions over stochastically modified inputs to support a robustness claim.
These approaches provide context, but they are outside the main experimental comparison. The authors focus on empirical training procedures and note that smoothing can be combined with different underlying techniques. They also describe practical obstacles to incorporating some certified methods into existing pretrained networks.
Their choice determines the meaning of the results. A defense is judged by its behavior under the selected attacks and datasets. The experiments do not establish that every admissible modification must preserve the answer. This distinction is essential when interpreting a lower attack success rate as evidence of improved resistance.
The method, step by step
Begin with a shared comparison
The study uses a common BERT starting point and varies the training intervention. The family called AT-DA prepares augmented examples in advance. AT-IP introduces adversarial changes in visible text during training. AT-EP operates on embeddings during training.
The timing distinction matters alongside the location distinction. A prepared collection can be reused across training iterations. A perturbation produced inside the optimization loop responds to the current example and classifier, but must be generated repeatedly.
The main evaluation then examines sentiment prediction under ordinary testing, transfer, and attack. Fine-tuning duration adds a computational measure. A separate tagging experiment provides material for analyzing linguistic selectivity within the network.
Training comparison and evaluation procedure
The steps in order.
The diagram combines the major branches of the study. The tagging branch involves its own task-specific training; it does not simply inspect sentiment labels at individual word positions. The authors introduce that separate task because grammatical labels provide a clearer basis for associating words with internal activations.
Specify what counts as an adversarial change
The paper expresses the general adversarial-example condition as follows:
x′ = x + δ; ‖δ‖ ≤ ϵ ∧ f(x, θ) ≠ f(x′, θ)
The original example is x, and x′ denotes the altered example. The intervention is δ. Its magnitude is measured by the norm ‖δ‖, and ϵ sets the permitted bound. The function f produces an output from an input using parameters θ. The symbol ∧ joins the size restriction to the requirement that the outputs differ.
This definition captures a prediction-changing intervention within a constrained region. Its algebra is especially convenient when x is continuous. When discussing text, the authors emphasize that an acceptable alteration also needs a defensible relationship to the original meaning.
The attack literature described by the paper seeks small distortions because a large alteration can make a changed prediction unsurprising. Finding the exact smallest successful intervention is difficult and can be computationally expensive. Gradient-based methods instead construct approximations.
The search-space growth for substitutions is written as:
C = (n + 1)ᵐ
Here C names the number of combinations described in the paper’s example. The sentence has m words, and n replacement candidates are available at each position. The additional choice represented by 1 is to leave a position unchanged. The exponent m reflects that choices can be combined across positions.
The expression explains why candidate generation alone does not solve textual attack construction. Even a manageable set of alternatives for each word can create an extensive joint search. The evaluated input-space procedures therefore use importance estimates and search heuristics.
Separate the two embedding objectives
The authors select PGD-AT and LDS as representative embedding-space approaches. Both generate a difficult local perturbation using projected-gradient steps. They differ in what makes that perturbation difficult and what training subsequently tries to correct.
PGD-AT refers to the external target label. Its inner search seeks an embedding change that raises the loss for the correct answer. Its outer update then reduces that loss, alongside the loss on the unchanged example.
LDS refers to the prediction made before perturbation. Its inner search seeks a change that produces disagreement. Its outer update discourages that disagreement while continuing ordinary supervised learning.
This distinction is more precise than describing both procedures as making nearby inputs behave similarly. PGD-AT explicitly retains the target label as the reference for the perturbed example. LDS uses the unperturbed prediction as the reference in its consistency term. Correctness and agreement therefore enter the two procedures differently.
The authors present these as basic representatives of broader traditions. They acknowledge that improved variants may perform better. The comparison is consequently an examination of these particular objectives, rather than a search for the strongest possible implementation of every embedding-based defense.
Initialize the inner search
For each labeled example, both procedures begin by sampling a perturbation:
δ ∼ N(0, σ²)
The random quantity δ is the initial perturbation. N denotes a normal distribution. Its mean is zero, σ is its standard deviation, and σ² is its variance.
The algorithm receives a dataset D consisting of pairs of inputs and labels. It processes that dataset over E epochs. The epoch count E controls repetition of the outer training loop, while the perturbation is initialized within the example-level procedure.
Random initialization supplies a starting location for the adversarial search. The next operation depends on which objective is being used. Both approaches differentiate with respect to δ, but the loss supplied to that differentiation differs.
For PGD-AT, the inner gradient is:
g_adv = ∇δ l(f(x + δ, θ), y)
The quantity g_adv is the gradient guiding the adversarial search. The operator ∇δ means differentiation with respect to the perturbation. The function l measures loss. The prediction on the perturbed representation is f(x + δ, θ), and y is the annotated target.
This gradient asks which local numerical direction makes predicting y more difficult. The classifier parameters θ participate in the prediction, but this stage uses the derivative to change δ. Updating the classifier itself comes afterward.
For LDS, the inner gradient is:
g_adv = ∇δ l(f(x, θ), f(x + δ, θ))
The symbols retain the same roles, except that the loss now compares the original prediction f(x, θ) with the perturbed prediction f(x + δ, θ). The inner search therefore targets a local discrepancy in outputs.
The algorithm writes the loss generically as l. It does not provide a separate explicit formula specifying every classification or distribution-comparison implementation. Explaining the conceptual difference does not require assigning an unstated divergence to the consistency term.
Keep the perturbation within bounds
After obtaining the inner gradient, either method updates δ through projection:
δ ← Π‖δ‖≤ϵ(δ + µg_adv)
The arrow indicates replacement of the current perturbation by the updated value. The adversarial learning rate is µ. Multiplying the gradient g_adv by µ sets the proposed step size. The operator Π projects the proposal back into the region whose perturbation norm does not exceed ϵ.
The algorithm repeats this operation S times. S therefore measures the depth of the local adversarial search for an example. It is separate from E, the number of passes through the dataset.
Although the paper uses the familiar projected-gradient terminology, the inner update moves towards a larger adversarial objective. The later parameter update moves towards a smaller training objective. Keeping those roles separate makes the nested optimization easier to follow.
The narrative describes clipping to an allowed range, while the sentiment experiments identify an L2-norm constraint. A coordinate-wise clipping description and a norm-ball projection are not interchangeable specifications. The reported settings establish the intended experimental constraint, but the compact algorithm does not resolve every implementation detail.
Train with the original example still present
PGD-AT forms its classifier gradient from ordinary and perturbed supervised losses:
g_θ ← ∇θ l(f(x, θ), y) + ∇θ l(f(x + δ, θ), y)
The combined parameter gradient is g_θ. The operator ∇θ differentiates with respect to the classifier parameters. The first term concerns the unchanged input x. The second concerns x + δ. Both terms use y as the desired answer.
The ordinary example remains part of the update. PGD-AT does not replace supervised learning entirely with adversarial examples. It adds pressure to classify the perturbed representation correctly while retaining the original training objective.
LDS constructs a different combined gradient:
g_θ ← ∇θ l(f(x, θ), y) + ∇θ l(f(x, θ), f(x + δ, θ))
Again, g_θ is the update gradient for θ. The first loss trains against the external label y. The second loss compares the predictions associated with the original and perturbed inputs.
This arrangement allows LDS to preserve supervised learning while encouraging a smoother local response. Smoothness here refers to limited prediction change under the permitted numerical intervention. It does not on its own establish that the correct label is preserved under every meaningful textual reformulation.
The parameter update is shared:
θ ← θ − τg_θ
The learning rate for the classifier is τ. Subtracting τg_θ moves θ in the direction intended to reduce the combined objective. The distinction between τ and µ separates learning the classifier from searching for its difficult perturbation.
The output of the outer algorithm is the updated parameter set θ. The full process alternates between finding a local challenge and adjusting the classifier to handle the relevant objective. That additional inner computation explains why embedding-space training costs more than ordinary fine-tuning even without discrete substitution search.
Use a scalar example to inspect the objectives
Before the language experiments, the authors study a linear relationship with noise:
y = θx + ε
In this setting x and y are scalar observations, θ is the slope, and ε is observational noise. The same notation θ now represents a single fitted quantity rather than an entire network’s parameters.
The noise assumption is:
ε ∼ N(0, σ²)
The symbol ε denotes the observation error, N is a normal distribution, and σ controls its standard deviation. This ε is conceptually different from the earlier perturbation bound ϵ. One describes random noise in the generated observations; the other limits an adversarial intervention.
The ordinary least-squares objective is:
L_OLS = (1/n) Σᵢ (θxᵢ − yᵢ)²
The loss L_OLS averages squared residuals over n observations. The index i identifies an observation, with input xᵢ and target yᵢ. The expression θxᵢ is the predicted target, so θxᵢ − yᵢ is its residual.
For the fixed-perturbation PGD-AT comparison, the paper uses:
L_PGD-AT = (1/n) Σᵢ [(θxᵢ − yᵢ)² + (θ(xᵢ + δ) − yᵢ)²]
The quantity L_PGD-AT adds a squared residual for the perturbed input xᵢ + δ. The perturbation δ is held fixed for this analytical comparison. Both residuals refer to the same observation target yᵢ.
The corresponding LDS objective is:
L_LDS = (1/n) Σᵢ [(θxᵢ − yᵢ)² + (θ(xᵢ + δ) − θxᵢ)²]
The loss L_LDS retains ordinary squared error and adds a penalty for the change in prediction. Its second term compares θ(xᵢ + δ) with θxᵢ. The target yᵢ appears only in the ordinary fitting term.
These expressions expose the distinction without the complexity of language. PGD-AT asks the perturbed observation to fit the target. LDS asks the perturbation to have little effect on the output. Those requirements can influence the estimated slope differently.
Compare the resulting estimates
The paper gives the ordinary least-squares estimate as:
θ_OLS = (Σᵢ xᵢyᵢ) / (Σᵢ xᵢ²)
The estimate is θ_OLS. Its numerator sums input–target products, while its denominator sums squared inputs. The index i ranges over the observations.
For PGD-AT, the stated estimate is:
θ_PGD-AT = Σᵢ(2xᵢyᵢ + yᵢδ) / Σᵢ[xᵢ² + (xᵢ + δ)²]
The estimate θ_PGD-AT depends on the perturbation δ in its numerator and denominator. The observed values remain xᵢ and yᵢ. The coefficient 2 belongs to the expression reported for this objective.
For LDS, the corresponding estimate is:
θ_LDS = (Σᵢ xᵢyᵢ) / Σᵢ(xᵢ² + δ²)
The estimate θ_LDS has the ordinary input–target product in its numerator. Its denominator includes δ² alongside xᵢ². The analytical difference lies in where perturbation-related terms enter the fitted parameter.
The authors use this contrast to motivate expectations about behavior under noise. They argue that PGD-AT should track ordinary fitting more closely because the perturbation affects both parts of its estimate. They describe LDS as becoming closer to ordinary fitting when observation noise overwhelms the perturbation’s influence.
Those statements are hypotheses drawn from the simplified setup. They should not be read as a general theorem about noisy language classification. The scalar calculation does not include word choice, ambiguous sentiment, nonlinear representations, or domain transfer.
The accompanying simulation trains a single neuron on generated input–target pairs. The noise conditions are σ = 0.01 and σ = 0.1. Training lasts 2K epochs with learning rate 0.005. The alternative objectives replace the ordinary objective after epoch 1750, and the reported parameter distributions come from 25 runs.
The figure caption treats concentration around 0.5 as favorable estimation and interprets a smaller spread as greater stability. This illustrative notion of robustness differs from the attack success rate used later. The scalar experiment supplies an intuition about the objectives, not a numerical forecast for the review experiments.
Prepare the linguistic investigation
The final methodological branch concerns interpretability. The authors use Linguistic Correlation Analysis, abbreviated LCA, through the NeuroX toolkit to identify neurons associated with grammatical labels.
They choose tagging because sentiment does not provide a clean word-level target. A word can appear in positive and negative reviews, so associating its activation directly with a review label would be difficult to interpret. A grammatical annotation instead provides a category attached to a particular word occurrence.
BERT and the embedding-trained alternatives are fine-tuned on the Penn Treebank. The analysis identifies highly ranked neurons for each category, examines words that activate them strongly, and compares those words with the relevant annotations.
A further prediction analysis uses only activations from the top 10 ranked neurons. This restriction examines the usefulness of a compact selected representation. Its meaning depends on the tagging task and selected activations; it is not another sentiment test.
Experiments and results
Datasets and training conditions
The main experiments use text classification to study sentiment. IMDB and MR serve as separate training sources. Each trained system is evaluated on its corresponding test split, and YELP supplies an additional evaluation outside that source distribution.
The paper identifies IMDB through Learning Word Vectors for Sentiment Analysis and MR through Seeing Stars. Its YELP source is associated with Character-level Convolutional Networks for Text Classification. The comparison uses these established resources instead of introducing a new dataset.
Ordinary BERT is the reference condition. The augmentation family contains BackTranslation and SSMBA. The input-space family contains BERT_Attack, A2T, and A2T_MLM. The embedding-space family contains PGD-AT and LDS.
The authors adopt the settings recommended in the corresponding papers for the augmentation and input-space procedures. For the embedding procedures, the inner search uses 3 PGD steps, with an L2 perturbation limit of 0.003. The experiments use an Nvidia v100 Tensor Core GPU.
These settings define the actual comparison. The results do not summarize an exhaustive search over every possible radius, objective weighting, or training schedule. They show what these selected procedures do under the stated configuration.
Measures answer different questions
Classification accuracy measures the proportion of correct sentiment decisions. The paper reports it separately for familiar-source testing and YELP transfer. Higher accuracy is favorable in both cases, but the distributional condition changes the claim being tested.
Attack success rate, or ASR, measures the fraction of samples for which an attack succeeds. Lower ASR indicates better resistance to that attack procedure. An ASR entry is therefore not ordinary test accuracy under another name.
Fine-tuning duration measures computational cost over 4 epochs. The authors report minutes for each training source. This evaluates a particular training workload on the stated hardware, instead of every cost involved in preparing and deploying a defense.
The distinction among these measures is central to the paper. A method can lower ASR while reducing ordinary accuracy. Another can improve ordinary accuracy while allowing more successful attacks. Training duration adds a practical constraint without resolving either predictive question.
The evaluated attacks all alter words
The robustness suite contains several substitution strategies. TextFooler estimates importance by removing a word and observing the change in sentiment score. It then proposes replacements using nearby word representations.
BAE uses a BERT-based masked-word predictor. It masks part of the text and obtains candidate alternatives from predictions for the missing material. Its candidate-generation mechanism therefore depends on contextual prediction rather than only vector proximity.
A2T selects a location using the loss gradient with respect to the word embedding. It then replaces the word with a synonym obtained from counterfitted embeddings. The gradient determines importance, while the embedding resource supplies the replacement.
PSO uses sememe-based substitution together with particle swarm optimization. The paper describes it as searching for effective adversarial configurations through that optimization strategy.
These attacks differ enough to expose variation hidden by a single test. Nonetheless, they share a boundary: the final intervention is a textual word substitution. The experiment does not test every kind of linguistic disturbance, nor does it attack only the continuous region used by the embedding defenses.
Average resistance shows a conditional advantage
On MR, the average ASR for baseline BERT is 62.0. A2T training and BERT_Attack training each produce 56.1. A2T_MLM produces 57.2. These averages support the usefulness of input-space training for the evaluated textual threats.
The augmentation methods are competitive in the same MR comparison. BackTranslation records 56.5, while SSMBA records 60.3. The embedding methods are closer to the baseline: PGD-AT records 60.5 and LDS records 61.5.
The IMDB averages produce a different ordering:
IMDB average attack success rate by training procedure
BackTranslation provides the strongest average resistance in this comparison.
The numbers
| System or setting | ASR % |
|---|---|
| BERT | 63.8 |
| SSMBA | 61.0 |
| BackTranslation (this paper) | 41.6 |
| A2T training | 59.5 |
| A2T_MLM training | 49.2 |
| BERT_Attack training | 52.6 |
| LDS | 71.4 |
| PGD-AT | 66.2 |
BackTranslation is important to the interpretation because it prevents a simple claim that adversarial text training always provides the best observed defense. The authors favor input-space adversarial training as a broad family, but the strongest IMDB average belongs to advance augmentation.
Their explanation points to the longer sentences in IMDB. They argue that this makes back translation more capable of producing useful, diverse alternatives. The comparison itself does not independently manipulate sentence length, so this remains an interpretation of the dataset-dependent result.
The embedding methods perform poorly on IMDB average ASR relative to ordinary BERT. Their generalization advantages, discussed below, therefore cannot be treated as evidence of superior word-substitution resistance.
Individual attacks qualify the averages
The detailed robustness entries show why the average cannot carry the whole explanation. Under A2T attack on MR, baseline BERT has ASR 33.8. PGD-AT has 20.9, and LDS has 22.3. In that condition, embedding training provides a favorable result.
TextFooler on IMDB reverses the picture. Its ASR is 80.6 for BERT, 91.5 for LDS, and 94.7 for PGD-AT. The same embedding procedures that resist one tested attack more effectively can be more vulnerable to another.
The input-space procedures also vary. For TextFooler on IMDB, A2T_MLM training yields 65.3 and BERT_Attack training yields 72.8, while A2T training yields 86.5. Sharing a broad training family does not make their attack-specific behavior identical.
BackTranslation’s IMDB entries are consistently favorable relative to BERT across the reported attacks. Its BAE ASR is 41.4, compared with 68.8 for BERT. Its PSO ASR is 42.8, compared with 46.4. Against A2T, the corresponding entries are 36.4 and 59.5.
These observations establish performance against the implemented searches. They do not show that no valid substitution could succeed. A more capable search, a different candidate resource, or another linguistic intervention would constitute a different test.
The broad lesson from the robustness table is therefore conditional. Training on adversarial text often helps against textual attacks. Advance augmentation can also be highly effective. Embedding perturbation does not reliably cover the same threat, even when it improves behavior elsewhere.
PGD-AT leads the ordinary accuracy comparison
For IMDB training and testing, PGD-AT produces the highest reported accuracy. The comparison with other conditions is compact enough to show directly:
IMDB test accuracy after IMDB training
PGD-AT has the highest reported ordinary accuracy in the IMDB setting.
The numbers
| System or setting | accuracy % |
|---|---|
| BERT | 93.49 |
| SSMBA | 93.49 |
| BackTranslation | 93.44 |
| A2T training | 92.59 |
| A2T_MLM training | 92.70 |
| BERT_Attack training | 92.63 |
| LDS | 93.24 |
| PGD-AT (this paper) | 93.80 |
The augmentation results remain close to the baseline. The input-space results are lower, despite their advantages against some attacks. LDS does not exceed baseline accuracy in this particular condition.
MR testing gives both embedding procedures a favorable result. BERT reaches 85.27, LDS reaches 86.49, and PGD-AT reaches 86.59. BackTranslation records 84.96, while SSMBA records 85.24.
The input-space methods again fall below baseline MR accuracy. BERT_Attack records 84.61, A2T_MLM records 83.90, and A2T records 83.58. This makes the robustness–accuracy tension visible without requiring the same outcome for every training family.
The authors attribute part of that tension to the validity of generated supervision. A difficult substitution can change meaning enough that the inherited sentiment label is no longer appropriate. Training repeatedly on such examples can distort learning rather than simply improve resistance.
They contrast this with augmentation procedures that consider broader context. Their account is that translation-based and self-supervised generation are less likely to damage the relationship between text and label. The experiment does not include a separate audit measuring how frequently each procedure preserves sentiment, so the mechanism remains explanatory rather than directly quantified.
Transfer distinguishes the embedding objectives
With IMDB as the training source and YELP as the test source, BERT accuracy is 91.24. LDS reaches 92.09 and PGD-AT reaches 92.11. Both embedding objectives therefore improve this reported transfer condition.
BackTranslation reaches 91.50, while SSMBA reaches 91.17. The input-space values are lower: A2T yields 89.97, BERT_Attack yields 90.04, and A2T_MLM yields 89.15.
The MR-to-YELP condition is especially informative because LDS no longer follows PGD-AT:
YELP transfer accuracy after MR training
PGD-AT leads the transfer comparison, while LDS loses the advantage seen on MR testing.
The numbers
| System or setting | accuracy % |
|---|---|
| BERT | 87.06 |
| SSMBA | 87.72 |
| BackTranslation | 87.77 |
| A2T training | 83.62 |
| A2T_MLM training | 81.79 |
| BERT_Attack training | 80.41 |
| LDS | 81.80 |
| PGD-AT (this paper) | 88.16 |
This result makes the objective distinction consequential. LDS cannot be described as a uniformly successful generalization method merely because it belongs to the embedding-space family. Its favorable familiar-source accuracy on MR coexists with weak transfer to YELP.
PGD-AT is the consistent result across the sentiment accuracy table. It exceeds baseline BERT under IMDB testing, MR testing, and each YELP transfer condition. That is a more precise statement than saying every embedding procedure improves every kind of generalization.
The augmentation results also require care. They can improve transfer while leaving familiar-source accuracy unchanged or slightly lower. The authors’ broad conclusion about augmentation is most useful when read as a favorable overall compromise, with the individual entries retained.
Training duration exposes the cost of repeated search
The timing results cover 4 epochs of fine-tuning. Standard BERT takes 79.0 minutes for IMDB and 38.2 minutes for MR. These values provide the reference workload.
Among the augmentation procedures, SSMBA takes 112.8 minutes on IMDB and 46.4 minutes on MR. BackTranslation takes 210.5 minutes on IMDB and 66.0 minutes on MR. Preparing alternatives before training avoids generating a fresh adversarial sentence at every update.
The embedding procedures incur recurring gradient work. PGD-AT takes 158.2 minutes for IMDB and 69.0 minutes for MR. LDS takes 163.4 minutes for IMDB and 64.2 minutes for MR.
Input-space adversarial training is much more expensive in the reported runs. On IMDB, A2T takes 1600.5 minutes, while BERT_Attack takes 1495.2 minutes and A2T_MLM takes 1494.3 minutes. On MR, A2T takes 448.5 minutes, BERT_Attack takes 461.5 minutes, and A2T_MLM takes 504.7 minutes.
The authors connect this burden to substitution search within the training loop. They report that generating an adversarial example with A2T requires 6 seconds. The relevant distinction is recurring discrete search versus repeated continuous differentiation or reuse of prepared text.
The timing discussion also contains broad verbal approximations that do not describe every table entry equally well. The exact durations are the clearer basis for comparing the reported workloads. In addition, advance preparation and fine-tuning are different accounting stages. The table does not establish a complete cost ordering for every end-to-end workflow.
What the ablations show
Several analyses address different mechanisms
The paper includes an explicit restricted-neuron analysis, together with the scalar objective comparison and category-level activation inspection. These investigations ask different questions and should not be merged into a single explanation.
The scalar study isolates objective structure in a minimal numerical setting. The linguistic association study asks whether selected activations concentrate on grammatical categories. The restricted prediction study asks whether a small ranked subset carries useful information for tagging.
The main sentiment comparison is broader. It contrasts training families and measures several outcomes, but does not isolate every causal factor within those families. A method changes candidate generation, optimization, computational effort, and sometimes supervision quality together.
As a consequence, the strongest claims concern observed comparative behavior. The analyses help interpret that behavior, but they do not completely decompose why an ordinary accuracy gain occurs.
The scalar study separates concentration from accurate estimation
In the generated-data experiment, the authors inspect the distribution of fitted slope values across repeated runs. PGD-AT gives a narrower distribution than LDS under each stated noise condition. They interpret this as a stability advantage.
At the larger noise setting, LDS gives an estimate closer to the target indicated by the figure. This creates a useful distinction between repeatability and accurate centering. A procedure can produce similar answers across runs while being displaced from the desired value.
The closed-form expressions help explain why the objectives need not behave identically. In the PGD-AT estimate, the perturbation contributes to the numerator and denominator. In the LDS estimate, the additional squared perturbation enters the denominator. The authors use that asymmetry to motivate their expectations.
However, the example is not a controlled reduction of the sentiment task. It does not preserve its linguistic ambiguity, representation geometry, or attack construction. The figure’s notion of robustness concerns spread in an estimated parameter, whereas the language experiment measures successful adversarial substitutions.
The analytical comparison also assumes a fixed perturbation when deriving the estimates. The simulation obtains perturbations through the iterative procedure. Those related but distinct settings make the example informative as an illustration, without turning it into a complete theoretical account.
How the neuron association score is constructed
LCA identifies the top-5 firing neurons associated with each part-of-speech category. The authors then obtain test words with the strongest activations for those neurons. They compare that selected collection with words annotated as belonging to the category of interest.
The association measure is an intersection proportion. “Match” counts selected words that have the relevant tag, and “Total” counts the selected words under consideration. The reported percentage describes the concentration of the category within that collection.
This measure is different from tagging accuracy. A high association percentage means that the selected activations align closely with a particular category in this diagnostic. It does not mean the full tagger correctly labels that percentage of every test token.
The association also depends on selection. The procedure deliberately examines neurons ranked as salient for the tag, instead of averaging all neurons. It therefore investigates whether useful specialization can be found and how concentrated that specialization appears.
The qualitative word lists supplement the counts. For third-person singular present verbs, PGD-AT’s examples include “indicates,” “refuses,” and “agrees.” For adjectives, examples include “bright,” “strong,” and “cold.” These make the intended associations concrete without establishing that the selected neurons implement explicit grammar rules.
Several categories favor PGD-AT
For adjectives, baseline BERT and LDS each have a match percentage of 13.33. PGD-AT has 60.00. Its selected collection contains 6 matches among 10 entries, compared with 2 among 15 for the baseline.
Comparative adjectives also favor PGD-AT. The percentages are 33.33 for BERT, 44.44 for LDS, and 53.84 for PGD-AT. The underlying selected totals differ, so the comparison concerns concentration rather than equal-sized collections of words.
For third-person singular present verbs, BERT records 40.00, LDS records 77.77, and PGD-AT records 90.00. This is one of the clearer category-level patterns supporting increased selectivity under embedding training.
The punctuation category covering colons and semicolons gives 0.00 for BERT, 20.00 for LDS, and 60.00 for PGD-AT. For gerunds or present participles, the corresponding percentages are 83.33, 77.77, and 100.00.
These entries support the authors’ claim that useful linguistic concentration can increase. They also show why the claim should name the diagnostic. It concerns words selected through salient activations, not an unrestricted assessment of every internal component or every grammatical distinction.
Other categories resist a uniform account
The modal category favors LDS rather than PGD-AT. BERT records 0.00, LDS records 60.00, and PGD-AT records 40.00. Different adversarial objectives therefore produce different kinds of specialization.
Past-tense verbs give the strongest counterexample to a universal improvement claim. BERT records 100.00, whereas LDS and PGD-AT each record 0.00. A narrative that mentions only the favorable adjective and present-tense results would omit a substantial reversal.
Adverbs also qualify the pattern. BERT and LDS each record 90.00, while PGD-AT records 60.00. Better aggregate sentiment accuracy does not require PGD-AT to lead every grammatical association.
The selected word lists likewise include mismatched entries. The paper marks matches using the words’ frequent tags in the tagging data. This makes the examples understandable, but it also means that lexical preferences and context-sensitive grammatical behavior are not fully separated.
Taken together, the category results support heterogeneous representational change. Some categories become more concentrated, some favor another objective, and some favor the baseline. The evidence is richer than either “all neurons become better” or “nothing linguistic changes.”
The restricted-neuron experiment measures accessible information
The authors’ neural ablation uses activations from the top 10 ranked neurons to build what they describe as a linear regression predictor. The purpose is to compare how useful a small selected subset is for the tagging analysis.
The reported result is 34.2% for BERT. PGD-AT reaches 35.3%, and LDS reaches 38.6%. Both adversarial alternatives exceed the baseline within this restricted diagnostic.
LDS leads this experiment even though PGD-AT supplies the most consistent sentiment accuracy results. That difference is informative. The restricted tagging procedure and the complete sentiment classifier evaluate different information under different training conditions.
The percentage entries are not accompanied by a detailed metric definition comparable to the sentiment accuracy discussion. They should therefore be reported as the paper’s restricted-neuron performance values. Calling them full-network tagging accuracy would go beyond the description.
The procedure also differs from removing selected neurons from the original network and measuring the resulting performance loss. Using a subset asks whether its activations support prediction. Removing a subset asks how much the original decision process depends on it. The paper describes the former.
Accordingly, the result establishes increased usefulness of selected activations under the diagnostic. It does not establish that those neurons caused the sentiment improvement or that the sentiment classifier relies on them in the same way.
Important mechanisms remain unisolated
The paper does not report a systematic sweep over the perturbation radius or the number of inner steps. It also does not compare several weights for the ordinary and adversarial terms. The chosen configuration therefore supplies evidence at that setting, instead of a broad sensitivity map.
The proposed semantic-noise explanation is not tested through a separate verification experiment. The authors do not report manually checking all generated sentiment variants, correcting their labels, and measuring the effect of those corrections. Their explanation fits the training mechanisms but remains unquantified.
There is no evaluated combination of augmentation, adversarial text training, and embedding perturbation. The conclusion proposes that combination for future research. The complementary results make it a motivated direction, but the ablations do not show whether combining the procedures preserves their benefits.
The linguistic work also stops short of a direct causal intervention connecting grammatical specialization to review transfer. It provides a separate source of evidence about learned representations. That evidence strengthens the investigation, while leaving the explanation of the sentiment gains incomplete.
Limitations
Author-stated limit: BERT-small defines the scale
The authors explicitly identify computational demand as the reason for using BERT-small throughout the experiments. Generating attacks and training many defensive configurations makes the comparison expensive.
They acknowledge that larger systems could produce different measurements. Their expectation that the broad relationship between input-space and embedding-space training would remain is an extrapolation, not an experimentally demonstrated result.
This matters because the paper’s conclusions concern a particular backbone under a particular comparison. They do not establish that every architecture or scale must show the same ordering. The study offers evidence for a distinction worth testing elsewhere.
The resource constraint also helps explain the scope of the empirical design. The authors compare several strategies and attacks, but do not simultaneously explore every hyper-parameter choice or downstream application. Breadth across methods comes with limits on depth within each method.
Author-stated limit: numerical and linguistic changes remain disconnected
The authors identify the semantic relationship between embedding attacks and input attacks as unresolved. A small embedding displacement is mathematically bounded, but the text that would express it may be unclear or unavailable.
This affects the interpretation of a weak robustness result. An embedding defense can successfully regularize behavior around its numerical training examples without protecting against the word replacements used at evaluation. The training neighborhood and evaluated linguistic neighborhood may cover different changes.
The reverse problem also matters. A word substitution can look minor in ordinary language while producing a representation change that is poorly characterized by the selected norm. The paper does not derive a mapping that equates these notions of proximity.
As a consequence, the experiments cannot establish that one family is intrinsically better under every reasonable definition of perturbation. They establish how selected defenses behave against selected input-space attacks.
Author-stated limit: other defenses and applications need study
The limitations section calls for examining robustness techniques beyond adversarial training. The related-work discussion covers some alternatives, but the empirical tables do not compare the full range of certified and non-adversarial defenses.
The conclusion also proposes extending the analysis to other downstream applications. Sentiment classification provides the main performance comparison, while tagging supports the internal investigation. That combination does not establish the same tradeoff for every language-processing task.
The authors additionally seek a stronger theoretical account of robustness and generalization. The scalar example clarifies objective differences but does not predict the full language results. Their future-work statement recognizes that gap.
These are explicit research boundaries. They should remain visible even when the paper’s overall pattern is persuasive: different intervention spaces can offer different advantages, but the range over which that pattern holds still requires evaluation.
Reader-observed limit: the attack suite has a shared boundary
A careful reader can see that all evaluated attacks ultimately replace words. Candidate generation and search vary, but the tested disturbances remain within that broad family.
The experiments therefore do not establish robustness to every possible spelling change, sentence-level reformulation, or other linguistic intervention. Such tests would involve additional assumptions about what content and labels should remain fixed.
Observed attack failure is also weaker than a certificate. A search may fail because the classifier resists its candidates, because the candidate set is limited, or because the search does not discover a successful combination. The reported ASR does not distinguish these possibilities completely.
The paper defines ASR through successful attacks relative to samples, but its prose does not fully specify eligibility and filtering details. In particular, the treatment of examples already classified incorrectly is not resolved in the main description. Reconstructing a more precise denominator would require information beyond what is stated.
Reader-observed limit: uncertainty is not quantified for the main tables
The sentiment tables provide point estimates. They do not accompany those entries with confidence intervals or distributions across repeated training runs. The repeated scalar experiment does not supply uncertainty information for the review tasks.
This limits how strongly small accuracy differences can be interpreted. The reported ordering is clear as a description of the table. It does not automatically establish that every neighboring pair would retain its ordering under another initialization or sample.
The main discussion also does not give dataset sizes or detailed partition counts. The public resource names identify the broad experimental sources, but they do not replace an explicit account of the exact examples and preprocessing used.
Likewise, the paper states the principal embedding settings without presenting a comprehensive hyper-parameter search. A family that performs poorly under one configuration may perform differently under another. The authors themselves note that stronger variants of their representative embedding methods may improve on these results.
Reader-observed limit: explanations exceed the controlled evidence
The authors explain some input-space accuracy loss through semantic damage and inherited-label noise. This is plausible because substitutions can change the relationship between a review and its original sentiment annotation.
However, the study does not directly measure the frequency or severity of that damage. It also does not isolate label validity from search difficulty, training duration, or other differences among procedures. The explanation should therefore be attributed to the authors rather than presented as experimentally settled.
The discussion of binary sentiment labels raises a related concern. Sentiment can be more nuanced than the available label categories. The authors invoke that mismatch when interpreting LDS behavior, but do not provide an independent measurement connecting label ambiguity to the transfer failure.
BackTranslation’s IMDB advantage is likewise explained through longer sentences and more diverse generated examples. The data comparison is compatible with this account. It does not establish sentence length as the causal variable, because length is not independently varied while other dataset properties are held constant.
These qualifications preserve the value of the findings. The measured outcomes show what happened. The explanations suggest why, while leaving specific mechanisms available for further testing.
Reader-observed limit: grammatical association is not a complete causal account
The neuron analysis is compelling as an attempt to look beyond final accuracy. Nonetheless, it concerns a separately trained tagging task. A grammatical effect observed there cannot directly establish the mechanism behind sentiment transfer.
Selected neurons can correlate with a category because of useful grammatical information, preferences for particular words, or interactions between those factors. The displayed word analysis uses frequent-tag information, which does not fully resolve contextual ambiguity.
The match percentages also describe small selected collections with differing totals. An association score can change when the selected words change. Without a broader stability analysis, the results establish the reported diagnostic pattern instead of a universal property of the representation.
The category reversals further restrict the explanation. PGD-AT is not uniformly more selective, and LDS leads the restricted-neuron predictor. A single general claim about specialization cannot explain every entry without additional detail.
Most importantly, the study does not intervene on the identified components within the sentiment system and measure whether its accuracy advantage disappears. The linguistic findings are consistent with better representation learning. They do not prove that this is the exclusive cause of the generalization gains or rule out every form of memorization.
Reader-observed limit: timing depends on the accounting boundary
Fine-tuning duration is a useful practical measure, but advance augmentation relocates computation. Generating reusable text before training and generating adversarial text during every iteration impose costs at different stages.
The reported minutes should therefore remain attached to the stated fine-tuning workload. They do not establish total preparation cost, reuse cost across several experiments, or prediction-time cost for every possible deployment.
The timing narrative also uses general approximations that fit some entries more closely than others. The table shows the actual measured durations and should take precedence when assessing a particular dataset and method.
This does not weaken the main computational observation. Repeated discrete search is expensive in the reported experiment. It does mean that a practical decision should preserve the distinction between preparation, training, and any later evaluation workload.
Reader-observed limit: broad family claims need exceptions
The conclusion describes augmentation favorably for generalization and robustness. The detailed accuracy table contains unchanged values and decreases as well as increases. A precise reading is that augmentation frequently offers a useful compromise, not that every augmentation entry improves every metric.
The embedding family also requires separation by objective. PGD-AT improves baseline accuracy throughout the reported sentiment conditions. LDS does not: its MR-to-YELP result is a clear exception to a family-wide generalization claim.
The robustness conclusion is similarly conditional. Input-space training often performs strongly, but BackTranslation supplies the best IMDB average. Particular attacks can favor embedding training even when its average result is weak.
There are also compact-presentation ambiguities. The scalar target is represented inconsistently between the mathematical discussion and the figure description, while the figure clearly uses 0.5 as its favorable center. The restricted-neuron table reports percentages with less metric detail than the main accuracy table. These issues argue for bounded interpretation rather than reconstruction of missing specifications.
The durable result is the comparison itself: intervention location, objective, dataset, and attack construction interact. The paper gives concrete evidence that success on one reliability measure does not settle the others.
What came after
No later citing study is identified in the available record, so a specific line of subsequent adoption or confirmation cannot be described. The paper’s own proposed next steps are clear, but they remain proposals rather than demonstrated follow-up results.
The authors first suggest combining the training families. The motivation comes from their complementary behavior: augmentation can preserve useful ordinary performance, adversarial text training can strengthen resistance to substitutions, and embedding perturbation can improve accuracy. The experiments do not show whether a combined procedure retains these advantages or introduces additional conflicts.
They also propose developing a stronger theoretical understanding of the relationship between robustness and generalization. Their scalar analysis distinguishes the objectives, but the language setting adds discrete wording, uncertain semantic preservation, and task-dependent labels. Explaining those interactions remains beyond the analytical example.
A further direction extends evaluation to additional downstream tasks. The tagging investigation demonstrates a way to inspect linguistic representation, while the sentiment experiments establish the principal predictive findings. More applications would be needed to determine how broadly the observed family differences extend.
The unresolved input–embedding relationship connects these directions. Understanding which numerical interventions correspond to valid linguistic changes would sharpen both training and evaluation. In this study, that relationship remains an open problem, and the strongest supported conclusion is that robustness, ordinary accuracy, transfer, and linguistic selectivity must each be assessed on their own terms.
Cite
Cite as Enes Altinisik, Hassan Sajjad, Husrev Sencar, Safa Messaoud and Sanjay Chawla. 2023. Impact of Adversarial Training on Robustness and Generalizability of Language Models. Findings of the Association for Computational Linguistics: ACL 2023.
@inproceedings{altinisik2023impact,
title = {{Impact of Adversarial Training on Robustness and Generalizability of Language Models}},
author = {Enes Altinisik, Hassan Sajjad, Husrev Sencar, Safa Messaoud and Sanjay Chawla},
booktitle = {Findings of the Association for Computational Linguistics: ACL 2023},
year = {2023},
doi = {10.18653/v1/2023.findings-acl.496},
url = {https://doi.org/10.18653/v1/2023.findings-acl.496}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/altinisik-2023-impact-adversarial-training-robustness-generalizability/