Beginner's Guide to LLMs
Beginner's Guide to LLMs
New
Free Learning GenAI Agentic
Courses Paths Pinnacle AI
Program Pioneer
Program A
" Interview Prep Career GenAI Prompt Engg ChatGPT LLM Langchain RAG !
AI Agents
Build Large
Language Models
from Scratch
Aravind
Pai
16
Last
15 min read
Updated
: 11 Nov,
2024
Be it X or Linkedin, I encounter
numerous posts about Large
Language Models(LLMs) for beginners
Google
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 1 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Google
Introduction to Gemini, Falcon, and countless Gemma, the
to Open-Source
Generative
others, their names swirl around,
LLM
AI
leaving me eager to uncover their true Powerhouse
nature. These burning questions have How to Build a
Introduction lingered in my mind, fueling my Multilingual
to Chatbot using
Generative curiosity. This insatiable curiosity has
AI Large...
applications ignited a fire within me, propelling me to
What are
dive headfirst into the realm of LLMs. Large
No-code
Language
Generative Join me on an exhilarating journey as Models(LLMs)
AI app ?
development we will discuss the current state of the
Beyond
art in LLMs for begineers. Together,
Words:
Code- we’ll unravel the secrets behind their Unleashing
focused the Power of
Generative development, comprehend their
AI App Large Lan...
Development extraordinary capabilities, and shed
From GPT-3
light on how they have revolutionized
to Future
the world of language processing. Generations
of Language
Mo...
In this article, you will learn how to build
an LLM from scratch through a A Survey of
Large
beginner-friendly tutorial. We’ll cover Language
how LLMs are trained and share tips Models
(LLMs)
from Analytics Vidhya. By the end, you’ll
LLM Chatbot
have the skills to create a large
Architecture
language model. AI: Building
Smarter C...
12 Free And
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 2 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
30+ LLM
Interview
Questions and
Answers
Learning Objectives
evaluate LLMs
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 3 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Table of contents
Models
scratch?
A Brief History of
Large Language
Models
The history of Large Language Models
goes back to the 1960s. In 1967, a
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 4 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 5 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 6 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
datasets.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 7 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
competitor to ChatGPT.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 8 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
itself.
dataset.
Processing (NLP).
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 10 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Different Kinds of
LLMs
Dialogue optimized
the text.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 11 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
introduced.
Dialogue Optimized
40B-instruct, etc.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 12 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Infrastructure
an infrastructure/hardware supporting
multiple GPUs. Can you guess the time
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 13 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
“
It would take 288 years to train
V100 GPU.
LLMs-
Cost
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 14 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
‘
It is estimated that GPT-3 cost
LLMs.
Understanding the
Scaling Laws
Recently, we have seen that the trend
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 15 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
model size.
model?
of a particular size.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 16 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
‘
The no. of tokens used to train
model.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 17 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
something called
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 18 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Training Tips
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 19 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
to save memory.
performance of LLMs.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 20 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
from scratch.
a. Dataset Collection
possible.
‘
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 21 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
downstream generalization
language models
‘
Unlock the potential of LLMs with
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 22 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
RefinedWeb Dataset.
others.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 23 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
b. Dataset Preprocessing
training corpus.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 24 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Models Better
c. Dataset Preparation
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 25 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
output pairs.
DataHack Summit.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 26 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
architecture.
d. Model Architecture
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 27 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
For example,
tweaks.
e. Hyperparameter Search
model.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 28 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
memory.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 29 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Dialogue-optimized LLMs
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 30 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Feedback (RLHF).
suffice.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 31 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
dialogue-optimized LLMs.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 32 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Intrinsic Methods
next word.
Extrinsic Methods
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 33 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
by the community.
students.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 34 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
online.
Conclusion
these models.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 35 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
world.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 36 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
performance.
Key Takeaways
architecture, hyperparameter
tuning, and evaluation.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 37 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
and dataset.
Aravind Pai
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 38 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Generative AI Guide
Free Courses
4.7 Gene
rative
AI - A
Way
of
Life
Explore
Genera
tive AI
for
beginn
ers:
create
text
and
images
, use
top AI
tools,
learn
practic
al
skills,
and
ethics.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 39 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
4.5 Gettin
g
Starte
d with
Large
Lang
uage
Model
s
Master
Large
Langua
ge
Models
(LLMs)
with
this
course,
offering
clear
guidan
ce in
NLP
and
model
training
made
simple.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 40 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
4.6 Buildi
ng
LLM
Applic
ations
using
Prom
pt
Engin
eerin
g
This
free
course
guides
you on
building
LLM
apps,
masteri
ng
prompt
engine
ering,
and
develo
ping
chatbot
s with
enterpri
se
data.
4.8 Impro
ving
Real
World
RAG
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 41 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Syste
ms:
Key
Chall
enges
&
Practi
cal
Soluti
ons
Explore
practic
al
solution
s,
advanc
ed
retrieva
l
strategi
es, and
agentic
RAG
system
s to
improv
e
context
,
relevan
ce, and
accura
cy in
AI-
driven
applicat
ions.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 42 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
4.7 Micro
soft
Excel:
Form
ulas
&
Functi
ons
Master
MS
Excel
for data
analysi
s with
key
formula
s,
functio
ns, and
LookUp
tools in
this
compre
hensive
course.
Responses From
Readers
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 43 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Submit reply
Akshat
Dipak Khatri
Vinayak
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 44 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Frequently Asked
Questions
Q3.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 45 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Write for us
Write, captivate, and earn accolades
and rewards for your work
Flagship Courses
GenAI Pinnacle Program | AI/ML BlackBelt Courses
Free Courses
Generative AI | Large Language Models | Building LLM Applications using Prompt
Engineering | Building Your first RAG System using LlamaIndex | Stability.AI | MidJourney |
Building Production Ready RAG systems using LlamaIndex | Building LLMs for Code | Deep
Learning | Python | Microsoft Excel | Machine Learning | Decision Trees | Pandas for Data
Analysis | Ensemble Learning | NLP | NLP using Deep Learning | Neural Networks | Loan
Prediction Practice Problem | Time Series Forecasting | Tableau | Business Analytics
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 46 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Popular Categories
Generative AI | Prompt Engineering | Generative AI Application | News | Technical Guides |
AI Tools | Interview Preparation | Research Papers | Success Stories | Quiz | Use Cases |
Listicles
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 47 of 48
Build Large Language Models from Scratch - Analytics Vidhya 03/01/25, 2:23 PM
Terms & conditions Refund Policy Privacy Policy Cookies Policy © Analytics
Vidhya 2025.All rights reserved.
https://www.analyticsvidhya.com/blog/2023/07/beginners-guide-to-build-large-language-models-from-scratch/ Page 48 of 48