bixby404's picture
Update README.md
09ee4b5 verified
|
Raw
History Blame Contribute Delete
3.21 kB
---
library_name: transformers
tags:
- peft
- qlora
- lora
- cybersecurity
- text-generation
base_model: microsoft/Phi-3-mini-4k-instruct
---
# Model Card for Cybersecurity Assistant Sandbox
This model is a proof-of-concept conversational LLM fine-tuned to provide clean, direct definitions and concept explanations for machine learning architectures, NLP principles, and cybersecurity fundamentals.
## Model Details
### Model Description
This is a Parameter-Efficient Fine-Tuning (PEFT) adapter layer built using Low-Rank Adaptation (LoRA). It has been adapted from a quantized 4-bit base LLM to deliver specific, highly structured answers to technical instructions while minimizing verbose internet filler text.
- **Developed by:** bixby404
- **Model type:** Causal Language Model (LoRA Adapter)
- **Language(s) (NLP):** English
- **Finetuned from model:** microsoft/Phi-3-mini-4k-instruct
### Model Sources
- **Repository:** https://huggingface.co/bixby404/cybersecurity-assistant
- **Demo:** Hosted via Google Colab and Gradio UI Sandbox
## Uses
### Direct Use
This model is intended to be used directly as a lightweight technical assistant. It excels at answering explicit, structured definitions matching the instructions provided in its training regimen.
### Out-of-Scope Use
This model is **not** designed for:
- Writing production-grade exploit scripts or malicious software.
- Analyzing enterprise system log traffic in real-time.
- Serving as a standalone automated incident response tool without human oversight.
## Bias, Risks, and Limitations
Due to the compact dataset size (100 rows), the model acts primarily as a behavior/style filter rather than an extensive new knowledge repository. It carries a structural dependency on its base architecture (`Phi-3`) for general reasoning and might display style regression if prompted with heavily out-of-domain scenarios.
### Recommendations
Users should verify any specialized security remediations or definitions generated against official standards (such as NIST or MITRE ATT&CK frameworks) before executing them in live corporate lab environments.
## How to Get Started with the Model
Use the PyTorch execution code below in a standard Google Colab environment containing a T4 GPU runtime to interface with this model adapter:
```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, pipeline
from peft import PeftModel
base_model_name = "microsoft/Phi-3-mini-4k-instruct"
hf_adapter_id = "bixby404/cybersecurity-assistant"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16
)
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
quantization_config=bnb_config,
device_map="auto"
)
model = PeftModel.from_pretrained(model, hf_adapter_id)
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
test_prompt = "### Instruction:\nWhat is the primary function of an LLM?\n\n### Response:\n"
outputs = generator(test_prompt, max_new_tokens=50, return_full_text=False)
print(outputs[0]['generated_text'])