tardellirs/aac-board-generator-770m-ptbr
AAC Board Generator 770M (pt-BR)
  
A compact Brazilian-Portuguese model for Augmentative and Alternative Communication (AAC). It is multi-function: it drafts whole communication boards from a theme and follows in-assistant instructions to edit them — add or remove a pictogram, generate a couple of extra pictograms, adjust a board on request. Given "monta uma prancha de brincar no parquinho" it produces the board; given "apaga o pictograma 'escorregador'" or "gera mais 2 pictogramas sobre segurança" it performs the edit. It powers the AAC assistant in **Papuguinho**, a tool for building pictogram communication boards.
- 771.6M parameters, designed to run on CPU (no GPU) — about 4 s per board on a 4-core machine (Q8).
- Multi-function: board generation + instruction-following for board editing (add / remove / generate N).
- Quality-preserving vocabulary trim of a Gemma-3-1B model distilled for this task: 1.34× faster, same output.
- Ships with ready-to-serve GGUF builds for
llama.cpp: `aac-board-generator-770m-ptbr-GGUF`.
Model family & resources
In the Papuguinho pipeline these are complementary: this model drafts the words for a board; the retriever then finds the ARASAAC pictogram for each word.
What it's for
The model supports the full board-authoring assistant loop in pt-BR:
- Board generation. From an intention — an activity, routine, or topic ("trocar a fralda", "estrela cadente", "brincar no parquinho") — it drafts a short, coherent set of concrete, picturable pt-BR words.
- In-assistant instruction following. Given a request about an existing board, it performs the edit — e.g. remove a pictogram ("tira o 'escorregador'"), add / generate N pictograms ("gera mais 2 sobre segurança"), or otherwise adjust the item list. It is trained to respond in the same board item format so the app can apply the change directly.
Output format. One item per line, word|type|synonyms:
quero|v|querer,desejar
parquinho|l|parque,playground
escorregador|s|escorrega
balançar|v|balanço,gangorra
amigo|s|colega,amiguinho
...type is a short grammatical/semantic tag used by the app (v verb, s noun, a adjective, e expression, l place, p pronoun). The synonyms help the downstream retriever pick the right pictogram.
Intended use: drafting pictogram-board word lists from pt-BR themes and following board-editing instructions, inside AAC authoring tools like Papuguinho. Not intended for: general-purpose chat, languages other than Brazilian Portuguese, or as a source of factual answers — it is a task-specific AAC assistant, not an open-domain model.
Usage
The model was trained with the Gemma chat format, with the board-drafting instruction and the request in the user turn. On CPU, the GGUF build with llama.cpp is the recommended path.
On CPU with llama.cpp (recommended)
# from tardellirs/aac-board-generator-770m-ptbr-GGUF
llama-server -m aac-board-generator-770m-ptbr-Q8_0.gguf -t 4 -c 2048 --host 127.0.0.1 --port 8080Build the prompt yourself and call /completion (Gemma has no system role — put the instruction in the user turn):
import requests
INSTR = ("Você monta pranchas de CAA (pictogramas, pt-BR). Para o PEDIDO, liste ~12 itens concretos e relevantes, "
"um por linha, no formato palavra|tipo|sinônimos (tipo: v/s/a/e/l/p). Só a lista.")
pedido = "monta uma prancha de brincar no parquinho"
prompt = f"<start_of_turn>user\n{INSTR}\n\nPEDIDO: {pedido}<end_of_turn>\n<start_of_turn>model\n"
r = requests.post("http://127.0.0.1:8080/completion",
json={"prompt": prompt, "temperature": 0, "n_predict": 320})
print(r.json()["content"])With transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tok = AutoTokenizer.from_pretrained("tardellirs/aac-board-generator-770m-ptbr")
model = AutoModelForCausalLM.from_pretrained("tardellirs/aac-board-generator-770m-ptbr", dtype=torch.float32)
INSTR = "Você monta pranchas de CAA (pictogramas, pt-BR). ... (same instruction as above)"
msgs = [{"role": "user", "content": INSTR + "\n\nPEDIDO: monta uma prancha de brincar no parquinho"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=320, do_sample=False)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))The exact production instruction is part of the Papuguinho pipeline; the snippet above is a faithful, self-contained example of the format the model expects.
Model details
- Architecture: Gemma 3 (
gemma3_text) decoder — unchanged from the base, except the vocabulary/embedding. - Lineage: Google Gemma 3 1B → distilled for AAC board generation (pt-BR) → vocabulary-trimmed from 262k to 64k tokens (the tokens actually used in pt-BR AAC), which shrinks the tied embedding / LM-head from ~302M to ~74M parameters → 771.6M total (down from ~1.0B).
- Why trim the vocabulary: on CPU, batch-1 decoding is memory-bandwidth-bound and the 262k-row LM-head dominates the cost. Trimming it to 64k makes decoding 1.34× faster with no change in output: the kept-token logits are identical and the tokenizer is reconstructed to be bit-exact on this domain, so greedy generation is preserved (verified — identical boards, identical internal judge score).
- Context / decoding: trained for short, deterministic generations (greedy / temperature 0), ~12-item boards.
Evaluation
On an internal held-out set of board requests, boards were scored 0–2 for overall quality by an LLM judge. The trimmed model matches its untrimmed Gemma-3-1B parent exactly (judge 1.92 = 1.92) while running 1.34× faster (≈ 25.8 → 34.7 tok/s on 4 CPU threads). In other words, the speed-up is free — the vocabulary trim removes only tokens that never occur in pt-BR AAC boards.
For higher throughput at a real quality cost, see the smaller **140M sibling** (≈ 1.72× faster than its parent, but a weaker base model).
Limitations & responsible use
- Domain-specific drafting tool. It proposes words for pictogram boards in Brazilian Portuguese; it is not a general assistant and should not be used for factual, medical, or open-ended dialogue.
- Small model, greedy generation. Outputs are short lists; expect occasional off-theme or repeated items. Keep a human in the loop — an AAC board should be reviewed by a therapist/caregiver before use.
- AAC serves vulnerable users (often non-verbal children). Treat generated words as a draft to confirm, not a final board.
License & attribution
- Released under the [Gemma license](https://ai.google.dev/gemma/terms), inherited from its Gemma 3 base. Your use must comply with the Gemma Terms of Use and Prohibited Use Policy.
- Built for the ARASAAC pictogram ecosystem. ARASAAC content (authored by the Government of Aragón) is distributed under CC BY-NC-SA; if you distribute pictogram content, follow ARASAAC's attribution and non-commercial terms.
Citation
Developed for and used in Papuguinho — www.papuguinho.com.
@software{aac_board_generator_770m_ptbr,
title = {AAC Board Generator 770M (pt-BR)},
author = {Stekel, Tardelli R. C.},
year = {2026},
url = {https://huggingface.co/tardellirs/aac-board-generator-770m-ptbr},
publisher = {Hugging Face},
note = {A CPU-friendly Brazilian-Portuguese model for generating AAC pictogram-board word lists, used in Papuguinho (www.papuguinho.com). Vocabulary-trimmed derivative of Gemma 3 1B.}
}