marvin-cpt-12b-adapter

Masked continued-pretraining (CPT) LoRA adapter for gemma-4-12B-it.

Summary

  • Type: PEFT LoRA adapter (r=32, α=64, bf16)
  • Base: gemma-4-12B-it (internal instruct base)
  • Objective: masked CPT on the marvin corpus (private, non-redistributable training data — not included here)
  • Adapter size: ~500 MB (adapter_model.safetensors, 656 tensors)

Training

  • 1 epoch, max sequence length 32768 (split-not-truncate, packed with per-doc isolation)
  • Optimizer: paged AdamW 8-bit, lr 1e-5, constant schedule w/ warmup-ratio 0.05, seed 42
  • Effective batch 4 (mbs 1 × grad-accum 2 × 2-GPU DDP) → 270 optimizer steps
  • Instruct-subspace masking ON (r256 subspace + per-layer importance + logistic scale mask)
  • CCE (cut cross-entropy) loss; doc-isolation enforced via per-doc-reset position_ids (flash varlen)
  • Final train loss ≈ 2.7–3.0

Hardware / runtime

  • 2× RTX PRO 6000 Blackwell (sm_120), torch 2.11.0+cu128, transformers 5.10.x, peft 0.19.1
  • Sliding-window layers routed to a Blackwell flash-attn build; global layers on SDPA (~2.4× vs all-SDPA)

Usage

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base = AutoModelForCausalLM.from_pretrained("<gemma-4-12B-it path>", torch_dtype="bfloat16")
model = PeftModel.from_pretrained(base, "rpDungeon/marvin-cpt-12b-adapter")
tok = AutoTokenizer.from_pretrained("rpDungeon/marvin-cpt-12b-adapter")

A chat_template.jinja and the tokenizer are bundled with the adapter.

Framework versions

  • PEFT 0.19.1
Downloads last month
1
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support