Text Generation
Transformers
Safetensors
gpt2
childes
child-directed-speech
language-acquisition
developmental
sample-efficient-pretraining
Instructions to use mcxfrank/childes-gpt2-ladder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mcxfrank/childes-gpt2-ladder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mcxfrank/childes-gpt2-ladder")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mcxfrank/childes-gpt2-ladder", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mcxfrank/childes-gpt2-ladder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mcxfrank/childes-gpt2-ladder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mcxfrank/childes-gpt2-ladder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mcxfrank/childes-gpt2-ladder
- SGLang
How to use mcxfrank/childes-gpt2-ladder 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 "mcxfrank/childes-gpt2-ladder" \ --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": "mcxfrank/childes-gpt2-ladder", "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 "mcxfrank/childes-gpt2-ladder" \ --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": "mcxfrank/childes-gpt2-ladder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mcxfrank/childes-gpt2-ladder with Docker Model Runner:
docker model run hf.co/mcxfrank/childes-gpt2-ladder
Add model card / README
Browse files
README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- gpt2
|
| 7 |
+
- childes
|
| 8 |
+
- child-directed-speech
|
| 9 |
+
- language-acquisition
|
| 10 |
+
- developmental
|
| 11 |
+
- sample-efficient-pretraining
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# CHILDES-trained GPT-2 developmental ladder
|
| 15 |
+
|
| 16 |
+
A ladder of **GPT-2-small models trained from scratch on child-directed speech (CHILDES)**
|
| 17 |
+
at increasing amounts of input. It is the language-model side of a children-vs-LMs study of
|
| 18 |
+
how vocabulary is acquired across "development," and is meant as a research artifact for work
|
| 19 |
+
on developmental / sample-efficient language modeling.
|
| 20 |
+
|
| 21 |
+
## What's here
|
| 22 |
+
|
| 23 |
+
**180 models = 10 random seeds × 18 nested input budgets** (0.5M → 24M words).
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
development/seed{S}/rung{B}/
|
| 27 |
+
S ∈ {0, 1, 2, 3, 4, 5, 7, 42, 99, 123}
|
| 28 |
+
B ∈ {0.5M, 0.75M, 1M, 1.25M, 1.5M, 1.75M, 2M, 2.5M, 3M, 3.5M, 4M, 5M, 6M, 7M, 8M, 12M, 16M, 24M}
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
The budgets are **nested** (each larger budget contains the smaller), and a seed fixes both the
|
| 32 |
+
initialization and the input-stream order — so each seed is an "individual" accumulating input,
|
| 33 |
+
i.e. a developmental trajectory. Every model directory is self-contained (weights + tokenizer +
|
| 34 |
+
config + `provenance.json`).
|
| 35 |
+
|
| 36 |
+
## Load a model
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 40 |
+
sub = "development/seed42/rung24M" # pick any seed/budget
|
| 41 |
+
model = AutoModelForCausalLM.from_pretrained("mcxfrank/childes-gpt2-ladder", subfolder=sub, torch_dtype="auto")
|
| 42 |
+
tok = AutoTokenizer.from_pretrained("mcxfrank/childes-gpt2-ladder", subfolder=sub)
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
Use `torch_dtype="auto"` to preserve the stored bf16 weights (otherwise they upcast to fp32).
|
| 46 |
+
|
| 47 |
+
## Training
|
| 48 |
+
|
| 49 |
+
- **Architecture:** GPT-2-small (125.8M params; 12 layers, 768-dim), trained **from scratch**.
|
| 50 |
+
- **Tokenizer:** `GPT2_CHILDES` byte-pair encoding (52k vocab), trained on CHILDES (Feng et al. / TinyDialogues).
|
| 51 |
+
- **Data:** English CHILDES (Feng et al. 2024 preparation). Budgets are counted in whitespace
|
| 52 |
+
words (the developmental currency); each seed shuffles conversations and takes cumulative
|
| 53 |
+
prefixes to each budget.
|
| 54 |
+
- **Optimization:** up to 40 epochs with **early stopping** (patience 4) on held-out validation
|
| 55 |
+
loss; the lowest-validation-loss checkpoint is kept. AdamW, learning rate 1e-4 (linear decay,
|
| 56 |
+
no warmup), weight decay 0, batch size 8, sequence length 1024, no in-epoch shuffling.
|
| 57 |
+
- **Precision:** stored as **bf16** safetensors.
|
| 58 |
+
|
| 59 |
+
## Provenance & reproduction
|
| 60 |
+
|
| 61 |
+
Each model carries a `provenance.json` (seed, budget, config). These weights were re-trained from
|
| 62 |
+
the exact ladder samples used in the analysis; re-trained per-word surprisal reproduces the
|
| 63 |
+
published values at **r = 0.988** (aggregate mean within ~0.04 nats). GPU nondeterminism makes
|
| 64 |
+
them faithful re-trainings, not bit-identical.
|
| 65 |
+
|
| 66 |
+
## Intended use & limitations
|
| 67 |
+
|
| 68 |
+
Research artifacts for studying developmental / sample-efficient language modeling and word
|
| 69 |
+
acquisition. These are **child-scale** models (≤24M words of input, English child-directed
|
| 70 |
+
speech only) and are **not** intended for production use or as general-purpose language models.
|
| 71 |
+
|
| 72 |
+
## Citation
|
| 73 |
+
|
| 74 |
+
Paper: *Children, but not language models, learn words via accelerating accumulation* (Frank, in prep).
|
| 75 |
+
Data & training pipeline: Feng et al. (2024); CHILDES (MacWhinney, TalkBank).
|
| 76 |
+
|
| 77 |
+
## License
|
| 78 |
+
|
| 79 |
+
**To be set by the repository owner.** The training data (CHILDES via TalkBank) is subject to
|
| 80 |
+
TalkBank's terms of use; please respect those when using or redistributing these models.
|