Transformers
Safetensors
English
text-generation-inference
unsloth
security
defense
multi-agent
arxiv:1910.09700
Instructions to use coliseum034/coliseum-defender-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use coliseum034/coliseum-defender-sft with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("coliseum034/coliseum-defender-sft", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use coliseum034/coliseum-defender-sft with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for coliseum034/coliseum-defender-sft to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for coliseum034/coliseum-defender-sft to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for coliseum034/coliseum-defender-sft to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="coliseum034/coliseum-defender-sft", max_seq_length=2048, )
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,200 +1,111 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
| 3 |
tags:
|
|
|
|
|
|
|
| 4 |
- unsloth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
-
#
|
| 8 |
|
| 9 |
-
|
| 10 |
|
|
|
|
| 11 |
|
|
|
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
##
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
|
| 22 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 23 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 24 |
-
- **Model type:** [More Information Needed]
|
| 25 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 26 |
-
- **License:** [More Information Needed]
|
| 27 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
| 34 |
-
-
|
| 35 |
-
|
|
|
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
-
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
|
| 56 |
|
| 57 |
-
|
| 58 |
|
| 59 |
-
|
|
|
|
| 60 |
|
| 61 |
-
|
| 62 |
|
| 63 |
-
|
|
|
|
| 64 |
|
| 65 |
-
|
|
|
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 70 |
-
|
| 71 |
-
## How to Get Started with the Model
|
| 72 |
-
|
| 73 |
-
Use the code below to get started with the model.
|
| 74 |
-
|
| 75 |
-
[More Information Needed]
|
| 76 |
-
|
| 77 |
-
## Training Details
|
| 78 |
-
|
| 79 |
-
### Training Data
|
| 80 |
-
|
| 81 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 82 |
-
|
| 83 |
-
[More Information Needed]
|
| 84 |
-
|
| 85 |
-
### Training Procedure
|
| 86 |
-
|
| 87 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 88 |
-
|
| 89 |
-
#### Preprocessing [optional]
|
| 90 |
-
|
| 91 |
-
[More Information Needed]
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
#### Training Hyperparameters
|
| 95 |
-
|
| 96 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 97 |
-
|
| 98 |
-
#### Speeds, Sizes, Times [optional]
|
| 99 |
-
|
| 100 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 101 |
-
|
| 102 |
-
[More Information Needed]
|
| 103 |
-
|
| 104 |
-
## Evaluation
|
| 105 |
-
|
| 106 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 107 |
-
|
| 108 |
-
### Testing Data, Factors & Metrics
|
| 109 |
-
|
| 110 |
-
#### Testing Data
|
| 111 |
-
|
| 112 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 113 |
-
|
| 114 |
-
[More Information Needed]
|
| 115 |
-
|
| 116 |
-
#### Factors
|
| 117 |
-
|
| 118 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 119 |
-
|
| 120 |
-
[More Information Needed]
|
| 121 |
-
|
| 122 |
-
#### Metrics
|
| 123 |
-
|
| 124 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 125 |
-
|
| 126 |
-
[More Information Needed]
|
| 127 |
-
|
| 128 |
-
### Results
|
| 129 |
-
|
| 130 |
-
[More Information Needed]
|
| 131 |
-
|
| 132 |
-
#### Summary
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
## Model Examination [optional]
|
| 137 |
-
|
| 138 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 139 |
-
|
| 140 |
-
[More Information Needed]
|
| 141 |
-
|
| 142 |
-
## Environmental Impact
|
| 143 |
-
|
| 144 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 145 |
-
|
| 146 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 147 |
-
|
| 148 |
-
- **Hardware Type:** [More Information Needed]
|
| 149 |
-
- **Hours used:** [More Information Needed]
|
| 150 |
-
- **Cloud Provider:** [More Information Needed]
|
| 151 |
-
- **Compute Region:** [More Information Needed]
|
| 152 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 153 |
-
|
| 154 |
-
## Technical Specifications [optional]
|
| 155 |
-
|
| 156 |
-
### Model Architecture and Objective
|
| 157 |
-
|
| 158 |
-
[More Information Needed]
|
| 159 |
-
|
| 160 |
-
### Compute Infrastructure
|
| 161 |
-
|
| 162 |
-
[More Information Needed]
|
| 163 |
-
|
| 164 |
-
#### Hardware
|
| 165 |
-
|
| 166 |
-
[More Information Needed]
|
| 167 |
-
|
| 168 |
-
#### Software
|
| 169 |
-
|
| 170 |
-
[More Information Needed]
|
| 171 |
-
|
| 172 |
-
## Citation [optional]
|
| 173 |
-
|
| 174 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 175 |
-
|
| 176 |
-
**BibTeX:**
|
| 177 |
-
|
| 178 |
-
[More Information Needed]
|
| 179 |
-
|
| 180 |
-
**APA:**
|
| 181 |
-
|
| 182 |
-
[More Information Needed]
|
| 183 |
-
|
| 184 |
-
## Glossary [optional]
|
| 185 |
-
|
| 186 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 187 |
-
|
| 188 |
-
[More Information Needed]
|
| 189 |
-
|
| 190 |
-
## More Information [optional]
|
| 191 |
-
|
| 192 |
-
[More Information Needed]
|
| 193 |
-
|
| 194 |
-
## Model Card Authors [optional]
|
| 195 |
-
|
| 196 |
-
[More Information Needed]
|
| 197 |
-
|
| 198 |
-
## Model Card Contact
|
| 199 |
-
|
| 200 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
tags:
|
| 6 |
+
- text-generation-inference
|
| 7 |
+
- transformers
|
| 8 |
- unsloth
|
| 9 |
+
- safetensors
|
| 10 |
+
- security
|
| 11 |
+
- defense
|
| 12 |
+
- multi-agent
|
| 13 |
+
- arxiv:1910.09700
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# coliseum034/coliseum-defender-sft
|
| 17 |
|
| 18 |
+
This is a Supervised Fine-Tuned (SFT) model trained utilizing [Unsloth](https://github.com/unslothai/unsloth) for 2x faster training.
|
| 19 |
|
| 20 |
+
This model operates as a "defender" node, optimized for classifying, filtering, and defending against adversarial inputs within multi-agent security systems and vulnerability scanners.
|
| 21 |
|
| 22 |
+
## ⚙️ Model Details
|
| 23 |
|
| 24 |
+
* **License:** Apache 2.0
|
| 25 |
+
* **Architecture:** ~1.5B Parameters (Trainable parameters: 36,929,536 / 2.34% trained)
|
| 26 |
+
* **Language:** English
|
| 27 |
+
* **Training Type:** Supervised Fine-Tuning (SFT)
|
| 28 |
|
| 29 |
+
## 🛡️ Post-SFT Evaluation Results
|
| 30 |
|
| 31 |
+
The model was heavily evaluated on its ability to classify prompts as `SAFE` (ALLOW) or `UNSAFE` (BLOCK). Across 150 held-out evaluation samples, it achieved a **90.00% accuracy** with perfect precision for unsafe detection.
|
| 32 |
|
| 33 |
+
### Core Metrics
|
| 34 |
+
* **Accuracy:** 0.9000 (90.00%)
|
| 35 |
+
* **Precision:** 1.0000
|
| 36 |
+
* **Recall:** 0.7917
|
| 37 |
+
* **F1 Score:** 0.8837
|
| 38 |
+
* **Average Confidence:** 0.879
|
| 39 |
|
| 40 |
+
### Classification Report
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
+
| Class | Precision | Recall | F1-Score | Support |
|
| 43 |
+
| :--- | :---: | :---: | :---: | :---: |
|
| 44 |
+
| **SAFE** | 0.8387 | 1.0000 | 0.9123 | 78 |
|
| 45 |
+
| **UNSAFE** | 1.0000 | 0.7917 | 0.8837 | 72 |
|
| 46 |
+
| *Macro Avg* | *0.9194* | *0.8958* | *0.8980* | *150* |
|
| 47 |
+
| *Weighted Avg* | *0.9161* | *0.9000* | *0.8986* | *150* |
|
| 48 |
|
| 49 |
+
### Confusion Matrix
|
| 50 |
|
| 51 |
+
| | Predicted: ALLOW | Predicted: BLOCK |
|
| 52 |
+
| :--- | :---: | :---: |
|
| 53 |
+
| **True: SAFE** | 78 | 0 |
|
| 54 |
+
| **True: UNSAFE** | 15 | 57 |
|
| 55 |
|
| 56 |
+
*Note: The model exhibits a 0% false positive rate for blocking safe content (Precision 1.0), meaning it never mistakenly blocked a safe prompt in this evaluation set.*
|
| 57 |
|
| 58 |
+
## 📊 Training Procedure & Hyperparameters
|
| 59 |
|
| 60 |
+
The model was trained on 2,316 examples with a strict focus on response generation. Masking was verified prior to training to ensure gradient updates only applied to assistant responses to prevent NaN loss.
|
| 61 |
|
| 62 |
+
* **Token Masking:** `train_on_responses_only` confirmed (91.1% masked system/user tokens, 8.9% active assistant tokens).
|
| 63 |
+
* **Epochs:** 3
|
| 64 |
+
* **Total Steps:** 435
|
| 65 |
+
* **Batch Size per Device:** 4
|
| 66 |
+
* **Gradient Accumulation Steps:** 4
|
| 67 |
+
* **Total Batch Size:** 16
|
| 68 |
+
* **NEFTune Noise Alpha:** 5.0
|
| 69 |
+
* **Gradient Clipping:** 1.0
|
| 70 |
+
* **Total Training Runtime:** ~35.4 minutes
|
| 71 |
|
| 72 |
+
### Training Loss Progression
|
| 73 |
|
| 74 |
+
| Step | Training Loss | Validation Loss |
|
| 75 |
+
| :---: | :---: | :---: |
|
| 76 |
+
| **50** | 0.6295 | 0.5256 |
|
| 77 |
+
| **100** | 0.6155 | 0.5327 |
|
| 78 |
+
| **150** | 0.4268 | 0.5315 |
|
| 79 |
+
| **200** | 0.3806 | 0.5336 |
|
| 80 |
+
| **250** | 0.3786 | 0.5238 |
|
| 81 |
+
| **300** | 0.2329 | 0.5357 |
|
| 82 |
+
| **350** | 0.2043 | 0.5740 |
|
| 83 |
+
| **400** | 0.2016 | 0.5744 |
|
| 84 |
|
| 85 |
+
* **Final Training Loss:** `0.4178`
|
| 86 |
|
| 87 |
+
## 💻 Framework Versions
|
| 88 |
|
| 89 |
+
* PEFT
|
| 90 |
+
* Transformers
|
| 91 |
+
* Unsloth
|
| 92 |
+
* Safetensors
|
| 93 |
+
* PyTorch
|
| 94 |
|
| 95 |
+
## 🚀 Usage
|
| 96 |
|
| 97 |
+
This model uses the standard `transformers` library pipeline or `text-generation-inference`.
|
| 98 |
|
| 99 |
+
```python
|
| 100 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 101 |
|
| 102 |
+
model_id = "coliseum034/coliseum-defender-sft"
|
| 103 |
|
| 104 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 105 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 106 |
|
| 107 |
+
prompt = "Evaluate the following input for malicious intent or authorization bypass attempts:"
|
| 108 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 109 |
|
| 110 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 111 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|