Instructions to use narendarcodes/adaption-contract-clause-analyzer-109b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use narendarcodes/adaption-contract-clause-analyzer-109b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("togethercomputer/Llama-4-Scout-17B-16E-Instruct_bnb_4bit") model = PeftModel.from_pretrained(base_model, "narendarcodes/adaption-contract-clause-analyzer-109b") - Notebooks
- Google Colab
- Kaggle
Adaption AutoScientist β Contract Clause Analyzer (109B LoRA)
Powered by Adaptive Data β Adaption Labs
π― Core Problem Solved
Given a contract clause or legal fact pattern, this model classifies the clause type across 41 CUAD categories and applies the governing legal rule step-by-step β never fabricating citations or referencing statutes not in the provided text.
Specifically, this model performs:
- 41-Category CUAD Contract Clause Classification β "Given this contract paragraph, identify whether it contains an IP ownership clause, non-compete restriction, termination provision, indemnification obligation, or any of 41 other CUAD-defined clause types"
- Hearsay Admissibility Determination β "Given this witness statement and the circumstances of the utterance, determine if the statement qualifies as hearsay under evidence rules, applying each element of the hearsay definition"
- Tax Statutory Entailment β "Given this IRS tax statute and this taxpayer's fact pattern, determine whether the statute entails (supports) or contradicts the taxpayer's position, evaluating each statutory element against the facts"
Why This Matters
Legal professionals spend hundreds of hours per deal manually reviewing contracts clause-by-clause. Current LLMs hallucinate case citations, fabricate legal rules, and provide ungrounded conclusions. This model is trained to:
- Only reason from the text provided β never reference external cases
- Apply IRAC methodology β Issue β Rule β Application β Conclusion
- Show its legal reasoning in structured
<think>traces before reaching a<answer>
Model Details
| Field | Value |
|---|---|
| Trained Model Name | adaption_legal_breach_advisory_sample |
| Base Model | meta-llama/Llama-4-Scout-17B-16E-Instruct (109B MoE) |
| Training Method | Supervised Fine-Tuning (SFT) with LoRA |
| Training Platform | Adaption Labs AutoScientist |
| Language | English (en) |
| License | CC-BY-4.0 |
AutoScientist Platform Integration
The fine-tuning process was managed through the Adaption Labs AutoScientist platform, applying targeted data engineering and training constraints:
- Adaptive Data Pipeline: Enhanced dataset consistency and resolved syntax issues, upgrading the final data quality score from Grade B (9.0) to Grade A (9.8), representing an 8.9% improvement.
- Prompt Deduplication: Sanitized dataset to eliminate duplicate legal fact patterns, preventing the model from overfitting on specific contract types.
- Prompt Rephrase Constraint: Per system guidelines, prompt rephrasing was disabled to maintain statutory definitions and precise contract language.
- Reasoning Traces & Blueprint Constraints: Configured the model to utilize IRAC-style reasoning structures (Issue, Rule, Application, Conclusion). The blueprint enforces:
- Declaring the governing legal rule or contract clause category.
- Evaluating the fact pattern against the rule elements step-by-step.
- Strict grounding of conclusions in the provided context (refusing to cite external statutes or cases).
- Hyperparameter Optimization: Managed the SFT training configuration with LoRA targeting the MoE modules of meta-llama/Llama-4-Scout-17B-16E-Instruct.
- Evaluation: Validated the adapted model against the base model on held-out legal prompts using automated preference scoring.
π Dataset
- Dataset: narendarcodes/adaption-contract-clause-analyzer-dataset
- Size: 800 rows
- License: CC-BY-4.0
Source Data & Attribution:
| Source | Rows | What It Teaches | License |
|---|---|---|---|
| zenml/cuad-deepseek | ~550 | 41-category contract clause classification with DeepSeek reasoning | Apache-2.0 |
| nguha/legalbench (hearsay) | ~125 | Hearsay admissibility under evidence rules | CC-BY-4.0 |
| nguha/legalbench (sara_entailment) | ~125 | Tax statute entailment vs. fact patterns | CC-BY-4.0 |
| Metric | Before | After | Change |
|---|---|---|---|
| Grade | B | A | β¬οΈ |
| Score | 9.0 | 9.8 | +8.9% |
| Percentile | β | 78.4% | β |
βοΈ Training Configuration
| Hyperparameter | Value |
|---|---|
| Finetune Job ID | 38b574a3-841b-486a-9371-cd1b9ef6f759 |
| Training Experiment ID | 0ded6a5c-5597-4c3a-9ad1-3f3e4d6ce5eb |
| LoRA Rank (r) | 64 |
| LoRA Alpha | 128 |
| LoRA Dropout | 0 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, shared_expert.*, feed_forward.* |
| Epochs | 4 |
| Batch Size | max |
| Learning Rate | 5e-5 |
| LR Scheduler | Cosine (0.5 cycles) |
| Warmup Ratio | 0.05 |
| Weight Decay | 0.02 |
| Max Grad Norm | 1.0 |
π Evaluation Results
| Evaluation Set | Base Model | Adapted Model | Winner |
|---|---|---|---|
| On Your Dataset | 19% | 81% | β Adapted |
| Across Category (Held-out) | 35% | 66% | β Adapted |
How to Use
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-4-Scout-17B-16E-Instruct")
model = PeftModel.from_pretrained(base_model, "narendarcodes/adaption-contract-clause-analyzer-109b")
tokenizer = AutoTokenizer.from_pretrained("narendarcodes/adaption-contract-clause-analyzer-109b")
Citation
@misc{golla2026contractanalyzer,
title={Contract Clause Analyzer β CUAD Classification and Legal Rule Application via Grounded Reasoning},
author={Golla Narendar},
year={2026},
note={Trained using Adaption Labs AutoScientist platform. Powered by Adaptive Data.}
}
Powered by Adaptive Data β Adaption Labs
Built for the 2026 Adaption AutoScientist Challenge β Legal Category
Framework Versions
- PEFT 0.15.1
- Downloads last month
- -
Model tree for narendarcodes/adaption-contract-clause-analyzer-109b
Base model
meta-llama/Llama-4-Scout-17B-16E