--- language: - pt license: apache-2.0 library_name: transformers tags: - text-generation-inference datasets: - Polygl0t/gigaverbo-v2-sft - Polygl0t/gigaverbo-v2-preferences metrics: - perplexity pipeline_tag: text-generation widget: - text: "<|im_start|>user\nQual é a capital de Portugal?<|im_end|><|im_start|>assistant\n" example_title: Exemplo - text: "<|im_start|>user\nEscreva um poema sobre a floresta amazônica.<|im_end|><|im_start|>assistant\n" example_title: Exemplo - text: "<|im_start|>user\nListe três benefícios da energia solar.<|im_end|><|im_start|>assistant\n" example_title: Exemplo inference: parameters: repetition_penalty: 1.2 temperature: 0.1 top_k: 50 top_p: 1.0 max_new_tokens: 150 co2_eq_emissions: emissions: 65000 source: CodeCarbon training_type: post-training geographical_location: Germany hardware_used: NVIDIA A100-SXM4-80GB model-index: - name: Tucano2-qwen-1.5B-Instruct results: - task: type: text-generation name: Text Generation dataset: name: ARC Challenge type: Polygl0t/ARC-poly split: test args: num_few_shot: 5 metrics: - type: acc_norm value: 38.63 name: Acc-norm source: url: https://github.com/Polygl0t/lm-evaluation-harness/tree/polyglot_harness_portuguese name: arc_challenge_poly_pt - task: type: text-generation name: Text Generation dataset: name: MMLU type: Polygl0t/MMLU-poly split: test args: num_few_shot: 5 metrics: - type: acc value: 41.46 name: Acc source: url: https://github.com/Polygl0t/lm-evaluation-harness/tree/polyglot_harness_portuguese name: mmlu_poly_pt - task: type: text-generation name: Text Generation dataset: name: BELEBELE type: facebook/belebele split: test args: num_few_shot: 5 metrics: - type: acc_norm value: 62.33 name: Acc-norm source: url: https://github.com/Polygl0t/lm-evaluation-harness/tree/polyglot_harness_portuguese name: belebele_por_Latn - task: type: text-generation name: Text Generation dataset: name: BLUEX type: eduagarcia-temp/BLUEX_without_images split: train args: num_few_shot: 3 metrics: - type: acc value: 40.33 name: Acc source: url: https://github.com/eduagarcia/lm-evaluation-harness-pt name: bluex - task: type: text-generation name: Text Generation dataset: name: ENEM Challenge type: eduagarcia/enem_challenge split: train args: num_few_shot: 3 metrics: - type: acc value: 53.6 name: Acc source: url: https://github.com/eduagarcia/lm-evaluation-harness-pt name: enem_challenge - task: type: text-generation name: Text Generation dataset: name: OAB Exams type: eduagarcia/oab_exams split: train args: num_few_shot: 3 metrics: - type: acc value: 40.73 name: Acc source: url: https://github.com/eduagarcia/lm-evaluation-harness-pt name: oab_exams - task: type: text-generation name: Text Generation dataset: name: IFEval type: Polygl0t/IFEval-PT split: train args: num_few_shot: 0 metrics: - type: ifeval_pt_inst_level_loose_acc value: 41.86 name: Acc-loose - type: ifeval_pt_prompt_level_loose_acc value: 30.0 name: Acc-loose source: url: https://github.com/Polygl0t/lm-evaluation-harness/tree/polyglot_harness_portuguese name: ifeval_pt - task: type: text-generation name: Text Generation dataset: name: GSM8K type: Polygl0t/gsm8k-pt split: test args: num_few_shot: 0 metrics: - type: flexible-extract value: 18.49 name: Acc-flex source: url: https://github.com/Polygl0t/lm-evaluation-harness/tree/polyglot_harness_portuguese name: gsm8k_pt - task: type: text-generation name: Text Generation dataset: name: HumanEval type: openai/openai_humaneval split: test args: num_few_shot: 0 metrics: - type: pass@1 value: 26.21 name: pass@1 source: url: https://github.com/Polygl0t/lm-evaluation-harness base_model: Polygl0t/Tucano2-qwen-1.5B-Base --- # Tucano2-qwen-1.5B-Instruct An illustration of a Tucano bird showing vibrant colors like yellow, orange, blue, green, and black. ## Model Summary **[Tucano2-qwen-1.5B-Instruct](https://huggingface.co/Polygl0t/Tucano2-qwen-1.5B-Instruct)** is an instruction-tuned Portuguese language model on top of **Tucano2-qwen-0.5B-Base**. It has been trained using a combination of one round of supervised fine-tuning (SFT) and one round of Anchored Preference Optimization (APO). Despite its compact size, the model delivers strong performance across a wide range of Portuguese benchmarks and supports tasks such as **retrieval-augmented generation**, **function calling and tool use**, **summarization**, and **structured output generation**, among others. **All datasets, source code, and training recipes used to develop the Tucano2 series are fully open and reproducible.** ## Details - **Architecture:** a Transformer-based model ([`qwen3`](https://huggingface.co/docs/transformers/main/en/model_doc/qwen3)) - **Size:** 1,510,073,344 parameters - **Context length:** 4,096 tokens - **Dataset(s):** - [Polygl0t/gigaverbo-v2-sft](https://huggingface.co/datasets/Polygl0t/gigaverbo-v2-sft) - [Polygl0t/gigaverbo-v2-preferences](https://huggingface.co/datasets/Polygl0t/gigaverbo-v2-preferences) - **Training time**: ~ 82 hours - **Emissions:** 65 KgCO2 (Germany) - **Total energy consumption:** 170 kWh This repository has the [source code](https://github.com/Polygl0t/llm-foundry) used to train this model. The full configuration used for training is available in the following config files: - Single stage Supervised Fine-Tuning (linear warmup with cosine decay): [training_config_sft.yaml](training_config_sft.yaml) - Single stage Anchored Preference Optimization (linear warmup with cosine decay): [training_config_apo.yaml](training_config_apo.yaml) - Training Logs (loss, lr, rewards, etc.): [train_logs_apo.parquet](train_logs_apo.parquet), [train_logs_sft.parquet](train_logs_sft.parquet)
SFT Loss Curve ![SFT Loss Curve](./.plots/sft_loss.png)
APO Rewards ![APO Rewards](./.plots/apo_reward.png)
## Intended Uses The primary intended use Tucano2-qwen-1.5B-Instruct is to serve as foundations for research and development involving Portuguese language modeling. You may also fine-tune and adapt Tucano2-qwen-1.5B-Instruct for deployment if your use follows the Apache 2.0 license. If you decide to use Tucano2-qwen-1.5B-Instruct as a basis for your fine-tuned model, please conduct your own risk and bias assessment. ## Basic usage ```python from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig import torch # Load model and tokenizer model_id = "Polygl0t/Tucano2-qwen-1.5B-Instruct" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, device_map="auto" ) # Configure generation parameters generation_config = GenerationConfig( do_sample=True, temperature=0.1, top_k=50, top_p=1.0, repetition_penalty=1.2, max_new_tokens=150, pad_token_id=tokenizer.eos_token_id, ) # Prepare chat messages messages = [ {"role": "user", "content": "Qual é a capital de Portugal?"} ] # Apply chat template and generate prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) inputs = tokenizer(prompt, return_tensors="pt").to(model.device) with torch.no_grad(): outputs = model.generate(**inputs, generation_config=generation_config) # Decode and print response response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True) print(f"🤖 {response}") ``` ## Limitations Like almost all other language models trained on large text datasets scraped from the web, the Tucano2-qwen-1.5B-Instruct shows behavior that does not make it an out-of-the-box solution to many real-world applications, especially those requiring factual, reliable, and nontoxic text generation. Tucano2-qwen-1.5B-Instruct is subject to the following: - **Hallucinations:** Tucano2-qwen-1.5B-Instruct can produce content that can be mistaken as true facts, but are misleading or entirely false, i.e., hallucination. - **Biases and Toxicity:** Tucano2-qwen-1.5B-Instruct inherits the social and historical stereotypes from the data used to train it. Given these biases, the model can produce toxic content, i.e., harmful, offensive, or detrimental to individuals, groups, or communities. - **Language Limitations:** Tucano2-qwen-1.5B-Instruct is primarily designed to interact with Portuguese. Other languages might challenge its comprehension, leading to potential misinterpretations or errors in response. - **Repetition and Verbosity:** Tucano2-qwen-1.5B-Instruct may get stuck on repetition loops (especially if the repetition penalty during generations is set to a meager value) or produce verbose responses unrelated to the prompt it was given. Hence, even though Tucano2-qwen-1.5B-Instruct is released with a permissive license, we urge users to perform their risk analysis on them if they intend to use them for real-world applications. ## Evaluations The table below compares the Tucano2 (Instruct variant) series against other chat models of similar size. We divide our evaluations into three sets: - **Knowledge & Reasoning:** ARC-Challenge, ENEM, BLUEX, OAB Exams, BELEBELE, MMLU, GSM8K-PT - **Instruction Following:** IFEval-PT - **Coding:** HumanEval The NPM (Normalized Performance Metric) provides a balanced view of model performance across tasks, accounting for each task's inherent difficulty by normalizing its evaluation score relative to its random baseline. | | Total Avg. | Knowledge & Reasoning (NPM) | Instruction Following | Coding | | ------------------------------ | ---------- | --------------------------- | --------------------- | ------ | | **Tucano2-qwen-3.7B-Instruct** | 53.64 | 56.22 | 41.67 | 47.56 | | Jurema-7B | 53.03 | 50.66 | 47 | 75.61 | | Qwen2.5-3B-Instruct | 51.71 | 47.34 | 63.33 | 70.73 | | Qwen3-4B | 51.36 | 42.33 | 79.33 | 86.59 | | Gemma-3-Gaia-PT-BR-4b-it | 49.93 | 45 | 70.33 | 64.02 | | SmolLM3-3B | 49.54 | 43.99 | 69.67 | 68.29 | | Llama-3.2-3B-Instruct | 45.82 | 43.08 | 62.67 | 48.17 | | Qwen2.5-1.5B-Instruct | 41.39 | 40.25 | 42 | 48.78 | | **Tucano2-qwen-1.5B-Instruct** | 37.54 | 39.61 | 34.33 | 26.22 | | Qwen3-1.7B | 36.3 | 28.24 | 65 | 64.02 | | **Tucano2-qwen-0.5B-Instruct** | 26.08 | 27.77 | 30 | 10.37 | | Qwen3-0.6B | 22.21 | 15.13 | 55 | 39.02 | | Llama-3.2-1B-Instruct | 20.14 | 15.37 | 44.33 | 29.27 | | Qwen2.5-0.5B-Instruct | 17.8 | 14.98 | 31 | 24.39 | | Tucano-2b4-Instruct | 3.78 | 2.71 | 15 | 0 | | Tucano-1b1-Instruct | 2.59 | 1.42 | 13.33 | 0 | | TeenyTinyLlama-460m-Chat | 0.07 | -1.68 | 12.33 | 0 |
Evaluation Suite | **Benchmark** | **n-shot** | **Type** | **Baseline** | **Metric** | | ------------------------- | ---------- | ------------- | ------------ | ------------------------ | | **Knowledge & Reasoning** | | | | | | ARC-Challenge | 5-shot | MC-Q&A | 25 | `acc_norm` | | ENEM | 3-shot | MC-Q&A | 20 | `acc` | | BLUEX | 3-shot | MC-Q&A | 22.5 | `acc` | | OAB Exams | 3-shot | MC-Q&A | 25 | `acc` | | BELEBELE | 5-shot | MC-Q&A | 25 | `acc_norm` | | MMLU | 5-shot | MC-Q&A | 25 | `acc` | | GSM8K-PT | 0-shot | Math Problems | 0 | `flexible-extract` | | **Instruction Following** | | | | | | IFEval-PT | 0-shot | Instruction | 0 | `prompt_level_loose_acc` | | **Coding** | | | | | | HumanEval | 0-shot | Coding | 0 | `pass@1` |
Individual Benchmarks | | BLUEX | ENEM | OAB | ARC Challenge | BELEBELE | MMLU | IFEval-PT | GSM8K-PT | HumanEval | | ------------------------------ | ----- | ----- | ----- | ------------- | -------- | ----- | --------- | -------- | --------- | | **Tucano2-qwen-3.7B-Instruct** | 64.53 | 72.92 | 54.31 | 60.34 | 85.22 | 64.64 | 41.67 | 53.81 | 47.56 | | Jurema-7B | 63.42 | 70.96 | 64.97 | 52.56 | 88.44 | 49.91 | 47 | 30.29 | 75.61 | | Qwen2.5-3B-Instruct | 56.88 | 68.65 | 46.79 | 41.71 | 84 | 58.22 | 63.33 | 51.9 | 70.73 | | Qwen3-4B | 63.28 | 72.15 | 50.3 | 43.08 | 83.67 | 26.93 | 79.33 | 39.88 | 86.59 | | Gemma-3-Gaia-PT-BR-4b-it | 50.9 | 64.52 | 43.46 | 54.7 | 78.89 | 51.49 | 70.33 | 51.29 | 64.02 | | SmolLM3-3B | 53.55 | 64.73 | 41 | 52.74 | 78.67 | 53.23 | 69.67 | 44.44 | 68.29 | | Llama-3.2-3B-Instruct | 52.02 | 59.13 | 44.97 | 43.93 | 78.56 | 52.14 | 62.67 | 55.1 | 48.17 | | Qwen2.5-1.5B-Instruct | 52.02 | 61.79 | 44.28 | 39.74 | 76 | 51.91 | 42 | 42.16 | 48.78 | | **Tucano2-qwen-1.5B-Instruct** | 52.85 | 62.7 | 43.42 | 50.26 | 77.56 | 52.54 | 34.33 | 19.71 | 26.22 | | Qwen3-1.7B | 50.49 | 58.64 | 32.62 | 36.67 | 64.89 | 30.56 | 65 | 26.94 | 64.02 | | **Tucano2-qwen-0.5B-Instruct** | 40.33 | 53.6 | 40.73 | 38.63 | 62.33 | 41.46 | 30 | 18.49 | 10.37 | | Qwen3-0.6B | 34.91 | 41.15 | 29.75 | 30.51 | 37.11 | 26.48 | 55 | 31.66 | 39.02 | | Llama-3.2-1B-Instruct | 30.04 | 34.01 | 30.84 | 32.82 | 41.56 | 35.15 | 44.33 | 26.56 | 29.27 | | Qwen2.5-0.5B-Instruct | 30.18 | 34.08 | 29.34 | 27.44 | 50.67 | 39.54 | 31 | 14.69 | 24.39 | | Tucano-2b4-Instruct | 25.87 | 20.01 | 26.74 | 31.97 | 24 | 26.72 | 15 | 2.05 | 0 | | Tucano-1b1-Instruct | 22.95 | 19.94 | 25.33 | 30 | 24.89 | 25.59 | 13.33 | 1.67 | 0 | | TeenyTinyLlama-460m-Chat | 17.25 | 18.19 | 19.73 | 26.84 | 22.89 | 26.97 | 12.33 | 2.05 | 0 |
Inference Samples on Various Tasks ### Math **Prompt:** <|im_start|>user Como eu posso resolver o seguinte problema: 2x + 3 = 11?<|im_end|> <|im_start|>assistant **Response:** Para encontrar a solução para esta equação, você precisa isolar x. Primeiro subtraia 3 de ambos os lados da equação e depois divida por 2. A resposta é x=4. Para verificar sua resposta substitua 4 na equação original (2 * 4) + 3 = 11, que simplifica para 8 + 3 = 11. Portanto, a solução está correta .<|im_end|> --- ### Structured Output **Prompt:** <|im_start|>system Sempre responda em formato JSON estruturado conforme solicitado.<|im_end|> <|im_start|>user Extraia e resuma as informações principais do e-mail abaixo. Escreva sua resposta (em formato JSON) contendo as seguintes chaves: 'assunto', 'remetente', 'destinatário', 'resumo'. Aqui está o e-mail: Assunto: RE: Atualização sobre o Projeto de Conservação de Bacias Hidrográfica Carlos, Obrigado por enviar o currículo atualizado. Tive a oportunidade de revisá-lo e achei que ficou ótimo! Você fez um excelente trabalho ao tornar as informações acessíveis e envolventes para uma ampla audiência. Em relação à possível resistência dos membros da comunidade, concordo que devemos estar preparados para abordar suas preocupações. Uma ideia que tive foi incluir alguns exemplos práticos de como o uso indevido das águas no rio Amazonas ou na Baía de Guanabara e o descarte incorreto de resíduos sólidos têm prejudicado essas áreas. Ouvi-los falar diretamente sobre as consequências pode ser muito mais persuasivo do que simplesmente mostrar dados estatísticos. Além disso, também considero importante destacarmos os ganhos econômicos trazidos pela adoção de práticas mais sustentáveis, como tarifas de água menores e gastos diminutos relacionados à limpeza urbana. No final das contas, as pessoas costumam responder bem quando veem vantagens tangíveis além dos aspectos puramente ambientais. Diga-me o que você pensa dessas sugestões! Ficarei contente em ajudar a desenvolver ainda mais estratégias para vencer essa resistência e engajar as pessoas nessa nossa jornada. Atenciosamente, Helena<|im_end|> <|im_start|>assistant **Response:** ```json { "assunto": "RE: Atualização sobre o Projeto de Conservação de Bacias Hidrográficas", "remetente": "Helena", "destinatario": "Carlos", "resumo": "A remetente elogia o novo currículo enviado pelo destinatário, sugerindo adicionar casos reais impactantes nas bacias hidrográficas brasileiras para aumentar a eficácia educacional. Ela enfatiza a importância de evidenciar benefícios financeiros associados às práticas sustentáveis." } ```<|im_end|> --- ### Function Call / Tool Use **Prompt:** <|im_start|>system Utilize as ferramentas para resolver as tarefas que o usuário lhe solicitar. Se as ferramentas forem insuficientes, explique ao usuário que não é possível completar a tarefa. \# Tools / Ferramentas Você pode chamar uma ou mais funções para auxiliar na consulta do usuário. Você recebe assinaturas de funções dentro de tags XML : {"type": "function", "function": {"name": "create_todo", "description": "Cria uma nova tarefa no aplicativo de todo.", "parameters": {"type": "object", "properties": {"task_description": {"type": "string", "description": "Descrição da tarefa a ser criada."}, "due_date": {"type": "string", "description": "Data de entrega da tarefa no formato YYYY-MM-DD."}}, "required": ["task_description", "due_date"]}}} Para cada chamada de função, retorne um objeto json com o nome da função e os argumentos dentro das tags XML : {"name": , "arguments": } <|im_end|> <|im_start|>user Eu preciso criar uma nova tarefa para o meu projeto.<|im_end|> <|im_start|>assistant Claro, eu posso ajudar com isso. Você poderia, por favor, me fornecer a descrição da tarefa e a data de entrega?<|im_end|> <|im_start|>user A tarefa é finalizar o relatório do projeto e a data de entrega é 2022-03-15.<|im_end|> <|im_start|>assistant **Response:** {"name": "create_todo", "arguments": {"task_description": "Finalizing the project report", "due_date": "2022-03-15"}} <|im_end|> --- ### Similarity Scoring **Prompt:** <|im_start|>user Frase 1: O artista pintou um quadro inspirado nos campos floridos da primavera. Frase 2: O criador produziu uma obra que representava paisagens urbanas cinzentas. Pergunta: Qu\u00e3o similares s\u00e3o as duas frases? D\u00ea uma pontua\u00e7\u00e3o entre 1,0 a 5,0. Resposta:<|im_end|> <|im_start|>assistant **Response:** 2.5. As duas frases apresentam situações diferentes quanto à temática e estilo artístico, resultando numa pontuação média de similaridade de 2.5, indicando pouca relação entre elas.<|im_end|> --- ### Classification **Prompt:** <|im_start|>user Classifique o sentimento da seguinte resenha de filme como 'Positiva', 'Negativa' ou 'Neutra': "O filme foi uma experiência cinematográfica incrível, com atuações excepcionais e uma trama envolvente que me manteve na ponta da cadeira do começo ao fim."<|im_end|> <|im_start|>assistant **Response:** Sentimento: Positivo. A crítica destaca aspectos positivos como performances excelentes e um enredo cativante, indicando uma opinião favorável sobre o filme.<|im_end|> ---
Below, we compare the performance of Tucano2-qwen-1.5B-Instruct with Qwen3-1.7B, a strong baseline in the 1.5B parameter range. The percentages represent the absolute difference in performance between the two models on each benchmark. All other plots can be found in the [.plots](https://huggingface.co/Polygl0t/Tucano2-qwen-1.5B-Instruct/tree/main/.plots/) folder. **Tucano2-qwen-1.5B-Instruct vs Qwen3-1.7B** ![Performance Comparison](./.plots/model_comparison.png) ## Cite as 🤗 ```latex @misc{correa2026tucano2cool, title={{Tucano 2 Cool: Better Open Source LLMs for Portuguese}}, author={Nicholas Kluge Corr{\^e}a and Aniket Sen and Shiza Fatimah and Sophia Falk and Lennard Landgraf and Julia Kastner and Lucie Flek}, year={2026}, eprint={2603.03543}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2603.03543}, } ``` ## Aknowlegments Polyglot is a project funded by the Federal Ministry of Education and Research (BMBF) and the Ministry of Culture and Science of the State of North Rhine-Westphalia (MWK) as part of TRA Sustainable Futures (University of Bonn) and the Excellence Strategy of the federal and state governments. We also gratefully acknowledge the granted access to the [Marvin cluster](https://www.hpc.uni-bonn.de/en/systems/marvin) hosted by [University of Bonn](https://www.uni-bonn.de/en) along with the support provided by its High Performance Computing & Analytics Lab. ## License Tucano2-qwen-1.5B-Instruct is licensed under the Apache License, Version 2.0. For more details, see the [LICENSE](LICENSE) file.