kaggle-llm-124m-base

A 124M-parameter base language model pretrained from scratch on 0.98B tokens of FineWeb-Edu using free Kaggle GPUs (2x NVIDIA T4, 10.9 hours). Validation loss 3.43 (perplexity 31).

This is a text-completion model, not a chat model. For the instruction-following version see somdevsheel/kaggle-llm-124m-chat.

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "somdevsheel/kaggle-llm-124m-base"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.float16).to("cuda")

ids = tok("Photosynthesis is the process", return_tensors="pt").input_ids.to("cuda")
out = model.generate(ids, attention_mask=torch.ones_like(ids), max_new_tokens=100,
                     do_sample=True, temperature=0.8, top_k=50)
print(tok.decode(out[0], skip_special_tokens=True))

Model

Architecture Decoder-only Transformer, LLaMA-style: RoPE, RMSNorm (pre-norm), SwiGLU, no biases, tied embeddings
Size 123.6M parameters (85.0M non-embedding)
Shape 12 layers, hidden 768, 12 heads, FFN 2048, context 1024
Tokenizer GPT-2 BPE (vocab padded to 50,304)

Training

  • Data: 0.98B tokens of FineWeb-Edu (sample-10BT), no token seen twice.
  • 1,865 steps x 524,288 tokens; PyTorch DDP on 2x T4; fp16 mixed precision with loss scaling.
  • AdamW (0.9, 0.95), weight decay 0.1, peak LR 1.2e-3, 200-step warmup, cosine decay to 10%. The schedule was fitted to the 12-hour Kaggle session limit by timing the first steps.
Step 0 250 500 1000 1500 1864
Val loss 10.97 4.88 4.05 3.65 3.48 3.43

Limitations

Trained on about 8 tokens per parameter, well short of compute-optimal, so it has limited world knowledge and frequently produces fluent but incorrect statements. English only; no safety filtering beyond FineWeb-Edu's educational filter.

Downloads last month
-
Safetensors
Model size
0.1B params
Tensor type
F16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for somdevsheel/kaggle-llm-124m-base

Quantizations
1 model

Dataset used to train somdevsheel/kaggle-llm-124m-base