/ Модель

Характеристики

Контекст
32 768 токенов
Параметры
1,5 млрд
Лицензия
Apache 2.0
Архитектура
qwen2 · dense
Базовая модель
Qwen2.5-1.5B-Instruct
Библиотека
transformers
Опубликована
28 окт 2026

ClauseLM-Qwen2.5-1.5B

Генерация текстаТекст → текст

Модель извлекает дословные фрагменты по 41 категории условий из англоязычных коммерческих договоров и возвращает их в JSON.

337скачиваний за 30 дней2лайкавеса обновлены28 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

ClauseLM-Qwen2.5-1.5B — языковая модель на 1,5 млрд параметров от Z-Nadjib, дообученная на базе Qwen/Qwen2.5-1.5B-Instruct для извлечения условий из коммерческих договоров. Она принимает фрагмент договора примерно до 6 000 символов и возвращает JSON с найденными фрагментами по 41 категории CUAD: например, стороны, даты, применимое право, продление, расторжение, лицензии, ответственность и страхование.

Значения приводятся дословно, в виде списков строк; обучение использовало QLoRA, а LoRA-веса объединены с базовой моделью. Модель рассчитана на англоязычные договоры, в основном связанные с практикой SEC США; в описании заявлен контекст базовой архитектуры до 32 768 токенов. На тестовой выборке CUAD из 102 договоров модель показала micro Span F1 57,2 и 100% пригодных JSON-ответов, но качество заметно различается по категориям. Лицензия — Apache-2.0.

Сценарии применения

  • извлечение сторон и дат из коммерческого договора
  • поиск применимого права и условий продления
  • извлечение условий расторжения и уведомления
  • поиск условий лицензирования интеллектуальной собственности
  • выделение положений об ответственности и страховании
  • структурирование договорных условий в JSON

Ограничения

Обучена на англоязычных договорах SEC США, поэтому другие языки, юрисдикции и типы документов находятся вне распределения обучения. Результаты по редким категориям менее надёжны; фрагменты возвращаются дословно, а вывод предназначен для помощи при проверке договора и не является юридической консультацией.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qwen2.5-1.5B CUAD Clause Extractor

A 1.5B parameter model that reads a commercial contract and returns a JSON object with the passages belonging to each of the 41 clause categories of CUAD: parties, dates, renewal terms, governing law, termination rights, restrictive covenants, licences, liability caps, insurance, audit rights and more. Every value is a verbatim span of the contract.

It is Qwen2.5-1.5B-Instruct fine-tuned with QLoRA on the CUAD training contracts, with the LoRA weights merged into the 16-bit base.

Results

102 contracts of the official CUAD test split, document level. A span is correct when its word-level Jaccard similarity with a gold span of the same field is at least 0.5.

SystemSpan F1 (micro)Span F1 (macro)Presence F1Grounded spansUsable JSONLatency / contract
This model57.243.280.998.6%100%18.0 s
Qwen2.5-1.5B-Instruct, zero-shot11.73.949.943.5%100%21.0 s
Legal-BERT NER (token classification)42.730.280.8100%n/a0.08 s
Llama-3.2-3B + QLoRA (same recipe)61.750.483.897.4%100%27.5 s

Latency is measured on one RTX 5080 (16 GB) with transformers in bf16, all windows of a contract in one batch. At an on-demand rental price of USD 0.40 per GPU hour this is USD 0.0020 per contract; the electricity cost at 360 W and USD 0.25 per kWh is USD 0.00045.

Best fields: governing law (86 F1), document name (87), expiration date (83), renewal term (83). Weakest fields: post-termination services (18), non-disparagement (8), third party beneficiary (9), most favored nation (0, 3 test spans).

Output format

Given a contract excerpt of up to about 6,000 characters, the model returns a compact JSON object containing only the fields it found. Values are lists of strings.

{"document_name": ["SUPPLY CONTRACT"], "insurance": ["To be covered by the Seller for 110% invoice value against All Risks and War Risk."]}

Field keys: document_name, parties, agreement_date, effective_date, expiration_date, renewal_term, notice_period_to_terminate_renewal, governing_law, most_favored_nation, non_compete, exclusivity, no_solicit_of_customers, competitive_restriction_exception, no_solicit_of_employees, non_disparagement, termination_for_convenience, rofr_rofo_rofn, change_of_control, anti_assignment, revenue_profit_sharing, price_restrictions, minimum_commitment, volume_restriction, ip_ownership_assignment, joint_ip_ownership, license_grant, non_transferable_license, affiliate_license_licensor, affiliate_license_licensee, unlimited_all_you_can_eat_license, irrevocable_or_perpetual_license, source_code_escrow, post_termination_services, audit_rights, uncapped_liability, cap_on_liability, liquidated_damages, warranty_duration, insurance, covenant_not_to_sue, third_party_beneficiary.

How to use

The model was trained with a fixed system prompt that lists the field definitions. The simplest way to get identical inputs, long-document chunking, grammar-constrained decoding and merging is the project package:

from contract_extractor.inference.base import ChunkedExtractor
from contract_extractor.inference.hf_backend import HFBackend

backend = HFBackend("Z-Nadjib/ClauseLM-Qwen2.5-1.5B", constrained=True)
extractor = ChunkedExtractor(backend, chunk_size=6000, chunk_overlap=600, batch_size=8)
result = extractor.extract(open("contract.txt").read())
print(result.extraction)

With transformers only, for one excerpt:

from transformers import AutoModelForCausalLM, AutoTokenizer
from contract_extractor.prompts import build_messages  # or copy SYSTEM_PROMPT from the repository

tokenizer = AutoTokenizer.from_pretrained("Z-Nadjib/ClauseLM-Qwen2.5-1.5B")
model = AutoModelForCausalLM.from_pretrained("Z-Nadjib/ClauseLM-Qwen2.5-1.5B", dtype="auto", device_map="auto")
prompt = tokenizer.apply_chat_template(build_messages(excerpt), tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
output = model.generate(**inputs, max_new_tokens=2048, do_sample=False, repetition_penalty=1.0)
print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Use greedy decoding without repetition penalty, as set in the bundled generation config: the outputs copy the input text, and a repetition penalty degrades copying.

Training

DataCUAD v1, 367 training contracts, 41 held out for validation (official train split)
Examples3,402 windows of 6,000 characters with 600 characters of overlap, 21% without any clause
MethodQLoRA (4-bit NF4 base), LoRA r=32, alpha=32, all linear projections
FrameworkUnsloth 2026.10.9, TRL 1.15.0, transformers 5.17.0
OptimisationAdamW 8-bit, learning rate 2e-4, cosine schedule, 3% warmup, effective batch 16, 2 epochs
Losscompletion (JSON) tokens only
Sequence length4,096 tokens
Hardwareone NVIDIA RTX 5080 (16 GB), 29 minutes

Evaluation

The full protocol, per-field scores and the constrained decoding ablation are in the project repository.

Limitations

  • Trained on English contracts filed with the US SEC. Other languages, jurisdictions and document types are out of distribution.
  • Spans are verbatim and not normalized (dates are returned as written).
  • Clause categories with few training examples (for example Source Code Escrow or Unlimited/All-You-Can-Eat License) are less reliable.
  • The output is an aid for contract review, not legal advice.

License

Apache 2.0, inherited from Qwen2.5-1.5B-Instruct. Training data: CUAD, CC BY 4.0, The Atticus Project.

Citation

@article{hendrycks2021cuad,
  title   = {CUAD: An Expert-Annotated NLP Dataset for Legal Contract Review},
  author  = {Hendrycks, Dan and Burns, Collin and Chen, Anya and Ball, Spencer},
  journal = {NeurIPS Datasets and Benchmarks},
  year    = {2021}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen2ForCausalLM
Ревизия весов
dd332cf

0 моделей