Elamur Research

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

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

Summary

A system that can classify a Portuguese sentence may still be poorly equipped to continue a passage in European Portuguese. Lopes and colleagues address that gap with GlórIA, a decoder that learns to write by predicting what comes next in a text. They assembled a European Portuguese pretraining collection of 35.3M documents and 35.5B tokens after processing. The collection combines broad web crawls with material from newspapers, an encyclopedia, film subtitles and European Parliament proceedings. The authors used it to train GPT-Neo configurations with 1.3B and 2.7B parameters. They made the source code, pretrained checkpoints and data resources available. The work brings together a generator, the material used to train it and a way to test a specific part of what it learned. Language models and pretraining

The authors introduce CALAME-PT to measure whether a system can recover the final word of a short Portuguese passage from the preceding text. The benchmark contains 2076 passages. Some were written by annotators, and the others were generated from held-out documents and then reviewed by people. The test is zero-shot, so the systems complete the passages without being trained for the benchmark or shown examples of how to solve it. On the combined set, the 1.3B GlórIA checkpoint trained for 3M steps reaches 36.61 exact-match accuracy with greedy decoding and 52.79 with the paper’s beam search and sampling procedure. Both scores exceed those of Gervásio-PTPT and multilingual mGPT under the respective procedures. The handwritten passages are harder for every system in the main comparison. Text generation

The paper also asks how well the pretrained decoder can learn supervised tasks with fixed outputs. On the Brazilian Portuguese ASSIN-2 benchmark, GlórIA falls slightly behind BERTimbau-Large on entailment F1 and accuracy, while leading on the correlation between predicted and human similarity scores. On GLUE-PTPT, a translated European Portuguese benchmark, GlórIA beats the other decoder across the reported measures, and the encoders lead the comparison. Examples of longer continuations show that GlórIA can sustain a topic in European Portuguese. The strongest quantitative evidence concerns a narrower ability, recovering a designated word from its context under a specified generation procedure. Evaluation and benchmarks

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

GlórIA introduces a Portuguese text generator trained for the European variety and tests it on word completion and sentence-pair tasks. · about 32 minutes to read

The problem and its context

Generating text in a particular variety

Portuguese research already had systems for judging how sentences relate to each other, and it had corpora large enough to pretrain some of those systems. The opening for GlórIA lay at the intersection of a different architecture, a different use and a more specific target variety. The authors wanted a publicly available decoder that could produce European Portuguese across topics. They also wanted to know whether the recipes used to train large decoders elsewhere could support stable learning on a corpus assembled for that variety. Those aims called for training material and evaluation material with different roles. A large collection could expose the decoder to language in use, while a benchmark could establish what the resulting system actually did with a passage it was asked to finish.

The architectural distinction matters for understanding the choice of task. An encoder produces a representation of an input that can be used to make a decision about it. A benchmark for pairs of sentences may ask how similar they are or whether the first entails the second. A causal decoder learns to continue a sequence from the portion already visible to it. This makes it possible to provide the beginning of a passage and let the system supply the next piece, then use that piece as part of the context for the following prediction. GlórIA’s primary task uses that ability directly. The sentence-pair experiments ask a further question about what the decoder’s representations can support once it is adapted for a particular decision. Transformer and attention

The paper places this choice in the line of GPT-style work. The systems it reviews showed how a pretrained decoder could be prompted for tasks such as reading comprehension and question answering, sometimes from a task description alone and sometimes with a few demonstrations in the prompt. The authors describe decoder architectures in that line with parameter counts from 1.3B to 175B and note that their training material was predominantly English. They also point to the LLaMA family when discussing openness and to BLOOM when situating deep decoder architectures. An available architecture provided a starting point for the Portuguese work. The authors still had to decide which texts the decoder would read and how to measure its command of European Portuguese. GPT-3 · Few-shot learning · Question answering · LLaMA · BLOOM

What Portuguese already had

The paper describes multilingual pretraining as one route to wider language coverage. Multilingual BERT, mT5 and mGPT put Portuguese within systems designed to work across languages. The authors also cite work on French and Finnish in support of investigating single-language approaches. Those examples motivate the decision to devote the corpus to one language and, as far as the available sources and filtering allow, to one variety. In the GlórIA experiments, the multilingual mGPT decoder provides a direct point of comparison on the completion task. Multilingual and cross-lingual NLP · BERT · mT5 · mGPT · CamemBERT · BERT for Finnish

Several existing efforts specialized in Portuguese in different ways. BERTimbau was an encoder for Brazilian Portuguese. PTT5 used an encoder-decoder design and had been adapted to applications including paraphrasing and Portuguese question generation. Albertina provided separate European and Brazilian Portuguese versions of a 900M-parameter encoder, trained on different corpora. These efforts gave the authors precedents for selecting a variety and for adapting pretrained weights to a downstream task. They also made it possible to assess GlórIA’s sentence-pair performance against Portuguese encoders as well as against another decoder. Fine-tuning

The authors identify two close precedents in generative work. Gervásio-PTPT was available as a 1B decoder for European Portuguese and gives the paper a baseline with the same target variety. Sabiá, based on LLaMA, had a 65B configuration for Brazilian Portuguese and had been studied in few-shot settings. Together, these examples clarify the scope of the GlórIA project. Its target is European Portuguese, its primary evaluation is generation in the absence of demonstrations, and its comparison includes a decoder already aimed at the same variety.

Training material and test material

Earlier Portuguese projects also gave the authors examples of how to obtain text at scale. For BERTimbau, brWac supplied 2.7B tokens from Brazilian Portuguese websites. For Albertina, an OS-CAR selection filtered for European Portuguese was combined with material from the Portuguese and European Union parliaments. Sabiá used Portuguese material from ClueWeb22. The GlórIA authors drew on the latter web crawl and OSCAR and also sought sources whose editorial or conversational setting was easier to name. The aim was a collection that could expose the system to general web writing, edited prose and dialogue within the same training run. OSCAR

The authors approached evaluation as a separate resource problem. Even a large corpus cannot serve as a useful completion test merely by withholding a few words from arbitrarily chosen passages. Many natural endings would be hard to reconstruct because a writer could have chosen among several equally sensible alternatives. A curated test can try to make the surrounding sentences informative enough that a particular answer is plausible in advance. The paper takes its main precedent from LAMBADA, whose task makes a word prediction depend on a broader stretch of text. CALAME-PT adopts the final-word format and uses newly constructed Portuguese passages. LAMBADA

The other evaluation tradition in the paper comes from GLUE and Portuguese sentence-pair benchmarks. These tasks provide labeled examples and ask a system to learn a fixed kind of output. A decoder can be tested on them if it is equipped with a prediction layer appropriate to the label. This creates two distinct tests of the same pretraining effort. CALAME-PT evaluates the generator using its existing ability to continue text. The supervised evaluations examine what can be learned from that starting point with additional examples and task-specific prediction layers. GLUE

The method, step by step

Assemble the corpus before deciding how to sample it

The training procedure begins with documents. Each source supplies text written for a purpose that predates the training task. The web crawls include material such as blogs and forums. Archived periodicals supply news, Wikipedia supplies encyclopedia articles, and subtitles and parliamentary proceedings supply dialogue or recorded speech in textual form. After cleaning the sources, the authors assign each a sampling probability. This separates the size of a source on disk from how often a document from that source appears in training.

How GlórIA was pretrained

The steps in order.

How GlórIA was pretrainedStep 1: Collect European Portuguese text from varied sources1. Collect European Portuguese text from varied sourcesStep 2: Filter, clean and deduplicate the documents2. Filter, clean and deduplicate the documentsStep 3: Set a sampling probability for each source3. Set a sampling probability for each sourceStep 4: Sample documents and encode them as tokens4. Sample documents and encode them as tokensStep 5: Train GPT-Neo to predict the next token5. Train GPT-Neo to predict the next tokenStep 6: Save and evaluate checkpoints during training6. Save and evaluate checkpoints during training

ClueWeb22 contributes the largest collection after processing, with 29M documents and 31.6B tokens. The OSCAR selection contributes 1.5M documents and 1.8B tokens. Both are web crawls, so the source label identifies the collection process more clearly than it identifies a single style of writing. ClueWeb22 supplies the bulk of the available text. OSCAR serves as a separate body of web material and also supplies source documents for part of the later evaluation.

The other sources expand the range of settings represented in the corpus. Arquivo.pt supplies 1.5M documents and 0.8B tokens from archived news sites and periodicals. PTWiki supplies 0.8M documents and 0.2B tokens from encyclopedia articles in Portuguese. The authors value the news collection for its edited writing and the encyclopedia for its relatively neutral, revised prose. Both sources later contribute held-out documents to benchmark construction, where they play a different role from the material sampled for training.

The OpenSubtitles selection contributes 1.2M documents and 1.0B tokens. Its material includes short exchanges and narration from films. The Europarl selection contributes 1.3M documents and 0.05B tokens from European Parliament proceedings. A line written to be spoken in a film and a statement recorded in a parliamentary session give the decoder different examples of how turns and utterances are expressed. The texts reach the system through the same next-token objective as the web and encyclopedia material. OpenSubtitles

Clean the documents and choose how often each source appears

Where metadata was available, the authors used .pt in the document’s URL domain as a way to select European Portuguese material. The domain gives a clue about the origin of a document. The remaining steps address text quality and repetition. The authors remove documents with a word count of <=15, correct garbled characters and other encoding problems, and strip leftover HTML tags. They use hashes to remove exact duplicates. This treats identical document content as redundant while leaving wording that differs as a separate case.

Subtitles receive an additional filter. The authors compiled a Portuguese profanity list and discarded subtitle samples containing listed terms. They singled out this source because it contains direct dialogue and they wanted to reduce exposure to insults and first-person toxic language in that setting. The reported procedure specifies a property of which subtitle samples entered the corpus. Its effect on the generator’s behavior is a separate empirical question. After all processing, the authors give the collection’s total as 35.3M documents and 35.5B tokens. Bias, fairness and safety

The authors assign sampling probabilities to individual sources using an approach modeled on LLaMA’s data mixture. In their sampling notation, the parentheses indicate the item whose source determines the probability.

P(i)

P denotes the probability of sampling document i from the corresponding subset, as labeled in the paper’s sampling table. The symbol i identifies a document, and P(i) gives the probability associated with its subset in that scheme. The listed weights apply at the source level when batches are prepared. They describe the frequency with which material from each source is drawn, while the processed corpus statistics describe the material available to draw from.

The weight for ClueWeb is 0.62. PTWiki receives 0.10. OSCAR and Arquivo.pt each receive 0.08, and the subtitle and Europarl selections each receive 0.06. The large web crawl therefore supplies most sampled documents, and each smaller collection has a specified share of the training draws. The same weights are used for the 2.7B configuration. The paper gives realized document exposure for the longer 1.3B run, which makes it possible to see how often the available material from different sources could recur.

For this run, the authors report a total of 96M document exposures. ClueWeb accounts for 59.870M seen documents and 2.06 effective passes through its subset. PTWiki accounts for 9.516M seen documents and 11.60 passes. The term pass here describes the exposure relative to the size of the source, as reported in the paper. Wikipedia is sampled less often than ClueWeb, and its smaller collection is revisited more often. The difference matters because adding a small domain to a mixture and choosing how much repeated exposure it receives are distinct design decisions.

The remaining exposure figures show the same relationship between collection size and reuse. The 1.3B run saw 7.610M OSCAR documents and 7.598M from Arquivo.pt, corresponding to 4.88 and 5.07 passes respectively. The OpenSubtitles selection accounts for 5.707M seen documents and 4.41 passes, while Europarl accounts for 5.700M and 4.08 passes. These figures count training encounters. They describe the material presented during the run, including revisits to documents already sampled.

Turn documents into prediction problems

The authors use a GPT-2-style byte-pair encoding tokenizer with a vocabulary of 50,257 tokens. A token is a unit the decoder reads or predicts. It can correspond to only part of a written word, so the decoder’s elementary prediction and CALAME-PT’s scoring unit are different. Pretraining uses the token stream. The benchmark later reconstructs a first full word from the stream the system generates. This distinction explains why the evaluation gives the generator several token positions in which to produce a word. Subword tokenization

The decoder follows the Hugging Face implementation of GPT-Neo. In the 1.3B configuration it has 24 layers, 16 attention heads and a hidden size of 2048. The 2.7B configuration has 32 layers, 20 heads and a hidden size of 2560. The layer count describes the depth of the decoder. Attention heads carry out parallel attention operations within a layer, and the hidden size is the width of the representation passed through the network. Changing configurations therefore changes depth and width as well as parameter count.

The paper discusses local and linear attention in its account of GPT-Neo. It describes local attention through a sliding region of context and selected positions with wider access, citing Longformer. Its discussion of linear attention concerns ways to handle the operations underlying attention with linear memory and processing costs. These descriptions motivate the interest in efficient processing as inputs grow. In GlórIA, the architecture is adopted as part of the GPT-Neo setup. Longformer · Efficient models and compression

The learning objective is causal language modeling. At each position, the decoder uses the preceding tokens to assign probabilities to possible next tokens. Cross-entropy penalizes the system when it gives low probability to the token that actually occurs. A compact expression for the per-token contribution of the named objective is:

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

The symbol ℓₜ is the loss contribution at position t. The sequence’s observed token at that position is xₜ, and x<ₜ denotes the tokens at earlier positions. The symbol pθ is the probability distribution produced by the decoder with parameters θ. The vertical bar means that the probability is conditional on the earlier tokens. The logarithm and its preceding minus sign make a prediction more costly when the observed token receives less probability. The target comes from the document itself, so the procedure can use the collected text without separate task labels.

Run pretraining and inspect checkpoints

The reported batch size is 512, with 128 cited per GPU and 16 gradient accumulation steps. Gradient accumulation combines gradients across processing steps before the optimizer applies an update. The authors use BF-16 mixed precision and a weight decay of 0.01. Mixed precision governs the numeric representation used in training calculations. Weight decay acts on the learned parameters during optimization. GPU and parallel computing

The learning rate follows a cosine schedule with hard restarts every 500k steps and a warmup of 10k steps. The rate controls the size of the optimizer’s adjustments to the parameters. Warmup brings the rate up at the beginning of the schedule, while the restarts periodically reset the schedule. The authors also report evaluation and data shuffling every 1 million steps. A checkpoint is a saved state of training. Preserving checkpoints lets the authors run the same external benchmark against several stages of the 1.3B decoder.

The 1.3B run lasted 3M steps using 4x NVIDIA A100s 40GB. The authors report 21 days for that run and describe its rate as 7 days p/ 1M steps. Hardware constraints led them to stop the 2.7B run at 1M steps, which took 10 days on 7x NVIDIA A100s. The difference in duration shapes the later questions about scale. The paper can compare the architectures at a common step count, and it can follow the smaller architecture further into training.

For the 1.3B run, the authors plot training loss and perplexity. Perplexity summarizes how difficult the observed text is for the system to predict under its probability assignments. The plots show loss falling rapidly in the first 1 million steps and declining more gradually through the rest of training. This is evidence about progress on the pretraining objective. The checkpoint evaluations then ask whether continued progress on that objective accompanies better recovery of complete words on CALAME-PT.

Build a separate test for final-word prediction

CALAME-PT starts from the premise that a passage can contain enough information for a reader to anticipate its last word. The final word is stored as the target, and the rest of the passage is shown as input. The target may have appeared earlier in the text. In the paper’s handwritten example about a cat pursuing a mouse, the animal already named in the story can be recovered at the end by following who is pursuing whom. Another handwritten example uses an emergency to lead towards the end of a familiar expression about first aid. Both qualify as completion questions, even though the context helps in different ways.

The authors create a handwritten set, labeled H, and a generated and reviewed set, labeled A. The handwritten set contains 406 passages produced by 4 annotators who were asked to cover a variety of domains. To build A, the authors randomly select source documents from a small held-out portion of Arquivo.pt, PTWiki and OSCAR. They had deliberately excluded these source documents from GlórIA’s training material. The held-out documents provide subject matter for new passages.

The new passages are drafted by GPT-3.5. Its Portuguese prompt asks for a short text inspired by the source document. The instructions tell the generator to leave out names of people and countries, events, brands and dates. The intent is to make a completion answerable from a small amount of prose, without requiring recognition of the original document or knowledge of a particular named event. The authors report obtaining 2.5k drafts for ≈ 7 euros. That is a cost for the generation stage of benchmark construction.

Human review follows generation. Reviewers discard low-quality items, anonymize passages where necessary, repair minor problems and make small rewrites when a context admits too many plausible endings. The process retains 1670 items for A. The combined set, ALL, contains 2076 passages. Keeping H and A as separately scored subsets preserves information about the origin of an item after both have been placed in the same benchmark. Linguistic annotation

The reviewed examples illustrate the role of the source document. One passage concerns negotiations involving organizations that represent workers. Another concerns suspension of data sharing by a company and raises questions about the privacy of its users. The source contributes a topic and possibly a register. GPT-3.5 and the reviewers determine the actual passage on which the decoder is tested. An OSCAR-grounded item in A is therefore a newly written completion item inspired by OSCAR material.

Convert each continuation into a score

The systems receive the passage before the last word. Each can generate up to 5 new tokens, and the evaluators consider the first full generated word. They compare it with the stored word while ignoring case and accents. Exact match credits the specified word after these normalizations. A different word that makes sense in the sentence can still receive no credit. The method is easy to apply uniformly across systems, and its usefulness depends partly on how tightly the passages constrain the expected ending.

The authors use two decoding procedures. Greedy decoding chooses the most probable next token at each step. The other procedure combines beam search with top-k sampling. Beam search keeps several partial continuations in play, and top-k sampling restricts random selection to a group of high-scoring candidates. The authors specify 4 beams, k = 50, a temperature of 1.0 and a token repetition penalty of 2. Temperature governs the distribution used in sampling, while the repetition penalty affects the scoring of tokens that have already appeared. Because sampling can produce different outputs across runs, the reported scores for this procedure are averages of 3 runs.

Adapt the decoder for supervised sentence judgments

For supervised evaluation the authors start from the 1.3B checkpoints at 1M, 1.5M, 2M and 3M steps. A task head is a learned output layer that maps a sequence representation to the kind of answer a task requires. A classification head chooses a label. A regression head predicts a numeric value. Adding these heads changes how the pretrained decoder is used. The input can still be a tokenized sequence, but the answer is a score or label derived from that sequence.

ASSIN-2 calls for both a judgment of entailment and a score for semantic similarity on each pair of sentences. Entailment asks whether the meaning of one sentence follows from the other. Semantic similarity assigns a graded score for how close the sentences are in meaning. The authors attach separate heads to the representation of the last token and train them together. Entailment uses cross-entropy, while similarity uses mean squared error, which penalizes the squared distance between the predicted and annotated scores. The combined objective can be written as:

L = Lᵣₜₑ + Lₛₜₛ

L denotes the full loss for this multitask training procedure. Lᵣₜₑ is the classification loss for recognizing textual entailment. Lₛₜₛ is the regression loss for semantic textual similarity. The plus sign indicates that the two task losses are added as described by the authors. Both terms can therefore influence the representation used by the heads. Semantic similarity

For GLUE-PTPT the authors fine-tune on separate sentence-pair subtasks. They compare systems using the same split and training protocol within each task. Where an experiment has multiple target metrics, validation performance determines the checkpoint selected for each metric. The authors also report averaging individual checkpoint results to obtain the metric values in their comparisons. In these experiments a GLUE-PTPT or ASSIN-2 score reflects supervised adaptation, including the search over training settings. It answers a different question from the scores obtained by directly prompting the causal decoder.

Experiments and results

Zero-shot completion against Portuguese and multilingual decoders

The main CALAME-PT comparison includes Gervásio-PTPT, mGPT and the GlórIA 1.3B checkpoints saved after 1M, 2M and 3M training steps. Gervásio-PTPT is based on Pythia 1B and provides the European Portuguese decoder baseline. The tested mGPT uses 1.3B parameters, follows a GPT-3-like architecture and provides the multilingual comparison. Each model receives the same passage prefixes. The split labeled ALL combines handwritten passages with generated, human-reviewed passages. A and H preserve the origin of the benchmark items for separate analysis.

Under greedy decoding, GlórIA leads the full-set comparison from the earliest of its reported checkpoints. The final checkpoint is also first on both subsets. On A, its exact-match score is 38.86, compared with 31.55 for mGPT and 19.88 for Gervásio-PTPT. On H, its score is 27.34, compared with 20.93 and 15.52 respectively. Thus the ranking seen in the combined data also holds when the two construction procedures are considered separately. The absolute scores depend on which passages are being finished.

Greedy decoder comparison on CALAME-PT ALL by exact match

The last GlórIA checkpoint leads both baselines and its earlier checkpoints.

Greedy decoder comparison on CALAME-PT ALL by exact matchGervásio-PTPT: 19.03Gervásio-PTPT19.03mGPT: 29.47mGPT29.47GlórIA 1.3B at 1M steps: 35.07GlórIA 1.3B at 1M steps35.07GlórIA 1.3B at 2M steps: 35.93GlórIA 1.3B at 2M steps35.93GlórIA 1.3B at 3M steps (this paper): 36.61GlórIA 1.3B at 3M steps (this paper)36.61
The numbers
System or settingexact match %
Gervásio-PTPT19.03
mGPT29.47
GlórIA 1.3B at 1M steps35.07
GlórIA 1.3B at 2M steps35.93
GlórIA 1.3B at 3M steps (this paper)36.61

With beam search and top-k sampling, the full-set ranking again puts GlórIA ahead. The score for the 3M checkpoint is 52.79, the highest in this comparison. Scores rise under the bundled procedure for both baselines as well as for GlórIA. For example, mGPT achieves 47.14 exact match on ALL with this procedure, compared with 29.47 under greedy decoding. Since each sampled result is averaged across 3 runs, the chart reports performance for the decoding setup rather than the outcome of a particular draw.

Beam and top-k decoder comparison on CALAME-PT ALL by exact match

GlórIA leads each baseline throughout the reported checkpoint series.

Beam and top-k decoder comparison on CALAME-PT ALL by exact matchGervásio-PTPT: 44.01Gervásio-PTPT44.01mGPT: 47.14mGPT47.14GlórIA 1.3B at 1M steps: 50.99GlórIA 1.3B at 1M steps50.99GlórIA 1.3B at 2M steps: 51.80GlórIA 1.3B at 2M steps51.80GlórIA 1.3B at 3M steps (this paper): 52.79GlórIA 1.3B at 3M steps (this paper)52.79
The numbers
System or settingexact match %
Gervásio-PTPT44.01
mGPT47.14
GlórIA 1.3B at 1M steps50.99
GlórIA 1.3B at 2M steps51.80
GlórIA 1.3B at 3M steps (this paper)52.79

The A and H results show where that ranking comes from. Under beam search and sampling, the final GlórIA 1.3B checkpoint reaches 55.39 exact match on A. mGPT reaches 50.03 and Gervásio-PTPT reaches 45.97 on the same subset. On H, GlórIA reaches 42.61, with mGPT at 35.87 and Gervásio-PTPT at 34.90. The best checkpoint’s score on H therefore describes performance on a different and more difficult pool of prompts than its full-set score. Reporting both subsets gives a clearer view of where systems succeed than a single score for ALL.

A comparison at the same training step

GlórIA 2.7B enters a separate comparison using beam search and top-k sampling. Both architectures are compared at 1M training steps, and each score is again averaged over 3 evaluations. The 2.7B configuration reaches 52.20 exact match on ALL, while the 1.3B configuration reaches 50.99. The larger configuration also leads at this shared point on A, with 54.57 against 53.21, and on H, with 40.40 against 38.75.

The separately reported 3M checkpoint of the 1.3B configuration scores higher than the 1M checkpoint of the 2.7B configuration on ALL, A and H under the same decoding procedure. Both size and duration therefore matter when reporting which GlórIA checkpoint leads. The paper gives a clear comparison at equal steps and a longer trajectory for the smaller model. Available training time determined which trajectories the authors could observe.

ASSIN-2 tests supervised transfer to Brazilian Portuguese

ASSIN-2 supplies sentence pairs with annotations for entailment and similarity. The training split contains 6.5k pairs, the validation split contains 500 pairs, and the test split contains 3k pairs. Because the benchmark is in Brazilian Portuguese, the authors select BERTimbau-Large as the comparison. Both systems are fine-tuned on the benchmark. The input length is capped at 128 tokens, and training uses batches of 32 with gradients accumulated over 2 steps.

The authors evaluate 8 hyper-parameter sets. The search covers learning rates of 1e-5 and 1e-6, training durations from 5 to 10 epochs, and linear and constant learning-rate schedules. An epoch is a pass through the task’s training examples. The best reported setting for both GlórIA and BERTimbau-Large uses 1e-5, 10 epochs and a constant scheduler. This common choice emerged from a search under the same protocol for both competitors.

For entailment, the paper reports F1 and accuracy. F1 combines precision and recall, while accuracy measures how frequently the predicted decision is correct. GlórIA records an F1 of 0.8960 and accuracy of 0.8967. BERTimbau-Large records an F1 of 0.9020 and accuracy of 0.9020. For the similarity task, the paper uses Pearson correlation, which measures how closely the predicted scores and annotated scores vary together. GlórIA reaches 0.8510 on this measure, and BERTimbau-Large reaches 0.8460. The decoder’s closest comparison with an encoder is therefore on these tasks in the supervised setting, and its strongest result relative to this baseline is on graded similarity.

GLUE-PTPT tests supervised transfer in European Portuguese

GLUE-PTPT is a machine-translated European Portuguese adaptation of GLUE. The authors use RTE, MRPC and STS-B from the adaptation’s 4 subtasks. RTE asks for an entailment decision. MRPC asks whether two sentences are paraphrases. STS-B asks for a graded similarity judgment. The comparison includes Albertina-PTPT and BERTimbau-Large as encoders and Gervásio-PTPT as the other decoder. The tasks have shared inputs in the form of sentence pairs, but their outputs distinguish entailment, paraphrase and similarity.

For each subtask the authors prepare 4 hyper-parameter sets. The RTE and MRPC settings vary the learning rate between 1e-4 and 1e-5 and use linear or constant scheduling. The STS-B settings also consider 1e-6. With inputs capped at 128 tokens, fine-tuning runs for 5 epochs using batches of 32 and accumulating gradients over 2 steps. The official evaluation service was unavailable at the time, so the authors use the original validation split as their test set and reserve 10% of the original training split to create a new validation set. Every system in the comparison uses these redefined splits.

The RTE results illustrate the decoder and encoder ordering. GlórIA reaches 0.6679 accuracy on the paper’s test split, ahead of Gervásio-PTPT at 0.6534. BERTimbau-Large reaches 0.6968 and Albertina-PTPT reaches 0.8628. The encoder trained for European Portuguese leads on this task, and the decoder comparison favors GlórIA.

Supervised system comparison on GLUE-PTPT RTE test accuracy

Albertina-PTPT leads overall, and GlórIA is the stronger decoder.

Supervised system comparison on GLUE-PTPT RTE test accuracyGervásio-PTPT: 0.6534Gervásio-PTPT0.6534GlórIA (this paper): 0.6679GlórIA (this paper)0.6679BERTimbau-Large: 0.6968BERTimbau-Large0.6968Albertina-PTPT: 0.8628Albertina-PTPT0.8628
The numbers
System or settingaccuracy
Gervásio-PTPT0.6534
GlórIA (this paper)0.6679
BERTimbau-Large0.6968
Albertina-PTPT0.8628

The same ordering appears in the other columns of the reported comparison. On MRPC, GlórIA has an F1 of 0.8775 and accuracy of 0.8162. Gervásio-PTPT reaches 0.8599 F1 and 0.7941 accuracy. BERTimbau-Large achieves 0.9030 F1 and 0.8652 accuracy, while Albertina-PTPT reaches 0.9261 F1 and 0.8971 accuracy. The two measures make the same ordering visible for this paraphrase task.

On STS-B, the reported Pearson correlations are 0.8500 for GlórIA and 0.8360 for Gervásio-PTPT. BERTimbau-Large reaches 0.8700 and Albertina-PTPT reaches 0.898. Taken together, the GLUE-PTPT results show what the authors mean by a competitive decoder for these tasks. GlórIA improves on the decoder baseline under the reported fine-tuning protocol. The strongest results on this translated benchmark come from encoders.

Longer generations show how the decoder continues a topic

The authors also prompt GlórIA 1.3B to continue text on varied subjects and inspect the results. They use beam search with top-k sampling at a temperature of 1.0. In a passage about Portuguese cooking, the continuation names dishes and keeps developing the topic introduced in the opening. A passage about surfing moves from the sport’s presence along the Portuguese coast to a description of the activity. A passage on financial literacy develops into the beginnings of a list. These examples demonstrate continuity across sentences and, in some cases, a change of format appropriate to the topic.

The samples also cover subjects such as recycling and Portuguese history. They let a reader inspect properties that an exact-match score leaves out, including whether the next sentence follows the previous one and whether the writing retains features of European Portuguese. The paper presents illustrative generations alongside the controlled completion and supervised tests. The examples support the observation that the decoder can produce connected prose across different prompts. Their evidential scope is the outputs shown.

What the ablations show

Training duration changes completion performance

The paper reports no component-removal ablation and instead analyzes training checkpoints, model size, decoding procedures and benchmark subsets. The checkpoint series provides the closest view of how one GlórIA configuration changes with continued training. The authors use the same 1.3B architecture throughout and test its saved states on the same completion items. Under greedy decoding, full-set exact match moves from 35.07 after 1M steps to 35.93 after 2M and 36.61 after 3M. Under beam search and top-k sampling, it moves from 50.99 to 51.80 and then 52.79. The ordering recurs on A and H for both decoding procedures.

The inner and outer measures of training progress tell compatible stories. The loss and perplexity plots summarize the token prediction objective for the 1.3B run. The CALAME-PT checkpoints score an answer after token generation has been converted into a full word, on a separately constructed benchmark. The later training checkpoints have better completion scores even after the rapid early decline in training loss gives way to a more gradual decline. The authors describe the full trajectory from 1M to 3M as showing an observed ≈ 4% relative improvement. The essential condition is that the same architecture and test procedure are used through each checkpoint series.

The size comparison fixes the reported step count and varies the GPT-Neo configuration. The larger configuration leads at 1M steps on the combined benchmark and on each subset. This is evidence about the pair of configurations under the training and decoding setup the authors used. Depth, number of heads, hidden width and parameter count change together. Hardware allocation also differs. The experiment consequently supports the authors’ interest in further scaling while leaving the contribution of individual architectural changes open.

The way a continuation is selected has a large effect

The greedy and beam-plus-sampling comparisons vary how the generator turns its token probabilities into text. A single most likely next token can lead to a different eventual word from a sequence of tokens selected while several partial continuations remain available. Since CALAME-PT scores at the word level and some words take several tokens, this difference can affect how the recorded answer is reached. On the handwritten subset, for instance, the final 1.3B checkpoint scores 27.34 with greedy decoding and 42.61 with the alternative procedure. Both use the same checkpoint and underlying test passages.

The performance gain appears for Gervásio-PTPT and mGPT as well as for the GlórIA checkpoints. This makes decoding part of the experimental condition a reader needs to know when interpreting the score. The tested alternative combines beam search, a sampling cutoff and a repetition penalty with a specified temperature. Because these settings are evaluated together, the comparison establishes the effect of using the complete procedure. The Greedy versus beam-plus-sampling result does not isolate an effect for the number of beams, the cutoff or the repetition penalty individually.

Passage construction influences what is easy to predict

H is harder than A in the main results. The direction is shared across systems and decoding procedures. The authors suggest that passages drafted by GPT-3.5 can lead to more predictable target words. Human reviewers also made changes expressly intended to resolve ambiguity. Both the drafting and review process could influence the degree to which the text points towards a particular ending. The split comparison observes their combined outcome in A alongside the outcome of human writing in H.

The distinction is more specific than a comparison between machine output and human output in general. In CALAME-PT, the generated item starts from a particular held-out document, passes through a prompt that limits named references, and can be revised or rejected by a reviewer. Handwritten items come from a separate authoring process. The subsets can differ in topic, phrasing and how an author introduces clues. The reported results show that their difficulty differs in practice for the tested systems. They leave open which properties of the items are responsible.

The authors also group the A samples by whether their source document came from PTWiki, Arquivo.pt or OSCAR. The final 1.3B checkpoint scores 53.84 on PTWiki-grounded items, 55.76 on Arquivo.pt-grounded items and 56.20 on OSCAR-grounded items under beam search and sampling. For mGPT, the respective exact-match scores are 49.69, 50.08 and 50.57. Both systems obtain their lowest A source score on the PTWiki group. The differences across sources are modest within each of these systems, and their ranking against each other is stable across the groups.

The other rows lend some nuance to the authors’ general observation that OSCAR-grounded items tended to score well. Gervásio-PTPT scores 46.15 for PTWiki, 45.42 for Arquivo.pt and 45.80 for OSCAR. The 2.7B GlórIA checkpoint scores 54.61, 54.06 and 55.89 respectively. Comparing these rows gives a more exact account than assigning one ranking of source difficulty to all systems. In particular, the top source for Gervásio-PTPT is PTWiki, although that group is the hardest for the final 1.3B GlórIA checkpoint and mGPT. These comparisons concern the origin of benchmark prompts. The authors do not compare training runs with a corpus source removed, so the scores cannot assign a causal benefit to the presence of that source in pretraining.

Limitations

Limits identified by the authors

The authors describe CALAME-PT as a test of one part of language modeling. Its task is to recover a word that is already known to the evaluator. Abstractive summarization requires producing a shorter account of a text in new wording, and dialogue requires responding across conversational turns. The paper identifies both as areas where Portuguese evaluation would be valuable. Its examples of free continuation help illustrate generation, while its reported exact-match scores remain tied to completion. The authors also discuss instruction tuning, human alignment and multimodal expansion as open research directions for the foundation they have built. Text summarization · Dialogue systems · Training language models to follow instructions · Visual instruction tuning

The authors encountered problems during CALAME-PT construction that could persist in spite of review. Some generated passages retained identifying details or leaned on encyclopedic knowledge the prompt was meant to make unnecessary. GPT-3.5 also sometimes used Brazilian Portuguese features. Review gave the authors a way to correct or discard cases they found. Their account still treats the occasional presence of these features as a caveat for a benchmark aimed at European Portuguese. It also acknowledges the difficulty of making each target predictable without making the task trivial.

Ambiguity is especially consequential under exact match. A generated word can fit the story or complete the sentence grammatically and still differ from the author’s target. The benchmark’s normalization handles changes in casing or accents when comparing strings. Human review handles some cases of ambiguous meaning before testing. Any acceptable alternative that survives those safeguards is counted as a miss. The authors explicitly recognize this issue when explaining why some generated passages needed small rewrites.

The authors report that free generations can be syntactically coherent and topical while also containing claims that are wrong or wrongly contextualized. They discuss better data selection, prompting and constrained decoding as avenues relevant to this behavior. Their paper supplies sample generations across subjects and does not contain a systematic factuality assessment. Grammatical and topical continuity are easier to inspect in those passages than the reliability of every assertion embedded in them. Survey of hallucination in natural language generation

The focus on European Portuguese also limits the language coverage the paper claims. The authors identify varieties such as those used in Mozambique and Guinea-Bissau as part of a broader goal for Portuguese language technology. ASSIN-2 supplies some evidence about supervised adaptation to Brazilian Portuguese sentence-pair tasks. The generation evaluation and the corpus construction are aimed at European Portuguese. They leave the broader geographic question for work that can test those varieties directly.

Limits visible in the design

The relative value of corpus scale, source diversity and training duration is unresolved. The authors attribute GlórIA’s performance in part to the large and varied corpus, as well as to model size and training time. The baseline comparison changes several of these factors at once. Gervásio-PTPT and mGPT differ from GlórIA in architecture or language coverage as well as in their training material. Within GlórIA, the dataset weights are reused across configurations. The experiments support the performance of the full recipe and the benefit of continuing the observed 1.3B run. Isolating the benefit of a particular source, mixture weight or cleanup step would require its own training comparison.

The domain heuristic is another reason to distinguish a corpus aimed at a variety from a verified count of texts in that variety. A .pt domain provides evidence about where a document was hosted. Its language is a property of the words on the page. The filtering account supplies a practical selection cue and gives processed document and token counts. It offers no reported audit of variety membership throughout the corpus. In the same way, the subtitle filter identifies a selection rule motivated by dialogue toxicity, and there is no measured generation comparison that isolates the filter’s effect.

The held-out documents used to construct A improve separation from GlórIA’s training material. The use of newly written passages further distinguishes the final items from the original records. The baselines were pretrained using their own data and procedures. The paper supplies no corresponding overlap audit for those systems. The defensible interpretation is that the held-out construction is documented for GlórIA’s training setup and that all systems face a common set of completion prompts at evaluation time.

The evaluation procedure also bounds what it means to recover a word. The decoder is given up to 5 new tokens and the scorer uses the first full word it can identify. A tokenizer that breaks a continuation differently may take a different number of prediction steps to reach an answer. Exact match simplifies comparison across the outputs, while the score still reflects a generator, a tokenizer, a decoding procedure and the word extraction rule together. The paper reports a shared protocol and does not give a separate analysis of errors attributable to word segmentation or the generation limit.

The scaling evidence concerns two configurations at a matched step count. The paper does not carry the larger run to the same endpoint as the smaller one. Matching steps provides a clear comparison on one axis, while the reported differences in GPUs and time preclude treating the two runs as an equal-compute study. A higher score for the larger variant at that point licenses a statement about the observed checkpoints. The authors’ expectation that a larger decoder trained longer would improve is a hypothesis suggested by the results.

The supervised comparisons likewise depend on the task and its evaluation split. GLUE-PTPT’s texts come from a machine-translated adaptation, and the paper uses the original validation split as its test when the official service is unavailable. The shared protocol makes the systems comparable within the reported experiments. A reader assessing European Portuguese ability should still distinguish performance on those translated sentence pairs from performance on naturally authored completion items and longer generation prompts. ASSIN-2 adds evidence from Brazilian Portuguese, but each of its scores follows supervised fine-tuning on a specific task.

Finally, the paper averages the sampled completion scores over repeated runs but does not give their dispersion in the results tables. The averages describe the reported ranking. Small differences between nearby checkpoints or source groups cannot be read as estimates of run-to-run stability. The repeated direction of improvement across ALL, A and H is observable in the tables, while the size of sampling variability and the behavior on a newly drawn set of passages remain open.

What came after

Later work citing GlórIA spans benchmark design, studies of training and a further open release for European Portuguese. The titles establish the questions those works take up. Detailed claims about a particular paper reusing CALAME-PT, training from GlórIA weights or comparing against a given GlórIA checkpoint would require details about its experiments. The connections here concern the research questions that can be identified from the works themselves.

IberoBench frames evaluation at the scale of Iberian languages. GlórIA’s CALAME-PT centers on a concrete test for Portuguese, with results split by how its passages were written. IberoBench’s title places the assessment of large language systems in a regional multilingual setting. The work represents a broader evaluation scope for the problem that motivates CALAME-PT, obtaining assessments for languages and varieties whose needs can be missed in benchmarks centered elsewhere. IberoBench

PHEB takes evaluation in another direction, specifying European Portuguese and a high-school level. The educational level gives the benchmark a frame that final-word completion does not have. The connection is through the target variety and the goal of making its assessment concrete. GlórIA gives readers a measure of success at contextual completion. PHEB identifies an educational setting in which European Portuguese language systems can also be assessed. PHEB

ALBA also targets European Portuguese, with an explicit focus on language and linguistic dimensions of generation. That focus speaks directly to the distinction between generating a single expected word and evaluating identifiable aspects of generated language. CALAME-PT makes output easy to score through a common exact-match rule. ALBA’s subject is how to organize assessment around linguistic dimensions in the same variety. ALBA

AMALIA addresses the supply side of the original problem by presenting a fully open large language model for European Portuguese. It shares GlórIA’s concern with making a generator for that variety available for research. The continuity is in the scope and openness of the resource. AMALIA’s title establishes the nature of its release, while a technical lineage between the two projects would depend on their actual choices of data, architecture and training. AMALIA

Anything Goes? studies possible and impossible language learning across languages. GlórIA measures whether its decoder can learn from a European Portuguese corpus and predict natural continuations. The later study’s crosslinguistic framing raises a different question about what kinds of linguistic patterns a system can learn. The citation places GlórIA alongside work concerned with what language training allows researchers to probe across languages. Anything Goes?

The continued-pretraining and interpretability work moves the emphasis towards evaluating an additional phase of training and examining what the resulting system learns. GlórIA provides an example of following training through checkpoints and testing their external behavior. Interpretability asks what can be learned by inspecting the system beyond its final answers. The later work’s identifying title supports this thematic connection, while leaving the specific role of GlórIA in its evaluation unspecified. Continued pretraining and interpretability-based evaluation · Interpretability

The Brazilian Portuguese sentence-embedding study returns to the question of language specialization from a representation task. A sentence embedding is a numerical representation of an entire sentence. The later work’s title describes a comparison involving monolingual systems and foundation models for Brazilian Portuguese. GlórIA asked a related question about the value of targeting a variety and tested its decoder on Brazilian Portuguese sentence pairs as well as on European Portuguese generation. The later study puts sentence representations, and the relative value of local and global approaches for producing them, at the center of the comparison. Global vs. Local Sentence Embeddings for Brazilian Portuguese

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.

@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/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/lopes-2024-gloria-generative-open-large-language/