Text Generation
Transformers
Safetensors
English
qwen3
littlelearner
bounded
base
text-generation-inference
Instructions to use littlelearner/littlelearner-5b-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use littlelearner/littlelearner-5b-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="littlelearner/littlelearner-5b-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("littlelearner/littlelearner-5b-base") model = AutoModelForCausalLM.from_pretrained("littlelearner/littlelearner-5b-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use littlelearner/littlelearner-5b-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "littlelearner/littlelearner-5b-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "littlelearner/littlelearner-5b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/littlelearner/littlelearner-5b-base
- SGLang
How to use littlelearner/littlelearner-5b-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 "littlelearner/littlelearner-5b-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": "littlelearner/littlelearner-5b-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 "littlelearner/littlelearner-5b-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": "littlelearner/littlelearner-5b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use littlelearner/littlelearner-5b-base with Docker Model Runner:
docker model run hf.co/littlelearner/littlelearner-5b-base
Add LittleLearner model + card
Browse files- README.md +41 -0
- config.json +79 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +11 -0
README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- qwen3
|
| 9 |
+
- text-generation
|
| 10 |
+
- littlelearner
|
| 11 |
+
- bounded
|
| 12 |
+
- base
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# littlelearner-5b-bounded-base
|
| 16 |
+
|
| 17 |
+
5B K-5-bounded base model (pretraining only).
|
| 18 |
+
|
| 19 |
+
Part of the **LittleLearner** scale-up study (*pedagogically-controlled knowledge exposure*): Qwen3 dense LMs trained on a corpus filtered to U.S. K–5 material (**bounded**) vs an unfiltered FineWeb-Edu corpus (**unbounded**), to measure what an interpretable knowledge boundary costs and grants.
|
| 20 |
+
|
| 21 |
+
## Model
|
| 22 |
+
- **Architecture:** Qwen3 dense (`Qwen3ForCausalLM`) — standard `transformers`, no custom code / `trust_remote_code`.
|
| 23 |
+
- **Size:** 5.04B params — hidden 3072, 44 layers, 24 query / 8 KV heads, FFN 9216. **Context:** 4096.
|
| 24 |
+
- **Tokenizer:** custom 64k byte-level BPE with per-digit splitting (trained for this project; ChatML special tokens).
|
| 25 |
+
- **Pretraining:** 88B tokens on K-5 **LittleCurriculum** (FineWeb-Edu filtered to U.S. grades K–5). WSD schedule, sharded Muon optimizer, MXFP8, Megatron-Core on 8×B200.
|
| 26 |
+
|
| 27 |
+
## Evaluation
|
| 28 |
+
- In-domain bits-per-byte (BPB): **0.536** (vs the 2B nanochat reference 0.805).
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
```python
|
| 33 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 34 |
+
import torch
|
| 35 |
+
tok = AutoTokenizer.from_pretrained("manueldeprada/littlelearner-5b-bounded-base")
|
| 36 |
+
model = AutoModelForCausalLM.from_pretrained("manueldeprada/littlelearner-5b-bounded-base", torch_dtype=torch.bfloat16, device_map="auto")
|
| 37 |
+
ids = tok("The sum of 2 and 3 is", return_tensors="pt").to(model.device)
|
| 38 |
+
print(tok.decode(model.generate(**ids, max_new_tokens=64)[0]))
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
> Research artifact. The **bounded** models carry an intentional K–5 knowledge boundary (they cannot model above-grade-5 material); the **base** models are not instruction-tuned.
|
config.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 0,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 3072,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 9216,
|
| 15 |
+
"layer_types": [
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"full_attention",
|
| 51 |
+
"full_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"full_attention",
|
| 54 |
+
"full_attention",
|
| 55 |
+
"full_attention",
|
| 56 |
+
"full_attention",
|
| 57 |
+
"full_attention",
|
| 58 |
+
"full_attention",
|
| 59 |
+
"full_attention"
|
| 60 |
+
],
|
| 61 |
+
"max_position_embeddings": 4096,
|
| 62 |
+
"max_window_layers": 28,
|
| 63 |
+
"model_type": "qwen3",
|
| 64 |
+
"num_attention_heads": 24,
|
| 65 |
+
"num_hidden_layers": 44,
|
| 66 |
+
"num_key_value_heads": 8,
|
| 67 |
+
"pad_token_id": 1,
|
| 68 |
+
"rms_norm_eps": 1e-06,
|
| 69 |
+
"rope_parameters": {
|
| 70 |
+
"rope_theta": 1000000.0,
|
| 71 |
+
"rope_type": "default"
|
| 72 |
+
},
|
| 73 |
+
"sliding_window": null,
|
| 74 |
+
"tie_word_embeddings": true,
|
| 75 |
+
"transformers_version": "5.2.0",
|
| 76 |
+
"use_cache": true,
|
| 77 |
+
"use_sliding_window": false,
|
| 78 |
+
"vocab_size": 64000
|
| 79 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 0,
|
| 5 |
+
"output_attentions": false,
|
| 6 |
+
"output_hidden_states": false,
|
| 7 |
+
"pad_token_id": 1,
|
| 8 |
+
"transformers_version": "5.2.0",
|
| 9 |
+
"use_cache": true
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:85cb71c145b5f3979f769f92a13d72d74eaf8b2c34c4c8379cd0187902576c50
|
| 3 |
+
size 10082683608
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": null,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"is_local": true,
|
| 7 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 8 |
+
"pad_token": "<|endoftext|>",
|
| 9 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 10 |
+
"unk_token": "<|endoftext|>"
|
| 11 |
+
}
|