Downloads · 30 days
8
11% of all-time downloads
Ace-2504/slm-500m-sft-dpo
slm-500m-sft-dpo is a text generation model from Ace-2504. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
500M · DPO — the QA model aligned with Direct Preference Optimization.
Downloads · 30 days
8
11% of all-time downloads
All-time downloads
72
Public
Parameters
518M
1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1 GB · 100%
From the Hugging Face model README
500M · DPO — the QA model aligned with Direct Preference Optimization.
One of 13 models in a controlled study of how far a small language model can be pushed on US legal and financial text. Every version was trained on the same data, evaluated on the same frozen held-out set, and scored by the same blind LLM judge, so the stages are directly comparable. Compare them side by side in the SLM Arena.
Trained and aligned by Harman Sandhu (Vizuara AI Labs).
| Base model | Ace-2504/slm-500m-sft |
| Method | DPO (full fine-tune) |
| Parameters | 517.8M |
| Trainable parameters | 517.8M (all) |
| Training data | 500 AI-judged preference triplets |
| Schedule | 3 epochs · 750 |
| Compute | 3.9 min on L4 (Modal) |
| Cost | $1.23 total lineage |
| Judge score | 3.99 / 10 |
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL = "Ace-2504/slm-500m-sft-dpo"
model = AutoModelForCausalLM.from_pretrained(MODEL, torch_dtype=torch.bfloat16).eval()
tok = AutoTokenizer.from_pretrained(MODEL)
SYS = ('You are a precise legal and financial assistant. Answer clearly using the '
'provided context; do not invent facts.')
user = 'Context:\n<passage>\n\nQuestion: <your question>'
# Custom chat scheme. NOTE: never prepend <|bos|> — it was left untrained.
prompt = f'<|system|>\n{SYS}<|eos|>\n<|user|>\n{user}<|eos|>\n<|assistant|>\n'
enc = tok(prompt, return_tensors='pt', add_special_tokens=False).to(model.device)
eos = tok.convert_tokens_to_ids('<|eos|>')
out = model.generate(**enc, max_new_tokens=160, eos_token_id=eos,
pad_token_id=eos) # pad and eos share an id here
print(tok.decode(out[0, enc['input_ids'].shape[1]:], skip_special_tokens=True))
Scored on 500 decontaminated held-out questions (chunk-level dedup against public legal benchmarks, so no evaluation passage was trained on). Every model in the study answered the identical questions with deterministic greedy decoding, and a Gemini judge blind to the model graded each answer with the gold answer in hand.
| Metric | Value |
|---|---|
| Judge score (0–10 rubric) | 3.99 |
| Judged correctness (0–1) | 0.279 |
| Groundedness | 46.2% |
| Fabrication ↓ | 6.6% |
| Token-F1 | 0.224 |
| n | 500 |
By source:
| US case law | SEC filings | Educational web |
|---|---|---|
| 5.04 | 3.57 | 3.45 |
The 0–10 figure is a four-dimension rubric (correctness 0–5 + completeness 0–2 + groundedness 0–2 + clarity 0–1). The 0–1 figure is the stricter correctness-only scale used in the experiment reports. Same questions, same answers, same judge — different scale, so the two numbers differ.
Token-F1 is reported for completeness and should not be read as quality: it punishes correct paraphrase heavily, which is exactly why the judge carries the headline.
| Class | LlamaForCausalLM |
| Layers | 24 |
| Hidden size | 1,280 |
| Attention | 20 heads · head dim 64 · full MHA |
| Feed-forward | SwiGLU · inner 3,456 |
| Positional | RoPE · θ 10,000 |
| Norm | RMSNorm · ε 1e-5 |
| Context | 1,024 tokens |
| Vocabulary | 32,768 |
| Embeddings | tied input/output |
Ace-2504/slm-500m-sftCost — $1.23. The base was imported, so only this project's own work is counted: $1.23 of Modal GPU time and shared dataset generation.
| Size | Base | QA SFT | RAFT | DPO | RLAIF |
|---|---|---|---|---|---|
| 125M | slm-125m-e4 | slm-125m-sft | slm-125m-raft | slm-125m-sft-dpo | slm-125m-sft-rlaif |
| 500M | slm-500m-base | slm-500m-sft | slm-500m-raft | slm-500m-sft-dpo | slm-500m-sft-rlaif |
| Gemma 2B | gemma-2-2b-it | gemma-2-2b-sft | gemma-2-2b-raft | gemma-2-2b-sft-dpo | gemma-2-2b-sft-rlaif |
All under Ace-2504 except the two imported bases.
This model has its own write-up — training details, cost breakdown and live demo — at https://slm-500m-dpo-harman.vercel.app.
@misc{sandhu2026slm,
title = {Small Language Models for Legal and Financial Text: a controlled study of
pretraining, instruction tuning, retrieval augmentation and alignment},
author = {Harman Sandhu},
year = {2026},
note = {https://slm-arena-harman.vercel.app}
}