Views
No views yet
| Base model | Qwen/Qwen2.5-Coder-7B-Instruct |
| Method | QLoRA (r=32, α=64, 4-bit) via unsloth |
| Training data | justinwangx/CTFtime — 18,013 writeup chunks → ~5,200 × 2048-token packed sequences (10.6M tokens) |
| Strategy | Continued pretraining on raw writeup text (no instruction-format conversion) |
| Learning rate | 2e-4, cosine schedule, 10 warmup steps |
| Epochs | 2 |
| Hardware | NVIDIA GeForce RTX 3060 12 GB |
| Wall time | 12 h 17 m |
| Final train loss | 1.62 |
| Final eval loss | 1.644 |
adapter/ — LoRA adapter for use with PEFT
adapter_config.json, adapter_model.safetensorstokenizer.json, tokenizer_config.json, chat_template.jinjamasafee-ctf-7b.q4_k_m.gguf — single-file Q4_K_M GGUF (4.4 GB) for Ollama / llama.cpp1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5base = AutoModelForCausalLM.from_pretrained(
6 "Qwen/Qwen2.5-Coder-7B-Instruct",
7 torch_dtype=torch.bfloat16,
8).to("cuda")
9tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct")
10model = PeftModel.from_pretrained(base, "masafy/masafee-ctf-7b", subfolder="adapter")
11
12prompt = "How would you approach a CTF challenge that gives you an ELF binary with a gets() call?"
13msgs = [{"role": "user", "content": prompt}]
14ids = tokenizer.apply_chat_template(msgs, return_tensors="pt", add_generation_prompt=True).to("cuda")
15out = model.generate(ids, max_new_tokens=400, do_sample=False)
16print(tokenizer.decode(out[0][ids.shape[1]:], skip_special_tokens=True))1huggingface-cli download masafy/masafee-ctf-7b masafee-ctf-7b.q4_k_m.gguf
2
3cat > Modelfile <<'MFILE'
4FROM ./masafee-ctf-7b.q4_k_m.gguf
5TEMPLATE """{{ if .System }}<|im_start|>system
6{{ .System }}<|im_end|>
7{{ end }}{{ range .Messages }}<|im_start|>{{ .Role }}
8{{ .Content }}<|im_end|>
9{{ end }}<|im_start|>assistant
10"""
11PARAMETER stop "<|im_start|>"
12PARAMETER stop "<|im_end|>"
13PARAMETER temperature 0.7
14PARAMETER num_ctx 4096
15MFILE
16
17ollama create masafee-ctf-7b -f Modelfile
18ollama run masafee-ctf-7b| Benchmark | Base Qwen | masafee-ctf-7b | Foundation-Sec-8B |
|---|---|---|---|
| CyberMetric-500 accuracy | 86.20% | 84.00% | 82.60% |
| NYU CTF subset Pass@1 (30 Q.) | 13.3% | 0.0% | 6.7% |
| Hedging phrases (sum / 30) | — | 7 | 77 |
Qwen/Qwen2.5-Coder-7B-Instruct): Apache 2.0.1@software{suzuki_masafee_ctf_7b_2026,
2 author = {Suzuki, Masato},
3 title = {{Masafee CTF 7B: QLoRA Fine-Tuning of a 7B Code Model on
4 CTF Writeups for Stylistic and Knowledge Adaptation}},
5 year = {2026},
6 version = {v1.1.2},
7 doi = {10.5281/zenodo.20413080},
8 url = {https://doi.org/10.5281/zenodo.20413080},
9 orcid = {0009-0000-7977-2756}
10}