Instructions to use sfanm/nltower-100m-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sfanm/nltower-100m-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sfanm/nltower-100m-base") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sfanm/nltower-100m-base") model = AutoModelForCausalLM.from_pretrained("sfanm/nltower-100m-base", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sfanm/nltower-100m-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sfanm/nltower-100m-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sfanm/nltower-100m-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sfanm/nltower-100m-base
- SGLang
How to use sfanm/nltower-100m-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 "sfanm/nltower-100m-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sfanm/nltower-100m-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "sfanm/nltower-100m-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sfanm/nltower-100m-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sfanm/nltower-100m-base with Docker Model Runner:
docker model run hf.co/sfanm/nltower-100m-base
nltower-100m-base
The 124M-parameter base language model of the nl_tower study, at iteration 30,000 of its pretraining run. This is the last constant-learning-rate checkpoint before the cooldown. Every CPT-N model in this collection branches from it. It has seen web text only and no nl_tower data, so it cannot solve the puzzles; it is released as the starting point of the CPT-N branch.
This repository is part of the nl_tower (100M) collection on the Hugging Face Hub (5 CPT models, 6 SFT models, the base model and 4 datasets).
nl_tower in brief
nl_tower is a synthetic reasoning task. Each puzzle places 6-12 people on distinct floors (1-40) of a tower. The prompt lists the occupied floors, each person's best friend, and clues that relate the floors of two terms ("greater than", "k floors above", sums, parity, "twice", highest/lowest). Many clues refer to people indirectly, for example "the best friend of the person on the second-highest floor"; such a clue becomes usable only after other clues have pinned part of the answer. Each puzzle has a unique solution that a step-by-step solver reaches without guessing.
The study asks whether reinforcement learning can teach reasoning compositions that the imitation data never shows:
- Covered patterns (shown in the mid-training traces):
friend("Ava's best friend"),friend2("the best friend of Ava's best friend"),order("the person directly above Ava"),rankn("the person on the second-highest floor"),dfriend_occ("the best friend of the person on floor 19"). - Held-out patterns (appear only in RL prompts and tests):
dfriend_rank("the best friend of the person on the highest floor"),dfriend_above("the best friend of the person directly above Ava"), andnested(two-level references).
Test rungs: easy (nltw_e, 6-7 people, covered only), covered mid (nltw_m0, 8-9 people, covered only), held-out mid (nltw_m, 8-9 people, 2-4 held-out steps), hard (nltw_h, 9-10 people, 4-6 held-out steps), size-only hard (nltw_hb, 10-11 people, 2-4 held-out steps) and 12 people (nltw_hb12, test only).
Position in the pipeline
base pretraining (iteration 30,000, before the cooldown) --CPT-N (cooldown + N trace sequences per batch)--> CPT-N models --RL--> policies
base pretraining (iteration 38,147, end of the run) --SFT on the same traces--> SFT models --RL (no demos)--> policies
- The five CPT-N models (
sfanm/nltower-100m-cpt8,sfanm/nltower-100m-cpt16,sfanm/nltower-100m-cpt32,sfanm/nltower-100m-cpt64,sfanm/nltower-100m-cpt128) start from this checkpoint and rerun the cooldown with N trace sequences added to each batch. - The six staged SFT models (
sfanm/nltower-100m-sft-tw1X-*) do not start from this checkpoint. They start from the end of the same pretraining run (iteration 38,147, after the full cooldown), which is not part of this release.
Pretraining
The base run trained the 124M model from scratch with Megatron-Bridge for 38,147 iterations of 256 sequences x 2,048 tokens (524,288 tokens per iteration, about 20.0B tokens). The learning rate followed a warmup-stable-decay (WSD) schedule whose decay ("cooldown") phase starts at iteration 30,518. The data blend was 75 % ClimbMix and 25 % Dolma 3 Dolmino (GPT-2 tokenised, EOS between documents).
This checkpoint was converted from the native Megatron distributed checkpoint to Hugging Face format for this release. The same converter reproduces the authors' earlier Hugging Face export of iteration 38,147 bit for bit (all 110 tensors equal).
Architecture
| property | value |
|---|---|
| architecture | LlamaForCausalLM (decoder-only) |
| parameters | 123,587,328 (embeddings tied with the output layer) |
| layers / hidden size / heads | 12 / 768 / 12 (head dim 64, no grouped-query attention) |
| MLP | SwiGLU, intermediate size 2,048 |
| normalisation / position | RMSNorm (eps 1e-5) / RoPE (theta 10,000) |
| tokenizer | GPT-2 BPE (50,257 tokens; embedding padded to 50,304) |
| special tokens | <|endoftext|> (id 50256) is BOS, EOS and PAD |
| context length | 2,048 tokens |
| weights | model.safetensors, bfloat16 |
Prompt format and usage
The prompt is the puzzle text followed by "\n\nAnswer: ". The model writes its reasoning and ends with the full assignment in \boxed{Name=floor, ...}. A completion is correct when every Name=floor pair in the boxed answer matches the solution (order does not matter). The chat template only concatenates message contents (no role markers), so apply_chat_template and the raw prompt give the same tokens.
from transformers import AutoModelForCausalLM, AutoTokenizer
from datasets import load_dataset
repo = "sfanm/nltower-100m-base"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="bfloat16")
test = load_dataset("sfanm/nltower-env", "tests", split="nltw_m0")
prompt = test[0]["prompt"] # question + "\n\nAnswer: "
ids = tok(prompt, return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=1280, do_sample=False, pad_token_id=tok.eos_token_id)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True)) # ... \boxed{Name=floor, ...}
print("gold:", test[0]["answer"])
Evaluation
No nl_tower evaluation of this checkpoint was run; as a pure web-text model it is not expected to produce boxed answers. Its loss on a short English paragraph is 3.40 nats/token (the CPT-N models reach 3.16-3.27 after the cooldown).
Intended use and limitations
- Intended for research on mid-training, imitation and reinforcement learning at small scale, mainly as the branch point for CPT-N.
- It is a 124M model trained on about 15.7B tokens up to this checkpoint, mid-schedule (before the learning-rate cooldown). It is not instruction-tuned, not safety-tuned and not suitable for any user-facing use.
- Web-scale pretraining data can contain biased, offensive or incorrect text, and the model can reproduce it.
Training data
- Pretraining:
karpathy/climbmix-400b-shuffle,allenai/dolma3_dolmino_mix-100B-1025(see License). - nl_tower data used downstream:
sfanm/nltower-traces-tw1X,sfanm/nltower-env,sfanm/nltower-rl-mixes; scores:sfanm/nltower-results.
Code
Code: the environment generator, solver, data builders, training recipes and evaluator are not public yet.
License
No license has been chosen for these weights yet, so the metadata says license: other. The base model was pretrained on:
karpathy/climbmix-400b-shuffle(75 % of tokens): a reshuffled copy of NVIDIA's ClimbMix. The copy is tagged MIT, while the originalnvidia/Nemotron-ClimbMixcard gives CC BY-NC 4.0 and says it is for research and development only.allenai/dolma3_dolmino_mix-100B-1025(25 % of tokens): ODC-By 1.0, with a note that it is intended for research and educational use.
Use the weights only in ways that the terms of these datasets allow. The nl_tower data used after pretraining is the authors' own synthetic data (Apache-2.0, see the dataset repositories).
Authors and citation
Authors and citation: to be added.
This release (files and this card) was prepared with AI assistance (Claude, an Anthropic model) and is being reviewed by the authors.
- Downloads last month
- 427