ALTUN 1: A compact LLM for math and CS, trained from scratch
2 min readupdated
ALTUN 1 is a 197M-parameter research prototype language model from erlic AI designed for mathematics and theoretical computer science (CS) tasks. Unlike most compact solutions, the model does not use pre-trained weights and was trained entirely from scratch on two T4 GPUs in Kaggle using a custom Decoder-only Transformer architecture (including GQA - grouped-query attention, and SwiGLU) with its own 16,384-token BPE tokenizer. The author explicitly warns that the model often makes calculation errors, but produces coherent step-by-step reasoning. It is suitable for researchers and students as an open base with a ready-to-use training pipeline for custom experiments from scratch.
Key features
- Trained from scratch on 1.94 billion tokens (Mathlib4, Lean 4, Metamath, Wikipedia articles, synthetic step-by-step tasks) without relying on external checkpoints.
- Custom architecture (16 layers, 1024-token context) is incompatible with the standard
transformerslibrary and runs via the author's custom code. - Supports English and Turkish (~30% of training tasks are in Turkish).
- The full data preparation, training (PyTorch +
torch.compile), and evaluation cycle is open-source under the Apache-2.0 license.
What you can do
- Study the architecture and reproduce the training pipeline for a compact language model from scratch on budget hardware like Kaggle 2×T4.
- Use the weights as a starting point for further fine-tuning in educational and research projects focused on formal proof generation and step-by-step problem solving.
- Test step-by-step solution generation on basic arithmetic, formal mathematics, and number theory tasks via a local CLI.
Example
git clone [https://github.com/erlic-AI/altun](https://github.com/erlic-AI/altun) && cd altun
pip install torch safetensors pyyaml psutil huggingface_hub
huggingface-cli download erlic/ALTUN-1 --local-dir ALTUN-1-model
python -m inference.run_inference --model-dir ALTUN-1-model --prompt "What is 12 + 15?"
Read more
DetailsMetrics (greedy decoding): 53.8% (64/119) on the internal ALTUN benchmark (83% in formal math, 81% in arithmetic), 5.0% on MATH (200 questions), and 1.5% on GSM8K (200 questions).
Hardware and training: trained in 3 stages on 2×T4 (FP16 AMP, AdamW) at ~22.4k tokens/s.
Limitations: not intended for exact answers, weak in word problems and olympiad math, requires greedy decoding (sampling degrades arithmetic performance).










Comments