prajna-ai-124m-chat

Formerly kaggle-llm-124m-chat (old links redirect here). The current weights still introduce themselves by the old name; the next fine-tune will use "Prajna AI".

A 124M-parameter chat model trained from scratch on free Kaggle GPUs (2x NVIDIA T4): pretrained on 1.92B tokens of FineWeb-Edu, then supervised fine-tuned on 451K conversations from smol-smoltalk plus 1,000 synthetic identity conversations (so it knows its own name and origin).

It is a learning project, not a production assistant: it follows the chat format and writes simple code, but it often states wrong facts confidently.

Usage

The weights are a standard LlamaForCausalLM with the GPT-2 tokenizer, so plain transformers works:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "somdevsheel/prajna-ai-124m-chat"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.float16).to("cuda")

messages = [{"role": "user", "content": "Write a Python function that reverses a string."}]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")
out = model.generate(ids, attention_mask=torch.ones_like(ids), max_new_tokens=200,
                     do_sample=True, temperature=0.7, top_k=50, repetition_penalty=1.15)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))

Recommended sampling: temperature 0.7, top-k 50, repetition penalty 1.15. Context length is 1024 tokens.

Chat format (role tags are plain text; each assistant turn ends with <|endoftext|>):

<|system|>
...
<|user|>
...
<|assistant|>
...<|endoftext|>

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

Stage Data Compute Result
Pretraining 1.92B tokens of FineWeb-Edu (sample-10BT) 3,661 steps x 524K tokens (two runs), about 21 h on 2x T4 val loss 3.30 (perplexity 27)
Chat SFT 451K conversations from smol-smoltalk (full set) + 1K synthetic identity conversations, packed into 1024-token blocks (299M tokens) 4,578 steps x 65K tokens, 3.2 h on 2x T4 val loss on assistant tokens 2.65 -> 1.46
  • PyTorch DDP across 2 GPUs, fp16 mixed precision with loss scaling, AdamW (0.9, 0.95), weight decay 0.1, cosine LR schedule.
  • Pretraining LR 1.2e-3, then continued pretraining at 6e-4 on unseen data; the trainer measured its own speed and fitted the cosine schedule into the 12-hour Kaggle session limit.
  • SFT LR 2e-4; loss computed on assistant tokens only; whole conversations first-fit packed (92% fill). Identity conversations are train-only, so val loss is comparable with earlier versions (v1 1.61, v2 1.54, v3 1.46).

Limitations

  • Hallucination. About 16 training tokens per parameter (Chinchilla-optimal is ~20), so its knowledge is thin. Example: asked "What is DSA in computer science?", it invents a definition.
  • Asked about itself it gives the right name and creator, but may add invented details around them.
  • English only; no safety tuning or preference training (no RLHF/DPO).
  • Short code is often correct (string reversal, prime check); longer or vaguely specified code usually is not.
  • Do not rely on it for factual, medical, legal or financial answers.

Base model

Pretrained-only weights: somdevsheel/prajna-ai-124m-base.

Downloads last month
557
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/prajna-ai-124m-chat

Quantized
(1)
this model

Dataset used to train somdevsheel/prajna-ai-124m-chat

Space using somdevsheel/prajna-ai-124m-chat 1