Text Generation
Transformers
Safetensors
English
mathematics
modular-arithmetic
grokking
scratchpad
length-generalization
Instructions to use ameythakur/SAIR-Modular-Arithmetic-Challenge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ameythakur/SAIR-Modular-Arithmetic-Challenge with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ameythakur/SAIR-Modular-Arithmetic-Challenge")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ameythakur/SAIR-Modular-Arithmetic-Challenge", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ameythakur/SAIR-Modular-Arithmetic-Challenge with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ameythakur/SAIR-Modular-Arithmetic-Challenge" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ameythakur/SAIR-Modular-Arithmetic-Challenge", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ameythakur/SAIR-Modular-Arithmetic-Challenge
- SGLang
How to use ameythakur/SAIR-Modular-Arithmetic-Challenge with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ameythakur/SAIR-Modular-Arithmetic-Challenge" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ameythakur/SAIR-Modular-Arithmetic-Challenge", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ameythakur/SAIR-Modular-Arithmetic-Challenge" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ameythakur/SAIR-Modular-Arithmetic-Challenge", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ameythakur/SAIR-Modular-Arithmetic-Challenge with Docker Model Runner:
docker model run hf.co/ameythakur/SAIR-Modular-Arithmetic-Challenge
SAIR
Browse files
README.md
CHANGED
|
@@ -19,31 +19,31 @@ license: cc-by-4.0
|
|
| 19 |
|
| 20 |
## Overview
|
| 21 |
|
| 22 |
-
This repository hosts the
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
---
|
| 27 |
|
| 28 |
-
## Architectural
|
| 29 |
|
| 30 |
-
To bypass the
|
| 31 |
|
| 32 |
### 1. Abacus Significance Embeddings
|
| 33 |
-
Standard transformers track coordinate positions
|
| 34 |
|
| 35 |
### 2. Algorithmic Scratchpads (Bit-Serial Decoding)
|
| 36 |
-
The network operates as a recurrent state machine. By forcing the model to generate intermediate computational traces
|
| 37 |
|
| 38 |
### 3. Grokking Phase Transitions
|
| 39 |
-
The weights deployed here
|
| 40 |
|
| 41 |
---
|
| 42 |
|
| 43 |
-
## Inference
|
| 44 |
|
| 45 |
-
This model
|
| 46 |
-
If prompted with an equation, it
|
| 47 |
|
| 48 |
**Input Format**: Character-level ASCII equations.
|
| 49 |
```text
|
|
@@ -66,9 +66,9 @@ If prompted with an equation, it will sequentially emit the step-by-step logic t
|
|
| 66 |
|
| 67 |
---
|
| 68 |
|
| 69 |
-
## Citations
|
| 70 |
|
| 71 |
-
This model is an isolated
|
| 72 |
|
| 73 |
**Official Research Repository**:
|
| 74 |
[SAIR-MODULAR-ARITHMETIC-CHALLENGE](https://github.com/Amey-Thakur/SAIR-MODULAR-ARITHMETIC-CHALLENGE)
|
|
|
|
| 19 |
|
| 20 |
## Overview
|
| 21 |
|
| 22 |
+
This repository hosts the weights for the **SAIR Modular Arithmetic Challenge**. The model is an autoregressive transformer built to solve exact modular multiplication `(A × B) mod P` organically, without hardcoded arithmetic logic, symbolic parsers, or external computation modules.
|
| 23 |
|
| 24 |
+
Using state-machine decoding, this research targets the learnability wall of transformer mathematics, achieving theoretical infinite length generalization.
|
| 25 |
|
| 26 |
---
|
| 27 |
|
| 28 |
+
## Architectural Methods
|
| 29 |
|
| 30 |
+
To bypass the spatial limitations of standard transformers, this model uses three methods:
|
| 31 |
|
| 32 |
### 1. Abacus Significance Embeddings
|
| 33 |
+
Standard transformers track coordinate positions. This model strips coordinate embeddings, replacing them with Mathematical Significance Injections. Digits route based on their place-value, ensuring 1024-bit primes process through the exact same logic gates as 16-bit primes.
|
| 34 |
|
| 35 |
### 2. Algorithmic Scratchpads (Bit-Serial Decoding)
|
| 36 |
+
The network operates as a recurrent state machine. By forcing the model to generate intermediate computational traces autoregressively, the network allocates computation proportionally to integer complexity, mimicking a Turing machine tape.
|
| 37 |
|
| 38 |
### 3. Grokking Phase Transitions
|
| 39 |
+
The weights deployed here were captured after the grokking phase transition. The model trained through thousands of delayed gradient steps beyond the initial validation plateau with extreme weight decay, forcing the network to collapse memorization circuits into sparse mathematical algorithms.
|
| 40 |
|
| 41 |
---
|
| 42 |
|
| 43 |
+
## Inference Format
|
| 44 |
|
| 45 |
+
This model requires a specific execution format.
|
| 46 |
+
If prompted with an equation, it sequentially emits the step-by-step logic trace before terminating natively with the final matrix node.
|
| 47 |
|
| 48 |
**Input Format**: Character-level ASCII equations.
|
| 49 |
```text
|
|
|
|
| 66 |
|
| 67 |
---
|
| 68 |
|
| 69 |
+
## Citations and Laboratory
|
| 70 |
|
| 71 |
+
This model is an isolated artifact. The complete research laboratory - containing the synthetic data generators, the training loops, the sandbox validators, and the PyTorch implementations - is open-source.
|
| 72 |
|
| 73 |
**Official Research Repository**:
|
| 74 |
[SAIR-MODULAR-ARITHMETIC-CHALLENGE](https://github.com/Amey-Thakur/SAIR-MODULAR-ARITHMETIC-CHALLENGE)
|