Words shaped by
thought.
A small GPT-style language model, trained on cleaned text from writings associated with Mahatma Gandhi. Built to explore how machines learn the patterns of language.
Begin with a thought.
Small model.
Big questions.
GandhiGPT is an educational experiment exploring how machines learn patterns in human language. It was trained from scratch using a decoder-only Transformer architecture and cleaned text from writings associated with Mahatma Gandhi.
Loss values are from the final reported training evaluation. Lower values indicate better next-character prediction on the evaluated data.
Inside the architecture.
GandhiGPT learns to predict the next character based on the characters that came before it.
Input encoding
Text is broken into individual characters. Each character is converted into a numerical token.
Token embeddings
The model transforms character tokens into numerical vectors that it can process.
Self-attention
Attention allows the model to use earlier characters in the sequence when predicting the next one.
Text generation
The model predicts the next character repeatedly to produce a continuation of your prompt.
The training journey.
The dataset
GandhiGPT was trained on a cleaned text dataset containing writings associated with Mahatma Gandhi.
The dataset contains approximately 79.4 million characters and 205 unique characters.
View dataset source ↗Pretraining process
During training, the model learns to predict the next character in a sequence.
It uses a training and validation split to evaluate how well it learns patterns in the text.
What GandhiGPT isn't.
GandhiGPT is a small experimental language model. It is not ChatGPT, a search engine, or a factual question-answering system.
Its output is generated from patterns learned during training. It may produce incomplete, inaccurate, repetitive, or nonsensical text. Generated content should not be treated as an authentic quotation or statement by Mahatma Gandhi.