GPT-2 (small, from scratch) trained on Reuters articles

CS4681 Assignment 02. A GPT-2 style causal language model trained from randomly initialised weights on the concatenated title + body of ingeniumacademy/reuters_articles, using the tokenizer ingeniumacademy/gpt2-reuters-tokenizer.

Run Layers d_model Epochs Params Val loss Test loss Test ppl
base_5ep 6 384 5 30.71 M 4.195 4.000 54.6
ep2 6 384 2 30.71 M 4.827 4.601 99.6
small_5ep 2 256 5 14.96 M 4.566 4.349 77.4
  • Root folder = the main model (base_5ep). Other runs are in runs/<name>/.
  • results/ holds the loss logs, figures and results.json with every number used in the report.
from transformers import AutoTokenizer, GPT2LMHeadModel
tok = AutoTokenizer.from_pretrained("AbishSam/gpt2-reuters-from-scratch")
model = GPT2LMHeadModel.from_pretrained("AbishSam/gpt2-reuters-from-scratch")                       # base_5ep
model_2ep = GPT2LMHeadModel.from_pretrained("AbishSam/gpt2-reuters-from-scratch", subfolder="runs/ep2")
Downloads last month
-
Safetensors
Model size
30.7M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train AbishSam/gpt2-reuters-from-scratch