Views
No views yet
sentence-transformers/all-MiniLM-L6-v2
for Indian tax and finance question-answering retrieval.| Property | Value |
|---|---|
| Base model | all-MiniLM-L6-v2 (22.7M params) |
| Fine-tuning | LoRA (r=16, α=32, dropout 0.05) on query/key/value/dense |
| Trainable params | 675,840 — 2.89% of the model |
| Embedding dim | 384 |
| Max sequence length | 256 tokens |
| Loss | MultipleNegativesRankingLoss |
| Compute | GPU (Kaggle), P100 |
| License | Apache-2.0 (base model) |
| Metric | LoRA fine-tuned | Zero-shot baseline | Δ |
|---|---|---|---|
| nDCG@10 | 0.592 ± 0.001 | 0.447 | +0.145 |
| MRR@10 | 0.484 ± 0.002 | 0.361 | +0.123 |
| MAP@100 | 0.488 ± 0.002 | 0.373 | +0.115 |
| Recall@1 | 0.327 ± 0.002 | 0.250 | +0.076 |
| Recall@5 | 0.685 ± 0.001 | 0.496 | +0.189 |
| Recall@10 | 0.948 ± 0.002 | 0.735 | +0.212 |
| Accuracy@1 | 0.327 ± 0.002 | 0.250 | +0.076 |
1from sentence_transformers import SentenceTransformer
2
3model = SentenceTransformer("vivekkopthsd/minilm-l6-v2-taxfinance-lora")
4
5query = model.encode(
6 ["What is the deduction for rent paid on salary income?"],
7 normalize_embeddings=True,
8)
9docs = model.encode(
10 [
11 "Section 134: Deduction in respect of rent paid.",
12 "Section 123: Deduction for life insurance premium.",
13 ],
14 normalize_embeddings=True,
15)
16
17scores = query @ docs.Tligaments-dev/indian-income-tax-qa — 6,800 (question, answer) pairs from
Indian Income-Tax statutes, used as (query, positive-document) pairs.AIR-Bench/qa_finance_en (AIR-Bench_24.04) — 1,585 financial texts,
used as self-supervised pairs.MultipleNegativesRankingLoss: for each (query, positive) pair
in a batch, the positive is treated as the correct answer while all other
documents in the batch act as in-batch negatives. This is the standard
contrastive objective for dense retrieval.| Parameter | Value |
|---|---|
| Optimizer | AdamW (weight decay 0.01) |
| Learning rate | 2e-4 |
| Batch size | 32 |
| Scheduler | cosine with 10% warmup |
| LoRA rank / α | 16 / 32 |
| LoRA dropout | 0.05 |
| Epochs | 15 (elbow-selected ~4–5) |
| Max grad norm | 1.0 |
| Seeds | 42, 123, 456 |
1@misc{vivekkopthsd-minilm-l6-v2-taxfinance-lora,
2 title = {MiniLM-L6-v2 LoRA: Tax and Finance Retrieval},
3 author = {Vivek},
4 year = {2026},
5 url = {https://huggingface.co/vivekkopthsd/minilm-l6-v2-taxfinance-lora}
6}