The Little Book of Generative AI Foundations: An Intuitive Mathematical Primer

289 points - yesterday at 9:40 PM

Source

Comments

nh23423fefe today at 3:11 AM
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.

hasteg today at 12:57 AM
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.
p1esk yesterday at 10:53 PM
Wow, this book is surprisingly readable! I like how he starts from basics of linear algebra.
prideout yesterday at 9:54 PM
My favorite little book is François Fleuret's: The Little Book of Deep Learning https://fleuret.org/francois/lbdl.html
nblgbg yesterday at 10:52 PM
Are there any deep learning books with some problems to solve ?
amplifydev yesterday at 10:05 PM
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.

deleted yesterday at 10:22 PM
3abiton yesterday at 11:38 PM
Someone should add it to the hacker news curated paper list! Along side the video and book list.
minimaxa yesterday at 10:48 PM
Appreciated, I drop all of these into a RAG folder for when I need them later on in projects.

8Gb of whitepapers/books...

StilesCrisis today at 12:00 AM
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.
penguin_booze today at 2:19 AM
Ah, "intuition": one man's cheese is another man's rotten milk.
programjames today at 3:53 AM
I got annoyed at yet another primer that does not put information theory as foundational, so I decided to write my own.

The Little Pamphlet of AI Foundations: An Unintuitive Philosophical Primer

Losses

Intelligence is the ability to explain phenomena. One is more intelligent where they can better explain phenomena.

A phenomenon is any correspondence between data, and an explanation is an encoding of that correspondence. There is an infinite amount of data so an intelligence must be a program that generates new explanations when it sees new data.

A program is a string of bits run by an interpreter. Since strings of bits are data, programs may be generated by other programs, and a program's interpreter may itself be another program or intelligence. This recursion eventually bottoms out in physical ware. Human and artificial intelligences differ mainly in their ware, though human intelligences also have an impredicative recursion property that artificial intelligences are only expected to gain in 2027.

At a low level of intelligence, a calculator takes in numbers and operations through electrical impulses, moves electrons through a series of transistors, which creates new outputs to be displayed on the screen.

At a higher level, a neural network training algorithm takes in examples and outputs weights, usually through preconditioned gradient descent.

At an even higher level, a language model takes in words and outputs possible continuations. To convert this to the correct continuation, an additional error correction code must be provided for every word it outputs. This unexplained gap in the language model, or 'loss', dominates in the limit of a large number of words. To consistently provide short explanations, a model must have a small loss.

At the highest level, an explanation of an environment must encode all data in that environment, including any intelligences. An intelligence encompasses a larger share of its environment if it is harder to encode. Under a fixed loss budget, the hardest intelligence to encode provides explanations weighted exponentially by their length. This is the origin of the common mantras that a short explanation is exponentially more likely to be the correct one, colloquially known as Occam's razor, Solomonoff's lightsaber, and Kolmogorov's complexity.

The important takeaway is that a loss represents the average size of an error correction code, and a smaller loss is better.

Architecture

An intelligence is a program that generates encodings of data correspondences. Choosing an architecture with better data topologies enables it to do so more efficiently.

A data topology consists of data and possible connections between the data, with computational costs determined by the architecture. As computational resources grow superexponentially, the goal of architecting is generally to lower the computational complexity of creating connections, encapsulated colloquially as 'The Bitter Lesson'. To give a few examples:

1. The limited liability corporation lowered the personal risk of starting a business from the size of the business to a fixed cost, making economic connections cheaper to form.

2. Residual networks directly form connections between neuron data and output gradients, bypassing the exponentially weakening connections that previously made deep learning impossible.

3. Flow transport models improve upon continuous normalizing flows by giving target distribution data along the entire generation process.

4. Quadratic attention connects every input datum to every input datum, instead of relying on fringe connections from the nonlinearity in activation functions. Linear attention further lowers this cost by adaptively selecting data to go into a memory bank, and only forming connections with the memory bank.

5. A gradient descent preconditioner modifies the weight flow density, so distributions of weights are squeezed closer together or spread further apart. In the extreme, this no longer looks like gradient descent and looks closer to an intelligence directly writing weight updates based on new examples.

Learning Theory

A perfect intelligence provides explanations weighted exponentially by their length. A Bayesian neural network is a network generated by a perfect intelligence as an explanation for a dataset, and its distribution of weights—its 'partition function'—will be concentrated in regions with exponentially low loss. Analogous to physics, much can be gleaned from the partition function.

In adversarial contexts such as generative adversarial networks or reinforcement learning, examples rotate through a cyclic group of six elements, being positive, neutral, or negative examples depending on what the other intelligences have learned. This creates an anyonic partition function for each learnable feature and the familiar sextessential steep upwards loss curve before a plateau. Similarly, an alternating cycle of learning and forgetting gives the fermionic partition function and a loss curve colloquially referred to as grokking. Most learning is just learning and looks bosonic in nature: losses quickly go down, then settle into an exponential curve.

In the limit of a large number of training examples, the network's loss dominates the size of the explanation, but it still takes a logarithmically increasing number of bits to describe the path the weights take along the weight flow. To be precise, the explanation length grows as

  nL(w) + λ log n − (m − 1) log log n
where n is the number of training examples, L is the network's loss, λ the real log canonical threshold, and m its multiplicity. It is possible to subsume the logarithmic terms into the loss by adding normal noise to the weights after each training iteration with variance dηT/λn, where η is the learning rate, T the temperature, and d the model dimension. In the nonsingular case λ = d/2.
SlightGenius today at 1:03 AM
[flagged]
Daklone today at 12:05 AM
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