/ Модель

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

Контекст
2 048 токенов
Параметры
2,3 млрд
Размер весов
11,4 ГБ
Лицензия
Apache 2.0
Архитектура
parambharatgen · dense
Библиотека
transformers
Опубликована
4 сен 2025

LegalParam

Генерация текстаТекст → текст3 профессии

Двуязычная модель BharatGen для ответов на вопросы об индийском праве, суммаризации юридических документов и упрощения нормативных текстов.

207скачиваний за 30 дней11лайковвеса обновлены24 фев 2026

Бенчмарки

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

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

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

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

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

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

LegalParam — специализированная языковая модель BharatGen для вопросов по индийскому праву. Она дообучена на базе Param-1-2.9B-Instruct на корпусе индийских законов, политик и нормативных актов; в карточке указано 2,3 млрд параметров. Модель предназначена для ответов на юридические вопросы, краткого изложения правовых документов и упрощения сложных текстов о политике и регулировании.

Модель использует плотную архитектуру ParamBharatGenForCausalLM с grouped-query attention и контекстом до 2048 токенов. Она рассчитана на работу на английском и хинди, поддерживает диалоговый режим и распространяется в формате Safetensors для Transformers. Лицензия — Apache-2.0.

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

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

Ограничения

Специализация модели ориентирована на индийское законодательство, поэтому её ответы могут быть неприменимы к другим юрисдикциям. Контекст ограничен 2048 токенами; юридические ответы следует проверять по актуальным первоисточникам.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

LegalParam

BharatGen introduces LegalParam, a domain-specialized large language model fine-tuned from Param-1-2.9B-Instruct on an exhaustive India-centric legal dataset. Trained across a comprehensive taxonomy of acts, laws, policies, and regulations, LegalParam is built to deliver accurate, context-aware answers to legal queries while also supporting tasks such as summarizing lengthy legal documents and simplifying complex policy texts. Whether it’s aiding practitioners with quick references, assisting researchers in exploring legal frameworks, or helping citizens better understand their rights and obligations, LegalParam brings clarity and accessibility to the vast and intricate landscape of Indian law.


⚖️ Motivation

Law in India is vast, complex, and ever-evolving, yet most language models lack the depth and domain specialization needed to navigate acts, policies, and regulations in an India-centric context. Citizens, researchers, and practitioners often struggle with scattered information and dense legal language that is hard to interpret. LegalParam bridges this gap by combining Param-1’s strong instruction-following capabilities with a meticulously curated, exhaustive dataset of Indian laws, policies, and regulations, making legal knowledge more accessible, contextual, and actionable.


🏗 Model Architecture

LegalParam inherits the architecture of Param-1-2.9B-Instruct:

  • Hidden size: 2048
  • Intermediate size: 7168
  • Attention heads: 16
  • Hidden layers: 32
  • Key-value heads: 8
  • Max position embeddings: 2048
  • Activation: SiLU
  • Positional Embeddings: Rotary (RoPE, theta=10000)
  • Attention Mechanism: Grouped-query attention
  • Precision: bf16-mixed
  • Base model: Param-1-2.9B-Instruct

📚 Data Preparation

LegalParam’s training corpus was designed to ensure comprehensive coverage of Indian legal knowledge and high-quality instruction tuning along with bilingual (Hindi + English) accessibility.

Steps involved:

  1. Source Gathering

    • Open-source datasets on Indian laws, acts, and policies were collected and curated. Historical data (for acts and laws) for more grounded training
  2. Question Generation

    • Q&A pairs were generated from acts and legal texts to create grounded supervision signals
  3. Domain Taxonomy & Personas

    • An exhaustive taxonomy of the Indian legal framework was built.
    • Personas such as citizen, lawyer, policymaker, and researcher were defined to guide synthetic data generation.
  4. Dataset Construction

    • ~2M Q&A pairs curated from open sources.
    • Additional synthetic data grounded in taxonomy and personas expanded the dataset.
    • In total, 5M Q&A pairs were used for fine-tuning.

🏋️ Training Setup

  • Base model: Param-1-2.9B-Instruct
  • Training framework: Hugging Face + torchrun multi-node setup
  • Prompt template: Custom-designed for legal inference
  • Scheduler: Linear with warmup
  • Epochs: 3
  • Total training samples: 12M
  • Test samples: 1.2M
  • Base learning rate: 5e-6
  • Minimum learning rate: 0
  • Additional tokens: <system>, <user>, <assistant>, <context>, <think>, </think>
  • Vocab size: 256k + 6
  • Global batch size: 1024
  • Micro batch size: 4
  • Gradient accumulation steps: 32

🚀 Inference Example

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_name = "bharatgenai/LegalParam"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=False)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    trust_remote_code=True,
    torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.bfloat32,
    device_map="auto"
)

# Example legal query
user_input = "What steps should a farmer take to legally transfer agricultural land ownership?"

# 3 types of prompt
# 1. Generic QA
# 2. Context based QA (context as part of prompt)
# 3. Multi-turn conversation

# Based on your requirements use the type of prompt (refere the above examples)
prompt = f"<user>\n{user_input}<assistant>\n"
# prompt = f"<user>\n{user_or_rag_context}\n<assistant>\n"
# prompt = f"<user>\n{user_input1}\n<assistant>\n{user_input2}\n<user> {user_input3} <assistant>..."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    output = model.generate(
        **inputs,
        max_new_tokens=300,
        do_sample=True,
        top_k=50,
        top_p=0.95,
        temperature=0.6,
        eos_token_id=tokenizer.eos_token_id,
        use_cache=False
    )

print(tokenizer.decode(output[0], skip_special_tokens=True))

📊 Evaluation

  • Legal Skills & Communication Q&A
  • Corporate, Commercial & Criminal Law
  • Legal Theory & Jurisprudence
  • Public International Law
  • Humanitarian & Refugee Rights
  • Bilingual (English/Hindi) capability

BhashaBench-Legal (BBL)

ModelBBLBBL-EnglishBBL-Hindi
gemma-2-2b-it33.2234.4930.25
granite-3.1-2b-instruct34.9138.1827.30
Llama-3.2-1B-Instruct28.4729.0827.04
Llama-3.2-3B-Instruct36.8639.7430.13
Nemotron-4-Mini-Hindi-4B-Instruct36.1236.9934.11
Qwen2.5-3B-Instruct37.3940.6229.89
Legal Param35.1736.1532.89

Subject Domain Performance

Domaingemma-2-2b-itgranite-3.1-2b-instructLlama-3.2-1B-InstructLlama-3.2-3B-InstructNemotron-4-Mini-Hindi-4B-InstructQwen2.5-3B-InstructLegal Param
Civil Litigation & Procedure32.3333.6928.1834.9732.7735.3135.07
Constitutional & Administrative Law33.7536.3528.1540.6240.3737.9338.43
Consumer & Competition Law37.3334.6722.6734.6738.6746.6732.00
Corporate & Commercial Law31.0434.7428.6334.6733.5937.7033.96
Criminal Law & Justice32.4733.3326.9833.6634.7134.4533.95
Employment & Labour Law37.1436.0025.7129.1441.7137.1432.00
Environmental & Energy Law32.3332.7924.4237.9136.2838.8432.56
Family & Personal Law31.1830.6828.8631.6932.6932.8032.09
General Academic Subjects38.8439.8132.5243.9143.0545.4438.21
Healthcare & Medical Law40.0068.0020.0040.0064.0040.0048.00
Human Rights & Social Justice15.7942.1142.1126.3210.5331.5810.53
Intellectual Property Law48.3547.2531.8745.0542.8654.9539.56
Interdisciplinary Studies37.1940.7728.1041.3242.9844.0831.96
International & Comparative Law37.3239.9230.3545.2244.1843.7637.84
Legal Skills & Communication27.9429.5327.3330.1529.9031.7427.82
Legal Theory & Jurisprudence35.3335.6128.3639.6938.7840.0436.31
Media & Entertainment Law44.4444.4435.1951.8535.1933.3335.19
Real Estate & Property Law28.3032.7525.9131.9632.1133.5528.62
Tax & Revenue Law32.0331.6031.6038.1038.1037.6639.83
Technology & Cyber Law44.7239.8441.4649.5949.5959.3543.90

Question Level Difficulty

Difficultygemma-2-2b-itgranite-3.1-2b-instructLlama-3.2-1B-InstructLlama-3.2-3B-InstructNemotron-4-Mini-Hindi-4B-InstructQwen2.5-3B-InstructLegal Param
Easy35.6637.0029.8840.1938.6539.8137.96
Hard27.5129.2327.7031.8132.5733.0530.18
Medium30.2532.4526.4632.4932.7734.3031.61

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

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

GPU в ailist

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

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
ParamBharatGenForCausalLM
Ревизия весов
32a87ba

0 моделей