Perron Gemma 4 E2B LoRA Adapter

Parameter-efficient Low-Rank Adaptation (LoRA) adapter for Google DeepMind's google/gemma-4-e2b-it model, trained on provenance-conditioned candidate ranking over SWE-bench dependency multigraphs.

Model Summary

  • Author: Sultan Haikal (GitHub: @yvliet)
  • Base Model: google/gemma-4-e2b-it
  • Architecture: Dense PLE Transformer, 2B parameters
  • Adapter Configuration: LoRA rank $r=16$, $\alpha=32$, dropout $0.05$ targeting language model attention projections (q_proj, v_proj, k_proj, o_proj)
  • Trainable Parameters: ~4.7M (<0.25% of total base parameters)
  • License: Apache 2.0

Training Details

  • Objective: Provenance-Conditioned Ranking Cross-Entropy ($\mathcal{L}_{\text{Rank}}$) over atomic candidate choices [A] through [Y]
  • Active Loss Slicing: Sequence length 2048 with tail token slicing (logits_to_keep=24)
  • Optimization: AdamW, learning rate 2e-4, linear warmup with cosine decay
  • Hardware: Dual Tesla T4 GPUs (sharded pipeline via device_map="auto")
  • Validation Receipts ($N=50$ held-out pairs):
    • Epoch 1: Loss 0.6391, Val Acc@1: 98.0%, Val Acc@5: 100.0%
    • Epoch 2: Loss 0.0074, Val Acc@1: 100.0%, Val Acc@5: 100.0%
    • Epoch 3: Loss 0.0002, Val Acc@1: 100.0%, Val Acc@5: 100.0%

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_id = "google/gemma-4-e2b-it"
adapter_id = "yvliet/perron-gemma4-e2b-lora"

tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype=torch.float16,
    device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)

Citation & Resources

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