Instructions to use erengz/EV1-3M-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erengz/EV1-3M-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="erengz/EV1-3M-Base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("erengz/EV1-3M-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use erengz/EV1-3M-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erengz/EV1-3M-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erengz/EV1-3M-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/erengz/EV1-3M-Base
- SGLang
How to use erengz/EV1-3M-Base 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 "erengz/EV1-3M-Base" \ --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": "erengz/EV1-3M-Base", "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 "erengz/EV1-3M-Base" \ --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": "erengz/EV1-3M-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use erengz/EV1-3M-Base with Docker Model Runner:
docker model run hf.co/erengz/EV1-3M-Base
EV1-3M-Base
EV1-3M-Base is a 2,963,917-parameter decoder-only language model, pretrained from scratch. It was trained on about 4.18B tokens on a single laptop GPU (RTX 3050, 6 GB).
Scores
All scores are zero-shot, fp32, on the full test or validation sets.
- HellaSwag, ARC and PIQA were run with lm-evaluation-harness 0.4.13.
- ArithMark-3 was run with the leaderboard's ArithMark-3.0 script.
- The raw numbers are in
eval_results.json.
| Benchmark | acc_norm | acc |
|---|---|---|
| HellaSwag | 27.44 ±0.45 | 27.03 |
| ARC-Easy | 31.90 ±0.96 | 32.58 |
| ARC-Challenge | 21.76 ±1.21 | 18.09 |
| PIQA | 54.62 ±1.16 | 55.55 |
| ArithMark-3 | – | 52.20 ±1.58 |
The Open SLM Leaderboard Intelligence Index is 10.55 with PIQA acc_norm, or 11.06 with PIQA acc.
Architecture
| Parameter | Value |
|---|---|
| Type | Decoder-only transformer (custom code, trust_remote_code=True) |
| Layers | 6 |
| Hidden size | 192 |
| Attention heads | 4 |
| MLP | ReLU², hidden 560 |
| Extras | QK-norm, value residual, U-Net skip connections, logit softcap 15 |
| Position | RoPE (base 10,000), context 1,024 |
| Vocabulary | 4,096 BPE tokens, digits split one per token |
| Embeddings | Tied |
| Parameters | 2,963,917 (786,432 embedding + 2,177,485 other) |
Training
Optimizer: Muon for matrices, AdamW for embeddings and scalars.
Stages (all trained by us from random initialization; no merging, no distillation):
- Main pretraining: 2.40B tokens of the general mix plus project-generated arithmetic text.
- 1.0B-token continuation: unseen general documents plus math data (see table).
- Four continuations of 90M, 90M, 300M and 300M tokens. Each re-warmed the learning rate to 0.1× the main peak and decayed it linearly to 0. They mixed unseen general documents with our synthetic arithmetic word problems and question/answer-formatted text.
Data:
| Source | License |
|---|---|
| FineWeb-Edu | ODC-By 1.0 |
| Cosmopedia (wikihow, openstax, stanford, web_samples_v1) | Apache-2.0 |
| TinyStories | CDLA-Sharing-1.0 |
| Wikipedia introductions | CC-BY-SA-3.0 / GFDL |
| nvidia/OpenMathInstruct-2 (stage 2) | CC-BY-4.0 |
| microsoft/orca-math-word-problems-200k (stage 2) | MIT |
| deepmind/math_dataset (stage 2) | Apache-2.0 (generator repository) |
| Project-generated arithmetic | Ours |
Synthetic arithmetic:
- Generated by our own rule-based generators: short past-tense word problems with unit answers (" 42 cents.").
- ArithMark rows, templates and wordings were never used for training.
- Every generated file was checked for 13-gram overlap with ArithMark-3; the count was 0.
Question/answer text:
- Rule-based reformatting of the sources above into "Question: … Answer: …" pairs, for example wikihow step headings and definition sentences.
Decontamination:
- No HellaSwag, ARC, PIQA or ArithMark data was used in training.
- Pretraining documents and question/answer rows sharing a word 13-gram with any of these benchmarks (all splits) were removed.
Usage
The model computes log-likelihoods. It is meant for scoring and evaluation; generate() is not implemented.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("erengz/EV1-3M-Base")
model = AutoModelForCausalLM.from_pretrained("erengz/EV1-3M-Base", trust_remote_code=True).eval()
def loglik(context, continuation):
ctx = tok(context).input_ids
full = tok(context + continuation).input_ids
with torch.no_grad():
lp = model(input_ids=torch.tensor([full[:-1]])).logits.log_softmax(-1)[0]
return sum(lp[i - 1, full[i]].item() for i in range(len(ctx), len(full)))
ctx = "Mia had 23 apples. Mia got 19 more apples. Now Mia had"
print(max([" 41 apples.", " 42 apples.", " 43 apples."], key=lambda c: loglik(ctx, c)))
For benchmarks, use lm-evaluation-harness:
lm_eval --model hf --model_args pretrained=erengz/EV1-3M-Base,trust_remote_code=True,dtype=float32 \
--tasks hellaswag,arc_easy,arc_challenge,piqa --num_fewshot 0
Limitations
- A 3M-parameter model has very little world knowledge.
- HellaSwag and ARC-Challenge are near chance.
- On PIQA the model mostly relies on how plausible an answer sounds on its own, not on the question.
- Arithmetic is strongest on short one- and two-step word problems.
- Downloads last month
- -
Datasets used to train erengz/EV1-3M-Base
wikimedia/wikipedia
roneneldan/TinyStories
Collection including erengz/EV1-3M-Base
Evaluation results
- acc_norm (0-shot) on ARC-Easytest set self-reported31.900
- acc_norm (0-shot) on ARC-Challengetest set self-reported21.760
- acc_norm (0-shot) on HellaSwagvalidation set self-reported27.440
- acc_norm (0-shot) on PIQAvalidation set self-reported54.620
- acc (0-shot) on ArithMark-3test set self-reported52.200