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")# pip install -U transformers accelerate # 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
Download README.md from ameythakur/SAIR-Modular-Arithmetic-Challenge: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/ameythakur/SAIR-Modular-Arithmetic-Challenge/resolve/0845a9815f5e4eadbd5d6d761ec8be0ad188afcc/README.md
- Command line
-
hf download hf://ameythakur/SAIR-Modular-Arithmetic-Challenge@0845a9815f5e4eadbd5d6d761ec8be0ad188afcc/README.md
-
curl -L -o README.md https://huggingface.co/ameythakur/SAIR-Modular-Arithmetic-Challenge/resolve/0845a9815f5e4eadbd5d6d761ec8be0ad188afcc/README.md
language:
- en
pipeline_tag: text-generation
tags:
- mathematics
- modular-arithmetic
- grokking
- scratchpad
license: cc-by-4.0
SAIR Modular Arithmetic Challenge - Baseline Model
Model Details
This is the baseline Grokking/Algorithmic model trained for the SAIR Modular Arithmetic Challenge. It is an autoregressive decoder-only Transformer designed to solve $(A \times B) \pmod{P}$ without utilizing any external mathematical libraries or hardcoded arithmetic operators.
- Architecture: Transformer with RoPE / Bit-Serial Algorithmic Decoder
- Framework: PyTorch
- Tokenization: Custom Character-level (
Base10Tokenizer)
Intended Use
This model is intended purely for research into algorithmic generalization, grokking, and mathematical reasoning in language models.
Send a string like 123*456 and the model will generate the Scratchpad trace and the final answer.
Limitations
As an algorithmic model, the context window bounds the maximum size of the integer that can be processed. If the multiplication trace exceeds the maximum sequence length, the model will fail to output <EOS>.
Citation
If you use this model or the dataset generation logic, please cite the original SAIR Modular Arithmetic Challenge repository.