CySent-SmolLM3-3B is a fine-tuned version of
HuggingFaceTB/SmolLM3-3B, specifically adapted for cybersecurity instruction-following tasks. It was trained on a 20,000-sample subset of the
Trendyol/Trendyol-Cybersecurity-Instruction-Tuning-Dataset. This model aims to act as a knowledgeable assistant for a wide range of cybersecurity topics.
It achieves the following results on the evaluation set:
This model is designed to assist with a variety of natural language cybersecurity tasks, including:
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = "RamzyBakir/CySent-SmolLM3-3B"
5
6# Load the model and tokenizer
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 torch_dtype=torch.bfloat16,
10 device_map="auto"
11)
12tokenizer = AutoTokenizer.from_pretrained(model_name)
13
14# Create a prompt
15prompt = "### Instruction:\nExplain what a SQL injection attack is and provide a simple example of a vulnerable code snippet.\n\n### Response:\n"
16
17# Generate a response
18inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
19output = model.generate(**inputs, max_new_tokens=250, do_sample=True, temperature=0.7, top_p=0.9)
20
21# Decode and print the result
22response = tokenizer.decode(output[0], skip_special_tokens=True)
23print(response)
The model was fine-tuned using Low-Rank Adaptation (LoRA) with the following configuration:
The model was trained for 3200 steps on a single H200 GPU. The training and validation metrics progressed as follows:
The model achieved its best performance at the final step, with a validation loss of 0.757 and a mean token accuracy of 0.796.