Tyness BOE 1.2B — Pre-Alpha 2 (RAG-style grounded SFT)
Second pre-alpha from Tyness Train, an agent-guided fine-tuning harness for small LLMs on low-VRAM GPUs. This model is RAG-style grounded: every prompt carries excerpts of the relevant norm, and the model is trained to answer only from that context.
⚠️ Status: PRE-ALPHA. Grounded answering works partially (35% of eval items judged partially correct; mean judge score 0.267, 53× better than the first pre-alpha), but structured outputs still degrade. Always verify against boe.es.
Model description
| Base model | LiquidAI/LFM2.5-1.2B-Base (1.2B, hybrid conv+attention, 32K context) |
| Task | Context-grounded Spanish law Q&A: answer exclusively from the provided norm excerpts |
| Method | QLoRA SFT (TRL, NF4 + double quant, fp32 compute) with CONTEXTO-in-prompt training |
| Hardware | NVIDIA GTX 1060 6GB (Pascal, sm_61) — 2016 consumer GPU |
| Training | 16.8h · 432 steps · 6 epochs · 8.7M tokens · loss 0.773 · token accuracy 87.5% |
| Author | jasonjimnz |
Why grounded SFT (the experiment behind this model)
Three iterations established that SFT alone teaches format, not facts on 1.2B models:
| Version | Approach | Mean judge score |
|---|---|---|
| pre-alpha 1 | plain SFT (facts memorization attempt) | 0.005 |
| run2 | more SFT (6 ep, r=32, 2.2× tokens) | 0.035 |
| pre-alpha 2 (this) | RAG-style grounded SFT | 0.267 |
Full log: eval-report.md and finding-sft-format-not-facts.md.
Training data
Source: consolidated Spanish legislation (BOE open data) via legalize-es, with teacher-generated ChatML entries from es-legal-priv. 10 BOE articles, 1,148 train + 20 held-out eval items:
| BOE id | Norm | Train | Eval |
|---|---|---|---|
| BOE-A-2026-14659 | Ley 8/2026, Ordenación del Transporte Marítimo de Cantabria | 118 | 2 |
| BOE-A-2020-7440 | Decreto-ley 9/2020 (ayudas COVID, Extremadura) | 142 | 2 |
| BOE-A-2021-10163 | Orden HAC/612/2021, modelo 179 | 118 | 2 |
| BOE-A-2019-18746 | Orden HAC/1270/2019 | 118 | 2 |
| BOE-A-2016-9637 | Orden INT/1676/2016 | 118 | 2 |
| BOE-A-1995-19198 | Acuerdo transporte internacional por carretera | 119 | 2 |
| BOE-A-1996-6400 | RD 330/1996, traspaso de funciones | 60 | 2 |
| BOE-A-1975-9248 | Ley 17/1975, Organismo «Registro de Matrícula…» | 118 | 2 |
| BOE-A-2014-10908 | Orden HAP/1949/2014, Punto General de Entrada | 119 | 2 |
| BOE-A-1993-10089 | RD 562/1993 | 118 | 2 |
Methodology (RAG-style):
- Each entry cites specific precepts (
articulos_citados); those sections are extracted from the norm markdown and embedded as aCONTEXTOblock in the user turn (up to 9,000 chars). - The system prompt enforces grounded behavior: answer only from the context; say «No consta en el contexto proporcionado» otherwise.
- Loss on assistant tokens only. Provenance metadata strictly separated from training.
- Held-out eval (2/article) with the same grounded format, judged by an LLM referee (glm5.3-flash): correct / partial / incorrect + score + reason.
Training configuration
| Parameter | Value |
|---|---|
| LoRA r / alpha / dropout | 16 / 32 / 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Learning rate / scheduler | 2e-4 / cosine, warmup 12 steps |
| Epochs | 6 |
| Effective batch | 1 × 16 |
| Sequence length | 2048 (fp32 ceiling on 6GB; see notes) |
| Quantization | NF4 4-bit + double quant, fp32 compute (Pascal) |
| Optimizer | paged_adamw_32bit |
Evaluation (held-out, LLM-judged)
| Metric | Value |
|---|---|
| Correct | 1/20 |
| Partial | 7/20 (35%) |
| Mean judge score | 0.267 (pre-alpha 1: 0.005) |
What works: grounded reading of provided precepts, correct norm identification, refusal
format, legal register. What fails: exact-structure outputs (JSON fichas), precise deadlines,
some citation loops. Details per item in eval-report.md.
How to run
llama.cpp (all quantizations included)
# 4-bit
llama-cli -hf jasonjimnz/tyness-boe-1.2b-pre-alpha-2:Q4_K_M --jinja -c 16384
# OpenAI-compatible server (recommended: paste norm excerpts as context)
llama-server -m tyness-boe-1.2b-pre-alpha-2-q4_k_m.gguf -ngl 99 -c 16384 --port 8080 --jinja
curl http://127.0.0.1:8080/v1/chat/completions -d '{
"messages": [
{"role":"system","content":"Eres un jurista experto en el BOE. Responde ÚNICAMENTE con el CONTEXTO. Si un dato no consta: No consta en el contexto proporcionado."},
{"role":"user","content":"CONTEXTO:\n<paste relevant norm paragraphs here>\n\nPREGUNTA: ¿…?"}
],
"temperature": 0
}'
transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("jasonjimnz/tyness-boe-1.2b-pre-alpha-2", dtype="auto")
tok = AutoTokenizer.from_pretrained("jasonjimnz/tyness-boe-1.2b-pre-alpha-2")
messages = [
{"role": "system", "content": "Eres un jurista experto en el BOE. Responde ÚNICAMENTE con el CONTEXTO proporcionado; si un dato no consta, responde: No consta en el contexto proporcionado."},
{"role": "user", "content": "CONTEXTO:\n...\n\nPREGUNTA: ..."},
]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
Files
| File | Format | Size |
|---|---|---|
model.safetensors | safetensors bf16 | 2.2GB |
tyness-boe-1.2b-pre-alpha-2-f16.gguf | GGUF F16 | 2.2GB |
tyness-boe-1.2b-pre-alpha-2-q8_0.gguf | GGUF Q8_0 | 1.2GB |
tyness-boe-1.2b-pre-alpha-2-q4_k_m.gguf | GGUF Q4_K_M | 698MB |
Limitations
- Partially grounded at best (35%): expect incomplete or mangled structured answers.
- Trained on 10 norms; out-of-scope norms are untested.
- Base (non-instruct) lineage: chat behavior comes purely from SFT.
- fp32 compute only on Pascal; 6GB VRAM caps training context at 2048 tokens.
- Spanish only. Never use for real legal guidance.
Attribution
Base model: LiquidAI (LFM Open License v1.0). Data: Agencia Estatal Boletín Oficial del Estado, reused per its open-data conditions, via legalize-es.
Trained and published with Tyness Train v0.4.15 — Pre-Alpha 2, October 2026.