CoolFace
Modelpublic

singhabhishekkk/apprentice-gemma4-e4b-lora-document-types

sourceHugging Faceapache-2.0updated 9d agoView on Hugging Face
0likes64downloads
Model Card

Apprentice Gemma 4 E4B LoRA (document type classification)

LoRA adapter fine-tuned on 140 golden examples from a corrected Tobacco3482 OCR-text dataset to classify one document type from: ADVE, Email, Form, Letter, Memo, News, Note, Report, Resume, Scientific.

The input prompt is the verbatim shipped document-type prompt from icereed/paperless-gpt, filled with English, the allowed type list, an empty title, and OCR text capped at about 4,000 characters.

Results (60 held-out rows, exact match)

ModelScore
gpt-5.4-mini, plain paperless-gpt prompt78.33
gpt-5.4-mini, GEPA-optimized prompt81.67
Gemma 4 E4B, no fine-tune63.33
Gemma 4 E4B, fine-tuned on 140 examples (this adapter)86.67

Same 60 held-out rows, same seed, same split for every row. The fine-tuned model scores +8.34 over the shipped prompt and +5.00 over the GEPA-optimized teacher. Gemma run 2026-07-12; gpt-5.4-mini runs 2026-07-10. Full method, data prep, notebooks and caveats: apprentice-benchmark, document type task.

Training

LoRA r=16, alpha 16, 3 epochs, lr 2e-4, batch 2 x grad-accum 4, Unsloth 4-bit, Colab GPU. Train/eval split: seed 42, 140/60 from 200 sampled rows, identical split across every model this task is fine-tuned on.

Usage

Load with PEFT on top of google/gemma-4-E4B-it, or serve locally with an adapter-capable runtime. Caveat: evaluated on 60 rows for one field only. Re-validate on your paperless-ngx document types before production use.