🛡️ MinimoSec V4

Fine-Tuned Cybersecurity LLM — Gemma 4 E2B

Cybersecurity-specialised language model for Portuguese-speaking analysts

Base Model Fine-Tuning Dataset Language Domain

HuggingFace GGUF Website

🇬🇧 English  |  🇵🇹 Português


🇬🇧 English


📌 Model Description

MinimoSec V4 is a cybersecurity-specialised language model fine-tuned from Google Gemma 4 E2B using supervised fine-tuning (SFT) with Low-Rank Adaptation (LoRA) via the Unsloth framework.

The model was trained on 22,571 Portuguese-language cybersecurity examples covering threat analysis, malware identification, MITRE ATT&CK mapping, YARA rule generation, IOC extraction, and digital forensics. It is designed to assist security analysts, SOC teams, and researchers in Portuguese-speaking environments.

Specification Detail
Primary Language Portuguese (pt-PT / pt-BR)
Domain Cybersecurity, Threat Intelligence, Digital Forensics
Base Model google/gemma-4-e2b-it
Training Epochs 1 (V4-final with 3 epochs in development)
Quantisation Available Q4_K_M GGUF (~3.2 GB)

🧪 Empirical Benchmark: MinimoSec V4 vs Gemma 4 Base

To evaluate the impact of fine-tuning, both models were submitted to an identical advanced cybersecurity scenario — a standard methodology used in domain-specific NLP evaluation.

Evaluation Scenario

"You are analysing a malware sample. The PE file imports VirtualAlloc, WriteProcessMemory, CreateRemoteThread, NtUnmapViewOfSection and GetProcAddress. In a sandbox environment, it creates a child process of explorer.exe but the PPID does not match the real PID of explorer.exe. Furthermore, the file on disk is 120 KB but the loaded module in memory is 2.4 MB.

Identify the evasion technique used, indicate the exact MITRE ATT&CK techniques with sub-techniques, write a functional YARA rule to detect this malware in memory, list relevant IOCs, and describe how you would perform forensic analysis using Volatility3. Answer in Portuguese."

This scenario was specifically designed to require simultaneous knowledge of PE import analysis, Process Hollowing (T1055.012), PPID Spoofing (T1134.004), YARA rule syntax, and Volatility3 command-line forensics — concepts that rarely appear together in generic training data but are common in real-world SOC workflows.

Scoring Methodology

Criterion Weight Rationale
Main technique identification 15% Core threat recognition
MITRE ATT&CK precision 25% Highest weight — exact TTP mapping is critical in SOC workflows
YARA rule functional quality 20% Directly actionable output
IOC relevance and specificity 15% Operational intelligence value
Volatility3 command correctness 15% Forensic procedural accuracy
Overall technical coherence 10% Consistency and absence of contradictions

📈 Results

Detailed Scoring

Criterion Weight Gemma 4 Base MinimoSec V4
Main technique identification 15% 6/10 8/10
MITRE ATT&CK precision 25% 3/10 7/10
YARA rule functional quality 20% 2/10 6/10
IOC relevance and specificity 15% 5/10 6/10
Volatility3 command correctness 15% 4/10 5/10
Overall technical coherence 10% 5/10 7/10

Weighted Final Scores

Model Calculation Score
Gemma 4 Base (6×0.15) + (3×0.25) + (2×0.20) + (5×0.15) + (4×0.15) + (5×0.10) 3.90 / 10
MinimoSec V4 (8×0.15) + (7×0.25) + (6×0.20) + (6×0.15) + (5×0.15) + (7×0.10) 6.50 / 10
Improvement (6.50 - 3.90) / 3.90 × 100 +66.7%

🔍 Qualitative Findings

✅ Where MinimoSec V4 Outperformed the Base Model

  • MITRE ATT&CK mapping: The base model incorrectly used T1574 (Hijack Execution Flow / DLL Hijacking) for a Process Injection scenario. MinimoSec V4 correctly identified T1055 (Process Injection). This is a critical distinction in threat reporting and SOC playbook execution.

  • YARA rule construction: The base model searched for 0x414C4C4F (the bytes "ALLO" from "VirtualAlloc"), a naïve approach generating massive false positives on any Windows system. MinimoSec V4 searched for the actual API name strings in ASCII/Wide format, which is the standard approach for PE static analysis.

  • Technical coherence: MinimoSec V4 maintained consistent technical framing, correctly contextualising Process Hollowing as a memory-resident evasion technique.

⚠️ Limitations Identified in Both Models (Expected at 1 Epoch / 2B Parameters)

  • Neither model identified the specific sub-technique T1055.012 (Process Hollowing), the precise classification given the use of NtUnmapViewOfSection.
  • Neither model identified T1134.004 (PPID Spoofing), directly indicated by the PPID inconsistency in the scenario.
  • Neither model explained the 120 KB on disk vs 2.4 MB in memory discrepancy — a strong indicator of a compressed payload unpacked at runtime, characteristic of Cobalt Strike or Meterpreter.
  • Both models mixed Volatility2 and Volatility3 syntax in forensics commands.

These gaps form the basis for the V4-final training roadmap (3 epochs, expanded dataset).


🏆 Performance Summary

Model Score Capability Level
Gemma 4 Base (no fine-tuning) 39% Generic junior analyst
MinimoSec V4 (1 epoch) 65% Specialised security analyst
MinimoSec V4-final (3 epochs, projected) ~82% Senior specialised analyst

Fine-tuning on 22,571 domain-specific examples produced a +66.7% improvement in cybersecurity technical precision with only 1 training epoch on a 2B parameter model.


🚀 Quick Start

Ollama (Recommended)

ollama run hf.co/dolutech/MinimoSec-V4-GGUF:MinimoSec-V4.Q4_K_M.gguf

LM Studio

  1. Download MinimoSec-V4.Q4_K_M.gguf from the GGUF repository
  2. Load it manually in LM Studio
  3. Note: Also download MinimoSec-V4.BF16-mmproj.gguf for multimodal (vision) support

Python (Transformers)

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "dolutech/MinimoSec-V4"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [
    {"role": "user", "content": "Cria uma regra YARA para detetar ransomware que encripta ficheiros .docx e .xlsx."}
]

inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512, temperature=1.0, top_p=0.95)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

💬 Recommended System Prompt

És o MinimoSec V4, um assistente especializado em cibersegurança desenvolvido pela Dolutech.
Respondes sempre em Português de Portugal.
És especialista em MITRE ATT&CK, regras YARA, análise de malware, IOCs, threat intelligence e forense digital.
Forneces respostas técnicas, precisas e estruturadas.

📋 Training Details

Parameter Value
Base model google/gemma-4-e2b-it
Framework Unsloth 2026.4.5
Method SFT + LoRA
LoRA rank 16
LoRA alpha 16
Target modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Training epochs 1
Max sequence length 2048
Batch size 2 (gradient accumulation 4)
Dataset size 22,571 examples
Dataset language Portuguese
Hardware 2× NVIDIA Tesla T4 (Kaggle)
Quantisation 4-bit (bitsandbytes, training) / Q4_K_M GGUF (inference)

📁 Available Files

File Size Use Case
MinimoSec-V4.Q4_K_M.gguf ~3.2 GB Local inference (Ollama, LM Studio, llama.cpp)
MinimoSec-V4.BF16-mmproj.gguf ~942 MB Vision/multimodal projection layer

🗺️ Roadmap

  • MinimoSec V4-final: 3 training epochs, expanded dataset (target: ~82% benchmark score)
  • MinimoSec V5: Larger base model (7B+), extended context (4096 tokens), English/Portuguese bilingual
  • CyberSecEval benchmark: Formal evaluation against Meta's CyberSecEval suite
  • API: REST endpoint for SOC tool integration

⚠️ Limitations

  • Trained for 1 epoch only; may miss advanced sub-techniques (e.g. T1055.012, T1134.004)
  • Optimised for Portuguese; English responses may be less precise
  • 2B parameter model; complex multi-step reasoning may require the V4-final version
  • Not a replacement for a certified security analyst — use as an assistive tool

📜 License

This model is released under the Gemma Terms of Use. The fine-tuning dataset and weights are provided for research and educational purposes.


🏢 About

Developed by Dolutech — cybersecurity research and open-source tooling for Portuguese-speaking communities.

Website HuggingFace Model Repo GGUF Repo


MinimoSec V4 — Bringing specialised cybersecurity intelligence to Portuguese-speaking analysts. 🇵🇹🇧🇷



🇵🇹 Português


📌 Descrição do Modelo

MinimoSec V4 é um modelo de linguagem especializado em cibersegurança, fine-tuned a partir do Google Gemma 4 E2B usando supervised fine-tuning (SFT) com Low-Rank Adaptation (LoRA) via o framework Unsloth.

O modelo foi treinado com 22.571 exemplos de cibersegurança em Português cobrindo análise de ameaças, identificação de malware, mapeamento MITRE ATT&CK, geração de regras YARA, extração de IOCs e forense digital. Projetado para assistir analistas de segurança, equipas SOC e investigadores em ambientes lusófonos.

Especificação Detalhe
Idioma Principal Português (pt-PT / pt-BR)
Domínio Cibersegurança, Threat Intelligence, Forense Digital
Modelo Base google/gemma-4-e2b-it
Épocas de Treino 1 (V4-final com 3 épocas em desenvolvimento)
Quantização Disponível Q4_K_M GGUF (~3,2 GB)

🧪 Benchmark Empírico: MinimoSec V4 vs Gemma 4 Base

Para avaliar o impacto do fine-tuning, ambos os modelos foram submetidos a um cenário idêntico de cibersegurança avançada — metodologia padrão usada em avaliação NLP de domínio específico.

Cenário de Avaliação

"You are analysing a malware sample. The PE file imports VirtualAlloc, WriteProcessMemory, CreateRemoteThread, NtUnmapViewOfSection and GetProcAddress. In a sandbox environment, it creates a child process of explorer.exe but the PPID does not match the real PID of explorer.exe. Furthermore, the file on disk is 120 KB but the loaded module in memory is 2.4 MB.

Identify the evasion technique used, indicate the exact MITRE ATT&CK techniques with sub-techniques, write a functional YARA rule to detect this malware in memory, list relevant IOCs, and describe how you would perform forensic analysis using Volatility3. Answer in Portuguese."

Este cenário foi desenhado para exigir conhecimento simultâneo de análise de imports PE, Process Hollowing (T1055.012), PPID Spoofing (T1134.004), sintaxe YARA e forense com Volatility3 — conceitos que raramente aparecem juntos em dados de treino genéricos, mas são comuns em workflows SOC reais.

Metodologia de Pontuação

Critério Peso Racional
Identificação da técnica principal 15% Reconhecimento central da ameaça
Precisão MITRE ATT&CK 25% Maior peso — mapeamento exacto de TTPs é crítico em workflows SOC
Qualidade funcional da regra YARA 20% Output directamente acionável
Relevância e especificidade dos IOCs 15% Valor de inteligência operacional
Correcção dos comandos Volatility3 15% Precisão processual forense
Coerência técnica geral 10% Consistência e ausência de contradições

📈 Resultados

Pontuação Detalhada

Critério Peso Gemma 4 Base MinimoSec V4
Identificação da técnica principal 15% 6/10 8/10
Precisão MITRE ATT&CK 25% 3/10 7/10
Qualidade funcional da regra YARA 20% 2/10 6/10
Relevância e especificidade dos IOCs 15% 5/10 6/10
Correcção dos comandos Volatility3 15% 4/10 5/10
Coerência técnica geral 10% 5/10 7/10

Pontuação Final Ponderada

Modelo Cálculo Score
Gemma 4 Base (6×0.15) + (3×0.25) + (2×0.20) + (5×0.15) + (4×0.15) + (5×0.10) 3.90 / 10
MinimoSec V4 (8×0.15) + (7×0.25) + (6×0.20) + (6×0.15) + (5×0.15) + (7×0.10) 6.50 / 10
Melhoria (6.50 - 3.90) / 3.90 × 100 +66.7%

🔍 Análise Qualitativa

✅ Onde o MinimoSec V4 Superou o Modelo Base

  • Mapeamento MITRE ATT&CK: O modelo base usou incorrectamente T1574 (Hijack Execution Flow / DLL Hijacking) para um cenário de Process Injection. O MinimoSec V4 identificou correctamente T1055 (Process Injection). Esta é uma distinção crítica em relatórios de ameaças e execução de playbooks SOC.

  • Construção da regra YARA: O modelo base procurou 0x414C4C4F (bytes "ALLO" de "VirtualAlloc"), uma abordagem naïve que gera falsos positivos massivos em qualquer sistema Windows. O MinimoSec V4 procurou as strings de nomes das APIs em formato ASCII/Wide, a abordagem padrão para análise estática PE.

  • Coerência técnica: O MinimoSec V4 manteve um enquadramento técnico consistente, contextualizando correctamente Process Hollowing como uma técnica de evasão residente em memória.

⚠️ Limitações Identificadas em Ambos os Modelos (Esperado para 1 Época / 2B Parâmetros)

  • Nenhum modelo identificou a sub-técnica específica T1055.012 (Process Hollowing), a classificação precisa dado o uso de NtUnmapViewOfSection.
  • Nenhum modelo identificou T1134.004 (PPID Spoofing), directamente indicada pela inconsistência de PPID no cenário.
  • Nenhum modelo explicou a discrepância de 120 KB em disco vs 2.4 MB em memória — um forte indicador de payload comprimido descompactado em runtime, característico de Cobalt Strike ou Meterpreter.
  • Ambos os modelos misturaram sintaxe Volatility2 e Volatility3 nos comandos de forense.

Estas lacunas formam a base do roadmap de treino da V4-final (3 épocas, dataset expandido).


🏆 Resumo de Performance

Modelo Score Nível de Capacidade
Gemma 4 Base (sem fine-tuning) 39% Analista júnior genérico
MinimoSec V4 (1 época) 65% Analista de segurança especializado
MinimoSec V4-final (3 épocas, projetado) ~82% Analista sénior especializado

Fine-tuning com 22.571 exemplos de domínio específico produziu uma melhoria de +66.7% na precisão técnica de cibersegurança com apenas 1 época de treino num modelo de 2B parâmetros.


🚀 Quick Start

Ollama (Recomendado)

ollama run hf.co/dolutech/MinimoSec-V4-GGUF:MinimoSec-V4.Q4_K_M.gguf

LM Studio

  1. Download MinimoSec-V4.Q4_K_M.gguf do repositório GGUF
  2. Carregar manualmente no LM Studio
  3. Nota: Download também de MinimoSec-V4.BF16-mmproj.gguf para suporte multimodal (visão)

Python (Transformers)

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "dolutech/MinimoSec-V4"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [
    {"role": "user", "content": "Cria uma regra YARA para detetar ransomware que encripta ficheiros .docx e .xlsx."}
]

inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512, temperature=1.0, top_p=0.95)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

💬 System Prompt Recomendado

És o MinimoSec V4, um assistente especializado em cibersegurança desenvolvido pela Dolutech.
Respondes sempre em Português de Portugal.
És especialista em MITRE ATT&CK, regras YARA, análise de malware, IOCs, threat intelligence e forense digital.
Forneces respostas técnicas, precisas e estruturadas.

📋 Detalhes do Treino

Parâmetro Valor
Modelo base google/gemma-4-e2b-it
Framework Unsloth 2026.4.5
Método SFT + LoRA
LoRA rank 16
LoRA alpha 16
Módulos alvo q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Épocas de treino 1
Comprimento máximo de sequência 2048
Batch size 2 (gradient accumulation 4)
Tamanho do dataset 22.571 exemplos
Idioma do dataset Português
Hardware 2× NVIDIA Tesla T4 (Kaggle)
Quantização 4-bit (bitsandbytes, treino) / Q4_K_M GGUF (inferência)

📁 Ficheiros Disponíveis

Ficheiro Tamanho Caso de Uso
MinimoSec-V4.Q4_K_M.gguf ~3.2 GB Inferência local (Ollama, LM Studio, llama.cpp)
MinimoSec-V4.BF16-mmproj.gguf ~942 MB Camada de projeção visão/multimodal

🗺️ Roadmap

  • MinimoSec V4-final: 3 épocas de treino, dataset expandido (objectivo: ~82% benchmark score)
  • MinimoSec V5: Modelo base maior (7B+), contexto estendido (4096 tokens), bilingue Inglês/Português
  • CyberSecEval benchmark: Avaliação formal contra o suite CyberSecEval da Meta
  • API: Endpoint REST para integração com ferramentas SOC

⚠️ Limitações

  • Treinado por apenas 1 época; pode não identificar sub-técnicas avançadas (e.g. T1055.012, T1134.004)
  • Optimizado para Português; respostas em Inglês podem ser menos precisas
  • Modelo de 2B parâmetros; raciocínio multi-passo complexo pode requerer a versão V4-final
  • Não substitui um analista de segurança certificado — usar como ferramenta assistiva

📜 Licença

Este modelo é lançado sob os Gemma Terms of Use. O dataset de fine-tuning e os pesos são disponibilizados para fins de investigação e educação.


🏢 Sobre

Desenvolvido pela Dolutech — investigação em cibersegurança e ferramentas open-source para comunidades lusófonas.

Website HuggingFace Model Repo GGUF Repo


MinimoSec V4 — Trazendo inteligência de cibersegurança especializada para analistas lusófonos. 🇵🇹 / 🇵🇹🇧🇷

Downloads last month
221
GGUF
Model size
5B params
Architecture
gemma4
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for dolutech/MinimoSec-V4-GGUF

Quantized
(184)
this model