CoolFace
Modelpublic

SimpleStories/SimpleStories-V2-30M

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes602downloads
Model Card

SimpleStories Model Family

The SimpleStories models are a tiny model family created for interpretability research, trained on the SimpleStories dataset. This is the second iteration of the model family.

Paper: https://arxiv.org/abs/2504.09184 Training code: https://github.com/simple-stories/simplestoriestrain Traning checkpoints: https://wandb.ai/finke/simplestories-v2

Usage

python
import torch
from transformers import AutoTokenizer, LlamaForCausalLM


MODEL_SIZE = "30M"
model_path = "SimpleStories/SimpleStories-V2-{}".format(MODEL_SIZE)

tokenizer = AutoTokenizer.from_pretrained(model_path)
model = LlamaForCausalLM.from_pretrained(model_path)
model.to("cuda")
model.eval()

prompt = "The curious cat looked at the"

inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
input_ids = inputs.input_ids.to("cuda")

eos_token_id = 1

with torch.no_grad():
    output_ids = model.generate(
        input_ids=input_ids,
        max_new_tokens=400,
        temperature=0.7,
        do_sample=True,
        eos_token_id=eos_token_id
)

output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(f"\nGenerated text:\n{output_text}")

Model Variants

Model Namen_paramsn_layersd_modeln_headsn_ctxd_vocab
SimpleStories-35M35 million1251285124019
SimpleStories-30M30 million1051285124019
SimpleStories-11M11 million638465124019
SimpleStories-5M5 million625645124019
SimpleStories-1.25M1.25 million412845124019

Dataset

The SimpleStories dataset is a collection of short stories generated by state-of-the-art language models. It features:

  • Story annotation with high-level concepts: theme, topic, style, etc.
  • Higher semantic and syntactic diversity through seeded story generation
  • Generated by 2024 models
  • Several NLP-metrics pre-computed to aid filtering
  • ASCII-only guarantee for the English dataset

Key improvements from previous version

  • Improved evaluation scores due to the increased training epochs
  • Pruning and optimization of the tokenizer resulting in vocabulary size from 4096 to 4019
  • Model training checkpoints are stored periodically in wandb for further research