Saul-7B Canadian Tax Law (DPO-Aligned)
This is a DPO-aligned version of Equall/Saul-7B-Instruct-v1 fine-tuned on Canadian Tax Law with Direct Preference Optimization.
Model Description
- Base Model: Saul-7B-Instruct-v1 (Legal domain specialist)
- Training: SFT (day3) + DPO alignment (day6)
- Domain: Canadian Income Tax Act & Excise Tax Act
- Training Data: 10,180 Q&A pairs + 900 preference pairs
- Hardware: NVIDIA RTX A6000 48GB
- Training Time: ~3-4 hours total (SFT + DPO)
Training Details
SFT Phase (day3)
- Supervised fine-tuning on Canadian tax Q&A pairs
- LoRA adapter (rank=16, alpha=32)
- 3 epochs, FP16 precision
DPO Phase (day6)
- Direct Preference Optimization for alignment
- Trained on preference pairs (chosen vs rejected responses)
- Beta=0.1, 2 epochs
- Optimized for RTX A6000 with TF32
Improvements over SFT-only
DPO alignment provides:
- โ Fewer hallucinations (more accurate citations)
- โ More precise legal terminology
- โ Better instruction following
- โ More helpful and relevant responses
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model
model = AutoModelForCausalLM.from_pretrained(
"Christine-HiAiPerf/saul-7b-canadian-tax-dpo",
torch_dtype=torch.float16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Christine-HiAiPerf/saul-7b-canadian-tax-dpo")
# Generate response
question = "What is Section 118 of the Income Tax Act?"
prompt = f"<s>[INST] {question} [/INST]"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=300)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response.split("[/INST]")[1])
Training Configuration
# DPO Settings
BATCH_SIZE = 4
GRADIENT_ACCUMULATION = 4
LEARNING_RATE = 5e-7
EPOCHS = 2
BETA = 0.1
# Optimization (RTX A6000)
- FP16 precision
- TF32 enabled
- Fused AdamW optimizer
- No gradient checkpointing
Limitations
- Trained specifically on Canadian federal tax law
- May not cover provincial tax differences
- Not a replacement for professional tax advice
- Based on training data available up to training time
Citation
If you use this model, please cite:
@misc{saul-7b-canadian-tax-dpo,
author = {Christine-HiAiPerf},
title = {Saul-7B Canadian Tax Law (DPO-Aligned)},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/Christine-HiAiPerf/saul-7b-canadian-tax-dpo}
}
License
Apache 2.0 (same as base Saul-7B model)
Acknowledgments
- Base model: Equall/Saul-7B-Instruct-v1
- Training framework: HuggingFace Transformers + TRL (DPO)
- LoRA: PEFT library
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for Christine-HiAiPerf/saul-7b-canadian-tax-dpo
Base model
Equall/Saul-7B-Instruct-v1