CoolFace
Modelpublic

rajeshthangaraj1/uae_rule_book_QA_assistant

sourceHugging Faceupdated 6mo agoView on Hugging Face
1likes70downloads
Model Card

RegulaUAE-1.2B - UAE Rulebook Q&A Assistant - Finetuned LFM2 Model

Model ID: rajeshthangaraj1/uae_rule_book_QA_assistant Base Model: [unsloth/LFM2-1.2B](https://docs.unsloth.ai/) ---

image/png

πŸ“˜ Model Overview

RegulaUAE-1.2B is a domain-specific conversational language model fine-tuned to answer questions strictly grounded in the UAE Central Bank Rulebook (Banking Regulations).

The model is designed to support regulatory, compliance, and educational use cases, with a strong focus on reduced hallucination within the UAE banking domain. Tested against CBUAE regulatory queries.

Coverage includes:

  • β€”Capital Adequacy
  • β€”Licensing & Authorization
  • β€”Corporate Governance
  • β€”Risk Management
  • β€”Compliance & Supervisory Frameworks

πŸ” Key Characteristics

  • β€”Domain: UAE Central Bank – Banking Regulations
  • β€”Dataset Size: 500,000+ question–answer pairs
  • β€”Language: English (complete rulebook coverage)
  • β€”Precision: bfloat16
  • β€”Task Type: Domain-specific legal & regulatory Q&A
  • β€”Framework: Hugging Face transformers
  • β€”Pipeline: text-generation with chat template support

🎯 Intended Use Cases

Regulatory & Legal Q&A

  • β€”What is the relationship between Decree Law No. (20) of 2018 and Cabinet Decision No. (10) of 2019?
  • β€”What minimum capital ratios are specified under Article (2)?

Compliance & Risk Teams

  • β€”Regulatory validation and internal compliance support

Education & Research

  • β€”Learning UAE banking regulations in a conversational format

AI & FinTech Development

  • β€”Base model for regulation-aware RAG systems

⚠️ Limitations

  • β€”Hallucination Risk: Without retrieval-augmented generation (RAG), the model may generate plausible but incorrect answers in edge cases.
  • β€”Domain Scope: Limited to UAE Central Bank banking regulations only.
  • β€”Numerical Accuracy: Percentages, ratios, and article references should be verified against the official rulebook.

πŸ“Š Dataset Creation

Source Data

Publicly available content from the official UAE Central Bank Rulebook: https://rulebook.centralbank.ae

Preprocessing

  • β€”Scraped and cleaned official rulebook content
  • β€”Segmented into ~65,000+ semantically aligned text chunks
  • β€”Average chunk size: ~500 characters
  • β€”Preserved articles, clauses, and legal definitions

Q&A Generation

Each chunk was used as grounded context to generate question–answer pairs.

Dataset structure:

json
{
  "context": "Rulebook text chunk",
  "question": "Regulatory question",
  "answer": "Answer grounded in the context"
}

πŸ§ͺ Example Usage (Transformers)

python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "rajeshthangaraj1/uae_rule_book_QA_assistant"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map="auto",
    torch_dtype=torch.bfloat16
)

messages = [
    {"role": "system", "content":
     "You are an assistant specialized in the UAE Central Bank Rulebook. "
     "Only answer based on the UAE Rulebook. "
     "If the answer is not in the Rulebook, reply 'Not found in UAE Rulebook'."},
    {"role": "user", "content":
     "According to the UAE Central Bank Rulebook – Capital Adequacy Section, "
     "what does Article (2) specify about minimum capital ratios?"}
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt"
).to(model.device)
inputs.pop("token_type_ids", None)

outputs = model.generate(**inputs, max_new_tokens=128)
answer = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
print(answer)

πŸ–₯️ Example Usage (Gradio)

python
import gradio as gr

def chat_with_model(message, history):
    # (your chat_with_model function here)
    ...

gr.ChatInterface(fn=chat_with_model, title="UAE Rulebook QA Assistant").launch()

πŸ”§ Technical Details

  • β€”Base Model: LFM2-1.2B
  • β€”Fine-tuning: LoRA adapters
  • β€”Precision: bfloat16
  • β€”Training Stack: Hugging Face transformers + accelerate

πŸ›£οΈ Roadmap

  • β€”Retrieval-Augmented Generation (RAG) integration
  • β€”Arabic language support
  • β€”Enhanced hallucination reduction and safety controls
  • β€”Productization for compliance-critical environments

✍️ Author: @rajeshthangaraj1 πŸ“… Last Updated: 2026