forocoches-lm v3

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 and a year. Demo at forocoches.m19182.dev (runs in the browser with the q4f16_1 MLC weights).

v3 continues from v2 on forocoches-threads-v3, which adds long stories and threads from 2003–2026. Compared with v2 it writes long opening posts that stay coherent, with paragraphs, edits and a closing summary, instead of drifting into run-on text.

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 | año: 2024

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

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

#2 forero_a: ...

The header takes tipo (historia, pregunta, debate, humor, hipotetico) and año (2003–2026), in that order. Each field was dropped half of the time in training, so either can be left out, as can the whole header.

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

Training

  • Init: forocoches-lm v2 (itself ~496M tokens on the 2019–2020 archive).
  • Data: 545.5M completion tokens, one epoch, from forocoches-threads-v3:
    • stories ×2: 280M;
    • October 2026 crawl threads: 120M;
    • a 90M sample of the archive threads;
    • 56M general-Spanish replay from FineWeb-2 (spa_Latn).
  • Long threads are split into 8,192-token chunks with 256 tokens of masked context.
  • Thread types and quality were labelled with Claude Haiku. Only media/alta quality threads of the five types above are kept.
  • Year of the opening post: archive years are estimated from the nearest crawled thread ID.
  • Full fine-tune with Unsloth + TRL + FlexAttention on one RTX 5090:
    • packed 8,192-token rows, 8 per step (65,536 tokens/step), 8,396 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.
    • 8 h.
  • Final eval loss 2.168 on the v3 validation set, which has longer stories than v2's.

Evaluation

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

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

On v3's own validation set (3,280 threads with more long stories), v3 vs v2:

  • historia: 12.31 → 10.46
  • all: 9.90 → 8.78

Limitations

Hobby/research artefact. It writes forum text, including the rude, sexist and otherwise offensive parts of the source, and states made-up facts confidently. Opening posts tagged as stories sometimes turn into encyclopedic articles. Authors are pseudonymised and usernames of five or more characters masked; shorter ones and a few @@nick forms survived. Spanish from Spain.

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

Downloads last month
21
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-v3

Finetuned
(1)
this model
Quantizations
1 model

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