The Little Book of Generative AI Foundations: An Intuitive Mathematical Primer
261 points by ibobev 6 hours ago | 46 comments

nh23423fefe 28 minutes ago
I don't like:

> Changing coordinates. Given a vector x expressed in the standard basis, we change coordinates by applying

    x_eig = V^−1 x.
> This operation does not change the vector itself; it only changes how the vector is represented, converting it into eigenvector coordinates.

I'm sure the author knows about the difference between the vector and a coordinate vector given a basis. I just don't like this wording. It's weird to say applying a function doesn't affect a change.

reply
KolenCh 19 minutes ago
That’s active vs passive transformation and AFAIK mathematicians often think in passive ones but physicists would use both. And the one you quoted is passive.
reply
hasteg 3 hours ago
Another book which I would highly recommend for learning the math (or at least getting a very good idea of how it works) behind machine learning/transformers is "Why Machines Learn: The Elegant Math Behind Modern AI" by Anil Ananthaswamy. I read it this past year and I found it was extremely good at pacing and building up intuition to the "how and why" of most important math concepts and discoveries in ML that have lead to where we are today. For those who don't already have a fairly deep understanding of linear algebra, statistics, and multivariate calculus, this book will be a far more gentle introduction yet still has enough rigor for you to come away with something.
reply
p1esk 5 hours ago
Wow, this book is surprisingly readable! I like how he starts from basics of linear algebra.
reply
prideout 6 hours ago
My favorite little book is François Fleuret's: The Little Book of Deep Learning https://fleuret.org/francois/lbdl.html
reply
arcanemachiner 6 hours ago
I love how that site offers a phone-formatted PDF as an option. How thoughtful!
reply
qifzer 4 hours ago
You may enjoy the reflow feature on Koreader. It fits a pdfs content into a screenwidth single column layout. That text is also zoomable.
reply
dominotw 5 hours ago
i got duo to increase my reading.
reply
deskamess 4 hours ago
Is it working out well for tech pdf's and books? Once I saw the form factor I realized it would be better than an iPad (less heavy, better battery) and that is the use case I am looking at. Might wait till v2.
reply
y1n0 4 hours ago
From what I understand the iPad mini weighs the same with a slightly larger screen. Has their matte display option.

I have big pockets so for me it’s probably pocketable. But I still would have a phone. So I’ve got a duo on order with a year lease so I’m not stuck if I don’t think it’s great.

I have to confess to considering a mini with cellular instead of a phone altogether though.

reply
y1n0 4 hours ago
My old crappy eyes need big screens for this. I have one on order. I’m ambivilating over the screen crack issue.
reply
brcmthrowaway 4 hours ago
My full stack JS jockey buddy studied this in the nascent days of LLMs to prep for an interview and is now generationally wealthy. Sliding doors moment for sure...
reply
joe_the_user 4 hours ago
I'd note that the Fleuret books gives the foundation for basic deep learning whereas the OP seems to give the necessary foundations for Transformers and related machinery. These later addition what is now "AI" are in total at least as complicated as the original deep learning concepts. Not that just learning basic neural networks but the two book don't appear to cover the same ground.
reply
wh306 4 hours ago
Only had a quick skim, but looks like the content of this book has very little to do with transformers. Might be more relevant for diffusion models (image/video generation) though.
reply
CamperBob2 6 hours ago
It's a nice treatment of the subject, but I wish he would post a conventionally-formatted .PDF that puts every page on a full sheet of standard printer paper.
reply
bscphil 6 hours ago
I immediately wanted the same thing, so I made it. The book is licensed Creative Commons BY-NC-SA 4.0 International License, so here you go.

https://cdn.filepost.dev/file/filepost/uploads/15/1578f21219...

reply
rahimnathwani 3 hours ago
Thanks.

But fyi for others this is one version behind and missing these updates:

  V1.3 (May 12, 2026)
  Many typos and phrasing fixes with the help of LLMs.
  Section 3.8. Added a section about large-scale training
reply
bscphil 2 hours ago
Oh, that's unfortunate! I made it from the A5 version on the site which I downloaded right before making my post. Looks like the author hasn't updated that one.
reply
rahimnathwani 2 hours ago
I just emailed him. Fingers crossed.
reply
CamperBob2 5 hours ago
Thanks!
reply
nblgbg 5 hours ago
Are there any deep learning books with some problems to solve ?
reply
Valk3_ 3 hours ago
Some that comes to mind:

- Understanding deep learning by Prince[1]. Has both theoretical and programming exercises.

- Deep learning - Foundations and concepts by Bishop[2].

- Deep learning architectures - mathematical approach - Calin[3].

- Mathematical theory of deep learning by Petersen et al[4]. Only handful of exercises each chapter.

- Dive into deep learning[5]. This one is more practical programming hands-on. The exercises is a mix between programming exercises and theoretical.

- EECS 182/282A | Deep Neural Networks 2025 (not a book but a course by Berkley)[6]. I only skimmed the assignments, but they seem very interesting. A mix of theoretical and practical.

I think Bishop is probably the best one for theoretical exercises, balancing between not too difficult but not too easy either. However, if you also want programming exercises, Prince has lots of those. Berkley also seems very interesting, modern and encompassing.

[1] https://udlbook.github.io/udlbook/

[2] https://www.bishopbook.com/

[3] https://link.springer.com/book/10.1007/978-3-030-36721-3

[4] https://arxiv.org/abs/2407.18384

[5] https://d2l.ai/index.html

[6] https://berkeley-cs182.github.io/fa25/

reply
brcmthrowaway 4 hours ago
+1. I only learn from doing exercises.
reply
amplifydev 6 hours ago
Interesting!

Is there any one who have recommended books on the attention architecture specifically? I have been interested in that for a long time but never gotten around to actually studying it.

reply
achandra03 6 hours ago
Not a book, but 3blue1brown's video on attention is pretty great: https://www.youtube.com/watch?v=eMlx5fFNoYc
reply
horseloverthin 6 hours ago
formal algorithms for transformers provides perhaps the most succinct introduction to attention I can imagine https://arxiv.org/pdf/2207.09238
reply
3abiton 4 hours ago
Someone should add it to the hacker news curated paper list! Along side the video and book list.
reply
minimaxa 5 hours ago
Appreciated, I drop all of these into a RAG folder for when I need them later on in projects.

8Gb of whitepapers/books...

reply
cheesewhistle 5 hours ago
I'm v curious how you're incorporating this into your workflow. Is it that when you want to implement something you can call out to these books as rigorous reference material for your agents? I'd never thought of doing such a thing and am curious how you're doing it and how it's worked.
reply
minimaxa 3 hours ago
You can source it here in the library tool, it connects to a cloud/local LLM for RAG:

https://vektormemory.com/

Extracted whitepapers, should keep you busy:

VL-JEPA: Joint Embedding Predictive Architecture for Vision-language [2512.10942v1] A Multi-Memory Segment System for Generating [2508.15294v3] Adversarial Cues in Decision Models Used [2610.11436v1] AGENTIC BACKDOORS VIA PRETRAINING POISONING [2610.37741v1] Agentic Memory Learning Unified Long-Term [2601.01885v2] Agentic Semi-Structured Memory [2604.14362v1] Agents That Know Too Much [2606.26627v1] AI Agents Enable Adaptive [2606.03811v1] AI Agents That Matter [2407.01502v1] AI Assistants Cloud Versus Local LLM [2604.18566v2] AMA-Bench Evaluating Long-Horizon Memory [2602.22769v2] A-Mem Agentic Memory for LLM Agents [2502.12110v11] APEX-MEM Agentic Semi-Structured Memory [2604.14362v1] ASK ONLY WHEN NEEDED [2604.20572v2] Attention Is All You Need [1706.03762v7] Attention Is Not What You Need [2512.19428v1] Benchmarking Multi-Agent LLM [2603.22651v1] Beyond Nodes vs. Edges [2604.14685v1] Beyond Static Summarization [2601.04463v1] Calibrated Decision Models for Autonomous [2609.28940v1] Character-and-Scene Episodic Memory for Agents [2602.06051v3] CLASP Training-Free LLM-Assisted Source Code Watermarking [2510.11251v2] Cognitive Architectures for Language Agents [2309.02427v3] COMPUTATIONAL COPYRIGHT [2312.06646v5] Constitutional AI [2212.08073v1] Creative Problem Solving in Artificially Intelligent Agents [2204.10358v1] CyberGym [2506.02548v3] Deep image search [2602.10809v1] Developing Surrogates [2602.21588v1] Diffusion-Based Neural Network Weights Generation [2402.18153v2] Dynamic LLM-Powered Agent Network [2310.02170v2] Dynamic Logit-Level Gating [2606.04378v1] EternalMath [2601.01400v1] EverMemOS [2601.02163v2] EvoMemBench Benchmarking Agent Memory [2605.18421v1] ExploitBench [2605.14153v1] FADEMEM BIOLOGICALLY-INSPIRED [2601.18642v2] Finance-Grounded Optimization [2509.04541v2] Formal Algorithms for Transformers [2207.09238v1] Geogalactica [2401.00434v2] HAGE - Harnessing Agentic Memory [2605.09942v1] HaluMem [2511.03506v1] Harnessing the Universal Geometry of Embeddings [2505.12540v4] HIPPOCAMPUS [2602.13594v1] hipporag [2405.14831v3] Hybrid Reasoning Agents [2610.18861v1] Hyper agents [2603.19461v1] HyperMem [2604.08256v2] Interactive Simulacra of Human Behavior [2304.03442v2] Is Complex Agentic Memory Always Needed [2610.30755v1] Language Modeling Is Compression [2309.10668v2] Learn from your own latents [2605.27734v1] Learning on the Job [2607.22157v1] Learning to Memorize at Test Time [2501.00663v1] Learning to Rewrite Tool Descriptions [2602.20426v2] LLM Agents Already Know When to Call Tools [2605.09252v2] LLM-Enabled Frequency-Aware [2602.19522v1] LONGMEMEVAL [2410.10813v2] MAGMA A Multi-Graph based [2601.03236v2] MemGround [2604.14158v1] Memory in the Age of AI Agents [2512.13564v2] Memory Tax [2610.34073v1] Memp - Exploring Agent Procedural Memory [2508.06433v4] Mitigating Provenance-Role [2605.25869v1] MOSS Self-Evolution through Source-Level Rewriting [2605.22794v2] Multi-task DAG Learning [2306.02831v1] Natural Language conductor [2512.04388v5] NeuroGen - Neural Network Parameter Generation [2505.12470v2] Next-Latent Prediction Transformers Learn Compact World Models [2511.05963v4] Novel Memory Forgetting Techniques [2604.02280v1] OMNI-LEAK Orchestrator Multi-Agen [2602.13477v2] On Understanding Extremely Long-Term Video with Adaptive [2411.12593v3] Opal Private Memory [2604.02522v1] Parameter Prediction for Unseen Deep Architectures [2110.13100v1] Prompt Optimization [2602.18449v1] PromptMark [2606.20835v1] RAG-MCP Mitigating Prompt Bloat [2505.03275v1] RAIN-MERGING [2602.22538v1] Recursive Self-Improvement through Multi-Agent [2610.12176v1] Reflection-Based Memory [2506.02158v1] Refusal in Language Models Is Mediated by a Single Direction [2406.11717v3] REMEM REASONING WITH EPISODIC MEMORY [2602.13530v3] Remember When It Matters [2607.08716v1] Remembering More, Risking More [2605.17830v1] Sakana Fugu Technical Report [2606.21228v1] SalesRLAgent [2503.23303v1] Scaling Long-Form Story Generation [2609.35759v1] Search-R1- Training LLM [2503.09516v5] Secure Semantic Communications [2602.22134v2] Selective Memory for Artificial Intelligence [2603.15994v1] Skill.state [2608.26263v2] Smarter Together [2511.08301v1] SmartSearch [2603.15599v1] SOLVING A MILLION-STEP LLM TASK [2511.09030v1] Storage Is Not Memory [2605.04897v1] StructMem Structured Memory [2604.21748v1] Structured Belief State and the First Precision [2605.11325v2] SuperLocalMemory V3.3 [2604.04514v1] SWE-MeM Learning Adaptive Memory [2606.28434v1] Synthius-Mem Brain-Inspired Hallucination [2604.11563v1] The AI Scientist-v2 [2504.08066v1] The Bitter Lesson of Tool Calling [2608.06370v1] The Customer Is the Builder [2610.30307v1] The Gradient of Generative AI Release [2302.04844v1] The Little Book of Generative AI Foundations [2605.29713v2] The Malicious Use [1802.07228v2] The Memory Wars [2508.05867v1] Thinking Fast and Slow in AI [2110.01834v1] Time algo [2610.00577v1] Towards trustworthy agentic AI [2605.23989v1] Transformers learn in-context by gradient descent [2212.07677v2] TReMu Towards Neuro-Symbolic Temporal Reasoning [2502.01630v2] TRINITY AN EVOLVED LLM COORDINATOR [2512.04695v3] VERBALIZED SAMPLING [2510.01171v3] Verifiable Agent-to-Agent [2602.02395v1] Verified Multi-Agent Orchestration [2603.11445v2] WEBCOACH - A MODEL [2511.12997v1] XGrammar-2 Dynamic and Efficient Structured Generation [2601.04426v4] Your Agent’s Memories Are Not Its Own [2607.05029v1] Zep A Temporal Knowledge Graph Architecture [2501.13956v1]

reply
plicense 5 hours ago
Can you share what you have so far in that folder?
reply
gerdesj 5 hours ago
They spell it out quite clearly: "8Gb of whitepapers/books..."
reply
whattheheckheck 2 hours ago
We do a lil copyright infringement
reply
brcmthrowaway 4 hours ago
Holy..

Care to share the list of titles in a gist?

reply
StilesCrisis 4 hours ago
The very first formula in the text, explicitly described as "as simple as possible," names its variable ê1 with no explanation given. I think this paper needs another pass.
reply
apricot 4 hours ago
What do you mean "no explanation given"? It says: "In 2 dimensions, the standard (or identity) basis vectors are ê1 = [ 1 0 ] and ê2 = [0 1]." Seems pretty clear to me he's defining ê1 and ê2, or rather telling us that he's using this very common way of naming the basis vectors.
reply
mkl 4 hours ago
It's just giving a vector a name. It also names ê₂. These particular names are very standard and familiar to most people who've met vectors before.

You can look at those vectors and see that the position of the 1 is the subscript, without explanation. The ^ could do with an explanation that it means unit vector, but if you've met vectors before you likely know that (maybe that's elsewhere in the book, but a quick search didn't find it).

reply
nhatcher 4 hours ago
That's absolutely standard notation for a unit basis vector. I haven't read the prerequisites carefully, so if it addressed to the general public maybe?

It is perhaps addressed to a different crowd?

reply
totetsu 2 hours ago
It’s not okay to be forgetful of maths anymore. Whats a dot product, whats a unit vector, how does matrix multiplication work..
reply
StilesCrisis 11 minutes ago
I was never actually taught ê as unit vector notation. I did game development for years and am quite familiar with 3D math but a lot of formal math notation is very foreign to me.
reply
mkl 2 hours ago
It's fine to be forgetful of maths that you're not actively using. (I am speaking as a mathematician.) It's also easier than ever to get a quick reminder or introduction, e.g. for this Google something like [what does e1 with ^ on the e mean], or [standard basis vector] from earlier in the sentence, or ask another AI.
reply
penguin_booze 2 hours ago
Ah, "intuition": one man's cheese is another man's rotten milk.
reply
SlightGenius 3 hours ago
[flagged]
reply
Daklone 4 hours ago
We are recommending books for HackerBooks.org I see. Good, this is why I have come here also.

Let me tell you about one of the greatest book series of our generation: Dungeon Crawler Carl, By Matt Dinniman

https://mattdinniman.com/books/

From the Dust jacket: The apocalypse will be televised!

You know what’s worse than breaking up with your girlfriend? Being stuck with her prize-winning show cat. And you know what’s worse than that? An alien invasion, the destruction of all man-made structures on Earth, and the systematic exploitation of all the survivors for a sadistic intergalactic game show. That’s what. READ MORE

Join Coast Guard vet Carl and his ex-girlfriend’s cat, Princess Donut, as they try to survive the end of the world—or just get to the next level—in a video game–like, trap-filled fantasy dungeon. A dungeon that’s actually the set of a reality television show with countless viewers across the galaxy. Exploding goblins. Magical potions. Deadly, drug-dealing llamas. This ain’t your ordinary game show.

Welcome, Crawler. Welcome to the Dungeon. Survival is optional. Keeping the viewers entertained is not.

Published sept 21, 2020 RePublished Aug 27, 2024

reply
northes 4 hours ago
The street marketing around this book is frankly baffling, do you suppose this is relevant?
reply
Daklone 2 hours ago
I guess not. My bad.
reply