Abstract
While Spanish is the world's second-most spoken native language, its Natural Language Processing (NLP) ecosystem has historically lacked specialized sequence-to-sequence (seq2seq) models. This paper introduces BARTO and T5S, the first seq2seq transformer models pre-trained exclusively on Spanish text. By leveraging a massive 120GB corpus and document-level formatting, these models bridge the "generative gap," outperforming existing multilingual giants and "stitched-together" encoder-decoder models on tasks ranging from abstractive summarization to machine translation.
Introduction
The rapid advancement of NLP has been driven by pre-trained language models like BERT and GPT. However, these architectures are often specialized: encoder-only models excel at understanding (classification, NER), while decoder-only models are optimized for text continuation. Sequence-to-sequence tasks—where an input string is transformed into a different output string—require a balanced architecture.
Until now, Spanish developers primarily relied on massive multilingual models like mT5 or mBART. While capable, these models often lack the linguistic nuance and computational efficiency of a monolingual native. This research introduces native Spanish versions of the BART and T5 architectures to provide a high-performance toolkit for generative Spanish NLP.
Methodology
The researchers developed two primary architectures and compared them against several baselines:
- BARTO: Based on the BART-base architecture, this model utilizes a "denoising" objective. It learns to reconstruct original text from versions corrupted by token masking or sentence shuffling.
- T5S: Based on the T5.1.1-base architecture, T5S focuses on "span-filling," where the model predicts missing chunks of text within a sequence.
- Baselines (BERT2BERT & BERTShare): These models were "warm-started" by using existing Spanish BERT (BETO) and RoBERTa (MarIA) checkpoints for both the encoder and decoder components.
A critical technical innovation was the use of Document-level Formatting during pre-training. Rather than packing random sentences together, the authors ensured sequences originated from single, coherent documents. This allows the models to capture broader contextual dependencies, which is vital for long-form tasks.
Datasets and Evaluation
The models were pre-trained on a cleaned corpus of over 120GB of Spanish text sourced from OSCAR 21.09, mC4-es, and the Spanish Unannotated Corpora (SUC).
Evaluation spanned a diverse battery of benchmarks:
- Summarization: MLSUM, WikiLingua, and long-form datasets like XL-Sum and EUR-Lex-Sum.
- Generative QA: Adapted versions of MLQA and SQAC.
- Dialogue: The Spanish partition of the MIAM dataset.
- Translation: Fapesp-v2 (Portuguese ↔ Spanish) and WMT13 (English ↔ Spanish).
Key Results and Discussion
The Power of Monolingual Pre-training
BARTO and T5S consistently outperformed much larger multilingual models like mBART-large and mT5 on most Spanish-specific tasks. This reinforces the value of language-specific pre-training even as the industry trends toward universal models.
Summarization and Long-form Context
T5S emerged as the leader for standard summarization and "split-and-rephrase" tasks, likely because its span-filling objective prepares it to generate sequences that mirror the input's word order. However, BARTO showed exceptional strength in handling very long sequences, such as legal documents in the EUR-Lex-Sum dataset.
On the EUR-Lex-Sum dataset, BARTO achieved a ROUGE-1 score of 66.49, a massive improvement over the BERT2BERT baseline (~42.76). The authors attribute this to BARTO's sentence permutation pre-training, which forces the model to grasp global document structure.
Versatility in Translation
Despite being trained exclusively on Spanish text, both models proved highly effective at translation. For English-to-Spanish (WMT13), T5S achieved a BLEU score of 31.99, surpassing the 29.33 achieved by the much larger mBART-large.
Conclusion and Future Work
BARTO and T5S represent a significant step forward for Spanish NLP, providing a specialized foundation for generative tasks. While encoder-only models like BETO still lead in pure classification, these new seq2seq models are highly competitive across the board.
Future research will look toward scaling these models from "base" to "large" or "XL" sizes and addressing the challenge of "hallucinations" in generative QA. The authors have made all models and code publicly available to encourage community-driven innovation in Spanish language technology.
Summary updated