Downloads · 30 days
28
7% of all-time downloads
rzeraat/qwen-0.5b-law-phase1
qwen-0.5b-law-phase1 is a text generation model from rzeraat. 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.
This model is NOT suitable for legal advice or production use. It hallucinates case citations, confuses legal concepts, and produces factually incorrect information. This is an experimental model for educational purpo…
Downloads · 30 days
28
7% of all-time downloads
All-time downloads
427
Public
Parameters
494M
2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2 GB · 99%
From the Hugging Face model README
This model is NOT suitable for legal advice or production use. It hallucinates case citations, confuses legal concepts, and produces factually incorrect information. This is an experimental model for educational purposes only.
This is Qwen2.5-0.5B fine-tuned on a company law textbook through continued pretraining. The model learned legal vocabulary and writing style but exhibits significant factual inaccuracies and overfitting to the training data's structure.
Hyperparameters:
Infrastructure:
Loss Trajectory:
Step 1: 2.303
Step 100: 1.874
Step 200: 0.980
Step 300: 0.465
Step 400: 0.237
Final: 1.035 (average)
Educational demonstration of continued pretraining pipeline. This model is part of a three-phase learning experiment:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"your-username/qwen-0.5b-law-phase1",
device_map="auto",
trust_remote_code=True,
torch_dtype=torch.float16
)
tokenizer = AutoTokenizer.from_pretrained(
"your-username/qwen-0.5b-law-phase1",
trust_remote_code=True
)
# Generate (greedy decoding for stability)
prompt = "A corporation is"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=100,
do_sample=False,
pad_token_id=tokenizer.pad_token_id
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
✅ Generates grammatically correct legal text
✅ Uses appropriate legal terminology
✅ References Companies Act 2006 and case names
✅ Maintains coherent sentence structure
✅ No catastrophic collapse (no repetition/gibberish)
❌ Hallucinates case citations - Invents fake cases and misattributes legal principles
❌ Confuses case law - Misrepresents what famous cases established
❌ Overfitted to textbook format - Outputs exam questions instead of explanations
❌ Factual inaccuracies - Provides incorrect legal information
❌ No fact-checking - Cannot distinguish real from invented law
Prompt: "The doctrine of separate legal personality"
Output: "was developed by... Robert Goff and Sir Henry Price in... Bell v Lever Bros Ltd [1920]"
Reality: ❌ Completely false. The doctrine comes from Salomon v Salomon [1897], not Bell v Lever Bros.
Prompt: "In Macaura v Northern Assurance"
Output: "shareholders are entitled to the dividends..."
Reality: ❌ Wrong. Macaura is about insurable interest, not dividends.
DO NOT use this model for:
Misuse risks:
| Test Category | Result |
|---|---|
| Legal definitions | Coherent but sometimes wrong |
| Case law citations | Frequently hallucinates |
| Companies Act references | Better accuracy on Section 42 |
| Question answering | Mixed; sometimes outputs exam questions |
| Long-form generation | Coherent but factually unreliable |
| Edge cases | Handles unusual inputs without crashing |
Overall Assessment: Model learned legal writing style but not factual accuracy.
If you use this model for research on continued pretraining or domain adaptation:
@misc{qwen-law-phase1,
author = {Your Name},
title = {Qwen 0.5B Company Law Phase 1: Continued Pretraining Experiment},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/your-username/qwen-0.5b-law-phase1}},
note = {Experimental model - not for legal use}
}
[Your Name] - Experimental continued pretraining for educational purposes
For questions about the training methodology (not legal questions):
Version: 1.0 (Phase 1 only)
Last Updated: October 2025
Status: Experimental - Educational use only
This model card is honest about limitations while still documenting what was accomplished. Replace `your-username` and `[Your Name]` with your actual details before uploading.