Nandhu S KumarAI & MACHINE LEARNING
← PROJECT INDEXCASE STUDY / 03

Scientific GPT

A GPT language model implemented from scratch, including tokenization and distributed training.

DISCIPLINE

Machine Learning

TIMELINE

Sep to Dec 2025

BUILT WITH

PyTorch, Transformers, CUDA, Multiple GPUs

System architectureFIG. 03
TOKENIZERTRANSFORMERTRAININGDISTRIBUTIONTEXT → SEQUENCEATTENTION + FEEDFORWARDLOSS + GRADIENTSPYTORCH + CUDAFROM SCRATCH / DISTRIBUTED TRAINING
  1. Text & tokens

    The tokenizer converts training text into sequences used by the language model.

  2. Transformer

    The GPT transformer learns relationships within the token sequence.

  3. Training loop

    The training loop calculates loss, propagates gradients, and updates model parameters.

  4. Multiple GPUs

    Distributed PyTorch and CUDA support training across GPU devices.

Machine LearningConceptual overview
INSIDE THE SYSTEM / SELECT A STAGE

The tokenizer converts training text into sequences used by the language model.

Problem

I wanted to understand how to build and train a language model, from converting text into tokens to updating model weights across GPUs.

Implementation

I implemented a GPT language model without pretrained weights, including the tokenizer, transformer architecture, and training loop. I used distributed PyTorch and CUDA to scale training across multiple GPUs.

Technical decisions

  • Built the tokenizer and transformer architecture as part of the project.
  • Implemented the training loop instead of relying on a pretrained model.
  • Used distributed PyTorch and CUDA for distributed GPU training.
  • Worked across sequence modeling, GPU compute, and training infrastructure.

Results

I implemented the tokenizer, transformer, training loop, and distributed training setup using PyTorch and CUDA.

NEXT / KEEP EXPLORING

Hospital Triage AI

Send a message

Contact me

Tell me about the role, project, or question you have in mind.