Intrinsic evaluation of language models for code-switching

Sik Feng Cheong, Hai Leong Chieu, Jing LimW-NUT 2021 · DOI

TL;DR

This paper tackles the challenge of reliably evaluating language models (LMs) for code-switching (CS) by questioning the assumption that phonetically similar alternatives to ground truth sentences are always incorrect. They propose a refined evaluation method that requires at least two edits to generate alternatives and demonstrate that multi-lingual BERT (mBERT) significantly outperforms previous BiLSTM-based approaches on CS datasets.

What Problem Does This Paper Address?

Evaluating language models (LMs) is crucial for applications like automatic speech recognition (ASR), especially for code-switching (CS) where speakers mix languages within an utterance. Traditional intrinsic evaluation using perplexity often doesn't correlate well with ASR performance. Extrinsic evaluation, while more aligned with ASR, can be overly specific to the particular ASR system used.

A recent proposed evaluation method by Gonen and Goldberg (2019) uses a discriminative task: LMs are trained to distinguish the correct ground truth sentence from phonetically similar, synthetically generated "negative" examples. However, this method relies on the assumption that these generated alternatives are always linguistically incorrect. This paper challenges this assumption, arguing that sentences differing by just one edit from the ground truth can often be linguistically correct, thus introducing noise into the training and evaluation process. This makes it harder to reliably assess LM performance.

Methods

The authors propose two main contributions:

  1. Challenging the "one-edit" assumption: They empirically show that sentences differing by only one phonetic edit from a ground truth sentence can indeed be linguistically correct. This is illustrated with examples where pronoun substitutions or minor word changes maintain grammaticality.
  2. Refined generation of negative examples: To address the issue of linguistically correct negative examples, they propose generating alternative sentences that differ from the ground truth by at least two edits. This increases the likelihood that the generated sentences are indeed incorrect, making them more suitable as negative examples for training and evaluation.
  3. Discriminative fine-tuning with mBERT: They adapt the discriminative evaluation framework by replacing the BiLSTM model used by Gonen and Goldberg (2019) with a pre-trained multi-lingual BERT (mBERT) model. This leverages the powerful contextual embeddings of mBERT for the classification task. They experiment with different linear layers and normalization techniques on top of the mBERT embeddings.

Datasets

The paper uses two code-switching datasets for evaluation:

  • EN-ES data: This dataset was used in Gonen and Goldberg (2019) and is derived from the Bangor Miami Corpus.
  • EN-ZH SEAME corpus: This corpus was collected from residents of Singapore and Malaysia who are bilingual in English and Mandarin Chinese (Lyu et al., 2010).

The authors generated alternative sentences for these datasets using finite-state transducers (FSTs), ensuring at least two differences from the ground truth for their proposed method. They split the data into training, validation, and test sets, with 1,000 alternative sets each for validation and testing.

Key Insights and Ideas

  • The "one-edit" rule is too strict: The assumption that a single phonetic change always results in an incorrect sentence is flawed. This has significant implications for how negative examples are generated and used in training and evaluation.
  • More edits = better negative examples: Requiring at least two edits to generate alternatives significantly increases the probability of creating linguistically incorrect sentences, leading to a more robust evaluation.
  • mBERT excels at CS tasks: Multi-lingual BERT, pre-trained on a vast array of languages, demonstrates superior performance compared to previous BiLSTM-based models on code-switching evaluation tasks, even when fine-tuned.
  • Monolingual BERT vs. mBERT: While monolingual BERT models can outperform mBERT on purely monolingual test sets, mBERT's robustness across languages makes it a strong candidate for user-generated content, which often contains code-switching.

Key Results

  • The proposed method of generating alternative sentences with at least two edits improved the evaluation process.
  • mBERT consistently outperformed BiLSTM across both EN-ES and EN-ZH datasets in the discriminative evaluation task. For instance, in Table 1 (EN-ZH data), the best mBERT variant achieved a validation accuracy of 98.80% compared to the BiLSTM's 94.50%. Table 2 (EN-ES data) also shows similar trends, with mBERT variants achieving validation accuracies around 96%, while BiLSTM was around 95%.
  • Different configurations of linear layers and normalization on top of mBERT embeddings showed similar performance, suggesting the core mBERT representation is highly effective.

Limitations and Future Work

  • Dataset size: The authors note that while they used a significant number of alternative sets, the performance of a 3-layer BiLSTM did not improve, possibly due to insufficient training data. This suggests that larger datasets or more advanced training techniques might be needed for deeper models.
  • FST limitations: The FST approach for generating alternatives has limitations; if fewer than 5 alternatives can be generated for a given sentence type, that set is discarded. This could lead to a bias in the evaluation data.
  • Future work could explore:
    • Investigating more sophisticated methods for generating negative examples.
  • Exploring other pre-trained language models beyond mBERT for code-switching tasks.
  • Further analysis of why certain language rankings emerge in the scoring of alternative sentences.

Summary updated

BibTeX
@inproceedings{cheong2021intrinsic,
  author = {Sik Feng Cheong and Hai Leong Chieu and Jing Lim},
  title = {{Intrinsic evaluation of language models for code-switching}},
  booktitle = {W-NUT},
  year = {2021},
  doi = {10.18653/v1/2021.wnut-1.10},
}
Figure