← All projects

developing-gpt2-124M-from-scratch

by @Bensmail-anis

11

A custom implementation of OpenAI's GPT-2(124M) from scratch, following the paper "Language Models are Unsupervised Multitask Learners".We train the model on the FineWeb dataset -10 billion tokens.

About this project

📜 Inspired by Key Research Papers: Attention Is All You Need (Vaswani et al., 2017) Language Models are Unsupervised Multitask Learners (GPT-2 paper) (Radford et al., 2019) Language Models are Few-Shot Learners (GPT-3 paper) (Brown et al., 2020) Thanks to Andrej Karpathy’s clear and insightful explanations in his Neural Networks series. 📂 Dataset: FineWeb 10B Tokens For training our custom GPT-2 model, we utilized the FineWeb dataset with 10 billion tokens. This dataset underwent rigorous filtering to ensure high-quality data selection. Filtering steps included the removal of low-quality web content, duplicate text elimination, and language detection to maintain a clean and diverse corpus. As a result, the model learned from a balanced and representative sample of internet text, enhancing its performance on downstream tasks. 🏋 Training and Evaluaton Details GPU: A100 Training Time: 23 hours per epoch. Training Log : you will find it at src/log To evaluate model performance, we compared our results against GPT-2 and GPT-3 baselines across key metrics like: HellaSwag accuracy. Training Loss(Cross-Entropy Loss): Our model achieved a minimum training loss of 2.7826 after one epoch.

From the project README on GitHub

Stars
11
Forks
0
License
other
Last push
10 Apr 2025

Add this badge to your README

Show that your project is listed on Made in Algeria.

Made in Algeria
[![Made in Algeria](https://www.madeinalgeria.dev/badge/developing-gpt2-124m-from-scratch.svg)](https://www.madeinalgeria.dev/projects/developing-gpt2-124m-from-scratch)

Related projects

RAGbot---Generative_AI-RAG-Application

bensmail-anis/ragbot---generative_ai-rag-application

A powerful chatbot assistant leveraging Retrieval-Augmented Generation (RAG) to answer questions from multiple PDF documents. RAGbot generates accurate responses and provides source references, making it an ideal assistant for working with domain-specific PDFs.

16TypeScript

NetWise_DevFest24

bensmail-anis/netwise_devfest24

NetWise is a bandwidth management and optimization system developed for the DevFest Algiers Hackathon.

13Python

Human-Emotion-Detection-Through-Computer-Vision

bensmail-anis/human-emotion-detection-through-computer-vision

Human Emotion Detection through various deep learning techniques , including using diverse model architectures, Transfer learning , Transformers and data strategies.

12Jupyter Notebook

Building-a-GPT-Inspired-Transformer-from-Scratch

bensmail-anis/building-a-gpt-inspired-transformer-from-scratch

We build a Mini Generative Pretrained Transformer (GPT) inspired by the "Attention is All You Need" paper -11 M params

11Jupyter Notebook

Black-Friday-Project

bensmail-anis/black-friday-project

The project revolves around analyzing a comprehensive Black Friday sales dataset.The primary objectives involve exploring the relationships between various attributes, predicting purchase amounts using machine learning models, and understanding the impact of different factors on Black Friday sales.

10Jupyter Notebook

pythoncode-tutorials

x4nth055/pythoncode-tutorials

The Python Code Tutorials

3kJupyter NotebookEducationActive