Downloads · 30 days
48
18% of all-time downloads
JamesANZ/auslegal-slm
auslegal-slm is a text generation model from JamesANZ. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
A domain-specific Small Language Model fine-tuned on Australian legal documents from AustLII. This model is based on DistilGPT2 and has been adapted to generate text in the style of Australian legal documents.
Downloads · 30 days
48
18% of all-time downloads
All-time downloads
274
Public
Parameters
81.9M
655 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors328 MB · 100%
From the Hugging Face model README
A domain-specific Small Language Model fine-tuned on Australian legal documents from AustLII. This model is based on DistilGPT2 and has been adapted to generate text in the style of Australian legal documents.
This model is a fine-tune of distilgpt2, a distilled version of GPT-2 with 82M parameters.
The model was fine-tuned on a corpus of Australian legal documents scraped from AustLII. The training corpus consists of legal cases, legislation, and other legal documents from Australian jurisdictions.
Data Processing:
Training Hyperparameters:
Training Infrastructure:
| Metric | Value |
|---|---|
| Validation Loss | 3.19 |
| Perplexity | 24.34 |
| Training Loss | 3.29 |
Note: Lower perplexity indicates better performance. A perplexity of ~24 is reasonable for a domain-adapted model of this size.
This model is intended for:
⚠️ This model should NOT be used for:
Hallucination Risk: The model may generate plausible-sounding but incorrect legal information. Fine-tuning reduces but does not eliminate hallucinations.
Limited Coverage: Training on a relatively small corpus (~10,000+ documents) means the model may not have seen all areas of Australian law.
Temporal Limitations: Documents reflect the state of law at scraping time; laws may have changed since training.
Context Window: Limited to 512 tokens, restricting the amount of context the model can consider.
No Citations: The model doesn't explicitly cite sources (unlike RAG systems).
Generalization: May overfit to specific documents or underperform on unseen legal topics.
from transformers import GPT2LMHeadModel, GPT2Tokenizer
# Load model and tokenizer
model = GPT2LMHeadModel.from_pretrained("JamesANZ/auslegal-slm")
tokenizer = GPT2Tokenizer.from_pretrained("JamesANZ/auslegal-slm")
# Generate text
prompt = "In Australian law, negligence is defined as"
inputs = tokenizer.encode(prompt, return_tensors="pt")
outputs = model.generate(
inputs,
max_length=250,
temperature=0.4,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_text)
See the main repository README for detailed training configuration and code.
If you use this model, please cite:
@software{auslegal_slm,
title = {Australian Legal Small Language Model},
author = {James Sangalli},
year = {2025},
url = {https://github.com/JamesANZ/auslegal-slm}
}
For questions or issues, please open an issue in the repository.