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 of 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 rapid development of pre-trained language models (PLMs) like BERT has revolutionized Natural Language Processing. While Spanish-specific models such as BETO, BERTIN, and RoBERTa-BNE have emerged, a standardized framework for evaluating their general-purpose sentence representations has been missing. Researchers often rely on ad-hoc fine-tuning or translated English benchmarks, which may not capture the nuances of the Spanish language or the models' inherent representational quality.

To address this, we introduce Spanish SentEval and Spanish DiscoEval. These benchmarks utilize a "probing" methodology: instead of fine-tuning models, we extract frozen sentence embeddings and use them as input for simple, shallow classifiers. This approach directly evaluates the linguistic information encoded within the model's latent space.

Benchmarking Frameworks

Spanish SentEval

SentEval focuses on the properties of individual sentences. It comprises:

  • Sentence Classification: Sentiment analysis (movie reviews) and emotion detection.
  • Sentence Pair Classification: Tasks like entailment and paraphrasing (SICK-es, PAWS-es).
  • Semantic Similarity: Semantic Textual Similarity (STS) tasks.
  • Linguistic Probing (X-Probe): Nine tasks targeting specific linguistic features, such as subject number or syntax tree depth.

Spanish DiscoEval

DiscoEval evaluates a model's ability to understand the relationships between sentences within a discourse. It includes five tasks:

  • Sentence Position (SP): Finding the original position of a shuffled sentence.
  • Binary Sentence Ordering (BSO): Determining the correct order of two sentences.
  • Discourse Coherence (DC): Detecting if a sentence is out of place.
  • Sentence Section Prediction (SSP): Identifying if a sentence comes from a news subhead or the main body.
  • Discourse Relations (DR): Predicting rhetorical relationships (e.g., "Elaboration" or "Contrast") between units of text.
Example of a Discourse Relation (DR) structure showing an 'Elaboration' relationship.

The authors sourced data from Wikipedia, news (MLSUM), and a novel collection of Chilean university thesis abstracts to build these comprehensive suites.

Results and Analysis

Our evaluation of models like BETO, BERTIN, RoBERTa-BNE, and mBERT revealed several key insights into the current state of Spanish NLP.

The Multilingual Advantage in Discourse

A significant finding is the superior performance of mBERT on discourse-aware tasks. Despite being trained on 104 languages, mBERT consistently outperformed monolingual Spanish models in tasks like Sentence Position and Discourse Coherence. This suggests that multilingual training may foster a more robust understanding of structural and cross-sentential relationships.

Complexity of Discourse vs. Sentence Tasks

While models achieve high accuracy (~76%) in sentence classification, discourse tasks remain a significant challenge. For instance, accuracy on the Sentence Position (SP) task peaked at only ~43%, indicating that current architectures are still largely "discourse-blind."

Layer-wise Representation Quality

The quality of representations varies across model layers. For simple tasks like Section Prediction (SSP), early layers are often sufficient. However, for more complex semantic and discourse tasks, the most informative representations typically emerge in the final layers (10-12).

Layer-wise performance across SentEval and DiscoEval tasks for various Spanish and multilingual models.

Performance Summary

  • Sentence Classification: BETO took the lead with an average accuracy of 76.34%, proving its strength in standard sentiment and emotion tasks.
  • Discourse Tasks: mBERT dominated the DiscoEval suite, achieving the highest scores in Sentence Position (43.21%), Discourse Coherence (63.45%), and Discourse Relations (51.08%).
  • Semantic Similarity: Sent2Vec, a non-Transformer model, outperformed larger models in semantic similarity (STS) with a Pearson correlation of 76.05.

Conclusion

Spanish SentEval and DiscoEval provide a much-needed standardized evaluation for Spanish language models. Our analysis highlights that while monolingual models are proficient at sentence-level tasks, multilingual models currently hold an edge in discourse understanding. Future research should focus on developing architectures and training objectives that better capture long-range dependencies and rhetorical structures in Spanish.

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