Skip to content
All categories

ai

1239 posts

How N-grams Train, Sample, and Fail | CMU 07-280 Lecture 18

Lecture 18 truncates the chain rule with an N-gram Markov assumption, estimates probabilities from corpus counts, and contrasts greedy, categorical, and temperature sampling. The real bottlenecks are zero probability for unseen contexts and a fixed window.

Turning Next-token Prediction into Geometry | CMU 07-280 Lecture 19

Lecture 19 builds a minimal next-token model from two embedding matrices, dot-product similarity, softmax, and cross-entropy. Shared vector parameters replace the isolated count cells of an N-gram table.

From Position Encoding to Causal Self-Attention | CMU 07-280 Lecture 20

Lecture 20 expands one-token embeddings into sequences, adds positional information, derives Q/K/V scaled dot-product attention and causal masking, and assembles multi-head blocks into a GPT-2 skeleton.

How Bellman Equations Solve Markov Decision Processes | CMU 07-280 Lecture 21

Lecture 21 formulates stochastic sequential decisions as an MDP with known dynamics, defines value and Q-values through Bellman backups, and solves for an optimal policy with value or policy iteration.

Q-learning When Dynamics Are Unknown | CMU 07-280 Lecture 22

Lecture 22 keeps the MDP structure but removes known transitions and rewards. TD learning updates value from one sample, and Q-learning uses an off-policy target to learn optimal action values directly.

From Approximate Q-learning to DQN | CMU 07-280 Lecture 23

Lecture 23 replaces a huge Q-table with Qθ(s,a): first derive a gradient update for linear features from squared TD error, then add replay data and a fixed target network to form DQN.

How Monte Carlo Tree Search Connects to AlphaZero | CMU 07-280 Lecture 24

Spring 2026 Lecture 24 is MCTS, not Fall 2026 LLM post-training. It allocates simulations through selection, expansion, rollout, backup, and UCB, then connects policy/value heads and self-play to AlphaZero.

Stage Review I: From Search Problems to Supervised Learning | CMU 07-280 Topic Guide

Lectures 1–12 form one decision pipeline: define states, moves, and objectives, then use heuristics, losses, regularization, and backpropagation to control an otherwise intractable search space.

Stage Review II: Building AlexNet and GPT-2 as Working Systems | CMU 07-280 Topic Guide

Stage II uses HW8 and HW11 to test whether representation, computation graphs, training, transfer, and generation actually connect, rather than treating CNNs and Transformers as diagrams to memorize.

Stage Review III: From MDPs and Q-learning to AlphaZero | CMU 07-280 Topic Guide

Stage III connects value, policy, bootstrapping, function approximation, and MCTS into AlphaZero: a network supplies priors and estimates, search improves decisions, and self-play creates the next training set.

aideep-dive

Python Coding Agent M11: Why an Exec Loop Cannot Reproduce the Claude Code Conversation Experience

A Claude Code- or Codex-style TUI depends on long-lived sessions, typed transcripts, and approval at tool boundaries—not a screen full of color.

aideep-dive

Cognee Complete Guide: Turning Documents into Graph Memory for Agents

Cognee is a data-to-memory pipeline: a relational store preserves sources and provenance, a vector store finds semantically similar content, and a graph store represents entity relationships, exposed through remember, recall, improve, and forget.

Introduction and Setup: Turning Language Problems into Computable Components | Stanford CS124 Week 1

Week 1 has no algorithms. The live introduction explains what the course teaches: which week covers each component of an LLM, which language algorithms outside LLMs are also taught, and why language is hard. PA0 sets up the Python and Jupyter environment the later assignments use.

PageRank and Social Networks: From Anchor Text and Centrality to the Course Wrap-Up | Stanford CS124 Week 10

Week 10 treats web pages and human relationships as graphs. Link analysis teaches anchor text and PageRank: the long-run probability that someone clicking links at random is on a page is that page's score. Social networks covers centrality, the clustering coefficient, small worlds and weak ties. The final live lecture returns to LLMs with preference alignment, interpretability and machine translation.

Words, Tokens, Edit Distance, and N-grams: Decide What the Model Sees First | Stanford CS124 Week 2

Week 2 teaches three things: cutting text into tokens with BPE, computing the edit distance between two strings with dynamic programming, and estimating the next word's probability with n-grams, evaluated by perplexity. Each can be done on paper, and this post works one example of each.

Logistic Regression and Text Classification: From Features to Probability and Loss | Stanford CS124 Week 3

Week 3 teaches logistic regression: turn a document into a feature vector, pass the weighted sum through a sigmoid to get a probability, measure the error with cross-entropy, and fix the weights with gradient descent. This post works the slides' movie-review example through a prediction, a loss and one weight update, and explains why evaluation looks at precision and recall.

Information Retrieval: The Indexing and Ranking Layer Beneath RAG | Stanford CS124 Week 4

Week 4 teaches search: turn the query and the documents into vectors, weight them with tf-idf, rank by cosine similarity, speed it up with an inverted index, evaluate with precision, recall and MAP, and finally connect to dense retrieval and RAG. This post works the slides' four-document example in full.

Embeddings and Social NLP: Representing a Word by the Words Around It | Stanford CS124 Week 5

Week 5 teaches embeddings: the meaning of a word can be represented by the words that tend to appear around it. It builds vectors from co-occurrence counts and compares them by cosine, then trains dense vectors of a few hundred dimensions with word2vec, and finally separates static vectors from ones that change with context. The same week's live lecture on computational social science has no public material.

Neural Networks and LLMs: From Units and Backpropagation to Decoder-Only Models | Stanford CS124 Week 6

Week 6 has two halves. The pre-recorded material teaches neural networks: how one unit computes, why hidden layers are needed, the softmax, classification and language modeling with word vectors, and backpropagation. The live lecture introduces large language models: what they are, the three architectures, why so many tasks can be recast as continuing text, how to sample, how pretraining works, and how a model becomes an assistant.

Transformers and Speech Processing: How Attention Lets Each Token Use Its Context | Stanford CS124 Week 7

Week 7 opens up the Transformer: how attention lets each token draw on the tokens before it, what parts make up a block, and how the input and output ends are attached. PA6a has you write causal self-attention, train a small model and compute perplexity. The same week's live speech lecture introduces the speech recognition task and word error rate.