PEFT
Safetensors
ml-intern
lora
sft
distillation
gemma4

Run this model with HF Jobs

Run habibi26/gemma4-e2b-distill-sft on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/habibi26/gemma4-e2b-distill-sft. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/habibi26/gemma4-e2b-distill-sft on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

gemma4-e2b-distill-sft

LoRA adapter (r=16, Ξ±=32, dropout 0.05, all linear layers) for google/gemma-4-E2B-it, trained on r0b0tlab/qwen3.8-max-glm5.2-kimi-k3-distillation (canonical config).

Data

  • Config canonical, split train, shards *-of-00006 (52,205 rows β€” note the dataset card's ~890K-row metadata is wrong; the two generations in data/canonical/ overlap ~90% and the 6-part set supersedes the 5-part one).
  • Filtered to verifier_passed=true and n_tool_calls=0; stratified sample across task_type β†’ 27,351 prompt-completion examples (one per assistant turn).
  • Teacher chain-of-thought (from reasoning_content) merged into the assistant content as a 3507,2618525643435 block; verified to survive the Gemma-4 chat template before training.

Training

TRL SFTTrainer 1.18.0, transformers 5.23.0, conversational prompt-completion with completion_only_loss; batch 2 Γ— grad-accum 16, lr 1e-4 cosine, warmup 25 steps, 1 epoch = 812 optimizer steps; bf16, eager attention on the audio tower (no SDPA kernel in gemma4), max_length 2048. Run: job 6af8ebfd, 4h35m on an a10g-large.

Evaluation (held-out validation split, same filters)

Model loss token accuracy n
base gemma-4-E2B-it 2.372 0.714 100
pushed adapter (step 750/812) 0.600 0.840 1,105
end-of-training weights (in-run, step 812) 0.477 0.856 1,000

The pushed commit (4a93deb) is the trainer's last checkpoint save (step 750), because the training job crashed after its final eval but before its own push β€” 62 steps into a fully decayed cosine tail. The step-750 vs step-812 gap (0.600 vs 0.477) is larger than the LR tail alone should explain and is reported as an open discrepancy in eval_report.json rather than reconciled. Generations from the adapter are coherent <think>-style solutions ending in \boxed{} answers.

Files

  • adapter_config.json, adapter_model.safetensors β€” the LoRA adapter (attach to google/gemma-4-E2B-it with peft.PeftModel.from_pretrained)
  • eval_report.json β€” final metrics, base-model baseline, discrepancy note, 6 greedy generations

Caveats

  • The Trackio dashboard could not host metrics (Space creation returned 402 on this account), so per-step training metrics were not persisted remotely; eval-side numbers above come from the eval job and the training job's logs.
  • Multilingual/tool-use traces with tool calls were excluded by the filter.
Downloads last month
77
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for habibi26/gemma4-e2b-distill-sft

Adapter
(252)
this model

Dataset used to train habibi26/gemma4-e2b-distill-sft