ALBETO and DistilBETO: Lightweight Spanish Language Models

José Cañete, Sebastian Donoso, Felipe Bravo-Marquez, Andrés Carvallo, Vladimir Araujo

Abstract

In recent years, there have been considerable advances in pre-trained language models, with non-English versions becoming increasingly available. Due to their growing adoption, many lightweight versions of these models (with reduced parameters) have been released to accelerate training and inference. However, such efficient architectures (e.g., ALBERT, DistilBERT) remain scarce for languages other than English. This paper presents ALBETO and DistilBETO, versions of ALBERT and DistilBERT pre-trained exclusively on Spanish corpora. We trained several ALBETO variants ranging from 5M to 223M parameters and a DistilBETO model with 67M parameters. Evaluated on the GLUES benchmark, our models achieve competitive results compared to the standard BETO (Spanish-BERT) despite having fewer parameters. Notably, our larger ALBETO model outperforms all others on MLDoc, PAWS-X, XNLI, MLQA, SQAC, and XQuAD datasets, though BETO remains superior for POS and NER tasks.

Introduction

While massive Transformer models like BERT and GPT-3 have revolutionized NLP, their sheer size—often hundreds of millions or billions of parameters—presents significant deployment challenges. These models are frequently too computationally expensive for mobile devices, latency-sensitive web services, or hardware-restricted environments.

To address this, the research community developed "lightweight" architectures like ALBERT and DistilBERT. However, these were primarily optimized for English. For Spanish NLP, the standard benchmark has been BETO (a Spanish BERT-base). Until now, there was a significant gap: a lack of efficient, smaller, or faster Spanish-specific models that maintain high accuracy. This work introduces ALBETO and DistilBETO to fill that void.

Methodology

We developed two distinct types of lightweight models using a massive 3-billion-word Spanish corpus, including Wikipedia and the OPUS project:

  1. ALBETO (A Lite version of BETO): Based on the ALBERT architecture, these models utilize factorized embedding parameterization and cross-layer parameter sharing. By recycling weights across layers, the model drastically reduces total parameter count without sacrificing depth. We trained five configurations: tiny, base, large, xlarge, and xxlarge.
  2. DistilBETO: This model employs knowledge distillation, where a smaller "student" model is trained to mimic the output distributions of a larger "teacher" model (BETO).
Table 1: The configurations of each ALBETO model trained on this work.

Experimental Setup

The models were evaluated using the GLUES benchmark, a Spanish adaptation of GLUE, covering a diverse range of natural language understanding (NLU) tasks:

  • Document Classification: MLDoc.
  • Sequence Labeling: Part of Speech (POS) tagging and Named Entity Recognition (NER).
  • Sentence Relationships: PAWS-X (Paraphrase Identification) and XNLI (Natural Language Inference).
  • Question Answering (QA): MLQA, SQAC, XQuAD, and TAR.

Results and Discussion

The results demonstrate a highly favorable trade-off between model size and performance.

Efficiency vs. Performance

The ALBETO tiny model emerged as a powerhouse of efficiency. With only 5 million parameters—22 times smaller than BETO—it retains 87% of the original model's performance. This makes it an ideal candidate for edge computing and mobile applications. Conversely, the ALBETO xxlarge model, while using parameter sharing to remain efficient, utilizes a very wide internal state that allowed it to actually outperform the standard BETO on complex NLU tasks like document classification and inference.

Table 6: Comparison of different models in terms of task performance and size.

Task-Specific Performance

  • NLU Dominance: ALBETO xxlarge achieved the best results on MLDoc (96.85%), PAWS-X (89.85%), and XNLI (82.42%). In Question Answering, it outperformed BETO cased by 2.5 points in F1 score on the MLQA dataset.
  • The Casing Factor: For structural linguistic tasks like POS tagging and NER, the standard BETO cased model remains the state-of-the-art. This suggests that explicit casing information is a vital signal for identifying entities that lightweight architectures currently struggle to replicate perfectly.
  • The Sweet Spot: ALBETO base provides an optimal balance for many users, reaching 97% of BETO's performance while being 9 times smaller.

Conclusion

ALBETO and DistilBETO provide the Spanish-speaking NLP community with a suite of high-performance, efficient models. While there is a slight performance dip in sequence labeling tasks when moving to lighter architectures, the gains in inference speed and deployment flexibility are substantial. Future work will focus on refining DistilBETO and exploring the performance of these models in few-shot learning scenarios.

Summary updated

BibTeX
@inproceedings{canete2022albeto,
  author = {José Cañete and Sebastian Donoso and Felipe Bravo-Marquez and Andrés Carvallo and Vladimir Araujo},
  title = {{ALBETO and DistilBETO: Lightweight Spanish Language Models}},
  booktitle = {LREC},
  year = {2022},
  url = {https://openreview.net/forum?id=e8x2k42xmM},
}
Figure