Text Generation
PEFT
Safetensors
English
cybersecurity
phishing-detection
email-security
agents
lora
conversational
Instructions to use Gl00be-Cybersecurity/Phishing-Guard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Gl00be-Cybersecurity/Phishing-Guard with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("zai-org/GLM-4.7-Flash") model = PeftModel.from_pretrained(base_model, "Gl00be-Cybersecurity/Phishing-Guard") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,169 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
library_name: peft
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
base_model: zai-org/GLM-4.7-Flash
|
| 7 |
+
base_model_relation: adapter
|
| 8 |
+
tags:
|
| 9 |
+
- cybersecurity
|
| 10 |
+
- phishing-detection
|
| 11 |
+
- email-security
|
| 12 |
+
- glm
|
| 13 |
+
- lora
|
| 14 |
+
- peft
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# Gl00be Phishing Guard
|
| 18 |
+
|
| 19 |
+
A specialized language-model adapter for defensive email phishing classification, developed by Gl00be.
|
| 20 |
+
|
| 21 |
+
Built on GLM-4.7-Flash, Phishing Guard uses parameter-efficient post-training to adapt the model to security-focused email analysis.
|
| 22 |
+
|
| 23 |
+
**Release status:** adapter files and inference implementation will be uploaded when ready.
|
| 24 |
+
|
| 25 |
+
## Architecture
|
| 26 |
+
|
| 27 |
+
| Component | Specification |
|
| 28 |
+
|---|---|
|
| 29 |
+
| Base model | zai-org/GLM-4.7-Flash |
|
| 30 |
+
| Model family | GLM |
|
| 31 |
+
| Architecture | Mixture-of-experts causal language model |
|
| 32 |
+
| Total parameters | Approximately 30 billion |
|
| 33 |
+
| Active parameters per token | Approximately 3 billion |
|
| 34 |
+
| Adaptation method | Attention-only LoRA |
|
| 35 |
+
| Trainable adapter parameters | 10,515,968 |
|
| 36 |
+
| Trainable proportion | Approximately 0.0351% |
|
| 37 |
+
| Base-weight precision during training | BF16 |
|
| 38 |
+
| Implementation | PyTorch, Transformers and PEFT |
|
| 39 |
+
|
| 40 |
+
The original model weights remain frozen during post-training. The adapter introduces trainable low-rank updates to selected attention projections.
|
| 41 |
+
|
| 42 |
+
## Post-training
|
| 43 |
+
|
| 44 |
+
Phishing Guard uses supervised fine-tuning on labeled English email examples.
|
| 45 |
+
|
| 46 |
+
The training objective is completion-only causal language modeling: prompt tokens are masked from the loss, and the model learns to produce the classification label and end-of-sequence token.
|
| 47 |
+
|
| 48 |
+
### LoRA configuration
|
| 49 |
+
|
| 50 |
+
| Parameter | Value |
|
| 51 |
+
|---|---|
|
| 52 |
+
| Rank | 8 |
|
| 53 |
+
| Alpha | 16 |
|
| 54 |
+
| Dropout | 0.05 |
|
| 55 |
+
| Bias adaptation | None |
|
| 56 |
+
| Task type | CAUSAL_LM |
|
| 57 |
+
|
| 58 |
+
Targeted attention modules:
|
| 59 |
+
|
| 60 |
+
- `q_a_proj`
|
| 61 |
+
- `q_b_proj`
|
| 62 |
+
- `kv_a_proj_with_mqa`
|
| 63 |
+
- `kv_b_proj`
|
| 64 |
+
- `o_proj`
|
| 65 |
+
|
| 66 |
+
### Training configuration
|
| 67 |
+
|
| 68 |
+
| Parameter | Configuration |
|
| 69 |
+
|---|---|
|
| 70 |
+
| Training hardware | NVIDIA DGX Spark / GB10 |
|
| 71 |
+
| Maximum sequence length | 1,024 tokens |
|
| 72 |
+
| Microbatch size | 1 |
|
| 73 |
+
| Gradient accumulation | 16 |
|
| 74 |
+
| Effective batch size | 16 |
|
| 75 |
+
| Initial learning rate | 0.0001 |
|
| 76 |
+
| Optimizer | AdamW |
|
| 77 |
+
| Planned training duration | 1 epoch |
|
| 78 |
+
| Gradient checkpointing | Enabled |
|
| 79 |
+
| Random seed | 42 |
|
| 80 |
+
|
| 81 |
+
Training data preparation removes normalized exact duplicates and entries with conflicting labels before creating stratified training, validation and test splits.
|
| 82 |
+
|
| 83 |
+
Dataset source: `zefang-liu/phishing-email-dataset`.
|
| 84 |
+
|
| 85 |
+
Source revisions and preprocessing details will accompany the release.
|
| 86 |
+
|
| 87 |
+
## Input and output
|
| 88 |
+
|
| 89 |
+
### Input
|
| 90 |
+
|
| 91 |
+
Email text supplied as untrusted content within a chat prompt.
|
| 92 |
+
|
| 93 |
+
The system instruction directs the model to classify the email rather than follow instructions embedded within it. This prompt design does not establish immunity to prompt injection.
|
| 94 |
+
|
| 95 |
+
Inputs are truncated to fit the configured token budget. Long messages may require application-level segmentation.
|
| 96 |
+
|
| 97 |
+
### Output
|
| 98 |
+
|
| 99 |
+
The expected response is one label:
|
| 100 |
+
|
| 101 |
+
| Label | Meaning |
|
| 102 |
+
|---|---|
|
| 103 |
+
| `PHISHING` | The supplied text is classified as phishing |
|
| 104 |
+
| `LEGITIMATE` | No phishing detected in the supplied text |
|
| 105 |
+
|
| 106 |
+
Applications should handle any other output as an invalid classification requiring review.
|
| 107 |
+
|
| 108 |
+
`LEGITIMATE` is not a guarantee that an email, sender, URL or attachment is safe.
|
| 109 |
+
|
| 110 |
+
## Reuse and integration
|
| 111 |
+
|
| 112 |
+
The planned release distributes a PEFT LoRA adapter rather than a standalone copy of the full base model.
|
| 113 |
+
|
| 114 |
+
Local inference requires:
|
| 115 |
+
|
| 116 |
+
1. Loading the compatible GLM-4.7-Flash base-model revision.
|
| 117 |
+
2. Loading the tokenizer and adapter.
|
| 118 |
+
3. Applying the documented chat template and preprocessing.
|
| 119 |
+
4. Generating and validating the classification label.
|
| 120 |
+
|
| 121 |
+
The release will include the adapter configuration, adapter weights, tokenizer files, base-model revision and tested inference instructions.
|
| 122 |
+
|
| 123 |
+
### Planned repository contents
|
| 124 |
+
|
| 125 |
+
| File | Purpose |
|
| 126 |
+
|---|---|
|
| 127 |
+
| `adapter_config.json` | PEFT configuration and base-model reference |
|
| 128 |
+
| `adapter_model.safetensors` | Trained LoRA weights |
|
| 129 |
+
| Tokenizer files | Tokenization and chat-template configuration |
|
| 130 |
+
| `run.json` | Training configuration and base-model revision |
|
| 131 |
+
| `inference.py` | Local inference entry point |
|
| 132 |
+
| Dependency specification | Compatible runtime packages |
|
| 133 |
+
| `README.md` | Model documentation and usage instructions |
|
| 134 |
+
|
| 135 |
+
These files will be added when the release is ready.
|
| 136 |
+
|
| 137 |
+
## Local deployment
|
| 138 |
+
|
| 139 |
+
Phishing Guard is intended for integration into email triage, security tools and defensive agent workflows.
|
| 140 |
+
|
| 141 |
+
Users can load the base model and adapter within their own Python applications using Transformers and PEFT.
|
| 142 |
+
|
| 143 |
+
The adapter is small relative to the base model, but inference still requires sufficient memory for the underlying GLM model. Quantized deployment requires a compatible implementation and separate verification.
|
| 144 |
+
|
| 145 |
+
## Operational scope
|
| 146 |
+
|
| 147 |
+
This version performs text-based binary classification.
|
| 148 |
+
|
| 149 |
+
It does not independently:
|
| 150 |
+
|
| 151 |
+
- Verify SPF, DKIM or DMARC.
|
| 152 |
+
- Establish sender identity.
|
| 153 |
+
- Inspect binary attachments.
|
| 154 |
+
- Retrieve live URL reputation.
|
| 155 |
+
- Provide calibrated confidence scores.
|
| 156 |
+
|
| 157 |
+
Application integrations should combine classifications with email metadata, established security controls and human review where appropriate.
|
| 158 |
+
|
| 159 |
+
## Licensing and attribution
|
| 160 |
+
|
| 161 |
+
GLM-4.7-Flash is the upstream base model developed by Z.ai.
|
| 162 |
+
|
| 163 |
+
The base model and training dataset have separate licensing terms. Adapter release terms and attribution notices will be provided with the downloadable files.
|
| 164 |
+
|
| 165 |
+
## About Gl00be
|
| 166 |
+
|
| 167 |
+
Gl00be develops AI cybersecurity systems focused on autonomous agents, vulnerability discovery and defensive intelligence.
|
| 168 |
+
|
| 169 |
+
Website: https://cybersecurity.gl00be.com
|