library_name: transformers
tags: []
Model Card for gpt2_noLN
This is a gpt2-small model with LayerNorm fine-tuned out.
The model was fine-tuned on OpenWebText for ~500M tokens (1000 iterations of batch size ~488 at 1024 context length) while gradually disableing LayerNorm layers.
The model is a GPT2LMHeadModel
(to avoid requiring trust_remote_code
) which technically contains LayerNorm blocks.
However, the epsilon values are all set to 1e12 so that the LayerNorm has no effect. The LN scale is set to 1e6 (to counter the 1e12 epsilon), and the bias to 0.
The final LayerNorm also has 1e12 as epsilon, but non-unity weights and biases. This is because the embed and unembed matrix are tried (and there is no unembed bias),
thus the LN parameters cannot be folded into that matrix. You can completely remove all LNs by simply replacing ln_1
and ln_2
modules with identities, and replacing
ln_f
with modifications to the unembed matrix and unembed bias.
Available versions:
- v2 (default): Trained for 1000 iterations in a single training run
- v1: Trained for 900 iterations, with multiple interrup, modify LNs, and resume steps
The training script will be published shortly.