TinyStories GPT-Style Language Model (1.06M Parameters)

A small decoder-only Transformer language model trained from random initialization on a subset of the TinyStories dataset. This checkpoint demonstrates causal language modeling, BPE tokenization, training, checkpoint saving, and loading through Hugging Face Transformers.

Status: Experimental proof of concept; not a production-ready or instruction-following model.

Architecture

Property Value
Model family GPT-style decoder-only causal language model
Trainable parameters 1,060,992
Tokenizer BPE, trained on the sampled training text
Vocabulary size 3,512
Training initialization From scratch (random weights)
Training framework PyTorch and Hugging Face Transformers

Training data and setup

  • Training dataset: roneneldan/TinyStories, English text, train split.
  • Subset used for this run: 270 training examples and 30 validation examples.
  • Training epochs: 2.
  • Training loss: epoch 1: 7.5319; epoch 2: 6.6421.
  • Validation loss: epoch 1: 7.0656; epoch 2: 6.3688.
  • Training hardware: NVIDIA GeForce GTX 1650 series GPU with 4 GB VRAM.
  • Dataset license (as shown on its Hub page): CDLA-Sharing-1.0. This applies to the dataset; the model weights are licensed separately (see below).

The logged losses are specific to this small subset; they do not establish general-purpose language-model quality. There are no independent benchmark evaluations for this checkpoint.

Quick start

Install compatible PyTorch and Transformers packages, then run:

from transformers import AutoTokenizer, AutoModelForCausalLM

repo_id = "sudhanshu42844/my-tiny-llm"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id)

inputs = tokenizer("Once upon a time", return_tensors="pt")
outputs = model.generate(
    **inputs,
    max_new_tokens=40,
    do_sample=True,
    temperature=0.8,
    pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Alternatively, use the local model path instead of repo_id.

Intended use

  • Demonstrating GPT-style causal language model training from scratch.
  • Testing Hugging Face dataset, tokenizer, and checkpoint integration.
  • Experimenting with small-scale text generation.

Limitations

  • Only 270 training examples were used in the reported experiment.
  • Generated stories may be repetitive, ungrammatical, incoherent, or misleading.
  • The model is not intended for factual question answering, safety-critical decisions, or production deployment.
  • No safety, bias, robustness, or generalization evaluations have been performed.

Reproducibility

To reproduce the run, see the training program used to produce the checkpoint and specify the dataset, architecture, random seed, optimizer, and training arguments. Update this card when publishing any new version or substantially different checkpoint.

Attribution and licensing

Training data: TinyStories. The dataset is distributed under CDLA-Sharing-1.0, which continues to apply to the data itself.

The model weights, tokenizer and configuration in this repository are released under the Apache License 2.0 (Copyright 2026 Sudhanshu Shukla); see LICENSE.

Downloads last month
108
Safetensors
Model size
1.06M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train sudhanshu42844/my-tiny-llm

Space using sudhanshu42844/my-tiny-llm 1