How much do language models memorize?
Paper • 2505.24832 • Published • 4
How to use evalstate/tiny-gpt-memorization-0p5m with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="evalstate/tiny-gpt-memorization-0p5m") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("evalstate/tiny-gpt-memorization-0p5m")
model = AutoModelForCausalLM.from_pretrained("evalstate/tiny-gpt-memorization-0p5m", device_map="auto")How to use evalstate/tiny-gpt-memorization-0p5m with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "evalstate/tiny-gpt-memorization-0p5m"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "evalstate/tiny-gpt-memorization-0p5m",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/evalstate/tiny-gpt-memorization-0p5m
How to use evalstate/tiny-gpt-memorization-0p5m with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "evalstate/tiny-gpt-memorization-0p5m" \
--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": "evalstate/tiny-gpt-memorization-0p5m",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "evalstate/tiny-gpt-memorization-0p5m" \
--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": "evalstate/tiny-gpt-memorization-0p5m",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use evalstate/tiny-gpt-memorization-0p5m with Docker Model Runner:
docker model run hf.co/evalstate/tiny-gpt-memorization-0p5m
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("evalstate/tiny-gpt-memorization-0p5m")
model = AutoModelForCausalLM.from_pretrained("evalstate/tiny-gpt-memorization-0p5m", device_map="auto")From an exploratory tiny-scale replication of How much do language models memorize?.
This is the near-capacity (saturation-boundary) run for this model size.
Below- and above-capacity checkpoints for the same architecture are published as
state.pt files in the results dataset evalstate/tiny-memorization-results.
Load with:
from transformers import GPT2LMHeadModel
model = GPT2LMHeadModel.from_pretrained("evalstate/tiny-gpt-memorization-0p5m")
Findings are scoped as an exploratory tiny-scale check (three architectures), NOT a universal scaling law.
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="evalstate/tiny-gpt-memorization-0p5m")