This model fine-tunes
Qwen2.5-1.5B-Instruct using
LoRA (Low-Rank Adaptation) on the
CUAD dataset for
legal contract Q&A.
It helps extract clauses and answer questions about contracts, such as termination conditions or exclusivity obligations.
1from transformers import pipeline
2
3generator = pipeline("text-generation", model="ArielZamir23/legal-assistant-qwen2_5-1_5b-lora")
4
5question = "What is the termination clause in this contract?"
6output = generator([{"role": "user", "content": question}], max_new_tokens=256)
7
8print(output[0]["generated_text"])
This Agreement shall terminate automatically at any time upon expiration of 12 months from the date it was executed or if the Parties do not enter into an agreement to continue providing Services pursuant to this Agreement within [***] after such expiration (the "Initial Term").
-
Base model: Qwen2.5-1.5B-Instruct
-
Dataset: CUAD (Contract Understanding Atticus Dataset)
-
Method: LoRA fine-tuning with Hugging Face trl + peft
-
Hardware: Google Colab (T4 GPU)
-
Tracking: Weights & Biases
-
Contract analysis → extract clauses like termination, exclusivity, confidentiality
-
Legal Q&A → answer questions about contract obligations
-
Educational tool → show domain adaptation of LLMs
-
Not a substitute for professional legal advice
-
Answers are dataset-dependent (may not generalize to all contracts)
-
Sensitive to prompt phrasing
The full training pipeline, dataset preprocessing, and documentation are available in the GitHub repository:
👉
arielzamir/qwen2.5-finetuned-legal-assistant
1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}