Butanium commited on
Commit
40e27a9
·
verified ·
1 Parent(s): 4e74706

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +34 -10
README.md CHANGED
@@ -1,10 +1,34 @@
1
- ---
2
- tags:
3
- - model_hub_mixin
4
- - pytorch_model_hub_mixin
5
- ---
6
-
7
- This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
8
- - Code: [More Information Needed]
9
- - Paper: [More Information Needed]
10
- - Docs: [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # One-Layer Simple Transformer
2
+
3
+ A 1-layer transformer described in [A Mathematical Framework for Transformer Circuits](https://transformer-circuits.pub/2021/framework/index.html).
4
+
5
+ ## Usage
6
+
7
+ ```python
8
+ from transformers import LlamaConfig
9
+ from migrate_models import OneLayerTransformer
10
+
11
+ # Load the model
12
+ model = OneLayerTransformer.from_pretrained('Butanium/simple-stories-one-layer-simple-transformer')
13
+
14
+ # Or create from config
15
+ config = LlamaConfig(vocab_size=4096, hidden_size=128, num_hidden_layers=1)
16
+ model = OneLayerTransformer(config)
17
+ ```
18
+
19
+ ## Model Architecture
20
+
21
+ This model consists of:
22
+ - Token embeddings
23
+ - Single self-attention layer with residual connection
24
+ - Linear output head
25
+
26
+ It serves as a minimal transformer for understanding attention mechanisms and transformer circuits.
27
+
28
+ ## Training Details
29
+
30
+ - Trained on SimpleStories dataset
31
+ - Vocabulary size: 4096
32
+ - Hidden size: 128
33
+ - Single self-attention layer
34
+ - 4 attention heads