Dialect Identification through Adversarial Learning and Knowledge Distillation on Romanian BERT
Paper · 2021 · George-Eduard Zaharia, Andrei-Marius Avram, Dumitru-Clementin Cercel et al.
Summary
A short text can be easy to understand and still hard to place by dialect. Romanian and Moldavian entries in the VarDial 2021 Romanian Dialect Identification task often use much the same words and sentence structures. The challenge adds a second difficulty. The main training material comes from news, while the test entries come from a different domain. Zaharia and colleagues ask how well a classifier can distinguish the two labels under that shift, and whether training it to cope with deliberate disturbances makes it more reliable. The distinction matters in applications such as machine translation, where an initial dialect decision can help select a translation system, and in speech recognition and opinion mining.
The authors start with Romanian BERT, a pretrained text encoder specialized for Romanian. They split long training entries into sentences so that the classifier sees examples closer in length to the short items it will have to label. A classifier trained on the original validation entries then screens the sentences, retaining those it can assign to either dialect with confidence over 95%. The strongest individual test submission uses adversarial training. During training, the system deliberately pushes the numerical representation of a text in a direction that makes its correct label harder to predict, then learns from the disturbed input as well as the original.
The adversarially trained system reaches a weighted F1 of 0.7318 on the test set. Weighted F1 summarizes how well the system finds each label and how often the labels it assigns are correct, giving each dialect a weight based on how common it is in the evaluation set. Combining the predictions of the neural systems raises test weighted F1 to 0.7324 and earns second place. On validation, the adversarial variant scores 0.8559, compared with 0.8492 for standard Romanian BERT. A smaller system trained to imitate Romanian BERT reaches 0.6744 on the test set, showing the cost in classification quality of that particular attempt at compression.
The authors’ error analysis helps explain the difficulty. Some confidently classified texts contain visible personal names that also occur in training or words associated with a particular dialect. Other texts use ordinary phrasing shared across the labels, and masking names can leave little evidence to work with. The ensemble’s stronger validation score of 0.8564 also matters for interpreting its test result. The authors suggest that screening training sentences for compatibility with the validation material favored the domain used to guide that screening. The competition result shows what the approach achieved on the held-out task, while the validation and test scores make clear how strongly the measured performance depended on the evaluation material.
Deep dive: Dialect Identification through Adversarial Learning and Knowledge Distillation on Romanian BERT
Zaharia and colleagues test adversarial training, distillation, and ensembles for identifying Romanian and Moldavian dialects across domains. · about 34 minutes to read
The problem and its context
A dialect label for a short text
Romanian Dialect Identification is a text classification task. The system receives a text and assigns it either the Romanian label, abbreviated RO, or the Moldavian label, abbreviated MD. The benchmark supplies the labels against which the decisions are judged. The unit being labeled is the entry, so a short headline or excerpt counts as a complete decision even when it contains little language that would help a reader tell the varieties apart. A system therefore has to act on whatever combination of lexical, structural, and contextual clues the entry happens to preserve.
The paper places this task within the broader effort to distinguish closely related languages and varieties. It uses speech and spoken language as one application area, since dialect recognition can play a role in automatic speech recognition. The experiments in the paper use written text. Earlier work cited by the authors also connects dialect identification with sentence-level translation system selection and with opinion mining. These applications share a straightforward dependency. If a subsequent component expects a particular variety, an initial classification can determine which component handles the input.
The evaluation introduces a complication beyond the resemblance between the dialects. The text available for learning and the text used for the final assessment come from different domains. An expression can be useful for classifying news articles because it repeatedly appears with one label there. That association may be rare or absent in the evaluation material. Even when a classifier has learned something relevant about the varieties, it may receive too little text at test time to put that knowledge to use. In this setup, learning a dialect boundary and carrying it across different kinds of text are inseparable parts of the task.
The authors describe Romanian language resources as becoming more substantial. They point to a sentiment dataset, the Romanian Named Entity Corpus, and a Romanian portion of a cross-lingual question-answering dataset. They also mention the Romanian Speech Corpus as part of the growth in speech resources. For the experiments at hand, the particularly relevant development was the availability of pretrained Romanian encoders. The authors cite both Romanian BERT and RoBERT as examples of that development. The Romanian BERT used in the experiments comes from the first of those works.
What earlier VarDial tasks had established
The paper traces the problem through earlier VarDial evaluations. The 2019 challenge drew on MOROCO, the Moldavian and Romanian Dialectal Corpus. One part of the challenge asked systems to distinguish the dialects. The other parts changed the prediction target to topic and changed the variety between training and evaluation. One direction used Moldavian examples to learn a topic classifier for Romanian examples. The reverse direction used Romanian examples for Moldavian topic classification. This distinction matters because the same two varieties can appear on either side of quite different learning problems. In the dialect task the variety itself is the outcome, while in cross-dialect topic classification the topic is the outcome and the change of variety is a condition under which the system must operate.
On the earlier dialect task, the leading team combined two convolutional neural networks for sentence classification. One component used skip-gram representations and a softmax loss for classification. The other was trained with a triplet loss, which uses relative similarity to bring related representations together and distinguish them from others. The example gave the present authors a precedent for combining predictors trained with different objectives. The earlier results also showed that useful text signals could be captured with relatively direct features. The leading cross-dialect topic approach used a linear support vector machine and both character and word n-grams. An n-gram is a sequence of neighboring units. Character n-grams expose short spelling patterns, while word n-grams preserve short sequences of words.
The paper also describes approaches that process sequences in both directions using recurrent units. Such a system can build a representation of a word using context to its left and to its right. Earlier participants tried both bidirectional long short-term memory units and bidirectional gated recurrent units. The related work also included a Hierarchical Attention Network, which organizes attention over a text at different levels. These approaches put context into the learned representation in different ways, as opposed to representing a text solely by which short sequences appear in it.
In 2020 the competition framed Romanian Dialect Identification as a binary prediction problem with evaluation on Twitter messages. The earlier study on dialect identification under domain shift obtained the strongest result in that edition with an ensemble of support vector machines using word and character n-grams. An ensemble makes a decision from the outputs of several predictors. The authors’ account of that result makes character features a meaningful baseline for the new study, even though their main experiments use pretrained encoders. Earlier teams had also applied Romanian BERT, including the authors’ own study of Romanian BERT for dialect identification. The 2021 paper thus starts from an existing line of work with Romanian BERT and asks what changes when that encoder is trained under different conditions.
The 2021 competition supplies an expanded version of the news-based MOROCO material and again uses a test set from another domain. The paper identifies the evaluation domain as Twitter for the earlier edition and describes the current test set in terms of its separation from the training domain. The shared concern is transfer across domains. The current experiment adds a specific design problem: how to turn long, labeled news texts into useful training examples for a classifier whose evaluation inputs are much shorter. That problem motivates a data procedure alongside the changes to the classifier itself.
Why the authors vary the training procedure
The paper’s central architecture is based on the Transformer and attention. An encoder of this kind represents a token in the context of other tokens in its input. Pretraining gives that encoder a starting point before the dialect task supplies its own labels. Fine-tuning then adjusts the system for the new task. Using a Romanian encoder makes it possible to ask whether task-specific training can extract useful distinctions from representations already specialized for the language. Using multilingual encoders separately tests how well alternatives with broader language coverage perform on the same prediction task.
The authors consider two kinds of adversarial training. One uses synthetic representations, which a discriminator must distinguish from representations of real texts while also learning the dialect labels. The other changes the representation of an actual example in a direction calculated to challenge its current prediction. These are distinct interventions. The synthetic-example approach adds a source of artificial feature vectors and a separate prediction class during training. The perturbation approach keeps the dialect task in place and varies the input representation within that task. The paper also tests compression through knowledge distillation, asking how well a smaller classifier can imitate the Romanian BERT teacher. These experiments let the authors compare a change in the input data, a change in the learning objective, and a change in the size of the system within the same evaluation setting.
The method, step by step
Make the training examples resemble the inputs to be classified
The pipeline starts by cleaning the competition entries. The authors standardize punctuation by removing repetitions such as runs of question marks. They also tidy extraneous whitespace. This is a surface-level preprocessing step. The separate selection procedure changes the training material more substantially by deciding which parts of the original texts become examples in their own right.
A large share of the original training entries exceeded the encoders’ 512-token input limit. A token is a unit produced when the encoder prepares text for processing. Token counts and word counts can describe different aspects of an entry, so the system limit is given in tokens, while the paper describes the typical validation length in words. The validation entries average 20 words. An article-length input and a short entry create different conditions for classification. In a long text, a decision can draw on clues scattered across sentences. At the length of a short evaluation entry, any useful evidence has to occur in the small amount of text available.
The authors split the training entries into sentences. Each sentence inherits its original entry’s dialect label. This supplies short labeled inputs without requiring a separate labeling effort for every sentence. It also makes the label less informative about the contents of a particular example. An article may contain several pieces of evidence in favor of its assigned label, yet an individual sentence extracted from it may consist entirely of wording common to both varieties. Inheriting the document label is therefore a practical way of obtaining supervision, and the screening step addresses the fact that the resulting sentences vary in how readily they can be classified.
The original training split has 39,487 entries. Sentence splitting yields 431,875 candidate sentences. The authors use a separate classification pass to narrow that collection. Their first step is to use the original validation entries to train a Romanian BERT classifier. After four epochs, meaning four passes through the training material for that stage, they apply the classifier to the split training sentences. They keep a sentence if the classifier assigns it to Romanian or Moldavian with confidence over 95%. The paper describes this as a confidence filter applied to sentences that already received their labels from the parent entries. It does not describe a relabeling step or specify a separate requirement that the screen’s predicted label agree with the inherited one.
The filtered pool contains 158,363 sentences. The validation-trained classifier serves as a proxy for what makes a sentence classifiable under the conditions of that split. A high score indicates that the classifier sees strong evidence for one of its labels. That can be due to wording, names, or other signals represented in the classifier. The authors interpret the selected sentences as closer in structure and context to the short validation items and potentially closer to the test items as well. Confidence is the actual selection rule. Similarity to the test material is an expectation about what that rule will accomplish.
This procedure assigns different jobs to different pieces of data. The news training entries supply the underlying sentences and inherited labels. The short validation entries supply labeled examples for the classifier that screens those sentences. The screened sentences then become the training pool for the task architectures. The final systems therefore depend on the original validation data even though their fine-tuning examples come from the original training entries. That dependency is important when interpreting the scores from the two evaluation splits.
From competition entries to dialect predictions
The steps in order.
Fine-tune encoders for the dialect decision
The authors’ main classifier uses the Romanian BERT encoder with a prediction component for the two dialect categories. Fine-tuning means adapting the pretrained system to this labeled task. The encoder begins with representations acquired during Romanian pretraining, and task training adjusts how it processes the input and turns those representations into dialect predictions. The standard Romanian BERT run gives the authors a reference point for changes involving adversarial training or a generator.
They also build classifiers from multilingual BERT and XLM-RoBERTa. Each provides a different pretrained text encoder for the same labels. The paper treats them as individual alternatives and as potential contributors to a combined decision. The value of an individual predictor and the value of its contribution to an ensemble are related questions. A weaker predictor may still be helpful if some of its correct decisions occur on inputs that the stronger predictors miss. The paper tests the combined outcome and leaves individual ensemble contributions unresolved.
The Transformer-based runs use Adam with weight decay, or AdamW. An optimizer uses gradients to decide how to adjust the parameters, and weight decay acts on the parameter magnitudes during training. The paper points to the earlier Adam work and gives an optimizer epsilon of 1e-8. Here epsilon is a small constant in the optimizer’s settings. The reported learning rate is 2e-5, which sets the scale of the optimizer’s steps. The paper specifies four epochs of fine-tuning for the Transformer-based systems. The optimizer’s epsilon and the perturbation magnitude in the adversarial equations play different roles, in spite of the common notation.
Use the gradient to make a real example harder
The perturbation-based approach starts with the adversarial examples method. The important choice here is where to make the change. The authors alter the embeddings, the numerical input representations consumed by the encoder. A reader would still see the same words. During training, the classifier sees a deliberately changed vector in addition to the regular representation. This creates a way to challenge the prediction without defining a list of word substitutions or spelling changes for Romanian and Moldavian texts.
The disturbance is calculated from the behavior of the classifier on the example it is currently processing. The authors take the gradient of the log probability of the known label with respect to the input. A gradient records the direction of change in that quantity near the current input. The paper writes it as follows.
g = ∇ₓ log p(y | x; θ̂)
Here g is the gradient vector, and ∇ₓ means differentiation with respect to the input representation x. The symbol y denotes the example’s known dialect label. The expression p(y | x; θ̂) is the probability of that label given x, evaluated using θ̂, a copy of the system’s parameters. The vertical bar marks conditioning on the input, and the separator before θ̂ marks the parameters used to evaluate the probability. The logarithm is written log. The hat identifies the parameter copy used to find the perturbation direction. With a given set of parameters, g points towards a local increase in the log probability of the correct label.
The training procedure uses the opposite direction to make the example harder. It scales the gradient to a size controlled by the perturbation setting.
rₐ𝒹ᵥ = −ε g / ‖g‖₂
The symbol rₐ𝒹ᵥ is the adversarial perturbation vector. The minus sign reverses the direction of g. The double bars with subscript 2, written ‖g‖₂, denote the Euclidean norm, or ordinary vector length, of g. Dividing g by that norm retains its direction and normalizes its length. The symbol ε sets the magnitude of the resulting perturbation. In terms of the classifier’s current local behavior, the reversed direction makes the correct dialect label less probable. The construction chooses a direction from the gradient at the current input, so the difficulty it creates depends on the current example and parameters.
The resulting perturbation is added to the embeddings. The loss on that perturbed input is the negative log probability of the known dialect label.
−log p(y | x + rₐ𝒹ᵥ; θ)
The expression x + rₐ𝒹ᵥ is the original input representation plus the computed perturbation. The label y is still the known label for that example. The symbol θ denotes the parameters used to evaluate the training loss, while θ̂ in the earlier expression denotes the copy used to construct the disturbance. The vertical bar again means that the probability is conditional on the input, now perturbed. The negative sign converts log probability into a loss that grows as the probability of the correct label falls. Minimizing it rewards the system for assigning high probability to the same label after the disturbance.
The paper describes the total loss as the sum of this adversarial loss and the ordinary loss on the unaltered input. The ordinary term keeps the system learning from the original training example. The adversarial term adds a penalty for being vulnerable to a small, specifically chosen move in embedding space. Thinking of the two terms together helps explain the aim. The classifier has to fit the sentence as represented normally and sustain the correct decision when that representation moves toward a region where its answer is less secure.
This is a way to promote local stability during training. The gradient tells the procedure how to move a numerical representation, and the known dialect label tells it which prediction to make harder. At prediction time the task is to classify the actual text. The perturbation is part of the training objective, and calculating it uses information that belongs to labeled training examples. The reported robustness evidence comes from classification scores under the competition’s evaluation conditions. The paper’s adversarial objective does not by itself establish which words or sentence patterns the classifier learns to rely on.
Train a discriminator with synthetic representations
The other adversarial variant adapts the setup of generative adversarial networks to Romanian BERT. A generator takes a 100-dimensional noise vector and produces another vector intended to resemble the representation of a genuine input. This generated output exists at the feature level. The paper describes the generator as producing vectors, so the artificial examples need not appear as readable Romanian or Moldavian sentences.
A discriminator learns to classify both real and generated inputs. Its outputs during training cover Romanian, Moldavian, and a third class for generated inputs. To do well, it must distinguish the two dialect labels on genuine examples and detect artificial examples arriving from the generator. A mistake about whether an input is genuine or generated incurs a penalty. The generator, in turn, is trained to produce output that resembles real inputs. This adds pressure to recognize features of genuine examples beyond what would be required by dialect labels alone.
The authors give the discriminator an advantage in training frequency. Every 200 steps, they let the generator backpropagate its loss. Back-propagation computes the gradients that guide parameter updates, so this schedule limits how frequently the generator changes in response to its loss. The paper motivates that choice by pointing out that the discriminator also has to serve as the dialect classifier. The schedule is part of the reported implementation of the GAN variant.
After training, the authors disable the generator and the discriminator’s output for generated inputs. The deployed classifier uses Romanian BERT features and predicts between the two dialect labels. Its training differs from the perturbation-based approach in what it asks the classifier to learn. The discriminator has an additional category during training, and the generated vector has a separate origin in noise. In the perturbation formulation, the changed vector is derived from a particular labeled example and the training loss still rewards predicting that example’s dialect.
Compress the Romanian encoder through imitation
The compression experiment uses knowledge distillation. In distillation, a larger teacher guides the training of a smaller student. The student is trained to reproduce aspects of the teacher’s behavior, using the trained teacher as a source of supervision. The paper uses TextBrewer for this transfer. Romanian BERT is the teacher and has 12 hidden layers. Each hidden layer transforms the current internal representation before passing it onward. The student also uses a Transformer architecture, has 3 hidden layers, and starts without corpus pretraining.
The authors’ motivation is to see whether the smaller architecture can preserve the accuracy that makes the teacher useful. With fewer layers, it requires less computation for additional fine-tuning or prediction, as the paper explains. The performance question is empirical because reproducing the teacher’s decisions requires enough capacity and appropriate training to use subtle distinctions between the dialects. The experiment jointly changes the depth and the pretraining history of the system used at prediction time. It is a comparison of practical configurations, with the teacher’s knowledge transferred through the toolkit to the smaller, initially unpretrained student.
The paper identifies the teacher, the student’s starting point, and the distillation software. Its account stops short of specifying the precise TextBrewer objective or which teacher signals and layers are matched. The evidence therefore concerns that reported distillation setup and its measured dialect performance. The authors’ basic question remains clear even without knowing those internal settings. They want to know how closely a much shallower student can approach the larger Romanian encoder on the short-input, cross-domain classification task.
Choose a cutoff and combine predictions
The confidence used to screen training sentences and the cutoff used to predict a dialect are separate decisions. The screening confidence determines which sentences enter the training pool. After fine-tuning on that pool, the authors try different prediction thresholds to find a setting that maximizes performance. They illustrate the rule with Moldavian as the class selected when its score crosses the threshold and Romanian as the class selected otherwise. The reported optimum for the prediction threshold is 0.21.
This step matters because a numerical class score and the final label answer different questions. The score represents the classifier’s view of an input. The threshold determines when that score is sufficient to choose a given label for evaluation. Moving the threshold changes which examples are assigned to each dialect. It can affect both how many relevant examples a class retrieves and how many of its assigned labels are wrong. The low reported threshold is a setting chosen for the authors’ prediction procedure. The paper presents it as an empirical optimum in their search and gives limited detail about whether the same rule and value were applied identically to every configuration.
Finally, the authors combine the predictions of the six neural systems into an ensemble. This draws together the standard Romanian encoder, its alternative training configurations, the multilingual encoders, and the student. The paper identifies the members and reports the combined score. The individual weighting or voting rule is unspecified. Thus, the supported description is that the ensemble makes use of the predictors together. Its result measures their joint output under the authors’ procedure, while preserving separate scores for members where the corresponding split was reported.
Experiments and results
What the competition supplies
The VarDial 2021 Romanian Dialect Identification data have a training split of 39,487 entries, a validation split of 5,237 entries, and a test split of 5,282 entries. Training is based on the expanded MOROCO news material. Many of those texts exceed 512 words according to the paper’s dataset description. The encoders’ input limit, given separately, is 512 tokens. The validation and test entries average 20 words. The training split consequently offers long documents to learn from, while the other splits ask the classifier to make many decisions from short texts. The sentence selection procedure directly addresses that mismatch in input length and also introduces an opportunity to favor the kinds of signals present in validation.
The training split includes 21,366 Romanian entries and 18,121 Moldavian entries. Validation has 2,625 Romanian entries and 2,612 Moldavian entries. These are counts of original entries, before the training texts are segmented and screened. The distributions are relatively balanced at that level, especially on validation. The paper gives the overall size of the test set and leaves the class breakdown unspecified in its dataset account. It also gives the aggregate size of the screened training pool, so the balance of the original training entries alone gives limited information about the balance after sentence selection.
The authors compare different kinds of reference systems. Standard Romanian BERT establishes how well the specialized encoder does under ordinary fine-tuning. The multilingual encoders test a different starting point for the same task. The GAN and perturbation variants change the learning procedure around the Romanian encoder, and TextBrewer tests a compressed student. A separate group of baselines uses character n-gram features with conventional classifiers. The paper reports scores on validation for every system it lists and test scores for a subset of the neural systems.
How the scores measure performance
The paper reports macro-F1, weighted F1, and micro-F1. For a given dialect, precision describes how often predictions of that dialect are correct. Recall describes how much of that dialect’s actual set of examples the predictions recover. F1 combines precision and recall through their harmonic mean, so high precision with poor recall, or high recall with poor precision, limits the score. This makes F1 useful for a dialect classifier because predicting a label liberally can recover more of its true examples while creating more false assignments.
Macro-F1 gives the dialects equal weight when it averages their F1 scores. Weighted F1 also averages class-level F1, with weights determined by the number of examples belonging to each class. Micro-F1 pools the decisions across classes before calculating the score. Each answers a slightly different question about the same predictions. Macro-F1 gives each label equal influence. Weighted F1 describes performance with the evaluation split’s class frequencies reflected in the average. Micro-F1 summarizes the pooled decisions. The headline metric in the paper is weighted F1, which the authors use when reporting the ensemble’s leaderboard result.
The closeness of macro-F1 and weighted F1 on validation is consistent with the similar numbers of examples of each dialect in that split. Aggregate agreement among metrics does not identify which examples were confused or how confidently the classifier made them. The distinction is also important when reading the paper’s review of previous VarDial evaluations. An earlier macro-F1 score measured on a different edition of the task is a different observation from the current weighted F1, even if the task titles sound similar.
Validation puts the Romanian variants in front
On the validation set, standard Romanian BERT reaches a weighted F1 of 0.8492. Perturbation-based adversarial training raises it to 0.8559. The adversarial variant has validation macro-F1 of 0.8558 and micro-F1 of 0.8564, compared with macro-F1 of 0.8492 and micro-F1 of 0.8495 for the standard version. The gains run in the same direction under each of the reported aggregations. This comparison is the main evidence that adding the adversarial loss helped the Romanian classifier under the conditions of the authors’ validation setup.
The Romanian BERT system with a generator and discriminator achieves validation weighted F1 of 0.8516. Its macro-F1 is 0.8516 and its micro-F1 is 0.8523. It sits between standard Romanian BERT and the perturbation-trained variant on the headline metric. The authors describe its gain over standard training as slight and emphasize that they get a stronger score from perturbing the embeddings. Both adversarial approaches improve the validation point estimate relative to the standard encoder, with different sizes of improvement and with different evidence available on test.
Neural systems on the VarDial Romanian Dialect Identification validation set
The ensemble leads, with adversarially trained Romanian BERT close behind.
The numbers
| System or setting | Weighted F1 |
|---|---|
| XLM-RoBERTa | 0.7619 |
| Romanian BERT + TextBrewer | 0.7891 |
| Multilingual BERT | 0.8097 |
| Romanian BERT | 0.8492 |
| Romanian BERT + GAN | 0.8516 |
| Romanian BERT + adversarial training | 0.8559 |
| Ensemble (this paper) | 0.8564 |
Multilingual BERT reaches validation weighted F1 of 0.8097, and XLM-RoBERTa reaches 0.7619. Both trail standard Romanian BERT on that split. Multilingual BERT also exceeds the TextBrewer student, which has validation weighted F1 of 0.7891. That detail matters when comparing categories. The authors describe the distilled system as the weakest member of the Romanian BERT group. The full validation ordering places the student between the multilingual systems in spite of its Romanian teacher. The results therefore support Romanian specialization as a strength of the full encoder in this setup, with a more mixed ordering once compression changes the comparison.
The ensemble obtains validation weighted F1 of 0.8564. It also has validation macro-F1 of 0.8564 and micro-F1 of 0.8566. The adversarial Romanian BERT variant is already very close on the validation scores. The ensemble’s advantage is visible on the primary metric, and the closeness of the scores limits what can be inferred from their ordering about the value of any single member. Validation establishes the combined result and gives a starting point for interpreting how the strongest individual system and the ensemble perform on the separate test set.
Character n-grams provide a conventional baseline
The conventional comparisons all use character n-gram features. These features keep track of short neighboring character sequences, so they can make spelling fragments available to the classifier without requiring the encoder used by the neural systems. The classifiers using those features are a support vector machine, logistic regression, multinomial naive Bayes, and a random forest. They offer different ways of mapping a common broad feature type to the dialect labels. The comparison is useful because earlier VarDial approaches had succeeded with n-gram representations, sometimes combining characters and words.
The strongest baseline is the support vector machine, or SVM, with the parameter C set to 3. The SVM uses a decision boundary, and C governs the penalty associated with errors in its training objective. Its validation weighted F1 is 0.6298, with validation macro-F1 of 0.6297 and micro-F1 of 0.6324. Logistic regression is close behind at validation weighted F1 of 0.6251. Multinomial naive Bayes scores 0.5728, and the random forest scores 0.5218 on the same split and metric.
Character n-gram classifiers on the VarDial Romanian Dialect Identification validation set
The support vector machine leads this group, followed closely by logistic regression.
The numbers
| System or setting | Weighted F1 |
|---|---|
| Random forest | 0.5218 |
| Multinomial naive Bayes | 0.5728 |
| Logistic regression | 0.6251 |
| SVM with C set to 3 (this paper) | 0.6298 |
All the neural systems in the paper’s validation comparison exceed the strongest character n-gram baseline on weighted F1. The observation concerns the implementations and features the authors tested. Earlier systems using a mixture of character and word features and combinations of SVMs supply context, but those earlier scores come from other editions and setups. The current comparison provides a direct ranking for one conventional feature group and one family of pretrained or distilled systems on the current validation set.
The ensemble takes second place on test
The ensemble records a weighted F1 of 0.7324 on the test set and places second on the competition leaderboard. Its macro-F1 and micro-F1 on that split are also 0.7324. The adversarial Romanian BERT variant is the strongest individual system with a reported test result, reaching weighted F1 of 0.7318. Its test macro-F1 and micro-F1 are both 0.7319. The ensemble’s lead is small on test as well as on validation. The comparison shows that the combined predictions produce the highest reported score for the authors, with the adversarial system accounting for a strong individual result in its own right.
Reported neural systems on the VarDial Romanian Dialect Identification test set
The ensemble edges ahead of adversarial Romanian BERT, and the distilled student trails both.
The numbers
| System or setting | Weighted F1 |
|---|---|
| Romanian BERT + TextBrewer | 0.6744 |
| Romanian BERT + adversarial training | 0.7318 |
| Ensemble (this paper) | 0.7324 |
The TextBrewer student records test weighted F1 of 0.6744. Its test macro-F1 is 0.6743, and its test micro-F1 is 0.6749. Together with the student’s validation result, these figures show that the smaller system could carry out the classification task but gave up performance relative to the stronger reported Romanian BERT configurations. The paper leaves the full standard teacher’s test score blank. The observed test comparison is thus with the reported adversarial Romanian BERT variant and the ensemble. On validation, a direct comparison with standard Romanian BERT is possible.
The test table also leaves the multilingual encoders and the GAN variant without scores. The conventional baseline table is validation-only. Consequently, the test ranking has a narrower set of entries than the validation ranking. The adversarial system and ensemble both perform more strongly on validation than on test, as does the student. On the headline metric the ensemble goes from 0.8564 on validation to 0.7324 on test. These are the two directly reported measurements. Their separation establishes a split-dependent performance gap. Identifying its causes requires looking at the selection procedure, the domains, and the kinds of errors the authors observed.
What the ablations show
Which changes the comparisons can isolate
The paper reports comparisons among system variants and an analysis of errors. It does not report a systematic ablation of the data pipeline or the ensemble. The distinction matters because several decisions are made before a prediction is scored. The authors change the training inputs through sentence splitting and confidence filtering, change the objective or architecture in some runs, choose a prediction threshold, and combine outputs in the ensemble. A comparison that changes one of these elements while holding the others fixed would measure the effect of that particular decision. The reported comparisons give the clearest evidence where the same underlying Romanian encoder appears with a specified change in training.
The closest example is standard Romanian BERT versus Romanian BERT with adversarial perturbations. Their validation weighted F1 scores are 0.8492 and 0.8559, respectively. Because both are based on the same pretrained Romanian encoder, this comparison directly bears on the added perturbation objective. The higher score is consistent with a classifier that handles some of the short validation entries better after training on difficult variations of their representations. The paper leaves open which individual errors were corrected by the change and whether the gain has the same size across repeated runs. The test table also lacks the standard Romanian BERT result, so the adversarial system’s test score establishes its absolute performance there without a matched estimate of the improvement over ordinary fine-tuning.
The GAN comparison makes a related point. The validation numbers favor the GAN version over the standard version by a small amount, and favor embedding perturbations over the GAN. In the GAN setup, learning to detect a generated vector adds a new discrimination problem. In embedding perturbation training, the altered example remains tied to its original label, and the system must improve that same decision. The validation ordering favors the second intervention as implemented in the paper. The experiment combines the generator, discriminator, third class, and update schedule into one configuration. Their individual effects, including the influence of updating the generator every 200 steps, remain unresolved.
The distillation result is informative in a different way. The comparison tells a reader how much classification performance the authors retained with a student of the reported size and training history. The validation measurements put that student behind every full Romanian BERT variant. On test it also trails both the adversarial Romanian BERT system and the ensemble. The authors suggest that the reduced number of parameters makes it harder for the student to grasp the features that distinguish the two labels. This is a plausible interpretation of the compression experiment. Since the student is both shallower and initially unpretrained, the comparison leaves open how much each property contributed to the result. It also leaves open how a differently trained student of the same depth would behave.
The multilingual comparison likewise addresses the complete systems. The authors observe that XLM-RoBERTa’s pretraining corpus is larger, while multilingual BERT delivers the higher validation score. They suggest that multilingual BERT may have been exposed to more Romanian entries during pretraining. The performance ordering supports the narrower observation that the larger overall corpus did not confer the better validation result in this comparison. The proposed account based on Romanian exposure remains a hypothesis. The paper does not vary Romanian corpus coverage while keeping the encoder and the rest of pretraining fixed.
What the selection and ensemble results leave open
The training procedure is central to the paper, and its effects are harder to isolate from the scores. The paper gives the number of source entries, the number of candidate sentences, and the number retained by confidence filtering. Those counts establish what happened to the training material. The results table gives no comparison between training on the full news entries, on all split sentences, and on the filtered sentences. It also gives no performance series across different filtering cutoffs. The paper therefore explains how the authors arrived at their training pool, while the relative contribution of sentence length, confidence screening, and pool size remains unmeasured.
The decision threshold is similar. The authors report an empirical optimum of 0.21, demonstrating that the threshold was treated as a choice in its own right. A range of scores around that optimum would help show how sensitive the system was to this choice. The reported material supplies the chosen value and the resulting system scores. It leaves open how similar the results would have been under nearby thresholds and how much variation in the cutoff different systems or splits could tolerate.
The ensemble improves on the strongest individual score among the reported systems on both validation and test. The gain is small, and the paper gives no results for an ensemble with members removed in turn. That means an individual score cannot be used to infer the contribution of that system to the combination. Multilingual BERT or XLM-RoBERTa could help on a subset of examples even with lower aggregate validation F1, and the student could contribute useful or redundant predictions. The comparison establishes the result of combining all the reported members. It leaves the source of the incremental gain open.
Where the classifier finds evidence
The error analysis asks what features are available in the actual entries. The authors observe that texts assigned to different dialects can share ordinary words and structures. Their validation examples include short entries related to coronavirus in which the subject matter and phrasing give little clear surface evidence of a dialect distinction. A classifier encountering that kind of entry must still choose a label. Even sound reasoning about the meaning of the text may leave the benchmark’s distinction uncertain because the characteristic form that would support a confident dialect assignment may be absent.
At the other end of the confidence range, the authors find examples with recognizable names that also occur in training. They mention Arafat, Ceban, and Igor as examples of visible names. A named entity is an expression that identifies a particular person, place, or other specific entity. Its occurrence may correlate with the dialect labels because of who or what is discussed in texts assigned to each class. That offers a plausible basis for a confident corpus prediction. A name is evidence about the context of an entry, so its value as a cue can change when the people discussed or the source domain changes.
The error analysis also points to dialect-associated vocabulary. The authors give raional as an example of a word that can assist classification. This kind of signal differs from a recurring personal name. A dialect-associated word can provide evidence directly in the text’s choice of vocabulary. The qualitative examples put both kinds of clues in view. They show occasions on which lexically informative content remains visible and occasions on which the classifier has to depend on associations that may be specific to the data.
Some examples include masked names, represented by the placeholder $NE$. The authors discuss instances in which several placeholders remove much of the content that might have revealed who or what the text is about. A short item with repeated placeholders can preserve its grammatical frame while losing words that would have distinguished it from other entries. This helps explain why masking is visible in the discussion of errors. The examples show a possible mechanism for uncertainty and mistakes. The paper does not quantify the effect through a comparison of performance on matched masked and unmasked texts.
The authors connect the error analysis to the validation–test gap. A selector trained on validation can favor sentences that resemble entries the validation classifier already finds easy to assign. Repeated names are one concrete example of a signal whose usefulness may depend on the sample. A short expression can likewise be common or informative in one split and less useful in another. The authors suggest that selecting inputs for compatibility with validation contributed to the difference between validation and test performance. The filtering rule and the observed gap support the relevance of that explanation, while the absence of a selection ablation leaves the size of its effect undetermined.
Limitations
Limits the authors identify
The authors explicitly draw attention to the gap between their strongest validation and test performance. Their explanation centers on the sentence selection method, which learns what to keep from a classifier trained on validation entries. Under that procedure, validation supplies the evidence about which short pieces of training text are easy to place by dialect. The authors acknowledge that the resulting pool is selected for resemblance to validation, while resemblance to test was presumed. This is a practical limit of the domain adaptation strategy. It can target the short examples for which labeled guidance is available and has only indirect grounds for expecting that the same examples will help in another domain.
They also identify a limit on the linguistic evidence in individual inputs. Some validation items have no apparent differences in everyday vocabulary or structure that would tell the dialects apart. Others have potentially informative words hidden by named-entity masking. A short entry gives the classifier little opportunity to recover from those missing cues. The examples indicate why a successful classifier on the benchmark can still have difficulty whenever the text consists of shared wording. They also show why high confidence on names or distinctive words can coexist with errors on superficially similar inputs.
The authors discuss limits of two of their experimental approaches. The generator and discriminator give only a small improvement over standard Romanian BERT on validation, and the authors judge the perturbation method more effective among the adversarial techniques they implement. The distilled student also gives up accuracy. They attribute this tentatively to its smaller parameter capacity, in particular its ability to capture distinctive features of the varieties. The paper reports classification performance as the test of that tradeoff. Its conclusion proposes testing further variants of adversarial training to seek stronger scores.
Limits visible in the evaluation design
The roles of the data splits affect the strength of the performance claims. The original validation entries are explicitly used to train the screening classifier. The threshold is chosen after the authors try different values following fine-tuning, and the paper does not identify an independent threshold-tuning split. Validation performance is therefore measured in a data setting that informed the design of the final training pool. Its scores are useful for comparing the reported configurations under that design. The test figures are the relevant evidence for carrying the selected approach to the competition’s separate domain.
At the same time, the test results cover only some of the comparisons. There is a test result for the adversarial Romanian BERT system, the student, and the ensemble. A matched test result for standard Romanian BERT would be needed to estimate the adversarial improvement over ordinary training on the separate domain. A test score for the GAN would allow a direct comparison of the two adversarial methods on that split. The available entries support the ensemble’s test ranking within the reported results and the leaderboard placement. The more comprehensive ordering of architectures belongs to validation.
The paper reports point estimates for the configurations. It gives no variation across training runs or uncertainty estimates around the smaller differences. This is especially relevant to the ensemble’s lead over the adversarial classifier and the GAN’s lead over standard Romanian BERT on validation. A point estimate establishes the ordering of the runs reported. The stability of that ordering across training runs or another collection of inputs is a separate empirical question.
The claim about robustness also has a specific scope. The perturbation is defined in embedding space, and the measured outcomes are classification scores on the competition data. The paper does not evaluate deliberate changes to the words of an entry, nor does it report a separate test of how predictions behave under controlled changes to names or dialect-associated terms. The classification gains are evidence about the reported training technique under the benchmark’s conditions. The behavior of a classifier when a particular written clue is added, removed, or replaced remains open.
Several details limit exact replication of the comparisons. The paper gives the formulas for the perturbation and specifies the optimizer, learning rate, and training length, while leaving the numerical perturbation size unspecified. The confidence procedure states how candidates are retained, with the agreement between predicted and inherited labels left unclear. The text identifies the ensemble members without spelling out the rule for combining their predictions. It also describes the student’s architecture and the distillation toolkit without giving the full matching configuration. These gaps concern the precise implementation of otherwise identifiable methods.
Finally, the compression result has two distinct outcomes of interest. The reduction from 12 hidden layers in the teacher to 3 in the student is explicit, and the student’s F1 scores measure its classification quality. The paper motivates the smaller architecture by the reduction in resources needed for fine-tuning or inference. It gives no measured latency, memory use, or throughput for that comparison. Accordingly, the size change and the loss of accuracy are directly documented, while the practical resource savings for a given use remain unquantified. The experiment is evidence about a particular student and teacher arrangement under the competition conditions.
What came after
LIMIT, published in 2023, cites this study and examines language identification, misidentification, and translation using a hierarchical approach across 350+ languages. Its scope puts the consequences of an identification decision alongside the identification task itself. Zaharia and colleagues had already motivated dialect identification partly through the example of choosing a translation system for a sentence. They tested the initial classification step for one pair of closely related varieties. LIMIT brings identification errors and translation into the same stated research scope, on a much broader set of languages.
The connection is at the level of the problem and its consequences. The citation links an experiment on Romanian and Moldavian under domain shift with later work concerned with language identification errors in a translation setting. It does not establish that LIMIT adopted the Romanian BERT perturbation objective, the confidence-screening procedure, or the distilled student. The shared question is how to understand the reliability of an upstream language label when the available text permits mistakes and that label can influence what happens next.
Cite
Cite as George-Eduard Zaharia, Andrei-Marius Avram, Dumitru-Clementin Cercel and Traian Rebedea. 2021. Dialect Identification through Adversarial Learning and Knowledge Distillation on Romanian BERT. Proceedings of the Eighth Workshop on NLP for Similar Languages, Varieties and Dialects.
@inproceedings{zaharia2021dialect,
title = {{Dialect Identification through Adversarial Learning and Knowledge Distillation on Romanian BERT}},
author = {George-Eduard Zaharia, Andrei-Marius Avram, Dumitru-Clementin Cercel and Traian Rebedea},
booktitle = {Proceedings of the Eighth Workshop on NLP for Similar Languages, Varieties and Dialects},
year = {2021},
url = {https://aclanthology.org/2021.vardial-1.13/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/zaharia-2021-dialect-identification-through-adversarial-learning/