GPT-2 (small, from scratch) on Reuters articles
Trained from random initialisation with the causal (next-token) language-modelling objective
on the concatenated title + body of ingeniumacademy/reuters_articles, using the tokenizer ingeniumacademy/gpt2-reuters-tokenizer.
Results
| metric | value |
|---|---|
| parameters | 18,116,608 |
| epochs | 5 |
| training time | 7.9 min |
| validation loss / perplexity | 4.3802 / 79.85 |
| test loss / perplexity | 4.1682 / 64.6 |
Configuration
{
"run": "main",
"epochs": 5,
"n_embd": 256,
"n_layer": 6,
"n_head": 8,
"block_size": 256,
"learning_rate": 0.0005,
"batch_size": 32,
"total_params": 18116608,
"embedding_params": 13377536,
"non_embedding_params": 4739072,
"train_time_sec": 474.4,
"final_train_loss": 4.0094,
"avg_train_loss": 4.7307,
"val_loss": 4.3802,
"val_perplexity": 79.85,
"test_loss": 4.1682,
"test_perplexity": 64.6
}

Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("MeshMax/gpt2-reuters-from-scratch")
model = AutoModelForCausalLM.from_pretrained("MeshMax/gpt2-reuters-from-scratch")