hotdogs

hotdogs

qwen3.6-27b-cybersecurity-lora

Dedicated Endpoints

Run this model inference on single tenant GPU with unmatched speed and reliability at scale.

Learn more

Get help setting up a custom Dedicated Endpoints.

Talk with our engineer to get a quote for reserved GPU instances with discounts.

README

License: apache-2.0

📋 Model Details

Table
AttributeValue
Base ModelQwen/Qwen3.6-27B
Adapter TypeLoRA (Low-Rank Adaptation)
Fine-tuning MethodQLoRA (4-bit NF4 + LoRA)
Hardware1× RTX 4090 (24GB VRAM)
Training Time~5 hours
Dataset Size5,000 rows (sampled from 99,870)
Max Sequence Length512 tokens
LicenseApache 2.0

🎯 Intended Use

This LoRA adapter enhances Qwen3.6-27B's capability in cybersecurity domains including:

  • Penetration testing methodology & tools
  • Vulnerability assessment & analysis
  • Security operations & incident response
  • Network security & protocol analysis
  • Web application security (OWASP Top 10)
  • Malware analysis & reverse engineering
  • Cryptography & secure communications
  • Security policy & compliance frameworks

⚙️ Training Configuration

Quantization (4-bit NF4)

python

BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
)

LoRA Configuration

python

LoraConfig(
r=8,
lora_alpha=16,
target_modules=[
"q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj",
],
lora_dropout=0.05,
bias="none",
task_type="CAUSAL_LM",
)

Training Hyperparameters

python

SFTConfig(
max_length=512,
per_device_train_batch_size=1,
gradient_accumulation_steps=8,
num_train_epochs=1,
learning_rate=2e-4,
bf16=True,
optim="paged_adamw_8bit",
warmup_steps=10,
lr_scheduler_type="cosine",
logging_steps=10,
)

Training Metrics

Table
StepLossAccuracy
01.9456.8%
~300.3690.7%
~600.2693.2%
~1000.2194.1%
Final~0.21~94%

Loss converged rapidly within the first ~200 steps, indicating successful knowledge injection into the LoRA adapters.

📦 How to Use

1. Install Dependencies

bash

pip install torch transformers accelerate peft bitsandbytes

2. Load Model with LoRA Adapter

python

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
# Base model
model_name = "Qwen/Qwen3.6-27B"
# 4-bit quantization config
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(
model_name,
quantization_config=bnb_config,
device_map="auto",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
)
# Load LoRA adapter
model = PeftModel.from_pretrained(model, "hotdogs/qwen3.6-27b-cybersecurity-lora")

3. Inference

python

def generate_response(system_prompt, user_prompt):
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt},
]
text = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Example
response = generate_response(
"You are a cybersecurity expert. Provide detailed, accurate technical information.",
"Explain how to identify SQL injection vulnerabilities in a web application."
)
print(response)

4. Merge with Base Model (Optional)

bash

python -m peft merge_and_save \
--model_name Qwen/Qwen3.6-27B \
--peft_model hotdogs/qwen3.6-27b-cybersecurity-lora \
--output_dir ./qwen3.6-27b-cybersecurity-merged

📊 Training Details

Dataset

  • Source: AlicanKiraz0/Cybersecurity-Dataset-Fenrir-v2.1
  • Format: Chat template (system/user/assistant)
  • Sample size: 5,000 rows
  • Topics: Penetration testing, vulnerability assessment, network security, web security, cryptography, malware analysis, forensics, security policies

Training Environment

Table
ComponentSpecification
GPU1× NVIDIA RTX 4090 (24GB)
CPU8 vCPU
RAM32 GB
FrameworkPyTorch 2.12 + Transformers 5.12 + TRL 1.6
Quantizationbitsandbytes 0.49 (4-bit NF4)
Precisionbfloat16 mixed precision

Memory Usage

Table
StageVRAM Usage
Model Load (4-bit)~17.65 GB
After LoRA~17.81 GB
During Training~18-20 GB

🔗 References

⚠️ Limitations

  • Trained on a subset (5K/99K) of the full dataset — may not cover all cybersecurity topics exhaustively
  • LoRA rank 8 — limited representation capacity compared to full fine-tune
  • 4-bit quantization introduces minor precision loss vs half-precision
  • Domain knowledge is limited to the training dataset coverage

📝 Notes

  • This adapter was trained using CPU offload-free 4-bit NF4 quantization on a single RTX 4090
  • Gradient checkpointing was used to reduce VRAM consumption during training
  • The prepare_model_for_kbit_training step was skipped to avoid OOM from fp32 casting of large tensors — gradients are computed directly in bf16

Created by: hotdogs
Training Date: June 17, 2026


💖 Support / สนับสนุน

If you find this model useful, please consider supporting my work!
หากคุณคิดว่าโมเดลนี้มีประโยชน์ กรุณาสนับสนุนผลงานของฉันด้วยนะคะ! 🙏

Bitcoin QR — Donate

₿ Bitcoin — BTC:

markdown

bc1qf27cyk3vmugcdyv9xdtuv5jwz37863crpj5c9v

Thank you for your support! 🙏✨
ขอบคุณมากๆ สำหรับการสนับสนุนค่า! 💖🤗

Model provider

hotdogs

hotdogs

Model tree

Base

Qwen/Qwen3.6-27B

Adapter

this model

Modalities

Input

Video, Text, Image

Output

Text

Pricing

Dedicated Endpoints

View details

Supported Functionality

Model APIs

Dedicated Endpoints

Container

More information

Explore FriendliAI today