Downloads · 30 days
19
7% of all-time downloads
schaeff/gpt2-medium_vanilla500
gpt2-medium_vanilla500 is a text generation model from schaeff. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
Associated publication: Transformers Don’t Need LayerNorm at Inference Time: Scaling LayerNorm Removal to GPT-2 XL and the Implications for Mechanistic Interpretability (arXiv TBD)
Downloads · 30 days
19
7% of all-time downloads
All-time downloads
282
Public
Parameters
355M
5.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt2.8 GB · 50%
From the Hugging Face model README
schaeff/gpt2-medium_vanilla500Associated publication: Transformers Don’t Need LayerNorm at Inference Time: Scaling LayerNorm Removal to GPT-2 XL and the Implications for Mechanistic Interpretability (arXiv TBD)
Associated GitHub: removing-layer-norm
This model is based on openai-community/gpt2-medium and was finetuned on OpenWebText for 500 iterations with 0.5M tokens per iteration. This model has the same architecture as the corresponding gpt-2 model and is being made available for reproducibility of the results reported in the associated publication.
You can load the model with transformers:
model = GPT2LMHeadModel.from_pretrained("schaeff/gpt2-medium_vanilla500")
This model is part of a collection of LayerNorm-free models. The table below provides links and details.
Reported values are mean cross-entropy losses for 10.2M tokens for The Pile and The Pile filtered and 4.5M tokens for the OpenWebText (WT) validation set. For each model size and dataset, the lowest loss is highlighted in bold, and the loss difference between the LN-free model and the best-performing model is shown in brackets.
| Model | FT steps | OWT (val) | The Pile | The Pile-filtered |
|---|---|---|---|---|
| OpenAI GPT-2 Small original | 0 | 3.1006 | 2.8450 | 2.7899 |
| schaeff GPT-2 Small vanilla | 300 | 3.0126 | 2.8511 | 2.8112 |
| schaeff GPT-2 Small LN-free | 300 | 3.0797 [+0.0671] | 2.8852 [+0.0402] | 2.8757 [+0.0858] |
| OpenAI GPT-2 Medium original | 0 | 2.8145 | 2.5163 | 2.5390 |
| schaeff GPT-2 Medium vanilla | 500 | 2.7390 | 2.5752 | 2.5724 |
| schaeff GPT-2 Medium LN-free | 500 | 2.7642 [+0.0252] | 2.6579 [+0.1416] | 2.6352 [+0.0962] |
| OpenAI GPT-2 Large original | 0 | 2.6623 | 2.5320 | 2.4347 |
| schaeff GPT-2 Large vanilla | 600 | 2.6240 | 2.6233 | 2.5074 |
| schaeff GPT-2 Large LN-free | 600 | 2.6384 [+0.0144] | 2.7504 [+0.2184] | 2.5159 [+0.0812] |
| OpenAI GPT-2 XL original | 0 | 2.5567 | 2.4436¹ | 2.3739 |
| schaeff GPT-2 XL vanilla | 800 | 2.4799 | 2.4673 | 2.3821 |
| schaeff GPT-2 XL LN-free | 800 | 2.5052 [+0.0253] | 130.2197² | 2.3992 [+0.0253] |
If you have found our work useful please cite as:
@misc{gpt2layernorm2025,
author = {Baroni, Luca and Khara, Galvin and Schaeffer, Joachim and Subkhankulov, Marat and Heimersheim, Stefan},
title = {Transformers Don't Need LayerNorm at Inference Time: Scaling LayerNorm Removal to GPT-2 XL and the Implications for Mechanistic Interpretability},
year = {2025},
eprint = {2507.02559},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2507.02559v1}
}