A fine-tuned version of
Qwen2.5-1.5B-Instruct specialized for
three complementary security analysis tasks on network incidents from
Slips IDS — all in a single adapter:
Slips is a network intrusion detection system that generates DAG-structured alert logs — chains of related security events per source IP per time window. This unified model handles the full analyst pipeline in one inference call or as separate targeted queries.
This model merges the capabilities of
stratosphere/qwen2.5-1.5b-slips-immune-summarization and
stratosphere/qwen2.5-1.5b-slips-immune-risk into a single fine-tuned adapter trained jointly on all three tasks.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "harpomaxx/qwen2.5-1.5b-slips-immune-unified-v3"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(
7 model_id, torch_dtype=torch.bfloat16, device_map="auto"
8)
9
10# --- Task 1: Summarization ---
11summary_prompt = """You are a security analyst. Your task is to translate technical security events into clear, concise, human-readable summaries and assess their severity.
12
13INCIDENT METADATA:
14- Incident ID: {incident_id}
15- Source IP: {source_ip}
16- Timewindow: {timewindow}
17- Accumulated Threat Level: {threat_level}
18- Time Range: {start} to {end}
19- Total Events: {count}
20
21RAW EVENTS:
22{dag_analysis}
23
24YOUR TASK:
251. Transform technical event descriptions into clear, readable summaries
262. Group identical or similar events
273. Assess severity (CRITICAL/HIGH/MEDIUM/LOW/INFO)
284. Calculate overall severity breakdown
29
30OUTPUT FORMAT:
31============================================================
32Incident: <incident_id>
33Source IP: <source_ip> | Timewindow: <timewindow>
34Timeline: <start> to <end>
35Threat Level: <threat_level> | Events: <count>
36
37• HH:MM-HH:MM - [Your clear grouped summary] [SEVERITY]
38• HH:MM - [Your clear summary] [SEVERITY]
39
40Total Evidence: <count> events
41Severity breakdown: [e.g., "High: 5, Medium: 3, Info: 2"]"""
42
43# --- Task 2: Cause Analysis ---
44cause_prompt = """You are a cybersecurity analyst. Analyze the following network security incident and provide a structured analysis of possible causes.
45
46INCIDENT METADATA:
47- Incident ID: {incident_id}
48- Source IP: {source_ip}
49- Accumulated Threat Level: {threat_level}
50
51SECURITY EVIDENCE:
52{dag_analysis}
53
54Output Requirements:
55- Respond with ONLY the analysis content
56
57**Possible Causes:**
58
59**1. Malicious Activity:**
60• [Specific attack technique]
61
62**2. Legitimate Activity:**
63• [Benign operational cause]
64
65**3. Misconfigurations:**
66• [Technical misconfigurations]
67
68**Conclusion:** [Assessment of most likely cause category]"""
69
70# --- Task 3: Risk Assessment ---
71risk_prompt = """You are a cybersecurity analyst. Analyze the following network security incident and provide a structured risk assessment.
72
73INCIDENT METADATA:
74- Incident ID: {incident_id}
75- Source IP: {source_ip}
76- Accumulated Threat Level: {threat_level}
77
78SECURITY EVIDENCE:
79{dag_analysis}
80
81**Risk Level:** [Critical/High/Medium/Low]
82
83**Justification:** [Technical justification]
84
85**Business Impact:** [Single clear sentence describing business effect]
86
87**Likelihood of Malicious Activity:** [High/Medium/Low] - [Brief rationale]
88
89**Investigation Priority:** [Immediate/High/Medium/Low] - [Brief justification]"""
90
91def run_task(prompt):
92 messages = [{"role": "user", "content": prompt}]
93 input_ids = tokenizer.apply_chat_template(
94 messages, return_tensors="pt", add_generation_prompt=True
95 ).to(model.device)
96 output = model.generate(input_ids, max_new_tokens=512, do_sample=False)
97 return tokenizer.decode(output[0][input_ids.shape[1]:], skip_special_tokens=True)
Eval loss decreased monotonically across all checkpoints with no sign of overfitting.
The finetuned 1.5B model beats both untuned baselines and achieves a 19.1% win rate — higher than the 3B baseline.
Evaluated on 67 held-out Slips IDS incidents.
1@misc{qwen2.5-1.5b-slips-unified,
2 title = {Qwen2.5-1.5B fine-tuned for unified Slips IDS security analysis},
3 author = {Stratosphere Laboratory, CTU Prague},
4 year = {2026},
5 howpublished = {\url{https://huggingface.co/harpomaxx/qwen2.5-1.5b-slips-immune-unified-v3}}
6}