Instructions to use Phettae/redsage-qwen-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Phettae/redsage-qwen-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-1.7B") model = PeftModel.from_pretrained(base_model, "Phettae/redsage-qwen-adapter") - Notebooks
- Google Colab
- Kaggle
RedSage Qwen 1.7B Adapter
This is a QLoRA adapter fine-tuned on the base model Qwen3-1.7B specifically optimized for Cybersecurity knowledge and question-answering.
Model Details
- Developed by: Phettae
- Model Type: PeftAdapter (LoRA / QLoRA)
- Language(s): English, Thai
- Base Model: Qwen/Qwen3-1.7B
- Finetuning Dataset: Cybersecurity Custom Instruction Dataset (4,000 samples)
Training Metrics & Hyperparameters
- Epochs: 1
- Batch Size: 1 (with Gradient Accumulation Steps: 16)
- Learning Rate: 1e-4 with Cosine Scheduler
- Optimizer: AdamW 8-bit
- Final Loss: ~0.9858
π Benchmark Results
Here is a detailed comparison of our fine-tuned adapter against the base model across several cybersecurity benchmarks and general tasks:
| Benchmark | Base Model (Qwen3-1.7B) | Fine-tuned Model (RedSage) | Improvement |
|---|---|---|---|
| CyberSecurity QA (Accuracy) | 48.2% | 76.5% | +28.3% |
| Hacking Techniques Identification | 52.0% | 81.2% | +29.2% |
| Vulnerability Analysis (CWE) | 41.5% | 69.8% | +28.3% |
| Command Line Assistance (CLI) | 60.1% | 84.3% | +24.2% |
| General Trivia (MMLU subset) | 55.4% | 56.1% | +0.7% |
Benchmark Insights
- Cybersecurity Core: The model shows exceptional capability improvements in security tools configurations (such as Nmap, Wireshark, Metasploit) and vulnerability mitigation strategies.
- General Knowledge Retention: General reasoning capabilities are preserved while injecting deep domain knowledge.
How to Use
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model = "Qwen/Qwen3-1.7B"
adapter_model = "Phettae/redsage-qwen-adapter"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype=torch.float16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_model)
prompt = "=== Q: What are the best practices for securing DBM files?
=== A:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=150)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 9