allenai/longformer-base-4096
Original148.7Mparameters
Fixture3.6Mparameters
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.
longformer.encoder.layer
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| Layer | 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 |
|---|---|---|---|---|
| longformer.encoder.layer | 106.3M | 71.5% | 91.9K | 2.5% |
| longformer.embeddings | 41.8M | 28.1% | 3.5M | 96.0% |
| lm_head.dense | 590.6K | 0.4% | 4.2K | 0.1% |
| lm_head | 50.3K | 0.0% | 50.3K | 1.4% |
| lm_head.layer_norm | 1.5K | 0.0% | 128 | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | longformer | longformer | ✓ kept |
| model | vocab_size | 50265 | 50265 | ✓ kept |
| model | tie_word_embeddings | True | True | ✓ kept |
| model | hidden_act | gelu | gelu | ✓ kept |
| model | max_position_embeddings | 4098 | 4098 | ✓ kept |
Module classes
Instances of each class in the built model (prefix Longformer omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 110 | 20 |
| LayerNorm | 26 | 6 |
| Dropout | 25 | 5 |
| GELUActivation | 12 | 2 |
| Attention | 12 | 2 |
| Intermediate | 12 | 2 |
| Layer | 12 | 2 |
| Output | 12 | 2 |
| SelfAttention | 12 | 2 |
| SelfOutput | 12 | 2 |
| Embedding | 3 | 3 |
| Embeddings | 1 | 1 |
| Encoder | 1 | 1 |
| ForMaskedLM | 1 | 1 |
| LMHead | 1 | 1 |
| Model | 1 | 1 |
| ModuleList | 1 | 1 |
Config changes
5 fields changed, 26 unchanged.
| Field | Original | Fixture |
|---|---|---|
| attention_window | 12 entries: 12× 512 | [512, 512] |
| hidden_size | 768 | 64 |
| intermediate_size | 3072 | 128 |
| num_attention_heads | 12 | 4 |
| num_hidden_layers | 12 | 2 |