forocoches-lm v2

Gemma 3 1B (pretrained) fully fine-tuned to write Spanish forum threads in the style of ForoCoches: title, opening post and replies, conditioned on a thread type. Demo at forocoches.m19182.dev (runs in the browser with the q4f16_1 MLC weights).

Prompt format

Plain text. Optional header line, then the title, then posts separated by blank lines. Authors are pseudonymised (OP, forero_a, forero_b, ...). Quotes are [cita=forero_a]...[/cita].

tipo: historia

TÍTULO: Lo que me ha pasado hoy en el Mercadona +tocho

#1 OP: Bueno shurs, ayer por la tarde...

#2 forero_a: ...

tipo is one of historia, pregunta, debate, noticia, humor, hipotetico, otro. Omit the header for an unconditioned thread. The model was trained with tipo only (v1 also saw calidad and páginas).

from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("mateo-19182/forocoches-lm-v2")
model = AutoModelForCausalLM.from_pretrained("mateo-19182/forocoches-lm-v2", dtype="bfloat16", device_map="auto")
ids = tok("tipo: pregunta\n\nTÍTULO:", return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=300, do_sample=True, temperature=0.8, top_p=0.95, repetition_penalty=1.1)
print(tok.decode(out[0], skip_special_tokens=True))

Training

  • Data: ~496M tokens, one epoch. Public ForoCoches archive 2018–2019 (Atenrev/forocoches-language-generation), up to 30 posts per thread, sales threads excluded, exact duplicates removed, 1% of threads held out. Stories sampled ×2, the rest ×1, plus 8% general-Spanish replay from FineWeb-2 (spa_Latn). Long threads split into 4,096-token chunks with 256 tokens of masked context.
  • Thread types labelled from the opening post with Claude Haiku.
  • Full fine-tune with Unsloth + TRL + FlexAttention on one RTX 3090: packed 4,096-token rows, 16 rows per step (65,536 tokens/step), 7,654 steps, lr 2e-5 cosine with 3% warmup, weight decay 0.01, bf16 compute with fp32 master weights. Completion-only loss: the header conditions and is not predicted. 26 h.
  • Final eval loss 1.992 (v1: 2.026 on its own validation set).

Evaluation

Completion perplexity on 4,873 held-out threads (same set for every model), lower is better.

base v1 v2
all forum text 11.11 7.08 6.81
historia 11.88 7.87 7.63
humor 12.53 6.60 6.40
debate 11.42 7.24 7.01
pregunta 10.58 6.95 6.65
general Spanish (control) 13.19 12.82 13.03

The control row (FineWeb-2 held-out) shows no forgetting of general Spanish. Perplexity does not measure story quality: short replies read well, long opening posts drift after ~150 tokens, as expected from a 1B model.

Limitations

Hobby/research artefact. It writes forum text, including the rude, sexist and otherwise offensive parts of the source. Pseudonymisation covers authors in the thread; a few @mentions of other usernames survived in the training text and the model can produce nickname-like strings. Spanish from Spain, 2018–2019 topics.

Weights are bf16 (2 GB). Base model terms: Gemma Terms of Use.

Downloads last month
26
Safetensors
Model size
1.0B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mateo-19182/forocoches-lm-v2

Finetuned
(428)
this model
Quantizations
1 model

Dataset used to train mateo-19182/forocoches-lm-v2