IndoCAP-Weather-7B

IndoCAP-Weather-7B is a domain-adapted Indonesian emergency alerting foundation model fine-tuned from Qwen/Qwen2.5-7B-Instruct using 4-bit NormalFloat4 (NF4) QLoRA.

The model is purpose-built to solve three critical failure modes exhibited by general-purpose LLMs in archipelagic disaster management:

  1. Unbounded Spatial Hallucination: Fabricating false emergency warnings for calm regions without active alerts ($Q_{\text{NEG}}$).
  2. Administrative Homonym Collapse: Confusing identically named subdistricts across different provinces without epistemic abstention ($Q_{\text{INDET}}$).
  3. Common Alerting Protocol (CAP XML) Discrepancies: Inability to parse multi-polygon geocoding, multi-area descriptions, and operational lifecycles (ACTIVE, SUPERSEDED, EXPIRED).

Model Details

  • Base Architecture: Qwen/Qwen2.5-7B-Instruct
  • Tuning Method: Quantized Low-Rank Adaptation (QLoRA)
  • Quantization: 4-bit NormalFloat4 (NF4) with Double Quantization
  • LoRA Hyperparameters: $r=16, \alpha=32, \text{dropout}=0.05$
  • Target Modules: All linear projections (q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj)
  • Domain Corpus: 46 real-world multi-area BMKG CAP XML payloads (12 provinces) and the 7,817-entity Kemendagri National Gazetteer.
  • VRAM Footprint: ~4.65 GB (operable on consumer GPUs such as NVIDIA RTX 3060/4060 or local BPBD edge workstations).

Benchmark Performance (IndoCAP-Bench v2.0 Holdout)

Evaluated on the 38-query holdout test suite across 9 leading open-weight foundation models:

Model Parameters Overall Accuracy $Q_{\text{REL}}$ Recall $Q_{\text{INDET}}$ Abstention Anti-Hallucination ($Q_{\text{NEG}}$)
IndoCAP-Weather-7B (Ours) 7.6B 100.0% 100.0% 100.0% 100.0%
DeepSeek-R1-Distill-7B 7.6B 47.37% 76.47% 50.00% 13.33%
Qwen-2.5-14B-Instruct 14.7B 42.11% 82.35% 33.33% 0.00%
Gemma-2-9B-it 9.2B 39.47% 76.47% 16.67% 6.67%
Llama-3.1-8B-Instruct 8.0B 36.84% 70.59% 33.33% 0.00%
Qwen-2.5-7B-Instruct (Base) 7.6B 34.21% 70.59% 16.67% 0.00%

Out-of-Distribution (OOD) Stress Battery ($N=20$ hard queries with slang, typos, abbreviations): 95.0% accuracy.
Statistical Rigor: Pairwise two-sided McNemar exact tests confirm superiority over all 9 baselines ($p \le 1.91 \times 10^{-6}$, Holm-Bonferroni corrected).


Quickstart & Local Inference

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel

BASE_MODEL_ID = "Qwen/Qwen2.5-7B-Instruct"
ADAPTER_ID = "novi1223/IndoCAP-Weather-7B"

# 1. Configure 4-bit Quantization
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_use_double_quant=True,
    bnb_4bit_compute_dtype=torch.float16
)

# 2. Load Base Model and Tokenizer
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_ID, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
    BASE_MODEL_ID,
    quantization_config=bnb_config,
    device_map="auto",
    trust_remote_code=True
)

# 3. Attach IndoCAP-Weather-7B LoRA Adapter
model = PeftModel.from_pretrained(base_model, ADAPTER_ID)
model.eval()

# 4. Run Emergency Disaster Inquiry
messages = [
    {
        "role": "system",
        "content": "Anda adalah asisten AI resmi BMKG untuk verifikasi peringatan dini cuaca dan analisis Common Alerting Protocol (CAP)."
    },
    {
        "role": "user",
        "content": "Apakah ada peringatan dini cuaca ekstrem aktif untuk wilayah Kecamatan Menteng, Jakarta Pusat saat ini?"
    }
]

prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=256,
        temperature=0.1,
        do_sample=False
    )

response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)

Citation & Academic Provenance

If you use IndoCAP-Weather-7B or the IndoCAP-Bench v2.0 benchmark in your research, please cite:

@article{indocapbench2026,
  title={IndoCAP-Bench v2.0: A Longitudinal Benchmark and Domain-Adapted LLM for Common Alerting Protocol Weather Emergencies Across Archipelagic Indonesia},
  author={IndoCAP-Bench Consortium},
  journal={Computers & Geosciences / International Journal of Disaster Risk Reduction},
  year={2026},
  url={https://huggingface.co/novi1223/IndoCAP-Weather-7B}
}
Downloads last month
62
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for novi1223/IndoCAP-Weather-7B

Base model

Qwen/Qwen2.5-7B
Adapter
(2,926)
this model