Stee201/lira-smollm3-3b-ita-sipar-3reg
LIRA — SmolLM3 3B, Italian
Italian personal-finance question answering, grounded in material published by CONSOB, that writes the same answer at three different reading levels.
Design label: smollm3-3b_ita_siaddestr_sipar_3reg — trained with the retrieved paragraphs in the prompt and with all three registers. This is the deployed configuration of the LIRA system.
What is in this repository
The two GGUF files are the same model, only quantised differently. Pick Q8_0 unless memory is tight.
How to prompt it — read this first
The adapter is trained for retrieval-augmented use and will not behave correctly without the retrieved passages. Every training example carries six passages in the system prompt, so it has to be prompted the same way:
Sei un assistente di finanza personale. L'utente ha conoscenze di finanza intermedie. Puoi introdurre alcuni termini tecnici, ma sempre accompagnati da una spiegazione.
REGOLE: Rispondi SOLO usando i documenti seguenti. Non inventare. Non dare consigli specifici di investimento. Rispondi in italiano in modo conciso.
DOCUMENTO [<id del passaggio>]:
<testo del passaggio>
DOCUMENTO [<id del passaggio>]:
<testo del passaggio>
... sei in tutto ...followed by the user's question as a normal user turn.
The sentence about the reader's level is what selects the register. There are three, and they are the exact strings the model was trained on:
Swap that sentence and the same question comes back rewritten for that reader — shorter and plainer for base, roughly three times longer for advanced.
Quick start
With llama.cpp (4-bit):
llama-server -hf Stee201/lira-smollm3-3b-ita-sipar-3reg:Q4_K_MWith transformers + peft (the adapter on top of the base model):
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "HuggingFaceTB/SmolLM3-3B"
model = AutoModelForCausalLM.from_pretrained(base, dtype="float16", device_map="auto")
model = PeftModel.from_pretrained(model, "Stee201/lira-smollm3-3b-ita-sipar-3reg")
tok = AutoTokenizer.from_pretrained(base)
messages = [
{"role": "system", "content": system_prompt_with_six_passages},
{"role": "user", "content": question},
]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
print(tok.decode(model.generate(ids.to(model.device), max_new_tokens=512)[0]))Retrieval in the paper is plain BM25 Okapi over 522 CONSOB paragraphs, top 6 — the same retriever at training and at serving time.
How well it does
Judge: Unbabel/M-Prometheus-14B, 1–5, on 174 held-out questions that appear nowhere in training.
Without the retrieved passages, correctness at intermediate drops to 2.57 (from 4.24): the model is trained to compose its answer out of the documents, so it depends on them.
Groundedness at advanced is lower than at intermediate across all six models. That is a property of the register, not invention: of the words used in the answers the judge marked down, only ~1.6% appear in none of the six passages — the same share as in the answers it approved.
Training
LoRA rank 8, alpha 16, dropout 0.05, on the attention and feed-forward projections, loss on the answer tokens only. 4 epochs, learning rate 5e-5, checkpoint chosen by lowest validation loss. Passage order is shuffled per example and per epoch.
Training examples are byte-for-byte identical in shape to what the server sends (persona + level instruction + six documents + question); the base and advanced variants of each answer were generated by a language model constrained to rephrase only the aligned source paragraph, then filtered by six automatic checks.
Limitations
- It needs its passages. Correctness without them is far below the numbers above.
- It is grounded in CONSOB material only, and answers nothing outside it.
- It gives no specific investment advice, by construction, and must not be used as financial advice.
- The judge is a model (
M-Prometheus-14B), not a human panel.
The other five models
- `Stee201/lira-gemma3-270m-ita-sipar-3reg` — Gemma 3 270M, Italian
- `Stee201/lira-gemma3-270m-ing-sipar-3reg` — Gemma 3 270M, English
- `Stee201/lira-gemma3-1b-ita-sipar-3reg` — Gemma 3 1B, Italian
- `Stee201/lira-gemma3-1b-ing-sipar-3reg` — Gemma 3 1B, English
- `Stee201/lira-smollm3-3b-ing-sipar-3reg` — SmolLM3 3B, English
The GGUF files contain SmolLM3 weights with the adapter merged in; SmolLM3 is Apache-2.0, and so is the adapter.
Replaces `Stee201/smollm3-3b-finance-it`, which held the same adapter under the older naming and only the 8-bit file.
