jonam-ai/gemma-2-2b-legal-raft
jonam-ai/gemma-2-2b-legal-raft is a 2.6 billion parameter Gemma-2-2B-IT model, developed by jonam-ai, fine-tuned using QLoRA RAFT (Retrieval-Augmented Fine-Tuning) for legal and financial assistance. This model excels at answering questions from provided context by quoting supporting text and is specifically trained to abstain from hallucinating when information is absent. It is designed for grounded, retrieval-augmented answering, particularly in legal and financial domains.
Loading preview...
Overview
This model, jonam-ai/gemma-2-2b-legal-raft, is a 2.6 billion parameter Gemma-2-2B-IT variant, developed by jonam-ai. It has been fine-tuned using QLoRA RAFT (Retrieval-Augmented Fine-Tuning) on top of jonam-ai/gemma-2-2b-legal-sft. The primary goal of this RAFT fine-tuning is to enable the model to answer questions accurately from a given context, quoting the exact supporting text and ignoring irrelevant information.
Key Capabilities
- Contextual Answering: Designed to answer questions by extracting and quoting information directly from provided numbered context documents.
- Faithfulness and Abstention: Explicitly trained to decline answering (abstain) when the necessary information is not present in the provided context, rather than fabricating responses. This addresses a common hallucination issue in other models.
- Legal and Financial Assistance: Optimized for use cases requiring grounded answers in legal and financial domains.
Training Details
The model was trained using QLoRA with 4-bit NF4 base, LoRA r=16, and α=32 on various projection layers. It utilized 3,866 RAFT examples, where 25% of examples had the oracle (correct answer source) removed to train for abstention. The training involved 2 epochs with a cosine learning rate schedule, achieving a final train loss of approximately 0.16.
Intended Use
This model serves as an educational demonstration for grounded, retrieval-augmented answering on a small open model. It is suitable for tasks where verifiable answers from specific documents are crucial, particularly in legal and financial contexts. Users should verify quotes against their source, as grounding is strong but not guaranteed. The model is English-only and inherits the Gemma license.