How To Train Your AI:
Demystifying ChatGPT With Machine Learning, Neural Networks, and Deep Learning Basics
An approachable look at the tech that powers AI
`
​
Segun Akinyemi
Senior Software Engineer
GitHub
Senior Software Engineer at Microsoft building systems that power business decisions using Azure. I lead STEM outreach initiatives in Charlotte, North Carolina, connecting people with knowledge that helps them navigate tech careers. Beyond that, I blog, read, run, hike, watch anime, longboard, and enjoy exploring Charlotte's best third places.
•🌍 Roots: Nigerian heritage, raised in Seattle, educated in St. Louis, now in Charlotte.
•🎓 Education: B.S. in Computer Information Systems (Lindenwood University), M.S. in Information Systems Management (Washington University in St. Louis).
•💻 Engineer: Building with Python, C#, TypeScript, & SQL. Embracing AI Engineering.
•📚 STEM Educator: Leading programs that connect students with tech careers.
LinkedIn
Website
> About
> Highlights
What Microsoft products have you used or are currently using?
You might be surprised by just how much Microsoft is a part of your everyday life! 🧐
Let’s Chat!
Today we are…
Exploring the inner workings of how the models powering Generative AI systems like ChatGPT are trained.
Machine Learning, Neural Networks, and Deep Learning are foundations of AI. They may sound complex, but we’re going to break them down into simple, approachable concepts.
​
What is Generative AI and why is it important in the world?
Let’s explore…
Question
Generative AI is…
A computer system that makes new things like text, images, videos, or music by learning from what it already knows.
Like an artist that draws inspiration from everything it has seen or heard to make something new.
​
Artificial Intelligence
​
Machine Learning
​
Deep Learning
This Is a New Moment For AI
Generative AI
1950s
Artificial Intelligence
the field of computer science that seeks to create intelligent machines that can replicate or exceed human intelligence.
1959
Machine Learning
subset of AI that enables machines to learn from existing data and improve upon that data to make decisions or predictions.
2017
Deep Learning
a machine learning technique in which layers of neural networks are used to process data and make decisions.
​
2021
Generative AI
create new written, visual, and auditory content given prompts or existing data.
The History of AI
​
​
1960
The ”first computer” that learned skills by trial and error.
​
​
1978/79
In Japan, SCARA, the robotic arm for high-speed assembly unveiled.
​
Late 2000s
IBM’s Watson, a computer system answers questions via natural language. Beats Jeopardy! contestants.
​
1950
Alan Turing introduces the “Turing Test”
1956
Field of AI is launched, “artificial intelligence” coined at Dartmouth
​
1997
IBM’s Deep Blue beats reigning world champion Garry Kasparov in chess.
Late 1990s
KISMET, a robot head that recognizes and replicates human emotion.
​
1988
Jabberwacky, a chatbot designed to have conversations with users and imitate human interaction.
​
2011
Apple launches Siri, an intelligent personal assistant.
​
​
2021
OpenAI develops DALL-E, an image generator based on text prompts.
2022
OpenAI launches ChatGPT,
a chatbot that interacts in
a conversational way.
​
​
16 years
3 months
50M
100M
​
​
​
Facebook: 4.5 years
ChatGPT: 3 Months!
Cell Phones: 16 years
Internet: 7 years
Time to reach 100M users
Generative AI Is Not Just Hype
Source: Microsoft Research
​
Some AI Model Makers
​
​
OpenAI
GPT (Astra, Sol, Luna, Mini, Nano), Codex
​
​
Anthropic
Claude Opus, Sonnet, Haiku, Fable, Mythos
​
​
Google
Gemini (Carbon, Argon, Pro, Flash, Deep Think), Gemma
​
​
Meta
Muse (Spark, Wonder, Glimmer), Llama (Maverick, Scout)
​
​
DeepSeek
DeepSeek V, DeepSeek R, DeepSeek Flash, DeepSeek Coder
​
​
Qwen
Qwen Max, Qwen Plus, Qwen Flash, Qwen Coder, Qwen Omni
​
​
Mistral
Mistral Large, Mistral Medium, Mistral Small, Magistral, Codestral
How are Generative AI models (LLMs) created?
It’s conceptually simple, yet in practice, can be quite complicated, and expensive.
Let’s find out how together!
Let’s Learn!
Cat
Tengwar
Not Tengwar
Not Cat
Cat
Not Tengwar
Tengwar
Cat
Not Cat
Tengwar
Tengwar
Not Cat
Not Cat
Not Tengwar
Tengwar
Cat
Let’s get ready to…
rumble
With great power comes great…
responsibility
Very mindful, very…
demure
The pen is mightier than the…
sword
6…
7
The rain fell softly against the window as she picked up her favorite…
ukelele
Without hesitation, he stepped onto the platform and grabbed the…
duck
It was the best of times, it was the worst of times, it was the age of…
wisdom
The lot is cast into the lap, but its every decision is from the…
Lord
Pattern Recognition → Everything AI does starts here
​
Supervised Learning → Learning from labeled examples
​
Self-Supervised Learning → Next token (word) prediction
​
Scale + Good Data + Compute = Intelligence emerges
​
​
But it still needs YOU to be useful!
What To Know
GPT stands for…
Generative: Creates new text by predicting what comes next, using patterns it learned from tons of reading.
Pre-trained: Was trained ahead of time on books, websites, social media, and more to understand language and context.
Transformer: A model that focuses on the most important words in a sentence, like highlighting key info to better understand meaning.
Machine Learning → Teaching computers to learn from data
​
Neural Networks → Machine Learning that mimics brain neurons
​
Deep Learning → Neural Networks with many layers
​
Large Language Models = Deep Learning trained on text
​
​
These are oversimplified but at a high level, this is what’s up!
What To Know
Guess, Check, Adjust
Training AI one step at a time using Visual Studio Code for Education.
​
​
Open your laptop and visit the website to the right.
Click Start Course, then login with your Microsoft or Google account.
​
​
​
Click Start Course then Sign In with your Microsoft or Google account
​
​
Read the page then click next
​
Click the Green play button
​
​
2. Click the X button next to index.html
1. Click the Green play button
Now you have a large Preview pane. Do your work here! Click Generate Random Text to start.
​
Follow this pattern (click play, close index.html) on all course pages.
​
Setting
Range to Try
Best Values
What It Does
Context Window
4 – 7
5
How many previous words the AI considers. Below 3, it's messy. Above 7, the corpus is too small, so it backs off to smaller windows automatically.
Temperature
0.6 – 0.9
0.7
How risky the AI's word choices are. Below 0.5, it repeats itself. Above 1.0, topics jump randomly. Sweet spot is 0.7.
Text Length
20 – 35
30
How many words to generate. Longer text needs good context settings to stay coherent.
Top-K
3 – 10 (or 0 for “all”)
5
Only consider the top K candidates at each step. Low (1-3) = very focused, tiny pool. High = more variety, bigger pool. 0 = consider all words, which also works fine.
Repetition Penalty
0.3 – 1.0
0.5
Discourages reusing words. 0 = words repeat freely. Above 1.0, output gets forced and unnatural.
Starting Word
“The”, “In”, “Alice”, “By”
Any of these
Words that begin many sentences in the training data give the AI the most branching paths to follow.
Some Ideal Values
Real World AI Training
It’s rather expensive, way more complicated, and extremely cool.
What You Tuned
What ML Engineers Tune
Scale Difference
A few parameters
Billions of parameters. Learning rate, attention heads, layer count, embeddings, and thousands more.
You tuned a few dials. They tune billions.
Context window of 1-10 words
128,000 - 200,000+ tokens
Same concept. Wildly different scale.
Temperature 0.1 - 2.0
Temperature 0.0 - 2.0
Identical range. Coding: 0.0-0.3. Creative writing: 0.8-1.2.
Starting word to guide the topic
System prompt + conversation history
Your 1-word prompt vs. their thousands of words of instructions
~4,000 words of training data
~13 trillion tokens
​
Their data is about 3 billion times larger.
Runs instantly in your browser
Thousands of GPUs, weeks of training
Training GPT-4 (which is old now) cost over $100 million.
You vs. Machine Learning Engineers
Training Data: The Secret Sauce of AI
·Blog Posts.
·Academic Papers.
·Social Media like Reddit, X (formerly Twitter), TikTok, Instagram, Facebook, Threads, and Tinder).
·Books.
·Wikipedia.
·Your anonymized data from Notion, Outlook, Gmail, OneNote, Salesforce, Slack, Google Photos, GitHub, etc.
·Literally anything on the Internet.
Real World AI: Guess, Check, Adjust, Hope, and Pray?
•Real machine learning engineers tweak trillions of parameters, adjusting inputs to get better results.
•But even with all that math, AI remains an inexact science.
•Sometimes models behave in ways we can’t predict and don’t fully understand.
​
”
Money…
talks
Guessing the missing word!
Ensure that artificial general intelligence (AGI) benefits humanity.
​
Empower every person and organization on the planet to achieve more
ChatGPT is powered by Microsoft Azure
Did you know?
Microsoft Learn Student Hub
All the tools, training, and community support to assist you build, learn, and succeed
Microsoft Recruiters Early In Profession LinkedIn Group
Exclusive LinkedIn group run by Microsoft recruiters. This invite-only group isn't discoverable through search and is only accessible to those who receive the link directly.
AI & Your Tech Career
A practical, continuously updated guide to AI’s impact on tech careers.
Skills to learn, tools to use, free courses, student perks, and straight answers to frequently asked questions about AI’s impact on software engineering.
Built by a software engineer who uses AI every day and is tired of watching people panic.
All facts, no cap. Scan the QR code and tap in!
​
Created by Segun Akinyemi | aka.ms/nocap
Thank You!
感謝
Dank u wel
谢谢
Grazie
Danke
Merci
Terima kasih
ありがとうございました
Kop khun ขอบคุณ
Tack
감사합니다
Obrigado
Teşekkür ederiz
Dziękuję
Gracias
Cám ơn
Questions?