---
title: "GlórIA — paper by Lopes et al. (2024) — summary and ideas"
description: "GlórIA introduces a Portuguese text generator trained for the European variety and tests it on word completion and sentence-pair tasks."
canonical: "https://research.elamur.ai/free/en/papers/lopes-2024-gloria-generative-open-large-language/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/lopes-2024-gloria-generative-open-large-language/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2024](https://md.research.elamur.ai/free/en/papers/2024/) / GlórIA: A Generative and Open Large Language Model for Portuguese

# GlórIA: A Generative and Open Large Language Model for Portuguese

Paper · 2024 · Ricardo Lopes, Joao Magalhaes and David Semedo

**Authors:** Ricardo Lopes, [Joao Magalhaes](https://md.research.elamur.ai/free/en/authors/joao-magalhaes/) and [David Semedo](https://md.research.elamur.ai/free/en/authors/david-semedo/) · **Year:** 2024 · **Venue:** Proceedings of the 16th International Conference on Computational Processing of Portuguese - Vol. 1 · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 16th International Conference on Computational Processing of Portuguese - Vol. 1 · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2024.propor-1.45/)
- [PDF](https://aclanthology.org/2024.propor-1.45.pdf)

## Summary

A passage can make its ending predictable even when its final word is missing. A story about a pursuit can name the animal early on, then leave the reader to supply its name when the chase ends. GlórIA asks how well a computer can make that kind of prediction in European Portuguese. The authors built a generator for the variety, assembled the material to train it, and created a benchmark called CALAME-PT. Portuguese already had systems for tasks such as classifying sentences. Here the primary task is to produce the continuation itself. [Language modeling](https://md.research.elamur.ai/free/en/topics/language-models/) · [Text generation](https://md.research.elamur.ai/free/en/topics/text-generation/)

GlórIA learns to predict successive pieces of text using GPT-Neo decoders with 1.3B and 2.7B parameters. Its processed training collection contains 35.3M documents and 35.5B tokens, the units into which the system divides text. Web crawls supply most of the material. Archived periodicals, Portuguese Wikipedia, movie subtitles and European Parliament proceedings extend the range of writing and dialogue the decoder encounters. The authors made the training resources, source code and pretrained checkpoints available.

CALAME-PT contains 2076 passages with designated endings. Annotators wrote some passages from scratch. For the others, GPT-3.5 drafted short passages inspired by documents reserved from GlórIA’s training collection, and people reviewed and edited the drafts. The evaluation is zero-shot. Each system gets the passage up to the missing word and uses its existing ability to continue text, without task-specific training or worked examples. On the combined set, the 1.3B GlórIA checkpoint saved at 3M steps obtains 36.61% exact match when it takes the highest-scoring token at every step and 52.79% with the paper’s procedure combining beam search and sampling. It leads Gervásio-PTPT and multilingual mGPT under both procedures. Across the main comparison, the passages written from scratch yield lower scores than the generated and reviewed passages. [Evaluation benchmarks](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/)

The authors also attach task-specific output layers and train the decoder to judge sentence pairs. On the Brazilian Portuguese benchmark ASSIN-2, BERTimbau-Large leads slightly on entailment, while GlórIA’s similarity scores have the higher correlation with human judgments. On the European Portuguese translation of GLUE, GlórIA leads Gervásio-PTPT on every reported measure, and the encoders score higher than either decoder. Longer continuations illustrate how GlórIA develops a topic in European Portuguese. The experiments with the clearest quantitative comparisons test a more specific skill, supplying an expected word from a passage under a defined decoding and scoring procedure.

## Deep dive: GlórIA: A Generative and Open Large Language Model for Portuguese

GlórIA brings open text generation to European Portuguese and tests how well its decoders can infer a missing final word from context. · about 34 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Why the variety matters

A research group that wants to train a generator for European Portuguese needs both enough writing to learn from and a way to tell whether the resulting system can use the variety. The authors describe both resources as scarce. Narrowing the target from Portuguese in general to European Portuguese further restricts the collections and task benchmarks available. It also raises a question about the training process itself. A recipe developed on substantial collections in English or other well-resourced languages has to be put into practice with the particular sources that can be assembled for Portuguese.

The choice of language variety affects more than the label on a corpus. If training sources mix varieties, a system may learn several ways to express an idea. That can be desirable for some purposes, while the project here asks for a generator that can produce European Portuguese across different topics. A corpus assembled around that aim still has to include varied uses of the language. News, encyclopedia articles, forum posts and dialogue serve different purposes. The authors wanted a system with exposure to those differences within a single pretraining run.

The paper also treats data availability and evaluation availability as separate problems. A research group may find enough text to run a training job without finding a Portuguese benchmark for the behavior it wants to measure. Conversely, a benchmark can specify a task without supplying the broad training experience that makes the task possible. In GlórIA, the raw material for learning comes from documents collected at scale. The test material is made for an evaluator who must know which word the system was expected to produce.

#### What a decoder adds

An encoder can read a sentence pair and produce a representation from which a classifier decides whether the pair has a particular relationship. A causal decoder can take a passage up to a particular point, predict a continuation, and use that continuation as part of its input for the next prediction. These uses place different demands on the architecture. Bidirectional encoders can use information on either side of an input position when creating a representation. In a causal decoder, a prediction at a given point is based on the text available up to that point. The paper adopts the decoder because its primary question concerns what a system can write from an unfinished input. [Transformer and attention](https://md.research.elamur.ai/free/en/concepts/transformer/) · [Text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/)

Earlier GPT-style research showed how such a system could be prompted for work beyond ordinary continuation, including reading comprehension and question answering. The paper describes systems in this family ranging from 1.3B to 175B parameters and says that most of their training text was English. Some could respond to a new task from the prompt, with a few examples when supplied and without demonstrations in the zero-shot setting. This flexibility made the architecture attractive for Portuguese, where labeled training data for every possible use could be hard to come by. The authors also point to LLaMA in their discussion of openness and access to training data. [GPT-3](https://md.research.elamur.ai/free/en/papers/brown-2020-language-models-few-shot-learners/) · [Question answering](https://md.research.elamur.ai/free/en/topics/question-answering/) · [Few-shot learning](https://md.research.elamur.ai/free/en/concepts/few-shot-learning/) · [LLaMA](https://md.research.elamur.ai/free/en/papers/touvron-2023-llama-open-efficient-foundation-language/)

Multilingual pretraining offered one way to include Portuguese in a larger undertaking. The paper discusses multilingual BERT, mT5 and mGPT as examples of systems trained to work across languages. It also cites research on French and Finnish as a reason to consider training for a single language. The underlying comparison of interests is between pooling material across languages and concentrating resources on the language in which the system will be used. For GlórIA, the concentration goes further, to a specific variety of Portuguese. [Multilingual NLP](https://md.research.elamur.ai/free/en/topics/multilingual-nlp/) · [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) · [mT5](https://md.research.elamur.ai/free/en/papers/xue-2021-mt5-massively-multilingual-pre-trained/) · mGPT · [CamemBERT](https://md.research.elamur.ai/free/en/papers/martin-2019-camembert-tasty-french-language-model/) · [BERT for Finnish](https://md.research.elamur.ai/free/en/papers/virtanen-2019-multilingual-enough-bert-finnish/)

Portuguese-specific work had already explored several combinations of architecture and variety. BERTimbau was built as a Brazilian Portuguese encoder. PTT5 used an encoder and a decoder, and other work adapted it to paraphrasing or to writing questions in Portuguese. Albertina used a 900M-parameter encoder architecture with separately trained European and Brazilian Portuguese versions. In generative work, Gervásio-PTPT offered a 1B decoder aimed at European Portuguese. Sabiá used a LLaMA-based architecture with 65B parameters and focused on Brazilian Portuguese, including tasks presented with a few examples. GlórIA thus had a close European Portuguese precedent in Gervásio-PTPT and a larger Portuguese-language precedent targeting a different variety in Sabiá.

#### Where the text and the tests came from

Earlier Portuguese projects had developed practical ways to find large quantities of unlabeled text. BERTimbau’s brWac collection provided 2.7B tokens gathered from Brazilian Portuguese websites. Albertina drew on an OSCAR selection for European Portuguese and on transcripts from the Portuguese and European Union parliaments. Sabiá relied on the Portuguese portion of ClueWeb22. These projects gave GlórIA precedents for using crawls, for selecting a Portuguese variety within a collection, and for supplementing web material with text from identifiable institutions. GlórIA extends that combination with archived journalism, encyclopedic articles and film dialogue. [OSCAR](https://md.research.elamur.ai/free/en/papers/abadji-2022-towards-cleaner-document-oriented-multilingual/)

The authors turned to LAMBADA for the central evaluation idea. If a whole passage supplies clues about a missing word, the prediction can depend on information introduced earlier in the discourse. The final phrase can narrow the possibilities, and a previous sentence can establish which person, thing or action is relevant. The evaluator can then compare a short generated answer with a reference. This makes contextual continuation measurable without asking a judge to assess the quality of an entire new passage. It also gives the benchmark writer a difficult job. A passage needs to leave enough room for a meaningful prediction while giving the reader a reason to prefer the intended word. [Discourse analysis](https://md.research.elamur.ai/free/en/topics/discourse-analysis/) · [LAMBADA](https://md.research.elamur.ai/free/en/papers/paperno-2016-lambada-dataset-word-prediction-requiring/)

GLUE and the Portuguese sentence-pair resources serve another purpose in the paper. They supply examples of relationships such as entailment and similarity, with labels that can be used for supervised training. The authors can therefore ask whether the decoder’s representations are a useful starting point when the task provides its own labeled data. The distinction matters throughout the experiments. Completion uses the pretrained system’s ordinary output, a sequence of tokens. Sentence-pair evaluation adds new output layers and trains the system to make a particular kind of judgment. [GLUE](https://md.research.elamur.ai/free/en/papers/wang-2018-glue-multi-task-benchmark-analysis/) · [Fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/)

### The method, step by step

#### Gather the documents

The GlórIA procedure starts with collections that differ in how their texts were produced. ClueWeb22 and OSCAR supply crawled pages, including writing from blogs and forums. The authors use European Portuguese selections from both. In the processed corpus, the ClueWeb22 selection accounts for 29M documents and 31.6B tokens, while OSCAR accounts for 1.5M documents and 1.8B tokens. The size of ClueWeb22 makes it the main source of available text, while the other collections give the authors ways to vary the domains seen in training.

From Portuguese documents to GlórIA checkpoints The steps in order.

The Arquivo.pt portion comes from archived periodicals and news sites. It contributes 1.5M documents and 0.8B tokens after processing. The authors sought it out for reviewed journalistic writing. Portuguese Wikipedia adds 0.8M documents and 0.2B tokens. Its role is to supply encyclopedic material and a style of prose shaped by revision. These sources have editorial purposes that differ from the more varied circumstances under which pages in a general crawl are written.

Dialogue comes from film subtitles and European Parliament proceedings. The OpenSubtitles portion contributes 1.2M documents and 1.0B tokens. It includes short conversations as well as narration. The Europarl portion contributes 1.3M documents and 0.05B tokens in the form of parliamentary transcripts. These collections make both lines written for performance and records of parliamentary speech available to a system that takes written text as input. Like the news and web documents, the dialogue material enters the next-token task as text. [OpenSubtitles](https://md.research.elamur.ai/free/en/papers/lison-2016-opensubtitles2016-extracting-large-parallel-corpora/)

#### Filter the corpus and decide what the decoder sees

When suitable metadata are available, the authors use a URL domain containing `.pt` as a clue for selecting European Portuguese documents. They discard documents of 15 words or fewer. The cleaning process repairs encoding problems that can turn readable characters into garbled strings and removes HTML tags left behind in the text. Exact duplicates are detected by hashing, which assigns a compact identifier to content so that repeated copies can be recognized. The procedure targets identical documents, a practical source of redundant training material in large collections.

The authors make one additional selection for subtitles. They build a list of Portuguese profanity and exclude subtitle samples containing words on that list. Their concern is that film dialogue can place insults and other objectionable expressions in the speaker’s own voice, and they want to reduce the decoder’s exposure to that kind of material. The rule is specific to the subtitle data. After the processing stages, the corpus totals reported by the authors are 35.3M documents and 35.5B tokens. [Bias, fairness and safety](https://md.research.elamur.ai/free/en/topics/bias-fairness-safety/)

The next decision is how frequently to present material from each collection. A corpus inventory gives the quantity of available documents. A sampling distribution gives the expected share of training draws. The two can be set independently, which matters when a large crawl sits alongside much smaller collections. The authors follow a source-weighting approach similar to LLaMA’s. In their table, they write the sampling quantity as follows.

```
P(i)
```

The symbol P denotes sampling probability. The index i denotes the document referred to in the table’s description, and P(i) is defined there in relation to the subset from which that document is drawn. The probabilities in the table are supplied by subset. In the batch construction described by the authors, those settings determine the relative frequency with which documents from different collections enter training.

ClueWeb has a sampling probability of 0.62. Portuguese Wikipedia has 0.10, and Arquivo.pt and OSCAR each have 0.08. Europarl and OpenSubtitles each have 0.06. This gives the large crawl a majority of the draws and preserves a defined role for the other collections. The same distribution is used for both GlórIA configurations. A choice such as the weight for Wikipedia affects how frequently the decoder encounters its smaller body of distinct documents during a long run.

The authors report 96M document encounters during pretraining of the 1.3B configuration. ClueWeb accounts for 59.870M of those encounters, which the paper expresses as 2.06 epochs for that subset. Wikipedia accounts for 9.516M encounters and 11.60 epochs. Here an epoch measures exposure on the scale of a pass through the collection. The fractional values are useful because the authors draw from a mixture throughout training. Wikipedia appears much less often than ClueWeb in absolute terms, while its available material is revisited more frequently relative to the collection’s size.

The encounter counts for OSCAR and Arquivo.pt are 7.610M and 7.598M, with 4.88 and 5.07 epochs respectively. The OpenSubtitles portion accounts for 5.707M encounters and 4.41 epochs. Europarl accounts for 5.700M encounters and 4.08 epochs. The close encounter counts within these pairs reflect the shared weights. The exposure figures count repeated presentations, so a statement about how many documents the decoder saw during training describes a different quantity from the number of documents in the processed corpus.

#### Change the text into units the decoder can predict

Before the decoder can use a document, its text has to be turned into tokens. GlórIA uses a GPT-2-style tokenizer based on byte-pair encoding, commonly abbreviated BPE. In this approach, text can be represented using units smaller than a whole word. A written word may be encoded by one token or spread across several tokens. The authors use a vocabulary of 50,257 tokens. Tokenization provides the shared interface between the documents supplied during training and the text the system will produce at evaluation time. [Subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/)

The decoder follows the Hugging Face implementation of GPT-Neo. The 1.3B configuration has 24 layers, 16 attention heads and a hidden size of 2048. A layer transforms the incoming representation. An attention head performs one of the parallel operations that relate a position to other accessible positions in the sequence. The hidden size is the width of the representation passed within the network. The 2.7B configuration increases these settings to 32 layers, 20 heads and a hidden size of 2560. Each choice belongs to a complete configuration that can be trained under the same objective.

The paper discusses routes to making attention less costly as sequences grow. In its architectural account, local attention restricts some interactions to a moving region of the input. The cited Longformer design describes how a window can cover a spaced set of positions and how selected positions can receive broader access. The paper also mentions linear attention in connection with reducing the memory and computation needed for the operations that combine token representations. These ideas supply context for the authors’ architectural choice. GlórIA itself is specified through the adopted GPT-Neo implementation and its reported configurations. [Longformer](https://md.research.elamur.ai/free/en/papers/beltagy-2020-longformer-long-document-transformer/)

Causal pretraining makes each observed token a target given its predecessors. It can obtain training examples from the document itself. A prediction can draw on a partly read sentence, and the next prediction can draw on a longer portion of the same text. The paper names cross-entropy as the loss, which is the quantity training seeks to reduce. Written for a prediction of the observed token at one position, its contribution is:

```
ℓₜ = −log pθ(xₜ ∣ x<ₜ)
```

The subscript t marks the token position. The symbol ℓₜ is the loss at that position, xₜ is the token actually present there, and x\<ₜ is the sequence of tokens at positions before t. The less-than sign indicates that those positions precede t. The symbol pθ denotes the decoder’s distribution of probabilities with learned parameters θ. The conditioning bar ∣ means “given,” so the quantity inside the logarithm is the probability assigned to the observed token given its predecessors. The minus sign makes a smaller assigned probability yield a larger loss. The equals sign states the loss contribution for that prediction.

At generation time, the observed next token is unavailable. The system produces probabilities in the same way, and the decoding procedure chooses a token to append. That chosen token becomes part of the context for the following prediction. The procedure can stop after enough tokens to form the answer needed for CALAME-PT, or continue to produce a longer piece of prose. The ability to use its own output as further input follows directly from the way the prediction problem is set up.

#### Run pretraining and save intermediate states

The paper gives a batch size of 512, with 128 per GPU and 16 gradient accumulation steps reported in the same setup. A batch is the material grouped for processing during training. Gradient accumulation lets a training run combine signals from successive processing steps before applying a parameter update. The authors use BF-16 mixed precision, a choice about how numbers are represented during the computation, and set weight decay to 0.01. Weight decay acts on the parameters during optimization.

The learning rate determines how large an adjustment the optimizer makes in response to the training signal. For both configurations, the authors vary it with a cosine annealing schedule. The schedule includes 10k warmup steps and hard restarts every 500k steps. Warmup raises the rate at the start, and a hard restart resets the scheduled rate so the cycle can begin again. The authors also report periodic evaluation and shuffling of the data every 1 million steps. A checkpoint saves the learned state at a particular point, allowing the same downstream test to be applied to an earlier and a later version of the decoder.

The 1.3B configuration runs for 3M steps. The paper reports 21 days on 4x NVIDIA A100s 40GB and gives 7 days p/ 1M steps as the training rate for this run. Hardware availability limits the 2.7B configuration to 1M steps, which take 10 days on 7x NVIDIA A100s. This produces a longer record of training progress for the smaller decoder and a common step count at which the two configurations can be compared. [GPU and parallel computing](https://md.research.elamur.ai/free/en/topics/gpu-parallel-computing/)

The training curves for the 1.3B run show loss and perplexity. Loss tracks the token prediction errors under the chosen objective. Perplexity expresses the difficulty of the text under the decoder’s probability assignments, with lower perplexity corresponding to a better fit. The authors describe a steep early decline in loss within the first 1 million steps, followed by a slower decline through the end of the run. That observation describes optimization on the training objective. Checking the saved states against a benchmark adds evidence about whether this progress also shows up as a better ability to finish a separate passage.

#### Construct passages with a recoverable ending

CALAME-PT makes a word the unit of evaluation, even when the tokenizer represents that word in multiple pieces. An item consists of the passage preceding the ending and the omitted word. The authors want the wording to give readers enough evidence to anticipate the ending. In one handwritten example, the animals have already been introduced, so understanding the action makes it possible to supply the name of the animal caught at the end. Another uses the scene of a medical emergency and the opening of the Portuguese expression for first aid. In that case, a familiar expression supplies part of the constraint.

The authors make a handwritten subset, H, and a generated and human-reviewed subset, A. For H, 4 annotators write 406 passages spanning different subjects. To construct A, the authors first reserve a small group of documents from Arquivo.pt, OSCAR and Portuguese Wikipedia. These particular documents are left out of GlórIA’s training collection. The authors then draw from the reserved group at random to obtain the source material for benchmark items.

For each source document selected, GPT-3.5 receives a request in Portuguese to compose a brief passage inspired by the document. The request excludes names of people and countries, along with events, brands and dates. The authors want passages that a reader can complete using the information they contain. For instance, a new passage can describe what happened to a company’s data sharing without requiring the reader to recognize the company. The drafting stage yields 2.5k samples and costs ≈ 7 euros. That price refers to generation of the initial samples.

During human review, the authors can reject weak passages, remove identifying information, correct small errors and rewrite ambiguous portions. This step matters because the drafting instructions do not always produce a self-contained item. Reviewers can strengthen the link between the passage and the intended ending when several words seem equally plausible. After review, A contains 1670 items. Combined with H, it forms the 2076-item set labeled ALL. [Linguistic annotation](https://md.research.elamur.ai/free/en/concepts/annotation/)

The paper’s reviewed examples give a sense of the relationship between an item and its source. One passage uses labor organizations and negotiations to set up a reference to the people those organizations represent. Another describes a suspension of data sharing and ends with a reference to the people whose information is at stake. The benchmark input is the newly composed and reviewed passage. The reserved document gives it a subject, while the drafting and review process determines the language and the clues that reach the evaluated system.

#### Decode and score the first full word

A system receives the passage without the target word and can emit up to 5 new tokens. The evaluator takes the first full word it can identify from the output, then compares that word with the target while ignoring accents and letter case. This is exact match after the stated normalizations. A differently worded continuation receives credit only if its first scored word matches the designated answer. The rest of the continuation plays no direct role in the score.

Under greedy decoding, the highest-scoring next token is chosen at every step. It gives a simple path from the decoder’s probability estimates to a continuation. The decision at each step is local. If the system starts a word with a particular piece, the remaining steps continue from that piece. For a word divided into several tokens, deciding which piece to emit immediately can affect whether the right spelling can be completed within the generation budget.

The alternative uses beam search with top-k sampling. Beam search keeps several partial continuations available as the output develops. Top-k sampling restricts sampling to a group of the highest-scoring token options. The authors use 4 beams and set the sampling cutoff k to 50. The temperature is 1.0. Temperature is a setting for how the probability distribution is used in sampling. The repetition penalty is 2, a setting that influences the selection of tokens that have already occurred. With sampling, repeated executions can give different continuations for the same input. For those results the paper averages 3 runs.

#### Add supervised outputs for sentence pairs

For the supervised comparisons, the authors use the GlórIA 1.3B checkpoints from 1M, 1.5M, 2M and 3M steps. They add output layers, called heads, to translate a representation into a particular kind of answer. A classification head scores possible labels. A regression head predicts a value on a numerical scale. This lets the same pretrained decoder serve a task that expects a label or a score rather than an open text continuation.

In ASSIN-2, each pair comes with both an entailment label and a similarity rating. Entailment concerns whether one sentence follows from the other. Graded similarity concerns how close the sentences are in meaning. The authors give the two heads the representation of the last token of the paired input. Because this comes at the end of the input, the causal decoder can use the preceding material in building the representation. The entailment head uses cross-entropy for label prediction. The similarity head uses mean squared error, so larger departures from the annotated score carry a larger training cost. [Semantic similarity](https://md.research.elamur.ai/free/en/concepts/semantic-similarity/)

The paper describes the multitask loss as the sum of the task losses.

```
L = Lᵣₜₑ + Lₛₜₛ
```

The symbol L on the left is the combined loss. Lᵣₜₑ is the classification loss for recognizing textual entailment, and Lₛₜₛ is the regression loss for semantic textual similarity. The subscripts identify those tasks. The plus sign adds their contributions, and the equals sign identifies the resulting quantity used for the joint objective.

For the sentence-pair evaluations, the authors apply a common search protocol to GlórIA and the relevant baselines. They try sets of training settings, including different learning rates or schedules. Where a task has multiple metrics, they use validation performance to keep the best checkpoint for each metric in the experiment. They report results from the best hyper-parameter settings and describe averaging individual checkpoint results in their methodology. The validation stage gives the comparison a way to select settings for a task before reporting performance on the evaluation split.

### Experiments and results

#### Completing CALAME-PT without demonstrations

The main zero-shot comparison uses GlórIA 1.3B at 1M, 2M and 3M steps, Gervásio-PTPT, and mGPT. Gervásio-PTPT is the decoder aimed at the same variety, based on Pythia 1B. The mGPT system is a multilingual decoder with 1.3B parameters and a GPT-3-like architecture. Each system gets the same passage prefixes. ALL gives a single exact-match percentage for the combined benchmark, while the A and H scores show how frequently the expected word is produced within each construction route.

With greedy decoding, the highest reported ALL score comes from the GlórIA checkpoint at 3M steps. At 1M steps GlórIA already leads both baseline systems on the combined benchmark. The same ordering of the systems is visible within each subset when the final checkpoint is used. On A, GlórIA scores 38.86% exact match, mGPT scores 31.55% and Gervásio-PTPT scores 19.88%. On H the corresponding scores are 27.34%, 20.93% and 15.52%. Every one of these greedy scores comes from accepting a single continuation path for each prompt.

Greedy decoding on CALAME-PT ALL by exact match The final GlórIA checkpoint leads the comparison, and its earliest checkpoint also ranks ahead of both baselines.

**The numbers**

| System or setting | exact match % |
| --- | --- |
| Gervásio-PTPT | 19.03 |
| mGPT | 29.47 |
| GlórIA 1.3B at 1M steps | 35.07 |
| GlórIA 1.3B at 2M steps | 35.93 |
| GlórIA 1.3B at 3M steps (this paper) | 36.61 |

Under beam search with top-k sampling, GlórIA at 3M steps reaches 52.79% exact match on ALL. The two baselines also obtain higher scores with this procedure than they do greedily. Gervásio-PTPT moves from 19.03% to 44.01% on ALL, and mGPT moves from 29.47% to 47.14% on the same set. The ranking within each decoding condition is clear. The absolute score of a given checkpoint depends substantially on how its next-token probabilities are used.

Beam search with top-k sampling on CALAME-PT ALL by exact match GlórIA leads the comparison at each reported checkpoint under the sampled decoding procedure.

**The numbers**

| System or setting | exact match % |
| --- | --- |
| Gervásio-PTPT | 44.01 |
| mGPT | 47.14 |
| GlórIA 1.3B at 1M steps | 50.99 |
| GlórIA 1.3B at 2M steps | 51.80 |
| GlórIA 1.3B at 3M steps (this paper) | 52.79 |

The sampled results for A and H are averages over 3 runs, like those for ALL. For A, the last GlórIA checkpoint reaches 55.39%, mGPT reaches 50.03% and Gervásio-PTPT reaches 45.97%. For H, GlórIA reaches 42.61%, ahead of mGPT at 35.87% and Gervásio-PTPT at 34.90%. The headline ALL value combines sets of unequal size. The larger generated and reviewed set therefore contributes more examples to that value, making the separate H result important for understanding performance on passages composed directly by annotators.

A second comparison introduces GlórIA 2.7B. With both configurations evaluated at 1M training steps using beam search and top-k sampling, 2.7B obtains 52.20% exact match on ALL and 1.3B obtains 50.99%. On A the scores are 54.57% and 53.21%, respectively. On H they are 40.40% and 38.75%. These averages also come from 3 evaluations. At the shared training step, the larger configuration leads on every reported split. The smaller configuration’s later checkpoint at 3M steps has the highest ALL score among the GlórIA checkpoints reported under this procedure.

#### Judging entailment and similarity in ASSIN-2

ASSIN-2 is a Brazilian Portuguese benchmark. The split sizes are 6.5k pairs for training, 500 for validation and 3k for testing. Each pair supports both an entailment judgment and a similarity prediction. The authors use BERTimbau-Large as the baseline because it is an encoder trained for Brazilian Portuguese. The comparison asks how the European Portuguese decoder can adapt to this specific labeled task in another variety.

The task input is limited to 128 tokens. For optimization the authors use batches of 32 and 2 gradient accumulation steps. They examine 8 sets of hyper-parameters drawn from learning rates of 1e-5 and 1e-6, durations from 5 to 10 epochs, and linear or constant learning-rate scheduling. An epoch here describes a pass through the task’s training set. The strongest reported setting for both systems has a learning rate of 1e-5, runs for 10 epochs and keeps the rate constant.

Entailment is measured by F1 and accuracy. F1 combines precision, the reliability of the relevant predictions, with recall, their coverage of the reference cases. Accuracy measures the share of correct label decisions. GlórIA obtains 0.8960 F1 and 0.8967 accuracy. BERTimbau-Large has 0.9020 on each measure. For the similarity task, Pearson correlation measures the extent to which the predicted scores and the human scores vary together. GlórIA reaches 0.8510, and BERTimbau-Large reaches 0.8460. The encoder therefore leads on the pair of classification measures, while the decoder leads on the reported measure of graded similarity.

The distinction between the task losses and the reported metrics is consequential here. GlórIA’s similarity head learns by paying for squared errors on individual scores, while Pearson assesses how the pattern of its scores follows the human ratings. Its entailment head learns through a classification loss, while the evaluator counts categorical decisions and summarizes them with F1 and accuracy. The comparison says how well the task-specific predictions fare on the chosen metrics after joint training.

#### Judging sentence pairs in GLUE-PTPT

GLUE-PTPT is a machine translation of GLUE into European Portuguese covering 4 subtasks. The authors select RTE for entailment, MRPC for paraphrase recognition and STS-B for graded similarity. MRPC asks whether sentences convey equivalent content, whereas STS-B calls for a score that can distinguish different degrees of resemblance. Alongside GlórIA, the results include the European Portuguese decoder Gervásio-PTPT and the encoders Albertina-PTPT and BERTimbau-Large.

The authors try 4 sets of hyper-parameters for each selected subtask. For RTE and MRPC the settings vary the learning rate between 1e-4 and 1e-5 and use linear or constant scheduling. The settings considered for STS-B also include 1e-6 as a learning rate. For all selected tasks the authors train for 5 epochs with batches of 32 and 2 gradient accumulation steps. They cap the tokenized input at 128 tokens.

The official GLUE evaluation service was unavailable at the time. The authors follow Albertina’s protocol by using the original validation set for testing and reserving 10% of the original training split to form a new validation set. This gives all systems the same split for selecting settings and the same test material for the final comparison. The scores refer to this arrangement of GLUE-PTPT.

GLUE-PTPT RTE accuracy on the paper’s test split Albertina-PTPT leads the full comparison, and GlórIA leads the decoders.

**The numbers**

| System or setting | accuracy |
| --- | --- |
| Gervásio-PTPT | 0.6534 |
| GlórIA (this paper) | 0.6679 |
| BERTimbau-Large | 0.6968 |
| Albertina-PTPT | 0.8628 |

The ordering in RTE recurs for the paraphrase results. On MRPC, GlórIA has 0.8775 F1 and 0.8162 accuracy, and Gervásio-PTPT has 0.8599 F1 and 0.7941 accuracy. BERTimbau-Large scores 0.9030 F1 with 0.8652 accuracy. Albertina-PTPT is first on both measures, obtaining 0.9261 F1 and 0.8971 accuracy. For these sentence pairs, choosing either reported metric leaves the systems in the same order.

The STS-B results follow the same ranking. The Pearson correlation is 0.8500 for GlórIA and 0.8360 for Gervásio-PTPT. BERTimbau-Large reaches 0.8700, and Albertina-PTPT reaches 0.898. So the decoder comparison favors GlórIA throughout GLUE-PTPT, while both encoders have the higher scores on every reported column. The result is consistent with the paper’s choice to treat supervised sentence judgments as a distinct test of a decoder developed principally for generation.

#### Looking at text beyond the first word

The paper also shows longer continuations from GlórIA 1.3B using beam search and top-k sampling with a temperature of 1.0. In its sports example, a passage about the spread of surfing in Portugal develops into a description of the equipment and activity. A passage on financial literacy moves from the value of learning to manage money to a list of what that learning can help someone do. A recycling passage poses a question and then begins an explanation. These changes give the reader something to inspect that the word-completion metric leaves out, namely how a continuation develops a local train of thought across sentences.

Other samples cover food, music, history, health and cars. The cooking passage brings in names of dishes, and the music passage continues with artists and institutions. The examples let readers see the writing and its relation to the prompt directly. They also show how fluent presentation and reliable factual content become separate questions once the system is allowed to write at length. The paper gives the passages as qualitative illustrations, with quantitative comparisons supplied by CALAME-PT and the supervised sentence-pair tasks.

### What the ablations show

The paper reports no component-removal ablation and instead compares saved training states, decoder sizes, decoding procedures and groups of benchmark items.

#### More training within one configuration

The checkpoint series keeps the 1.3B architecture and the evaluation items fixed. At 1M, 2M and 3M steps, the greedy exact-match scores on ALL are 35.07%, 35.93% and 36.61%. The sampled results on ALL are 50.99%, 51.80% and 52.79%. The later checkpoint leads the earlier one within each decoding procedure. The authors present this progression alongside the training curves, where the initial rapid drop in loss is followed by steadier change. The external results show improvement on a word-level task after that initial phase of optimization.

Separate scores on H and A show that the direction of the checkpoint effect goes beyond the combined result. On H, greedy exact match rises across the saved states from 25.62% to 26.84% and 27.34%. The sampled scores on H are 38.75%, 41.95% and 42.61%. On A, greedy performance rises from 37.36% through 38.14% to 38.86%. Its sampled counterpart rises from 53.21% through 53.69% to 55.39%. The result holds when the authors use a different way of turning token probabilities into words and when they consider passages with a different origin.

The checkpoints represent continued training along one trajectory. As the decoder progresses, it receives more document encounters and passes through more of the learning-rate schedule. This comparison shows what continued use of that recipe achieves. It cannot tell from the checkpoint scores how much of the improvement came from new documents, repeated encounters with familiar material, or changes in the rate of parameter updates.

#### Width and depth at a common stopping point

For the size comparison, the authors hold the reported step count at 1M and use the same source weights and decoding procedure. The 2.7B configuration leads the 1.3B configuration on ALL, A and H. Its best result at this shared point supports the possibility of improving the recipe through increased capacity. The experiment changes the complete GPT-Neo configuration, including depth, the number of attention heads and representation width. Parameter count describes the resulting scale of the network, while the comparison supplies no individual test of any of those design choices.

The two trajectories also illustrate how the answer to “which configuration performs better?” depends on where the authors stop. The 1.3B decoder at 3M steps leads the larger decoder at 1M steps on the combined set and on both subsets. That observation and the matched-step results fit together. The larger network has the stronger early checkpoint under this evaluation, and the smaller network gains from an observed continuation of training. The paper leaves the subsequent learning curve of the 2.7B configuration open.

#### How much the answer depends on decoding

For a fixed set of learned weights, switching from greedy decoding to the sampled beam procedure raises the reported exact-match score throughout the main comparison. This is visible even on H. At 3M steps, GlórIA has 27.34% exact match under greedy decoding and 42.61% with beam search and top-k sampling on those same handwritten items. Since the weights and passages are held fixed, the change concerns how a probability distribution is converted into the scored word.

Keeping more partial continuations available can matter when a word has several pieces. Sampling also changes which of the high-scoring pieces can make it into a generated sequence. The tested procedure sets beam width, sampling cutoff, temperature and repetition penalty together. Its benchmark advantage belongs to that joint setting. The comparison supplies no separate score for beam search alone or for changing only the repetition penalty. It therefore gives a direct reason to report the inference procedure whenever the paper’s completion results are used as a baseline.

#### Where the benchmark is easier or harder

The handwritten passages receive lower scores than the generated and reviewed passages across the principal comparisons. The authors conjecture that the drafting system tends to produce passages with more predictable target words. That is plausible in light of the item construction, but H and A differ in several respects. The generated drafts begin from source documents and respond to a common instruction. Reviewers can reject items and edit them for ambiguity. The handwritten questions arise from a separate authoring process. The scores show the difference in difficulty for the evaluated decoders and leave the cause of the difference unresolved.

Within A, the authors also group items by the collection that supplied the original document. Under beam search with top-k sampling, GlórIA 1.3B at 3M steps gets 53.84% exact match on the PTWiki group, 55.76% on Arquivo.pt and 56.20% on OSCAR. The corresponding mGPT scores are 49.69%, 50.08% and 50.57%. PTWiki produces the lowest score of these groups for both configurations, and OSCAR the highest. The ordering of the two systems relative to each other persists across the source groups.

For GlórIA 2.7B at 1M steps, the same source groups yield 54.61% on PTWiki, 54.06% on Arquivo.pt and 55.89% on OSCAR. Gervásio-PTPT’s scores are 46.15%, 45.42% and 45.80%, respectively. Its highest score comes from the PTWiki group. This is an exception to reading the paper’s general observation about stronger OSCAR results as a rule for all systems. It also shows why a benchmark source breakdown answers a specific question about the evaluated passages. Grouping test items by their source says how the decoders perform on passages inspired by each collection. A training ablation would have to change which collections the decoder actually sees.

### Limitations

#### Limits identified by the authors

CALAME-PT tests recovery of a word with a known reference answer. The authors point out that a generator can also be used for abstractive summarization, which calls for a shorter rendition of a source, or for dialogue, which calls for an appropriate response to a conversational turn. A missing-word score gives neither task its own evaluation. The authors identify additional Portuguese benchmarks as necessary for studying those uses in zero-shot or few-shot settings. They also discuss instruction following, human alignment and multimodal generation as directions for subsequent work. [Text summarization](https://md.research.elamur.ai/free/en/concepts/text-summarization/) · [Dialogue systems](https://md.research.elamur.ai/free/en/topics/dialogue-systems/) · [Instruction following with human feedback](https://md.research.elamur.ai/free/en/papers/ouyang-2022-training-language-models-follow-instructions/) · [Visual instruction tuning](https://md.research.elamur.ai/free/en/papers/liu-2023-visual-instruction-tuning/)

The authors describe several difficulties with using GPT-3.5 to draft benchmark items. It sometimes retained the sort of identifying information the prompt asked it to leave out. Some contexts depended on encyclopedic knowledge, even though the construction aimed for passages that could be completed from the text itself. The generator could also drift into Brazilian Portuguese. The human review process gave the authors a way to address these problems, and their account acknowledges sporadic Brazilian Portuguese features in the generated samples.

The paper explicitly recognizes the cost of ambiguous endings under exact match. A system can produce a word that fits while missing the designated answer. A reviewer can reduce this problem by rewriting a passage to make its ending more predictable. There is still a balance to strike. Additional clues can make the intended completion fairer to the reader, while very strong local cues can reduce the need to interpret the passage as a whole. Ignoring case and accents also gives a narrow kind of tolerance. It leaves alternative words and phrasings outside the scoring rule.

The authors also acknowledge that GlórIA can generate material that is factually wrong or inappropriate to its context. A fluent continuation can contain such an error within prose that otherwise reads naturally. The paper mentions possible approaches involving better selection of training data, careful prompting or constraints applied during decoding. The examples of extended prose illustrate the kind of text the system can produce, and the authors leave systematic mitigation of factual errors to further research. [Hallucination in natural language generation](https://md.research.elamur.ai/free/en/papers/ji-2022-survey-hallucination-natural-language-generation/)

The project’s language scope is European Portuguese. The authors identify other varieties, including those of Mozambique and Guinea-Bissau, as part of a broader goal for Portuguese generation. The ASSIN-2 results show supervised adaptation to a Brazilian Portuguese benchmark. The paper gives no corresponding generation study for the other varieties it names. Such an evaluation would require material and criteria appropriate to the variety being tested.

#### Limits evident in the experimental design

The comparisons support the performance of the full GlórIA training recipe. The authors credit a combination of corpus scale, domain diversity, decoder capacity and training duration. The baseline comparisons change several of those factors together. A multilingual decoder is trained under a different language allocation, and another European Portuguese decoder can differ in architecture and training material. The experiments leave the contribution of a particular corpus weight, source or cleaning operation unresolved. The paper’s document exposure table explains the treatment GlórIA received, while a causal test of any one of those decisions would need a second training treatment.

The use of a `.pt` domain is a selection heuristic. The host domain and the linguistic traits of the document are different kinds of evidence. The paper provides the selection rule and inventories for the processed sources, with no corpus-wide estimate of the rate at which individual documents exhibit European Portuguese. Similarly, filtering profanity from subtitle samples specifies a deliberate intervention in the training data. The paper gives no generation assessment that isolates what the intervention did to the frequency or character of toxic outputs.

The reserved documents in CALAME-PT’s construction give a concrete account of separation from GlórIA’s training material. The final benchmark item also goes through rewriting. For the baselines, the paper supplies no matching audit of prior exposure to the reserved documents or closely related text. Additionally, an item can be answerable for different reasons, from a common expression near the blank to the recurrence of an entity mentioned earlier. The paper does not use a shorter-context comparison to establish how often success specifically depends on reading across the passage.

The generation budget makes the score partly a property of the evaluation procedure. A limit of 5 tokens can allow different amounts of written text depending on the tokenizer and the word involved. The extraction rule credits the first whole word it identifies, so word boundaries matter alongside the probability of the intended continuation. The paper reports a uniform rule but gives no error breakdown that attributes misses to tokenization, failure to finish a word or selection of a semantically reasonable alternative.

The size comparison is made at equal training steps. The hardware assignments and run times differ, so the result gives a comparison of checkpoints at equal steps without establishing efficiency at equal computational cost. The longer 1.3B trajectory shows that its CALAME-PT performance continues to improve after the point where the larger run stops. It leaves the later 2.7B trajectory unobserved. Expectations about training a larger decoder for longer are extrapolations from these comparisons.

The supervised evidence is specific to the task data and split. The texts of GLUE-PTPT are translations, which gives the systems a common evaluation set and bounds the type of European Portuguese it represents. The paper’s “test” scores for that benchmark come from the original validation split. With ASSIN-2, the systems have both Brazilian Portuguese training examples and a task-specific output head. The results therefore describe adaptation under supervision, while the zero-shot findings come from the separate completion experiment.

For the sampled procedure, scores averaged over 3 runs describe the ordering of the reported experimental means. The tables give no spread around those means or significance tests. Small separations among checkpoints or source groups should be read as differences between the reported values. A detailed estimate of the stability of those separations would need run-level information or additional evaluation. The consistent ordering of the main systems across the reported conditions and the uncertainty of a small score difference are separate features of the evidence.

### What came after

Citations to GlórIA include later benchmarks, another open European Portuguese generator and studies of learning or representation. The citing titles identify the subjects pursued in those papers. A citation by itself leaves open whether the authors used GlórIA’s trained weights, its corpus, CALAME-PT or the paper as background. The connections below concern the projects’ stated research scope.

[IberoBench](https://md.research.elamur.ai/free/en/papers/baucells-2025-iberobench-benchmark-llm-evaluation-iberian/) takes evaluation to a regional scale by targeting Iberian languages. CALAME-PT is organized around one kind of prediction for Portuguese. An Iberian benchmark sets the problem of assessing language systems in a broader multilingual context. The shared concern is how to give evaluation a scope that reflects the languages in which the systems are meant to be used.

[PHEB](https://md.research.elamur.ai/free/en/papers/tavares-2026-pheb-european-portuguese-high-school/) defines an evaluation setting for European Portuguese at high-school level. GlórIA’s test gives a decoder a short piece of text and evaluates the word it supplies. A high-school benchmark frames assessment through an educational level. The citation connects a benchmark built for contextual continuation with subsequent work defining a setting for European Portuguese assessment through the knowledge or skills associated with schooling.

[ALBA](https://md.research.elamur.ai/free/en/papers/vieira-2026-alba-european-portuguese-benchmark-evaluating/) is a European Portuguese benchmark concerned with language and linguistic dimensions in generative systems. CALAME-PT organizes judgment around agreement with a target ending. ALBA’s stated focus gives linguistic dimensions a central role in what is evaluated. The two projects share the target variety and an interest in making generative ability measurable.

[AMALIA](https://md.research.elamur.ai/free/en/papers/simplicio-2026-amalia-fully-open-large-language/) presents a fully open large language system for European Portuguese. Its subject returns to the resource problem that motivated GlórIA, making a generator available for the variety. GlórIA’s contribution combined trained decoders, data resources and evaluation. AMALIA’s title establishes a further open release in the same language variety, while leaving its technical relationship to GlórIA unspecified.

[Anything Goes?](https://md.research.elamur.ai/free/en/papers/yang-2025-anything-goes-crosslinguistic-study-im/) studies language learning across languages with a focus on possible and impossible linguistic patterns. Its question concerns the kinds of patterns that can be acquired. GlórIA’s experiments concern learning from naturally occurring material assembled for European Portuguese and using the resulting predictions on completion tasks. The connection is through the use of learned language behavior as an object of study across different linguistic settings.

The work on continued pretraining and interpretability-based evaluation takes additional training and the analysis of learned behavior as its subjects. GlórIA follows its own training through saved states and measures the completion scores at successive points. Interpretability introduces a different kind of evaluation question, about what can be learned by examining the system beyond the correctness of its outputs. The citation does not specify a checkpoint or component from GlórIA that carries into this study. [Continued pretraining and interpretability-based evaluation](https://md.research.elamur.ai/free/en/papers/rodriguez-2025-continued-pretraining-interpretability-based-evaluation/) · [Interpretability](https://md.research.elamur.ai/free/en/topics/interpretability/)

[Global vs. Local Sentence Embeddings for Brazilian Portuguese](https://md.research.elamur.ai/free/en/papers/peixoto-2026-global-vs-local-sentence-embeddings/) revisits language specialization through numerical representations of sentences. It places monolingual approaches and foundation systems in the setting of Brazilian Portuguese. GlórIA approached specialization from European Portuguese pretraining and included a supervised test on Brazilian Portuguese sentence pairs. The later work’s focus is the representation of sentences itself, extending the question of language specialization to a different output and a different target variety.

## Cite

Cite as Ricardo Lopes, Joao Magalhaes and David Semedo. 2024. GlórIA: A Generative and Open Large Language Model for Portuguese. Proceedings of the 16th International Conference on Computational Processing of Portuguese - Vol. 1.

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{lopes2024gloria,
  title = {{GlórIA: A Generative and Open Large Language Model for Portuguese}},
  author = {Ricardo Lopes, Joao Magalhaes and David Semedo},
  booktitle = {Proceedings of the 16th International Conference on Computational Processing of Portuguese - Vol. 1},
  year = {2024},
  url = {https://aclanthology.org/2024.propor-1.45/}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
