openai-community/gpt2
Original124.4Mparameters
Fixture3.4Mparameters
Layer stacks1compared
Findings0to review
✓ Same architecture, smaller
Every module class, layer kind and checked property of the original is in the fixture.
Layer stacks
One square per layer, colored by kind: the layer's module classes and type attributes. Hover a square for its index and kind.
transformer.h
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| GPT2Block | 12 | 2 | ✓ kept |
Where the parameters are
Share of each model's parameters per component. Vocabulary and patch sizes are kept, so embeddings usually take a larger share of the fixture.
Original
Fixture
| Component | Original | Share | Fixture | Share |
|---|---|---|---|---|
| transformer.h | 85.1M | 68.3% | 100.0K | 3.0% |
| transformer.wte | 38.6M | 31.0% | 3.2M | 95.1% |
| transformer.wpe | 786.4K | 0.6% | 65.5K | 1.9% |
| transformer.ln_f | 1.5K | 0.0% | 128 | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | gpt2 | gpt2 | ✓ kept |
| model | vocab_size | 50257 | 50257 | ✓ kept |
| model | tie_word_embeddings | True | True | ✓ kept |
Module classes
Instances of each class in the built model (prefix GPT2LMHead omitted).
| Class | Original | Fixture |
|---|---|---|
| Conv1D | 48 | 8 |
| Dropout | 37 | 7 |
| LayerNorm | 25 | 5 |
| GPT2Attention | 12 | 2 |
| GPT2Block | 12 | 2 |
| GPT2MLP | 12 | 2 |
| NewGELUActivation | 12 | 2 |
| Embedding | 2 | 2 |
| Model | 1 | 1 |
| GPT2Model | 1 | 1 |
| Linear | 1 | 1 |
| ModuleList | 1 | 1 |
Config changes
3 fields changed, 34 unchanged.
| Field | Original | Fixture |
|---|---|---|
| n_embd | 768 | 64 |
| n_head | 12 | 4 |
| n_layer | 12 | 2 |