Downloads · 30 days
7
9% of all-time downloads
atlas-institute/gemma4-26b-a4b-dapt-offsec
gemma4-26b-a4b-dapt-offsec is a text generation model from atlas-institute. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
LoRA adapter for google/gemma-4-26B-A4B-it, domain-adaptive continued pretrained (DAPT) on an offensive security code corpus. This adapter grounds the model in security tooling patterns — exploit frameworks, C2 infras…
Downloads · 30 days
7
9% of all-time downloads
All-time downloads
81
Public
Repo size
1.1 GB
Likes
0
Public
Click a slice to open those files.
.safetensors474 MB · 57%
From the Hugging Face model README
LoRA adapter for google/gemma-4-26B-A4B-it, domain-adaptive continued pretrained (DAPT) on an offensive security code corpus. This adapter grounds the model in security tooling patterns — exploit frameworks, C2 infrastructure, network reconnaissance, privilege escalation — before downstream SFT and RL stages.
Part of the Code-Trainer / RTPI pipeline (GitHub).
Gemma 4 26B-A4B is a Mixture-of-Experts model: 128 experts + 1 shared expert, 8 active per layer, 30 layers (25 sliding-window @ 1024 + 5 full attention). Total parameters: 25.8B; active per forward pass: 3.8B.
LoRA targeting constraint: the routed expert FFN layers use 3D
nn.Parameter tensors that PEFT cannot target. LoRA is applied only to
shared attention + shared MLP modules (q_proj, k_proj, v_proj,
o_proj, gate_proj, up_proj, down_proj). Domain vocabulary is still
injected through these shared pathways.
Gemma4ClippableLinear: Gemma 4 wraps linear layers in
Gemma4ClippableLinear modules that must be unwrapped before PEFT
operations. This is handled by src/utils.py:unwrap_clippable_linear.
gemma4-26b-a4b-code-trainer-aggressive-full1)
on the merged weights.cmndcntrlcyber/gemma4-26b-a4b-dapt-offsec-corpus{"text": "..."} — plain text continuation (no chat formatting)src/phase3b_dapt/data/prepare_corpus.py| Knob | Value |
|---|---|
| Base model | google/gemma-4-26B-A4B-it |
| Adapter | LoRA (PEFT), r = 32, alpha = 64, dropout = 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Learning rate | 2.5e-5 (halved from Qwen's 5e-5 for MoE routing stability) |
| Batch size | 2 |
| Gradient accumulation | 8 (effective batch = 16) |
| Epochs | 1 |
| Sequence length | 2,048 |
| Precision | bfloat16 + gradient checkpointing |
| Meta | Value |
|---|---|
| Hardware | HF Jobs a100-large (1x A100 80 GB) |
| Entry point | src/phase3b_dapt/hf_skills/dapt_entry.py |
| Config | src/config/pipeline-gemma26b.yml (gemma_dapt section) |
nn.Parameter), so domain adaptation is limited to shared attention and
shared MLP pathways.import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_id = "google/gemma-4-26B-A4B-it"
dapt_id = "cmndcntrlcyber/gemma4-26b-a4b-dapt-offsec"
tokenizer = AutoTokenizer.from_pretrained(base_id)
model = AutoModelForCausalLM.from_pretrained(
base_id, torch_dtype=torch.bfloat16, device_map="auto",
)
# Unwrap Gemma4ClippableLinear before PEFT operations
from src.utils import unwrap_clippable_linear
unwrap_clippable_linear(model)
model = PeftModel.from_pretrained(model, dapt_id)
model = model.merge_and_unload() # merge into base for downstream SFT
src/phase3b_dapt/)python -m src.phase3b_dapt.data.prepare_corpus \
--config src/config/pipeline-gemma26b.yml
python -m src.phase3b_dapt.scripts.launch_dapt \
--config src/config/pipeline-gemma26b.yml --wait