Evaluation Benchmarks for Spanish Sentence Representations

Vladimir Araujo, Andrés Carvallo, Souvik Kundu, José Cañete, Marcelo Mendoza, Robert E. Mercer, Felipe Bravo-Marquez, Marie-Francine Moens, Alvaro Soto

Abstract

Due to the success of pre-trained language models, versions for languages other than English have been released in recent years. This fact implies the need for resources to evaluate these models. In the case of Spanish, there are few ways to systematically assess the models' quality. In this paper, we narrow the gap by building two evaluation benchmarks. Inspired by previous work, we introduce Spanish SentEval and Spanish DiscoEval, aiming to assess the capabilities of stand-alone and discourse-aware sentence representations, respectively. Our benchmarks include considerable pre-existing and newly constructed datasets that address different tasks from various domains. In addition, we evaluate and analyze the most recent pre-trained Spanish language models to exhibit their capabilities and limitations. As an example, we discover that for the case of discourse evaluation tasks, mBERT, a language model trained on multiple languages, usually provides a richer latent representation than models trained only with documents in Spanish. We hope our contribution will motivate a fairer, more comparable, and less cumbersome way to evaluate future Spanish language models.

Introduction

The "Golden Age" of Natural Language Processing (NLP) has produced a flurry of pre-trained language models, yet the evaluation landscape remains heavily skewed toward English. While several high-quality Spanish models—such as BETO, BERTIN, and RoBERTa-BNE—have emerged, researchers have lacked a standardized, systematic framework to measure the quality of the sentence representations they produce.

Existing evaluations for Spanish were often limited to word-level tasks or cross-lingual settings that failed to capture the nuances of the language. Specifically, there was a major gap in evaluating discourse awareness: the ability of a model to understand how sentences relate to one another within a paragraph or document. Without these benchmarks, it is difficult to determine if a model truly understands Spanish context or is simply performing pattern matching within isolated strings of text.

Methodology: Probing Sentence Representations

To address this gap, we adapted the established SentEval and DiscoEval frameworks for the Spanish language. Our methodology relies on probing tasks. Instead of fine-tuning the entire language model for a specific goal, we use the model as a frozen "feature extractor."

We extract the sentence embeddings (mathematical representations) generated by the model and feed them into a simple, shallow classifier—typically a linear or logistic regression. This approach ensures that the resulting performance score reflects the quality of the model's internal representations rather than the power of a complex downstream architecture. This allows for a "fair" comparison of what the models actually "know" about the language structure.

The Benchmarks

We curated a massive collection of datasets, combining pre-existing resources with newly constructed or translated corpora across two primary benchmarks:

1. Spanish SentEval

This benchmark focuses on stand-alone sentence capabilities, including:

  • Sentence Classification (SC): Sentiment analysis (MuchoChine, TASS 2020), subjectivity detection (FilmAffinity), and question-type classification (SQC).
  • Natural Language Inference (NLI): Incorporating NLI-es and SICK-es to test logical relationships.
  • Semantic Textual Similarity (STS): Evaluating how well models capture meaning across datasets from 2014–2017.

2. Spanish DiscoEval

This more novel contribution features five task sets designed to test discourse-level understanding:

  • Sentence Position (SP): Predicting where a shuffled sentence belongs in a paragraph.
  • Binary Sentence Ordering (BSO): Determining if two sentences are in the correct order.
  • Discourse Coherence (DC): Identifying if a sentence has been replaced by a random one from another context.
  • Sentence Section Prediction (SSP): Identifying if a sentence comes from a news subhead or the main body.
  • Discourse Relations (DR): Classifying the rhetorical relationship between sentence units using the RST Spanish Treebank.

Key Insights and Results

We benchmarked seven major models: Sent2Vec, ELMo, ELECTRA, RoBERTa-BNE, BERTIN, BETO, and mBERT. Our analysis revealed several critical findings:

The Multilingual Advantage in Discourse

One of the most striking findings is that mBERT (Multilingual BERT) consistently outperformed Spanish-only models on discourse tasks. mBERT led in four out of five DiscoEval categories, notably in Sentence Position (43.21% accuracy) and Discourse Coherence (63.45%). This suggests that training on multiple languages may allow a model to capture "universal" discourse patterns—such as narrative ordering—more effectively than models trained on a single language.

BETO and Sentence Classification

For standard, stand-alone sentence tasks, BETO (a Spanish-specific BERT) remains the top performer, achieving 76.34% accuracy in sentence classification. Its exposure to a high volume of general-domain Spanish text gives it an edge in capturing localized semantic nuances.

The Complexity Paradox in Similarity

Interestingly, Sent2Vec—a much simpler model than the Transformer-based giants—dominated the Semantic Similarity tasks with a Pearson correlation of 76.05. This suggests that complex contextual models might "overthink" simple word-overlap and similarity problems where simpler vector representations suffice.

Discourse as the "Final Boss"

While models perform well on simple classification, they struggle significantly with discourse. The best model only achieved ~43% accuracy on Sentence Position, indicating that current Spanish models are still relatively "blind" to long-range context.

Conclusion and Future Work

While these benchmarks represent a significant step forward, they are not exhaustive. Current tasks focus on sentences and small groups of sentences, leaving a gap in full document-level understanding. Furthermore, future iterations could include "stress tests" for specific Spanish linguistic phenomena, such as complex verb conjugations or regional dialects.

Our results suggest that future Spanish-specific models should incorporate discourse-level objectives during pre-training to close the gap with multilingual models. By making our code and datasets public, we aim to encourage a more comparable and less cumbersome way to evaluate the next generation of Spanish language technology.

Summary updated

BibTeX
@inproceedings{araujo2022evaluation,
  author = {Vladimir Araujo and Andrés Carvallo and Souvik Kundu and José Cañete and Marcelo Mendoza and Robert E. Mercer and Felipe Bravo-Marquez and Marie-Francine Moens and Alvaro Soto},
  title = {{Evaluation Benchmarks for Spanish Sentence Representations}},
  booktitle = {LREC},
  year = {2022},
  url = {https://openreview.net/forum?id=AimPxxCM8g},
}
Figure