BETO: the neural network that could be used during the next constitutional process

Jorge Pérez, researcher at the Millennium Institute for Foundational Research on Data (IMFD) and Computer Science professor at Universidad de Chile, has been working since 2019 on BETO: a neural network model that enables computational processing of natural language. Together with José Cañete (24) and Gabriel Chaperón (25) -both Computer Engineering students at U. de Chile-, they created this model based on BERT, a well-known neural network that only works with texts in English.

“BETO was born during the first semester of 2019 as a result of the emergence of BERT, which has excellent results in English, and due to the fact that natural language processing in languages other than English is very underdeveloped,” explains José Cañete.

Today it is pre-trained and freely published for anyone to use, adds researcher Jorge Pérez, who notes that this model is unique of its kind. “There are BERT-based models that have already been built for different languages, including German and French. But for Spanish, BETO is the first and to date, the only one,” says Jorge Pérez.


Currently, the team is in the evaluation stage of BETO, meaning they are analyzing how good it is at solving different tasks, compared to other existing models.

In this interview, José Cañete and Gabriel Chaperón explain what this neural network is about and the scope it could have, even during the upcoming constitutional process.

-BETO is a BERT model pre-trained with text in Spanish. How can we define a BERT model in simple terms?
-José Cañete (JC): A BERT model is a deep neural network model based on a new mechanism for neural networks, called “self-attention.” This enables the computational processing of natural language, but more generally, of sequences. For example, some people have used this type of architecture to model proteins and biological topics. Others, more inventive, have also used it for computational image processing, and even for general algorithms on sequences.

-How does BETO differ from its “first cousin” BERT?
-JC: The main difference is that BETO was trained entirely with text in Spanish. For example, it takes into account our accentuation and can process the letter “ñ.”
-Gabriel Chaperón (GC): They are like twin brothers, exactly alike, but separated at birth. One grew up in the United States and the other in Chile (laughs).

-What distinguishes BETO from other deep neural network models?
-JC: Some distinctive features of this type of neural network are that they have a huge number of “parameters.” Parameters are like small knobs that can be adjusted to modify how a model works. In BETO’s case, it has 110 million parameters, which makes it a very large model. The other difference is that these parameters are “pre-trained,” which would be the process of deciding what position to leave each of the 110 million knobs in. Pre-training is initially done on a very general task, such as a “complete the sentence” task. Then fine-tuning is carried out, meaning an attempt is made to adapt the model’s parameters (the knobs) to multiple other tasks, such as sentiment analysis, intent classification, hate speech recognition, etc. Adapting the model is much easier and cheaper than training it from scratch. BETO is a pre-trained model; anyone can take it and adapt it to the task they are interested in.
-GC: The main difference from previous models is that BETO is capable of learning from large amounts of unprocessed text -all of Wikipedia, for example. This process is called pre-training, since the model learns a great deal from the text it has given, but nothing specific. Then comes what José (JC) just mentioned.

-Are there difficulties in training networks in Spanish like BETO?
-GC: The problem is that there is not enough volume of quality data to train them with. That is not the case in English, which is the language that private companies are most interested in, so there is high availability of data for training.

-What need or question are you trying to answer? In other words, why is this development important?
-GC: The interest in developing a Spanish-language model is multifaceted. First, it arises from the question of whether a monolingual model -trained in a single language- improves its performance, or whether a model trained with many languages, like BERT, trained in 104 languages, is preferable. We also want to explore the relationship between the amount of pre-training data, costs, and training time, with final performance.
-JC: It is important because it improves quality and makes it easier to do applied research in natural language processing in Spanish, as well as to build tools or applications.

José Cañete.

-What applications could BETO have in the future?
-JC: It can be used for multiple tasks; the limit is imagination and datasets, that is, the amount of labeled data that is specific and in Spanish.

-Could it be useful for an analysis of the upcoming constitutional process, for example?
-JC: Yes, just as has been done in the past, but possibly with better results. Other interesting tasks are sentiment analysis and so-called QA -Question Answering- meaning, given a text and a question about the text, answering that question. It is like reading comprehension. It can also be used to classify texts on social media as “aggressive” or “safe.” And to identify bots on social networks like Twitter, based on the texts posted there, among others.
-GC: Considering the way BETO is used -first a pre-training process and then specialized training on some specific task-, its applications are many. BETO could replace many of the pre-existing natural language processing models, since it achieves the best results currently available in multiple different tasks, such as document/tweet classification, information extraction, automated summarization, and multiple-choice question answering, among others.

-Have you been contacted by any company or institution as a result of BETO’s development?
-JC: The project has been supported from the beginning by IMFD and by Adereso, a technology company that automates customer service with software, AI, and chatbots, and where I currently work. Both provided the necessary resources to train the models. We were also supported by Google, following our participation in the Khipu event, in Uruguay. Google gave us access to more machines, which allowed us to speed up training.

To learn more about BETO, go here: https://github.com/dccuchile/beto