Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- transformer
|
| 5 |
+
- education
|
| 6 |
+
- arithmetic
|
| 7 |
+
- algorithmic-learning
|
| 8 |
+
language:
|
| 9 |
+
- en
|
| 10 |
+
pipeline_tag: text-generation
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# addGPT: Teaching Transformers to Add
|
| 14 |
+
|
| 15 |
+
A transformer encoder-decoder that learns integer addition, demonstrating algorithmic learning capabilities.
|
| 16 |
+
|
| 17 |
+
## Model Description
|
| 18 |
+
|
| 19 |
+
- **Architecture**: Transformer encoder-decoder
|
| 20 |
+
- **Parameters**: ~2.7M (tiny config)
|
| 21 |
+
- **Task**: Integer addition (up to 5-digit numbers)
|
| 22 |
+
- **Accuracy**: >99% on held-out test set
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
|
| 26 |
+
```python
|
| 27 |
+
# Download checkpoint
|
| 28 |
+
from huggingface_hub import hf_hub_download
|
| 29 |
+
checkpoint_path = hf_hub_download(repo_id="m-bano/addGPT", filename="ckpt_step12500.pt")
|
| 30 |
+
|
| 31 |
+
# Or use the provided script
|
| 32 |
+
# python download_checkpoint.py
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
See the [GitHub repository](https://github.com/mbano/addGPT) for complete code and usage instructions.
|
| 36 |
+
|
| 37 |
+
## Training Details
|
| 38 |
+
|
| 39 |
+
- **Framework**: PyTorch 2.0+
|
| 40 |
+
- **Training Time**: ~10 minutes on GPU
|
| 41 |
+
- **Dataset**: 6.4M randomly generated addition problems
|
| 42 |
+
- **Optimizer**: AdamW with cosine annealing
|
| 43 |
+
|
| 44 |
+
## Configuration
|
| 45 |
+
|
| 46 |
+
```yaml
|
| 47 |
+
n_emb: 512
|
| 48 |
+
n_heads: 8
|
| 49 |
+
n_blocks: 4
|
| 50 |
+
max_src_len: 5 # 5-digit operands
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## License
|
| 54 |
+
|
| 55 |
+
Apache 2.0
|