Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Foundations of Large Language Models: From N-grams to LLMs
New

Foundations of Large Language Models: From N-grams to LLMs

Learn how LLMs work from the ground up: tokens, n-grams, embeddings, neural nets, and transformers. No prior ML needed.
Created byHadi Ataei
Last updated 10/2026
English

What you'll learn

  • Explain what a language model is and how it assigns probabilities to the next word in a sentence
  • Build and score n-gram language models using the chain rule, the Markov assumption, and simple counting
  • Describe how tokenization, embeddings, and neural networks extend simple language models into modern LLMs
  • Understand how transformers and attention let LLMs use long context to generate fluent text
  • Explain how LLMs are pre-trained, fine-tuned, and aligned to follow instructions
  • Recognize key LLM limitations such as hallucination and bias, and use these tools more critically

Course content

9 sections • 10 lectures • 31m total length
  • Introduction2:01
  • How This Course Is Organized1:18

Requirements

  • No machine learning experience needed. We start from the basics and build up step by step
  • Curiosity about AI and comfort with basic high-school math. Python knowledge is helpful but not required

Description

This course contains the use of artificial intelligence.


Large language models like ChatGPT and Claude can feel like magic. This course takes the magic away, step by step, so you understand what is really happening when a model writes a sentence.


We start with the simplest possible idea: predicting the next word by counting. From there we build up, one concept at a time, until you can explain how modern LLMs are built, trained, and turned into helpful assistants.


What you will learn:

  • How text is broken into words and tokens

  • How n-gram language models assign probabilities, and why they fall short

  • How embeddings turn words into numbers that capture meaning

  • How neural networks learn from data

  • How attention and transformers let models use long context

  • How pretraining and post-training create a helpful assistant

  • Where to go next: retrieval, agents, and interpretability

How the course works:

Each lesson is short and focused, with clear visuals, worked examples, and plain-language explanations. We begin with the basics and save the more advanced topics for later sections, so you always know why a new idea is needed before you meet it.


Who this course is for:

College students, developers, analysts, and managers who use AI tools and want a solid mental model of how they work. No machine learning background is required, only curiosity and basic high-school math.


Note: the narration in this course is AI-generated.

Who this course is for:

  • College students who want a clear, step-by-step foundation in how large language models work
  • Professionals, developers, analysts, and managers who use AI tools and want to understand what happens under the hood
  • Anyone planning to move on to advanced topics such as transformers, fine-tuning, and AI agents