minilm-contracts-ft

all-MiniLM-L6-v2 fine-tuned to retrieve clause passages from commercial contracts (12 CUAD clause types). It is the retriever of the ContractLens project (measured retrieval and grounded answering on CUAD). This is a research/portfolio model, not legal advice.

Usage

from sentence_transformers import SentenceTransformer
model = SentenceTransformer("sindhisalam/minilm-contracts-ft")
emb = model.encode(["Which state's or country's law governs this contract?"], normalize_embeddings=True)

Training

  • Data: CUAD v1 (CC BY 4.0), 357 training contracts only; dev and test contracts were never used for training.
  • 9,655 triples: query (5 AI-drafted phrasings per clause type), positive chunk (800 chars), BM25 negative from the same contract.
  • 1 epoch, batch size 64, lr 2e-5, MultipleNegativesRankingLoss, NO_DUPLICATES batch sampler.
  • Trained on Kaggle with two GPUs (DataParallel) using sentence-transformers 5.7.0; one run, one seed.

Evaluation (sealed test split: 77 contracts, 421 answerable questions, single pass)

Retriever (dense, original question) Recall@1 Recall@5 MRR@10
base all-MiniLM-L6-v2 0.439 0.774 0.583
this model 0.765 0.950 0.848

Paired difference in Recall@1: +0.325 (95% CI +0.273 to +0.383, bootstrap over contracts). On two held-out phrasings never used in training, Recall@1 gains were +0.181 and +0.247.

Limitations

  • Trained and tested on the same 12 clause types; generalization to other clause types is not tested.
  • One training run and one seed; variance across seeds is not measured.
  • Question phrasings were drafted with AI assistance in a similar style.
  • CUAD contracts are mostly US commercial agreements (SEC exhibits).
  • Hard negatives were BM25 negatives, not mined from the dense model.

Attribution

Data: CUAD, Hendrycks et al., arXiv:2103.06268, CC BY 4.0. Base model: sentence-transformers/all-MiniLM-L6-v2.

Downloads last month
44
Safetensors
Model size
22.7M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for sindhisalam/minilm-contracts-ft

Paper for sindhisalam/minilm-contracts-ft