CoolFace
Modelpublic

mufeedh28/dictalm2-israeli-law-pretrain-merged

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes20downloads
Model Card

DictaLM 2.0 - Israeli Law

A Hebrew legal language model fine-tuned on 140,000+ Israeli legal documents. Built for understanding, generating, and working with Israeli law, court rulings, and civil rights content.

Model Details

Base Modeldicta-il/dictalm2.0 (Mistral-based, 7B params)
TrainingContinued pretraining with QLoRA (4-bit) via Unsloth
LanguageHebrew
DomainIsraeli law, court rulings, legislation, civil rights
LicenseApache 2.0

Training Data

The model was trained on ~140,000 Israeli legal documents from four sources:

SourceDocumentsDescription
Israeli Courts (court.gov.il)~97,000Supreme Court and district court rulings
Kol-Zchut (kolzchut.org.il)~5,300Citizens' rights guides and legal explainers
Wikisource Laws~3,800Israeli legislation and basic laws
Total (after filtering)~106,000

Data Pipeline:

  • —Text cleaning and normalization (niqqud removal, whitespace, template stripping)
  • —PII scrubbing (Israeli ID numbers, phone numbers, emails, credit cards)
  • —Quality filtering (minimum length, Hebrew ratio, repetition, boilerplate)
  • —Near-deduplication via MinHash LSH (threshold 0.7)
  • —Source balancing: Kol-Zchut and Wikisource upsampled 5x to balance court dominance

Training Details

ParameterValue
GPUNVIDIA A100-SXM4-40GB
PrecisionBF16 + 4-bit QLoRA
LoRA rank64
LoRA target modulesq, k, v, o, gate, up, down projections
Trainable parameters167M / 7.4B (2.26%)
Batch size16 (4 x 4 gradient accumulation)
Learning rate2e-4 (cosine schedule)
Epochs1
Context length2,048 tokens
PackingEnabled
Training time~7.75 hours
FrameworkUnsloth + HuggingFace TRL

Training Loss

StepTrain LossVal Loss
5000.8500.827
10000.7810.816
20000.7940.801
40000.6970.782
60000.6360.770
80000.5640.769
87850.7000.769

Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("mufeedh28/dictalm2-israeli-law-merged")
tokenizer = AutoTokenizer.from_pretrained("mufeedh28/dictalm2-israeli-law-merged")

prompt = "בית המשפט העליון פסק כי"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7, top_p=0.9, repetition_penalty=1.15)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

With Unsloth (faster inference)

python
from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained("mufeedh28/dictalm2-israeli-law-merged")
FastLanguageModel.for_inference(model)

inputs = tokenizer("חוק יסוד: כבוד האדם וחירותו קובע כי", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Example Outputs

Prompt: חוק יסוד: כבוד האדם וחירותו קובע כי

כל אדם זכאי להגנה על חייו, גופו וכבודו. הזכות להגנה עצמית היא חלק מהזכות לכבוד. בנסיבות של הגנה עצמית מותר לאדם לתקוף את מי שמאיים עליו או תוקף אותו כדי להפסיק את התקיפה או למנוע אותה. שימוש בכוח במצב של הגנה עצמית מוגבל למידה הסבירה הדרושה בנסיבות המקרה.

Prompt: על פי חוק השכירות והשאילה

שטר-חוב הוא סוג מסוים של ערובה שמותר לדרוש משוכר דירה להפקיד בידי המשכיר. שטר-החוב צריך לעמוד בכל התנאים הבאים כדי שיהיה תקף: שוכרי הדירה יהיו רשומים בו כחייבים, על שטר החוב יופיע סכום כספי, השטר יהיה בר פרעון באופן מיידי עם דרישה של בעל הדירה.

Intended Use

  • —Legal text completion and generation
  • —Hebrew legal NLP research
  • —Legal document understanding and analysis
  • —Building legal search and retrieval systems
  • —Educational tools for Israeli law

Limitations

  • —This is a text completion model, not a chatbot. It continues text, not answers questions.
  • —May generate plausible-sounding but incorrect legal information. Do not use as legal advice.
  • —Trained primarily on court rulings — may be less knowledgeable about specific regulatory domains.
  • —May occasionally reproduce patterns from training data.
  • —Hebrew-only. Performance on other languages will match the base DictaLM 2.0 model.

Citation

bibtex
@misc{dictalm2-israeli-law,
  title={DictaLM 2.0 - Israeli Law},
  author={Mufeed Haj},
  year={2026},
  url={https://huggingface.co/mufeedh28/dictalm2-israeli-law-merged},
  note={Fine-tuned from dicta-il/dictalm2.0 on Israeli legal corpus}
}

Acknowledgments