yunusshin commited on
Commit
4aa2bf8
·
verified ·
1 Parent(s): 173b67b

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - tr
4
+ - en
5
+ license: apache-2.0
6
+ library_name: peft
7
+ base_model: Qwen/Qwen2.5-14B-Instruct
8
+ tags:
9
+ - aviation
10
+ - cybersecurity
11
+ - qwen2.5
12
+ - qlora
13
+ - fine-tuned
14
+ - mitre-attack
15
+ - threat-intelligence
16
+ - lora
17
+ - sft
18
+ - trl
19
+ - unsloth
20
+ datasets:
21
+ - custom
22
+ pipeline_tag: text-generation
23
+ ---
24
+
25
+ # ARGUS - Aviation Cybersecurity Expert LLM
26
+
27
+ **ARGUS** is a fine-tuned Qwen2.5-14B-Instruct model specialized in aviation cybersecurity. It provides expert-level answers on ICAO, EASA, FAA regulations, Turkish civil aviation legislation (SHT-Siber), MITRE ATT&CK framework, APT threat groups, and cybersecurity practices in the aviation sector.
28
+
29
+ ## Model Details
30
+
31
+ | Parameter | Value |
32
+ |-----------|-------|
33
+ | Base Model | Qwen/Qwen2.5-14B-Instruct |
34
+ | Method | QLoRA 4-bit (Unsloth) |
35
+ | LoRA Rank | 64 |
36
+ | LoRA Alpha | 128 |
37
+ | Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
38
+ | Training Data | 10,830 samples (authority, MITRE, APT, general CTI) |
39
+ | Epochs | 1 |
40
+ | Eval Loss | 1.068 (best) |
41
+ | Languages | Turkish, English |
42
+
43
+ ## Training Data Distribution
44
+
45
+ | Category | Samples | Weight | Percentage |
46
+ |----------|---------|--------|------------|
47
+ | Authority (ICAO, EASA, SHT-Siber) | 1,947 | 3x | 48.1% |
48
+ | MITRE ATT&CK Groups | 1,166 | 2x | 19.4% |
49
+ | APT Reports | 2,286 | 1x | 19.1% |
50
+ | General CTI | 1,558 | 1x | 13.0% |
51
+ | Negatives (anti-hallucination) | 50 | 1x | 0.4% |
52
+
53
+ ## Recommended System Prompt
54
+
55
+ ```
56
+ Sen ARGUS, bir havacılık siber güvenlik uzmanısın. ICAO, EASA, FAA düzenlemeleri,
57
+ Türk sivil havacılık mevzuatı (SHT-Siber), MITRE ATT&CK framework'ü ve havacılık
58
+ sektöründeki siber güvenlik uygulamaları konusunda derin bilgi sahibisin. Soruları
59
+ hem Türkçe hem İngilizce olarak detaylı ve teknik şekilde yanıtlıyorsun.
60
+ ```
61
+
62
+ ## Best Results with RAG
63
+
64
+ This model achieves its best performance when combined with a RAG (Retrieval-Augmented Generation) pipeline. The fine-tuning teaches the model **format, terminology, and aviation expertise style**, while RAG provides **grounded, factual information** from source documents.
65
+
66
+ ### Benchmark: 4-Configuration Comparison (9 Questions)
67
+
68
+ | Configuration | Correct | Hallucination | Wrong |
69
+ |---------------|---------|---------------|-------|
70
+ | Base Qwen (No RAG) | 1/9 | 3/9 | 5/9 |
71
+ | Base Qwen + RAG | 4/9 | 1/9 | 4/9 |
72
+ | ARGUS (No RAG) | 3/9 | 4/9 | 2/9 |
73
+ | **ARGUS + RAG** | **7/9** | **0/9** | **2/9** |
74
+
75
+ ### Recommended RAG Setup
76
+
77
+ - **Vector DB**: Qdrant
78
+ - **Embedding Model**: `intfloat/multilingual-e5-base` (Turkish + English)
79
+ - **LLM Server**: llama-server (llama.cpp) with Q5_K_M GGUF
80
+
81
+ ## Usage
82
+
83
+ ### With Transformers + PEFT
84
+
85
+ ```python
86
+ from peft import PeftModel
87
+ from transformers import AutoModelForCausalLM, AutoTokenizer
88
+
89
+ base_model = "Qwen/Qwen2.5-14B-Instruct"
90
+ model = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto")
91
+ model = PeftModel.from_pretrained(model, "yunusshin/argus-qwen25-14b")
92
+ tokenizer = AutoTokenizer.from_pretrained(base_model)
93
+
94
+ messages = [
95
+ {"role": "system", "content": "Sen ARGUS, bir havacılık siber güvenlik uzmanısın."},
96
+ {"role": "user", "content": "EASA Part-IS kapsamında ISMS gereksinimleri nelerdir?"},
97
+ ]
98
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
99
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
100
+ output = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
101
+ print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
102
+ ```
103
+
104
+ ### With GGUF (llama-server / Ollama)
105
+
106
+ A Q5_K_M GGUF quantization (9.8 GB) is also available in this repository.
107
+
108
+ ```bash
109
+ # llama-server
110
+ llama-server --model argus-q5_k_m.gguf --host 0.0.0.0 --port 8080 --ctx-size 4096 --n-gpu-layers 99
111
+
112
+ # Ollama
113
+ ollama create argus -f Modelfile
114
+ ollama run argus
115
+ ```
116
+
117
+ ## Limitations
118
+
119
+ - Without RAG, the model may hallucinate on topics not covered in training data
120
+ - Best suited for aviation cybersecurity domain; general cybersecurity knowledge comes from the base model
121
+ - Specific regulation article numbers and dates should be verified against official sources
122
+
123
+ ## Training Infrastructure
124
+
125
+ - **Hardware**: NVIDIA DGX Spark (GB10 Blackwell), 119.6 GB unified memory
126
+ - **Framework**: Unsloth + TRL (SFTTrainer)
127
+ - **Training Time**: ~3.7 hours (677 steps, 1 epoch)
128
+
129
+ ## Author
130
+
131
+ Yunus Sahin
132
+
133
+ ## License
134
+
135
+ Apache 2.0 (following the base model license)
adapter_config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": {
6
+ "base_model_class": "Qwen2ForCausalLM",
7
+ "parent_library": "transformers.models.qwen2.modeling_qwen2",
8
+ "unsloth_fixed": true
9
+ },
10
+ "base_model_name_or_path": "unsloth/qwen2.5-14b-instruct-unsloth-bnb-4bit",
11
+ "bias": "none",
12
+ "corda_config": null,
13
+ "ensure_weight_tying": false,
14
+ "eva_config": null,
15
+ "exclude_modules": null,
16
+ "fan_in_fan_out": false,
17
+ "inference_mode": true,
18
+ "init_lora_weights": true,
19
+ "layer_replication": null,
20
+ "layers_pattern": null,
21
+ "layers_to_transform": null,
22
+ "loftq_config": {},
23
+ "lora_alpha": 128,
24
+ "lora_bias": false,
25
+ "lora_dropout": 0,
26
+ "megatron_config": null,
27
+ "megatron_core": "megatron.core",
28
+ "modules_to_save": null,
29
+ "peft_type": "LORA",
30
+ "peft_version": "0.18.1",
31
+ "qalora_group_size": 16,
32
+ "r": 64,
33
+ "rank_pattern": {},
34
+ "revision": null,
35
+ "target_modules": [
36
+ "v_proj",
37
+ "gate_proj",
38
+ "k_proj",
39
+ "q_proj",
40
+ "o_proj",
41
+ "down_proj",
42
+ "up_proj"
43
+ ],
44
+ "target_parameters": null,
45
+ "task_type": "CAUSAL_LM",
46
+ "trainable_token_indices": null,
47
+ "use_dora": false,
48
+ "use_qalora": false,
49
+ "use_rslora": false
50
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdd8a87f9345c2f5381398702df476037c68059c7fdfd18055be97a76c754ffb
3
+ size 1101095848
chat_template.jinja ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0]['role'] == 'system' %}
4
+ {{- messages[0]['content'] }}
5
+ {%- else %}
6
+ {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
7
+ {%- endif %}
8
+ {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
9
+ {%- for tool in tools %}
10
+ {{- "\n" }}
11
+ {{- tool | tojson }}
12
+ {%- endfor %}
13
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
14
+ {%- else %}
15
+ {%- if messages[0]['role'] == 'system' %}
16
+ {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
17
+ {%- else %}
18
+ {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
19
+ {%- endif %}
20
+ {%- endif %}
21
+ {%- for message in messages %}
22
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
23
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
24
+ {%- elif message.role == "assistant" %}
25
+ {{- '<|im_start|>' + message.role }}
26
+ {%- if message.content %}
27
+ {{- '\n' + message.content }}
28
+ {%- endif %}
29
+ {%- for tool_call in message.tool_calls %}
30
+ {%- if tool_call.function is defined %}
31
+ {%- set tool_call = tool_call.function %}
32
+ {%- endif %}
33
+ {{- '\n<tool_call>\n{"name": "' }}
34
+ {{- tool_call.name }}
35
+ {{- '", "arguments": ' }}
36
+ {{- tool_call.arguments | tojson }}
37
+ {{- '}\n</tool_call>' }}
38
+ {%- endfor %}
39
+ {{- '<|im_end|>\n' }}
40
+ {%- elif message.role == "tool" %}
41
+ {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
42
+ {{- '<|im_start|>user' }}
43
+ {%- endif %}
44
+ {{- '\n<tool_response>\n' }}
45
+ {{- message.content }}
46
+ {{- '\n</tool_response>' }}
47
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
48
+ {{- '<|im_end|>\n' }}
49
+ {%- endif %}
50
+ {%- endif %}
51
+ {%- endfor %}
52
+ {%- if add_generation_prompt %}
53
+ {{- '<|im_start|>assistant\n' }}
54
+ {%- endif %}
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd5948af71b4f56cf697f7580814c7ce8b80595ef985544efcacf716126a2e31
3
+ size 11422356
tokenizer_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "is_local": false,
9
+ "model_max_length": 32768,
10
+ "pad_token": "<|PAD_TOKEN|>",
11
+ "padding_side": "left",
12
+ "split_special_tokens": false,
13
+ "tokenizer_class": "Qwen2Tokenizer",
14
+ "unk_token": null
15
+ }