Instructions to use AwakeningOS/babylm-dense-baseline-47m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AwakeningOS/babylm-dense-baseline-47m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AwakeningOS/babylm-dense-baseline-47m")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AwakeningOS/babylm-dense-baseline-47m") model = AutoModelForCausalLM.from_pretrained("AwakeningOS/babylm-dense-baseline-47m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AwakeningOS/babylm-dense-baseline-47m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AwakeningOS/babylm-dense-baseline-47m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AwakeningOS/babylm-dense-baseline-47m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AwakeningOS/babylm-dense-baseline-47m
- SGLang
How to use AwakeningOS/babylm-dense-baseline-47m 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 "AwakeningOS/babylm-dense-baseline-47m" \ --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": "AwakeningOS/babylm-dense-baseline-47m", "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 "AwakeningOS/babylm-dense-baseline-47m" \ --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": "AwakeningOS/babylm-dense-baseline-47m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AwakeningOS/babylm-dense-baseline-47m with Docker Model Runner:
docker model run hf.co/AwakeningOS/babylm-dense-baseline-47m
BabyLM Dense Baseline (47M parameters)
日本語の説明 · How we chose this baseline: experiments and lessons
An English language model with 47,292,288 parameters. We use it as the reference point for future architecture experiments. It earned 52.7745 on our local evaluation using the BabyLM 2026 English Strict-Small NLP tasks. It is a pretrained base model for research on learning from limited text. For a first look, give it a short English passage to continue.
Make your own model
You can change the training settings, fine-tune the weights, modify the architecture and publish the result under a name you choose. Commercial use is welcome. You can do all of this without asking us or crediting AwakeningOS.
AwakeningOS dedicates its rights in the weights, configuration, tokenizer artifacts, scoring code, documentation and research results in this repository to the public domain under CC0 1.0. The BabyLM source texts and third-party software have their own terms. License
Try the model
The checkpoint loads with the standard Transformers Llama implementation.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "AwakeningOS/babylm-dense-baseline-47m"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo).eval()
prompt = [tok.bos_token_id] + tok.encode("When the rain stopped,", add_special_tokens=False)
ids = torch.tensor([prompt])
with torch.inference_mode():
out = model.generate(ids, attention_mask=torch.ones_like(ids),
max_new_tokens=20, do_sample=False)
print(tok.decode(out[0].tolist(), skip_special_tokens=True))
What is inside
Ten independent decoder blocks of width 384 each contain six attention heads and a SwiGLU feed-forward layer of width 1,408. The blocks use rotary positions and pre-RMS normalization. The input embedding and output projection have independent weights. A fixed 32,768-entry Unigram tokenizer maps English text to tokens. The longest sequence used in pretraining was 512 tokens.
The network processes a sequence in one pass. Its training uses two ways of predicting a word piece. In causal prediction, only the text to its left is visible. In masked next-token prediction (MNTP), the target can be hidden while the surrounding text is visible, and its score comes from the immediately preceding position. These objectives use the same weights. Generation uses causal attention.
Data and checkpoint choice
The run used the English BabyLM Strict-Small corpus of 10 million words, including transcribed speech, subtitles, books and Wikipedia. Each pass exposed the model to another 10 million words. We compared checkpoints at 70, 80, 90 and 100 million word exposures. The 80-million-exposure checkpoint had the highest mean across the six zero-shot suites, so its weights are the baseline distributed here.
Training used a 1-to-3 balance of causal and masked prediction. After 60 million word exposures, four updates dedicated to individual objectives alternated with four updates that combined both losses. The combined updates weighted causal loss at 25% and masked loss at 75%. AdaMuon updated the block matrices and AdamW updated the vocabulary and normalization weights. Peak learning rates were 0.005 and 0.002 respectively, with 1.6 million words of warmup and cosine decay. Model development and downstream fine-tuning both used seed 20260907.
How to read the score
| Local evaluation at 80 million word exposures | Score |
|---|---|
| Mean of the six zero-shot suites | 50.8106 |
| Mean of seven supervised tasks after fine-tuning | 64.5581 |
| BabyLM-style NLP average | 52.7745 |
The six suites are BLiMP, BLiMP Supplement, EWoK, Entity Tracking, CoMPS and Global PIQA. The two English Global PIQA splits are averaged to form one suite. The supervised group averages BoolQ, MNLI, MRPC, MultiRC, QQP, RTE and WSC, each fine-tuned independently from these same base weights. The NLP figure gives each of the six zero-shot suites and the supervised group one vote. It is a local, single-seed result. The checkpoint contains the pretrained language model. Individual task scores and the fine-tuning settings are in evaluation.json.
Zero-shot evaluation used bidirectional MNTP pseudo-log-likelihoods. To score a target, replace that token with the mask token, allow attention on both sides, and read its log-probability at the previous position. The ordinary generation example above gives causal probabilities. The included scoring helper implements the MNTP calculation for a chosen span. Use the task's original prompt and normalization to reproduce its evaluation.
from huggingface_hub import snapshot_download
import sys
folder = snapshot_download(repo, allow_patterns=["mntp.py"])
sys.path.insert(0, folder)
from mntp import masked_token_log_probs
model = AutoModelForCausalLM.from_pretrained(repo, attn_implementation="eager").eval()
ids = [tok.bos_token_id] + tok.encode("The children are playing.", add_special_tokens=False)
log_probs = masked_token_log_probs(model, ids, range(1, len(ids)))
print(log_probs.mean().item())
Provenance and verification
The backbone and trained weights come from AwakeningOS's Modern Dense series. The mixed objective draws on GPT-BERT, and the optimizer recipe draws on the BabySteps MurphysLaw experiments. The Transformers export splits the native fused projections and reorders rotary query and key channels to preserve the original computation. The source checkpoint identity and the numerical comparison with the native loader are recorded in verification.json.
- Downloads last month
- 40