This is the merged 16-bit (bf16) model for
transformers / vLLM / TGI. Quantized GGUFs for Ollama and llama.cpp are at
exploitintel/cve-cwe-gemma4-12b-GGUF.
* v1 baseline = a 1-epoch Gemma-4-E4B fine-tune. The headline gain is macro-F1 (the rare-CWE long tail), which improves ~8×; hard (must-infer) exact-match of 0.644 is close to easy (0.805), indicating the model genuinely infers weaknesses rather than only keyword-matching.
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_id = "exploitintel/cve-cwe-gemma4-12b"
5tok = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto").eval()
7
8cve = ("A vulnerability in the login form allows remote attackers to execute "
9 "arbitrary SQL commands via the username parameter.")
10messages = [
11 {"role": "system", "content": "You are a vulnerability analyst. Given a CVE "
12 "description, reply with only the CWE ID(s) it maps to, comma-separated."},
13 {"role": "user", "content": cve},
14]
15prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
16inputs = tok(prompt, return_tensors="pt").to(model.device)
17out = model.generate(**inputs, max_new_tokens=32, do_sample=False)
18print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
19# -> CWE-89
Apache-2.0, inherited from the Gemma 4 base model.