Transformers
Safetensors
PEFT
English
text-generation-inference
gemma4
trl
cybersecurity
devsecops
security
lora
Instructions to use rezaduty/gemma4-e2b-cybersecurity-interview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rezaduty/gemma4-e2b-cybersecurity-interview with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rezaduty/gemma4-e2b-cybersecurity-interview", dtype="auto") - PEFT
How to use rezaduty/gemma4-e2b-cybersecurity-interview with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Update README: remove Unsloth branding, add detailed capabilities and usage
Browse files
README.md
CHANGED
|
@@ -1,22 +1,158 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
| 3 |
tags:
|
| 4 |
- text-generation-inference
|
| 5 |
- transformers
|
| 6 |
-
- unsloth
|
| 7 |
- gemma4
|
| 8 |
- trl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
license: apache-2.0
|
| 10 |
language:
|
| 11 |
- en
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
- **
|
| 17 |
-
- **License:** apache-2.0
|
| 18 |
-
- **Finetuned from model :** unsloth/gemma-4-e2b-it-unsloth-bnb-4bit
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
[
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: google/gemma-4-e2b-it
|
| 3 |
tags:
|
| 4 |
- text-generation-inference
|
| 5 |
- transformers
|
|
|
|
| 6 |
- gemma4
|
| 7 |
- trl
|
| 8 |
+
- peft
|
| 9 |
+
- cybersecurity
|
| 10 |
+
- devsecops
|
| 11 |
+
- security
|
| 12 |
+
- lora
|
| 13 |
license: apache-2.0
|
| 14 |
language:
|
| 15 |
- en
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# Gemma 4 E2B — Cybersecurity Interview Expert
|
| 19 |
|
| 20 |
+
A QLoRA fine-tuned version of [Gemma 4 E2B Instruct](https://huggingface.co/google/gemma-4-e2b-it) specialized in **deep, production-level cybersecurity knowledge**. This model answers technical security interview questions with precision, concrete examples, and actionable recommendations.
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## Model Details
|
| 25 |
+
|
| 26 |
+
| Property | Value |
|
| 27 |
+
|---|---|
|
| 28 |
+
| **Base model** | google/gemma-4-e2b-it (2B parameters) |
|
| 29 |
+
| **Fine-tuning method** | QLoRA (rank 16, α 16) |
|
| 30 |
+
| **Trainable parameters** | 31M / 5.15B (0.60%) |
|
| 31 |
+
| **Training data** | 646 curated cybersecurity interview Q&A pairs |
|
| 32 |
+
| **Epochs** | 3 |
|
| 33 |
+
| **Final training loss** | 0.574 |
|
| 34 |
+
| **License** | Apache 2.0 |
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## Expertise & Capabilities
|
| 39 |
+
|
| 40 |
+
This model demonstrates expert-level knowledge across the full spectrum of modern cybersecurity:
|
| 41 |
+
|
| 42 |
+
### Cloud & Container Security
|
| 43 |
+
- Docker security hardening (rootless containers, capabilities, seccomp, AppArmor)
|
| 44 |
+
- Kubernetes RBAC, Pod Security Standards, network policies, admission controllers
|
| 45 |
+
- AWS IAM least-privilege design, ECR image scanning, Terraform security patterns
|
| 46 |
+
- Cloud-native threat modeling and attack surface reduction
|
| 47 |
+
|
| 48 |
+
### DevSecOps & CI/CD
|
| 49 |
+
- Secure pipeline design (ArgoCD, GitHub Actions, GitLab CI)
|
| 50 |
+
- Supply chain security: SLSA, SBOM, sigstore/cosign, dependency verification
|
| 51 |
+
- Secrets management (Vault, AWS Secrets Manager, SOPS)
|
| 52 |
+
- Infrastructure-as-Code security scanning (Checkov, tfsec, Terrascan)
|
| 53 |
+
|
| 54 |
+
### Application & Secure Coding
|
| 55 |
+
- OWASP Top 10 — root cause analysis and remediation
|
| 56 |
+
- Injection attacks (SQL, command, LDAP, template), XSS, SSRF, deserialization
|
| 57 |
+
- Authentication & authorization: OAuth 2.0, OIDC, JWT, PKCE, session security
|
| 58 |
+
- Cryptography: TLS configuration, key management, algorithm selection
|
| 59 |
+
|
| 60 |
+
### Threat Intelligence & Offensive Security
|
| 61 |
+
- SOC operations, SIEM correlation rules, threat hunting
|
| 62 |
+
- MITRE ATT&CK mapping and adversary emulation
|
| 63 |
+
- Active Directory attack paths (Kerberoasting, Pass-the-Hash, DCSync)
|
| 64 |
+
- Red team tactics and purple team collaboration
|
| 65 |
+
|
| 66 |
+
### Emerging & Specialized Domains
|
| 67 |
+
- AI/LLM security: prompt injection, model poisoning, guardrail bypasses
|
| 68 |
+
- OT/ICS/SCADA security: Purdue model, IEC 62443, air-gap strategies
|
| 69 |
+
- Blockchain & smart contract auditing (reentrancy, overflow, access control)
|
| 70 |
+
- Digital forensics, incident response, and malware analysis
|
| 71 |
+
|
| 72 |
+
---
|
| 73 |
+
|
| 74 |
+
## Usage
|
| 75 |
+
|
| 76 |
+
```python
|
| 77 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 78 |
+
from peft import PeftModel
|
| 79 |
+
import torch
|
| 80 |
+
|
| 81 |
+
base_model = "google/gemma-4-e2b-it"
|
| 82 |
+
adapter = "rezaduty/gemma4-e2b-cybersecurity-interview"
|
| 83 |
+
|
| 84 |
+
tokenizer = AutoTokenizer.from_pretrained(adapter)
|
| 85 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 86 |
+
base_model,
|
| 87 |
+
torch_dtype=torch.bfloat16,
|
| 88 |
+
device_map="auto",
|
| 89 |
+
)
|
| 90 |
+
model = PeftModel.from_pretrained(model, adapter)
|
| 91 |
+
|
| 92 |
+
messages = [
|
| 93 |
+
{
|
| 94 |
+
"role": "system",
|
| 95 |
+
"content": [{"type": "text", "text": (
|
| 96 |
+
"You are an expert cybersecurity engineer specializing in DevSecOps, "
|
| 97 |
+
"container security, and cloud-native security. Answer technical interview "
|
| 98 |
+
"questions with depth, precision, and concrete examples."
|
| 99 |
+
)}]
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"role": "user",
|
| 103 |
+
"content": [{"type": "text", "text": "Explain why running Docker containers as root is a security risk and how to fix it."}]
|
| 104 |
+
},
|
| 105 |
+
]
|
| 106 |
+
|
| 107 |
+
inputs = tokenizer.apply_chat_template(
|
| 108 |
+
messages,
|
| 109 |
+
tokenize=True,
|
| 110 |
+
add_generation_prompt=True,
|
| 111 |
+
return_tensors="pt",
|
| 112 |
+
).to(model.device)
|
| 113 |
+
|
| 114 |
+
output = model.generate(
|
| 115 |
+
input_ids=inputs,
|
| 116 |
+
max_new_tokens=512,
|
| 117 |
+
temperature=0.7,
|
| 118 |
+
top_p=0.9,
|
| 119 |
+
use_cache=True,
|
| 120 |
+
)
|
| 121 |
+
print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True))
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
---
|
| 125 |
+
|
| 126 |
+
## Training Dataset
|
| 127 |
+
|
| 128 |
+
Covers 15 curated topic domains across 646 high-quality question/answer pairs:
|
| 129 |
+
|
| 130 |
+
- Container & Kubernetes security
|
| 131 |
+
- Cloud IAM, ECR, Terraform security
|
| 132 |
+
- CI/CD and ArgoCD pipeline security
|
| 133 |
+
- AI/LLM security
|
| 134 |
+
- DevOps patterns and security tooling
|
| 135 |
+
- Secure coding (OWASP, injection, crypto)
|
| 136 |
+
- SOC operations and threat intelligence
|
| 137 |
+
- Active Directory and red team techniques
|
| 138 |
+
- Software architecture and design security
|
| 139 |
+
- Authentication, identity, and supply chain
|
| 140 |
+
- OT/ICS/SCADA security
|
| 141 |
+
- Blockchain and smart contract security
|
| 142 |
+
- OS hardening, cloud SaaS, and forensics
|
| 143 |
+
|
| 144 |
+
---
|
| 145 |
+
|
| 146 |
+
## System Prompt
|
| 147 |
+
|
| 148 |
+
For best results, use this system prompt:
|
| 149 |
+
|
| 150 |
+
```
|
| 151 |
+
You are an expert cybersecurity engineer specializing in DevSecOps, container security, and cloud-native security. Answer technical interview questions with depth, precision, and concrete examples.
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
---
|
| 155 |
+
|
| 156 |
+
## Developed by
|
| 157 |
|
| 158 |
+
[rezaduty](https://huggingface.co/rezaduty)
|