Intended use
Use this adapter with its exact base model for educational question answering,
preferably with retrieval and citation validation. It is not a standalone
model and does not contain the base weights.
Do not treat its answers as authoritative scholarship, grading decisions, or
professional advice. The adapter is not designed to reproduce readings or to
answer unsupported questions from memory.
Loading
import torchfrom peft import PeftModelfrom transformers import AutoModelForMultimodalLM, AutoProcessor, BitsAndBytesConfig base_model = "google/gemma-4-12B-it"adapter = "sagnikdas-ml/epistemology-gemma4-12b-v0.1" processor = AutoProcessor.from_pretrained(base_model)model = AutoModelForMultimodalLM.from_pretrained( base_model, device_map="auto", dtype=torch.bfloat16, quantization_config=BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True, ),)model = PeftModel.from_pretrained(model, adapter)model.eval()
Access to the gated base model may require accepting Google's Gemma terms on
Hugging Face and authenticating locally.
Training
The adapter was trained with supervised fine-tuning on 16 approved examples
derived from course concepts. Examples carry provenance metadata and cover
definitions, explanations, comparisons, argument reconstruction/evaluation,
objections, applications, misconception correction, and unsupported-question
behavior. The original course documents are not distributed with this model.
Table with columns: Setting, Value| Setting | Value |
|---|
| Method | QLoRA / supervised fine-tuning |
| LoRA rank / alpha / dropout | 16 / 32 / 0.05 |
| Target modules | Attention and MLP projection layers |
| Quantization | NF4, double quantization, BF16 compute |
| Epochs | 3 |
| Learning rate | 2e-4, cosine schedule |
| Maximum sequence length | 2048 |
| Effective batch size | 32 |
| Seed | 42 |
| Hardware | 1× NVIDIA A40 |
Evaluation
Evaluation used a source-separated validation split of 2 examples.
Table with columns: Metric, Result| Metric | Result |
|---|
| Validation loss | 4.1711 |
| Mean token accuracy | 0.3583 |
| Validation tokens | 6,840 |
These figures are diagnostic rather than a robust estimate of generalization:
the validation set is extremely small. An end-to-end smoke test with the
course RAG system produced a passage-grounded answer with valid citations, but
no broad human evaluation has yet been completed.
Limitations and risks
- The training and validation sets are small and specific to one course.
- The adapter can still hallucinate, conflate philosophers, or overstate what
a retrieved passage establishes.
- Citation correctness depends on the external retrieval and validation layer;
the adapter alone cannot guarantee grounded citations.
- The base model's limitations and biases remain present.
- Only English text behavior was evaluated.
For consequential use, verify answers against primary texts and qualified
instructors. Keep retrieval restricted to materials you are authorized to use.
Reproducibility
The training configuration, run manifest, validation metrics, inference code,
and tests are available in the
Epistemology-Coursebot
repository. Key library versions were PyTorch 2.12.1, Transformers 5.12.1,
PEFT 0.19.1, TRL 1.13.0, and BitsAndBytes 0.49.2.