Downloads · 30 days
0
RDTvlokip/Focal-15M-fr
Focal-15M-fr is a text generation model from RDTvlokip. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
⚠️ Preliminary results — 1 seed, variance not controlled. Every number below is a single training run evaluated once (50 prompts × 200 tokens, fixed seed). Directions are consistent, magnitudes are not validated. Trea…
Downloads · 30 days
0
Access
Public
Updated Jul 3, 2026
Repo size
60.1 MB
Likes
1
Public
Click a slice to open those files.
.pt60.1 MB · 98%
From the Hugging Face model README
⚠️ Preliminary results — 1 seed, variance not controlled. Every number below is a single training run evaluated once (50 prompts × 200 tokens, fixed seed). Directions are consistent, magnitudes are not validated. Treat as a lab notebook, not a benchmark.
Focal is a 15M-parameter French language model trained from scratch (no 🤗 Transformers, no pretrained weights) on a single GTX 1080 Ti. It is the in-domain member of a three-model family: a looped transformer with learned per-token adaptive halting using an absolute entropy threshold.
n_embd 256 / n_layer 8 / n_head 4 · context 768.bpe_tokenizer_32k.json).Focal is the in-domain model: learned halting acts as a training-time regularizer that sharpens quality on prompts close to the training distribution.
Same table on all three model cards, so the trade-off is visible everywhere. Auto = held-out corpus prompts (in-domain); Fixed = generic hand-written prompts (out-of-domain).
| Model | Val PPL ↓ | Coherence auto ↑ | Coherence fixed ↑ | Invented names auto ↓ | Prompt overlap auto ↑ |
|---|---|---|---|---|---|
| Baseline (vanilla) | 31.2 | 35.2 | 40.7 | 0.137 | 0.139 |
| Cadence (looped R=4) | 28.9 | 39.3 | 32.5 | 0.121 | 0.147 |
| Focal (absolute halt) | 29.1 | 44.1 | 29.1 | 0.103 | 0.176 |
| Nomade (percentile halt) | 31.0 | 36.3 | 41.8 | 0.094 | 0.126 |
No model wins everything — that is the result. Recurrence helps in-domain and hurts out-of-domain; the halting variants trade one for the other. Factuality is not improved by any of them (15M capacity ceiling).
Direct basis — the two from-scratch looped studies this work reproduces in French: Kohli et al. 2026 (arXiv:2604.07822, COLM) and Chen 2026 (arXiv:2603.21676).
Focal is a variant of LoopViT for autoregressive language, with halting learned during training (per token, entropy criterion). No claim of novelty — the ingredients are all prior work.
This model uses custom from-scratch code (not 🤗 Transformers). The code ships with the repo (model/, utils/), so a snapshot download is self-contained. Requires torch, huggingface_hub, tokenizers.
import sys, torch
from huggingface_hub import snapshot_download
repo = snapshot_download("RDTvlokip/Focal-15M-fr") # code + weights + tokenizer
sys.path.insert(0, repo)
from model.gpt2 import GPT2
from utils.tokenizer import GPT2Tokenizer
# The absolute-halting config travels inside the checkpoint — nothing extra to set.
model = GPT2.from_pretrained(f"{repo}/best_model.pt", device="cuda"); model.eval()
tok = GPT2Tokenizer(f"{repo}/bpe_tokenizer_32k.json")
ids = tok.encode("Au Moyen Âge, les chevaliers", add_special_tokens=True)
if ids and ids[-1] == tok.eos_token_id:
ids = ids[:-1] # drop trailing <eos> (keeps it on-topic)
out = model.generate(
torch.tensor([ids], device="cuda"),
max_length=80, temperature=0.8, top_k=40, top_p=0.9,
repetition_penalty=1.3, eos_token_id=tok.eos_token_id,
)
print(tok.decode(out[0].tolist(), skip_special_tokens=True))
Théo CHARLET — TSSR Graduate, AI/ML · Creator of AG-BPE · rdtvlokip.fr