Releases: Avaneesh40585/GPT2-From-Scratch
Release list
gpt2-small_instruction
Fine-Tuned GPT-2 Instruction Follower (Alpaca)
This release contains the fine-tuned model weights (gpt2-small_instruction.pth) for the Instruction Following task. These weights allow users to run inference or evaluation immediately without needing to retrain the model from scratch.
Performance Metrics
The model was fine-tuned on a lightweight subset (5,000 examples) of the official Stanford Alpaca dataset for pipeline verification. It was evaluated using an automated LLM-as-a-Judge (gemma4:e2b) on a holdout test set.
| Metric | Value |
|---|---|
| LLM Judge Score | 39.59 / 100 |
| Training Samples | ~4,250 (85% of 5k subset) |
| Base Model | GPT-2 Small (124M) |
Usage Instructions
- Download
gpt2-small_instruction.pthfrom the Assets section below. - Place the file in the
instruction-finetuning/model_weights/directory. - Run the
main.ipynbnotebook. SetMODE = "inference"and execute the Interactive Generation cells. The pipeline will detect the weights:# Expected output: --- PREPARING FOR INFERENCE --- Loading finetuned model from: ./model_weights/gpt2-small_instruction.pth Moving model to mps...
Critical Requirement:
These weights are strictly coupled to the GPT-2 Small (124M) architecture.
- Do not try to load these into
gpt2-mediumor other sizes.- Do not try to load these into a standard Hugging Face model class directly; they require the custom
GPTModelarchitecture defined in our rootsrc.model.
Generated by the instruction-finetuning/main.ipynb pipeline on Apple Silicon (M3 Pro)
gpt2-small_classifier
Fine-Tuned GPT-2 Sentiment Classifier (IMDB)
This release contains the fine-tuned model weights (gpt2-small_classifier.pth) for the Binary Sentiment Analysis task. These weights allow users to run inference or evaluation immediately without needing to retrain the model from scratch.
Performance Metrics
The model was fine-tuned on the IMDB Large Movie Review Dataset (25,000 training examples) and evaluated on the official test set (25,000 examples).
| Metric | Value |
|---|---|
| Test Accuracy | 91.83% |
| Test Loss | 0.2026 |
| Base Model | GPT-2 Small (124M) |
Usage Instructions
- Download
gpt2-small_classifier.pthfrom the Assets section below. - Place the file in the
classification-finetuning/model_weights/directory. - Run the
main.ipynbnotebook. SetMODE = "inference"or run the evaluation cells. The pipeline will detect the weights:# Expected output: --- PREPARING FOR INFERENCE --- Loading trained classifier from: ./model_weights/gpt2-small_classifier.pth Moving model to mps...
Critical Requirement:
These weights are strictly coupled to the GPT-2 Small (124M) architecture with a custom 2-class Classification Head.
- Do not try to load these into
gpt2-mediumor other sizes.- Do not try to load these into a standard Hugging Face model class directly; they require the custom
GPTClassifierwrapper defined inmain.ipynb.
Generated by the classification-finetuning/main.ipynb pipeline on Apple Silicon (M3 Pro)