HMH-1.0-Cyber-R-7B

HMH-1.0-Cyber-R-7B is an experimental cybersecurity language model built on Qwen2.5-Coder-7B. It was trained with 4-bit QLoRA on cybersecurity instruction data distilled/generated by DeepSeek.

Performance is mediocre. This model is provided for entertainment, learning, and research only. It does not guarantee the accuracy of CVEs, versions, patches, or exploitation details. Do not use it for unauthorized attacks or production security decisions.

Model provenance

  • Base model: Qwen/Qwen2.5-Coder-7B (Apache-2.0)
  • Method: 4-bit NF4 QLoRA, LoRA r=32 / alpha=64, bf16 compute
  • Teacher / data generation: DeepSeek-distilled cybersecurity SFT data
  • Training corpus: recent NVD vulnerabilities, historical CVSS 9.0+ entries, GitHub Security Advisories, CISA KEV, Exploit-DB, EPSS, plus CWE and CVSS v3.1 knowledge data
  • Scale: ~23k intelligence records; ~20k SFT samples (19.4k train / 0.6k validation)
  • Identity: HMH-1.0-Cyber-R-7B, injected through SYSTEM_PROMPT.txt

What it is (and is not)

The model is intended for:

  • Vulnerability briefs, CVE impact and remediation-priority analysis
  • CVSS v3.1 vectors/scoring and CWE classification
  • Draft Sigma detection rules
  • Authorized red-team / penetration-test validation ideas and remediation advice

It is not a general security product and has not received full safety alignment. Open-domain CVE answers can hallucinate. For concrete versions or patches, put structured NVD/GHSA intelligence in the prompt and verify against the vendor advisory.

Evaluation (for reference only)

Benchmark Score
CS-Eval, full 4,369 questions (official platform) 70.75 / 100
CyberMetric-500 74.20% (371/500)
Internal four-part scorecard (CVSS/CWE/lab/Sigma) 54.9 / 100

These are knowledge/template-style evaluations, not evidence of real penetration or engineering ability. The results are mediocre; entertainment use only.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "fengraoyaoshi/HMH-1.0-Cyber-R-7B"
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype="bfloat16", device_map="auto", trust_remote_code=True
)

# Chinese prompt: SYSTEM_PROMPT.txt
# English prompt: SYSTEM_PROMPT_EN.txt
system = open("SYSTEM_PROMPT.txt", encoding="utf-8").read().strip()
messages = [
    {"role": "system", "content": system},
    {"role": "user", "content": "Explain the root cause and remediation of CWE-79."},
]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
out = model.generate(**tok(text, return_tensors="pt").to(model.device), max_new_tokens=512)
print(tok.decode(out[0][len(tok(text)["input_ids"]):], skip_special_tokens=True))

Recommended generation settings: max_new_tokens=512โ€“800, temperature=0.2, top_p=0.9, repetition_penalty=1.05, eos_token_id=[151643, 151645].

GGUF (Q4_K_M)

A 4-bit GGUF quantization is provided for local inference:

  • File: HMH-1.0-Cyber-R-7B-Q4_K_M.gguf
  • Size: 4.36 GB
  • SHA256: 2c582d131dc2cd229dfaa006b9b70b1cb18d77a7e42c5d1ab0b799d8126bd4ec
llama-cli -m HMH-1.0-Cyber-R-7B-Q4_K_M.gguf \
  -sysf SYSTEM_PROMPT_EN.txt -st \
  -p "Explain the root cause and remediation of CWE-79." \
  -n 512 -c 4096 -ngl 99

The Q4_K_M file is a convenience artifact; the unquantized safetensors above are the reference weights. Quantized outputs may differ slightly from bf16.

Known limitations

  • Weak stopping behavior: the model may continue with templates/disclaimers after a correct answer, or repeat tokens such as firepower. Limit max_new_tokens and truncate firepower, ๏ผˆไปฅไธŠ, and FRINGEMENT in post-processing.
  • Open-domain CVE hallucination: provide structured intelligence before asking for analysis.
  • CVSS/CWE still need review: the model can miscalculate or misclassify; it does not replace a calculator or human review.
  • No full safety alignment: use only for authorized security research, defense, and education; unauthorized attacks are prohibited.
  • 4-bit training/inference differs slightly from full precision.

License

The base Qwen2.5-Coder-7B is Apache-2.0. Training data comes from public vulnerability sources; follow each source's license. Model outputs are not a security guarantee.

Disclaimer

This is a personal research/entertainment project provided "as is", without warranties of any kind. The user assumes all risks and liability for any use or misuse.

Downloads last month
61
Safetensors
Model size
8B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for fengraoyaoshi/HMH-1.0-Cyber-R-7B

Base model

Qwen/Qwen2.5-7B
Quantized
(52)
this model