Thank you for putting that excellent article together
The concepts of fidelity/recall and the images/animation at the top reminded me of this small playful project that touches upon these topics: https://nicobrenner.github.io/lossy-git/
This is actually useful. I didn’t know that generic “you” meant “one”. I always interpreted it as “you the reader” and felt desperate once a week when reading articles like these.
As a native English speaker, I interpret it as “you the reader”. Or maybe I should say, I don’t intuit any material difference between “you the reader” and “any given reader” or “one”. I think your original comment is a good critique of the headline.
Great article. My favorite fact about "transformers as a hopfield network" is that transformers are so good at memorizing that they only need one step to find a suitable memory as opposed to multiple steps for a vanilla hopfield network
This is a really interesting article! While I can’t profess to understand all the math it is a great way to demonstrate it.
I recall awhile back hearing someone ask whether intelligence was actually the same or similar to “compression” or storing all of this knowledge in weights - IE the ability to create something from reason or weights or relationships / connections. This article makes it even more interesting!
In an attention layer, the query, key, and value are all computed at inference time using weight matrices that are determined as a result of the training. If X is the token representations entering the attention layer, then each of Q, K, and V would be determined by multiplying X by the corresponding learned weight matrix for queries, keys, and values:
Q = XW_q
K = XW_k
V = XW_v
From there, you can think of K and V like keys and values in a Python dictionary, and Q as the key you pass (e.g. d[Q] in Python to return some value V). The difference in an attention layer is that the query is matched to each key using a dot product, and rather than getting a single value back you get a weighted sum of values.
> The difference in an attention layer is that the query is matched to each key using a dot product, and rather than getting a single value back you get a weighted sum of values.
I understand you meant to compare it to dicts, but this is more like (the only?) similarity to outer product memory. Worth calling out since GP is confused about this connection specifically.
To clarify slightly, K and V are used to construct the dictionary, and then Q is the lookup key D[Q] as described (with the lookup being based on similarity rather than exact hash as it would be in an actual dictionary).
"interference-to-signal ratio", "capacity", ... These terms, and their context, are things a communications/electrical engineer would understand. I encourage comms engineers to start learning how AI works under the hood. Chances are, a lot of what you know about maximising channel capacity and throughput is applicable to AI (can be seen as a channel with memory?).
Goodness, someone posts a great article which IMO accessible math, and people get upset.
If you think that is crazy, ohh boy, just wait til you see all the other papers underlying LLMs, AI, and optimization in general.
I appreciate this post because starting from linear algebra is the correct way to form an intuition of the higher dimensional semantic spaces we're dealing with.
This article does two things which make it unhelpful for me:
1. It uses math notation. This is a software development site, wouldn't this be much more clear to this audience written as psuedo code instead of a complex series of greek and latin letters?
2. It doesn't step through a concrete example. What is hollow R raised to the (M * d_v) ? Is it a number, a set, a list, a matrix?
To use an example I understand: RAG used to seem complicated to me when only math people were talking about it in math words. For example, let's take a line from wikipedia on embeddings:
> the representation is a real-valued vector that encodes the meaning of the word in such a way that the words that are closer in the vector space are expected to be similar in meaning
What made it clear was learning that generating an embedding is just a function(string) -> list[float], and RAG is just taking a list[float] for your prompt and finding other list[float] that are close to it in your dataset.
So what would make this article more clear, is step through a simplified example of putting a value into a memory store and querying that memory store, showing the actual data structures.
> This is a software development site, wouldn't this be much more clear to this audience written as psuedo code instead of a complex series of greek and latin letters
At the risk of stating the obvious, this is a forum where people can post arbitrary links to other sites, some of which might have audiences that might not be "the exact set of people who read Hacker News". I'm not sure you'd be able to make a compelling argument that alexwang.ai is aimed at software developers and no one else.
Yes, but you need to consider your audience when posting links to this site. For example, if I posted to HN a link to a really good cookie recipe, it wouldn't be a good fit for this site. The author did nothing wrong, but that doesn't make it a good submission to HN.
This article is a bit more of a grey area. It is on a subject that is deeply relevant to this site and I'm sure some HN readers will get value from it. My point is that an even better submission to HN would have been an article on the same topic but written for programmers rather than mathematicians.
I'm surprised to this take, because I feel like I see math stuff posted here fairly often, and often with a large number of people commenting on it in substantive ways. Often times the math savvy crowd will even help explain stuff to people like me who are not particularly fluent in advanced math.
> Often times the math savvy crowd will even help explain stuff to people
Perhaps, but HN apparently is pretty hostile to people explaining why something is not clear and how it could be more clear based on all the downvotes. I'll keep that in mind: "If you don't understand something, shut up!"
Expect to be challenged by content here. Everybody is from time to time. Asking for a mathy analysis to drop the math, fundamentally misunderstands the value of the math.
I'm not suggesting they drop any math. I'm suggesting they drop the math notation. As programmers, we spend 8+ hours per day reading code. Expressing the same math but in the syntax of code would make it accessible to more people on this site. It's like speaking in someone's native tongue instead of their 2nd language. I can read and mostly understand a news article written in French but it is going to take a lot of time and effort. If a news article is written in English I could read it quickly and easily. Both languages are presenting the same information, it is just a matter of how it is presented.
HN is a site for programmers (or specifically "hackers"). Posting an article to a site for programmers in math notation is like posting a French article to an English message board. Some people will be able to read it with varying levels of difficulty, but wouldn't it be better to post an English version of the same information so everyone can read it easily?
the poster and the writer are different entities... only the writer influences the poster, not the other way around...now the poster saw value for HN readers and thats why it ended here.. with this logic your position doesn't make sense
I think people likely hit an early "break" and "goto xkcd 386" when they saw "this is a software development site" in your comment, without reading the rest of your comment.
Clear explanations are a good thing, but different explanations help people in different ways. Your explanation seems helpful to me, and reminds me of Ben Affleck's explanation in the GQ interview. But Ben Affleck connected it directly to arrays of RGB pixel data, which clicks more with me personally, but probably wouldn't with everyone. It certainly didn't make things any clearer to the interviewer.
"... the thing that makes hackers such good startup founders is that they care about more than business. They have intellectual curiosity driving them as well as the desire to make money. So the way to make a news site for startup founders is to make it be about more than just startups. ... If you had to reduce it to a sentence, the answer might be: anything that gratifies one's intellectual curiosity."
My thought was to show some grace, considering that not everyone's been around here for 20 years or knows that "hacker" doesn't apply only to computer programmers. That was my thinking anyway.
I had no idea it used to be called Startup News! When I joined in 2012 this site was "essentially /r/programming but for more serious programmers and without jokes"
I didn't downvote, and I don't think there's a problem with explaining why something isn't clear. There's a difference between expressing criticism and saying that something doesn't belong here, and which I'd argue is evidenced from the fact that the reaction to my comment critiquing yours doesn't seem to have ruffled many feathers (at least not yet!)
Not sure I'm understanding you correctly, but it sounds like you're saying that I said that this post doesn't belong here? I said no such thing. I said this article is "unhelpful for *me*" but "deeply relevant to this site" and "some HN readers will get value from it".
Imagine a nursing home that serves steak every day. One resident says "this food isn't helpful to me because I no longer have teeth to chew it. Wouldn't this be better for everyone if we had soup?". They're not suggesting outlawing steak, after all some people will get value from it. They suggesting a way to better serve the entire population of the nursing home.
Have you considered that you are simply not the audience that Alex or speckx had in mind? It would be healthy to recognize this simple fact and move on while letting the intended audience (Hi! Longtime HN member for over a decade!) enjoy it.
Please do not put words in my mouth. Did I say to shut up? I said to move on, since this is clearly stressing you out, and additionally because you are ostracizing other members of the community who are just fine with this content. This isn't Harrison Bergeron, the community as a whole does not have to cater to your own intellectual shortcomings. There is no need for sarcasm or snark.
They're the same thing on an internet forum. There is no space to move through, so while in the physical world "move on" is different from "shut up", on an online forum they both mean exactly the same thing: "don't say anything".
And yes, this is stressing me out. I took the time and effort to think about and explain how this post could reach a wider audience on hackernews, citing an example from my own learning experience, and nearly everyone has attacked me for it. The original article was clearly meant to explain/educate. You'd think "here's how you can do that for more people" would be useful feedback.
FWIW, I found the idea of interference-to-signal ratio as a way to think about memory capacity to be intuitive and was really interested in getting a better sense of how models increase capacity, until it hit the first math notation formula. My disconnect was based on the approachable tone of the intro, from which I assumed it would be a more generally accessible article.
To be clear, I have no problem with math people conveying math stuff with math notation but it seemed like the type of article which, even if it will get into notation, first at least explains "the main idea of it" without notation, then expands with notation as necessary when fleshing details or implementation.
That is not an accurate read of my post. My post was about two things:
1. The notation used
2. The lack of concrete examples
I'm not saying they should remove any of the content, just put it in a form more accessible to us. For example, I can read and mostly understand a news article in French, but it will take a lot of time and effort. If it was written in English, it would be easy for me to read. The two news articles have exactly the same content, one is just written in a form easier for me to understand.
I guess you're not the target audience for this article then.
This is pretty approachable maths, and explain really well. I've seen far worse in programming language theory papers, which would qualify as "software development" in my mind. There are plenty of users of this forum that would find this paper useful and interesting, with sufficient math background to read it to boot.
Well, you could tell your AI of choice to read the article and explain the math. I did that with ChatGPT and it helpfully translated a lot of it into Python for me.
>It's easy to forget that the average person probably only knows the formulas for Olivine and one or two Feldspars
That being said the llm is indeed the universal translator — the babelfish supreme — and is excellent at translating whatever you want into pseudocode in your language of choice.
Hey author here! I have a short summary here if people find it helpful: https://x.com/heyyalexwang/status/2111158818730397932?s=46
Thank you for putting that excellent article together
The concepts of fidelity/recall and the images/animation at the top reminded me of this small playful project that touches upon these topics: https://nicobrenner.github.io/lossy-git/
That's such a neat idea! Now I want to try it out too
This is one of the most well written blog posts I've seen in a while. Thanks
Thank you! It's been sitting in my head for so long. I'm glad I finally got to share it with people
This sparks a thought that I have not seen revisited in the LLM age - memristors [1].
[1] https://en.wikipedia.org/wiki/Memristor
Would be nice if articles defined the requirements to be a “you”.
https://en.wikipedia.org/wiki/Generic_you
This is actually useful. I didn’t know that generic “you” meant “one”. I always interpreted it as “you the reader” and felt desperate once a week when reading articles like these.
As a native English speaker, I interpret it as “you the reader”. Or maybe I should say, I don’t intuit any material difference between “you the reader” and “any given reader” or “one”. I think your original comment is a good critique of the headline.
I love seeing helpful people create this moment :)
https://xkcd.com/1053/
That said, the audience for this is still pretty niche.
(Even the audience for, say, 3b1b's explanation of what a transformer is, is niche.)
why?
Because I'm an idiot.
Great article. My favorite fact about "transformers as a hopfield network" is that transformers are so good at memorizing that they only need one step to find a suitable memory as opposed to multiple steps for a vanilla hopfield network
This is a really interesting article! While I can’t profess to understand all the math it is a great way to demonstrate it.
I recall awhile back hearing someone ask whether intelligence was actually the same or similar to “compression” or storing all of this knowledge in weights - IE the ability to create something from reason or weights or relationships / connections. This article makes it even more interesting!
For anyone interested, here is a recent 3Blue1Brown series on "Compression is Intelligence": https://www.youtube.com/watch?v=l6DKRf-fAAM
(For anyone not familiar with 3B1B, it's a YouTube channel that visualizes intriguing math concepts to explain them intuitively!)
For anyone here who understands this stuff, help me out because the article dropped me at the end when drawing the connection from memory to LLMs.
For an LLM, the keys are the tokens in your context, and the values are … what exactly?
In an attention layer, the query, key, and value are all computed at inference time using weight matrices that are determined as a result of the training. If X is the token representations entering the attention layer, then each of Q, K, and V would be determined by multiplying X by the corresponding learned weight matrix for queries, keys, and values:
Q = XW_q
K = XW_k
V = XW_v
From there, you can think of K and V like keys and values in a Python dictionary, and Q as the key you pass (e.g. d[Q] in Python to return some value V). The difference in an attention layer is that the query is matched to each key using a dot product, and rather than getting a single value back you get a weighted sum of values.
> The difference in an attention layer is that the query is matched to each key using a dot product, and rather than getting a single value back you get a weighted sum of values.
I understand you meant to compare it to dicts, but this is more like (the only?) similarity to outer product memory. Worth calling out since GP is confused about this connection specifically.
To clarify slightly, K and V are used to construct the dictionary, and then Q is the lookup key D[Q] as described (with the lookup being based on similarity rather than exact hash as it would be in an actual dictionary).
"interference-to-signal ratio", "capacity", ... These terms, and their context, are things a communications/electrical engineer would understand. I encourage comms engineers to start learning how AI works under the hood. Chances are, a lot of what you know about maximising channel capacity and throughput is applicable to AI (can be seen as a channel with memory?).
EE here. Indeed I asked Gemini Argon to translate this article in to DSP terms and it helped.
The animated bird, the kea is absolutely fabulous. I appreciate the effort and detail that went into this.
I was about to return here to say the same, I wonder how many people noticed it!
See also:
NNCP: Lossless Data Compression with Neural Networks (2019)
https://news.ycombinator.com/item?id=27244004
https://bellard.org/nncp/
Who? Me?
Goodness, someone posts a great article which IMO accessible math, and people get upset.
If you think that is crazy, ohh boy, just wait til you see all the other papers underlying LLMs, AI, and optimization in general.
I appreciate this post because starting from linear algebra is the correct way to form an intuition of the higher dimensional semantic spaces we're dealing with.
This article does two things which make it unhelpful for me:
1. It uses math notation. This is a software development site, wouldn't this be much more clear to this audience written as psuedo code instead of a complex series of greek and latin letters?
2. It doesn't step through a concrete example. What is hollow R raised to the (M * d_v) ? Is it a number, a set, a list, a matrix?
To use an example I understand: RAG used to seem complicated to me when only math people were talking about it in math words. For example, let's take a line from wikipedia on embeddings:
> the representation is a real-valued vector that encodes the meaning of the word in such a way that the words that are closer in the vector space are expected to be similar in meaning
What made it clear was learning that generating an embedding is just a function(string) -> list[float], and RAG is just taking a list[float] for your prompt and finding other list[float] that are close to it in your dataset.
So what would make this article more clear, is step through a simplified example of putting a value into a memory store and querying that memory store, showing the actual data structures.
> This is a software development site, wouldn't this be much more clear to this audience written as psuedo code instead of a complex series of greek and latin letters
At the risk of stating the obvious, this is a forum where people can post arbitrary links to other sites, some of which might have audiences that might not be "the exact set of people who read Hacker News". I'm not sure you'd be able to make a compelling argument that alexwang.ai is aimed at software developers and no one else.
Yes, but you need to consider your audience when posting links to this site. For example, if I posted to HN a link to a really good cookie recipe, it wouldn't be a good fit for this site. The author did nothing wrong, but that doesn't make it a good submission to HN.
This article is a bit more of a grey area. It is on a subject that is deeply relevant to this site and I'm sure some HN readers will get value from it. My point is that an even better submission to HN would have been an article on the same topic but written for programmers rather than mathematicians.
I'm surprised to this take, because I feel like I see math stuff posted here fairly often, and often with a large number of people commenting on it in substantive ways. Often times the math savvy crowd will even help explain stuff to people like me who are not particularly fluent in advanced math.
> Often times the math savvy crowd will even help explain stuff to people
Perhaps, but HN apparently is pretty hostile to people explaining why something is not clear and how it could be more clear based on all the downvotes. I'll keep that in mind: "If you don't understand something, shut up!"
Not understanding something isn’t the issue.
Also not an issue: the quality of the article.
Expect to be challenged by content here. Everybody is from time to time. Asking for a mathy analysis to drop the math, fundamentally misunderstands the value of the math.
I'm not suggesting they drop any math. I'm suggesting they drop the math notation. As programmers, we spend 8+ hours per day reading code. Expressing the same math but in the syntax of code would make it accessible to more people on this site. It's like speaking in someone's native tongue instead of their 2nd language. I can read and mostly understand a news article written in French but it is going to take a lot of time and effort. If a news article is written in English I could read it quickly and easily. Both languages are presenting the same information, it is just a matter of how it is presented.
HN is a site for programmers (or specifically "hackers"). Posting an article to a site for programmers in math notation is like posting a French article to an English message board. Some people will be able to read it with varying levels of difficulty, but wouldn't it be better to post an English version of the same information so everyone can read it easily?
the poster and the writer are different entities... only the writer influences the poster, not the other way around...now the poster saw value for HN readers and thats why it ended here.. with this logic your position doesn't make sense
I think people likely hit an early "break" and "goto xkcd 386" when they saw "this is a software development site" in your comment, without reading the rest of your comment.
Clear explanations are a good thing, but different explanations help people in different ways. Your explanation seems helpful to me, and reminds me of Ben Affleck's explanation in the GQ interview. But Ben Affleck connected it directly to arrays of RGB pixel data, which clicks more with me personally, but probably wouldn't with everyone. It certainly didn't make things any clearer to the interviewer.
There's a certain irony in praising clear explanations as a defense of an explanation that needlessly veered into value judgment
Well, sure... but it seemed to me that they didn't realize they're posting on Startup News, a news site for founders of startups:
https://news.ycombinator.com/hackernews.html
"... the thing that makes hackers such good startup founders is that they care about more than business. They have intellectual curiosity driving them as well as the desire to make money. So the way to make a news site for startup founders is to make it be about more than just startups. ... If you had to reduce it to a sentence, the answer might be: anything that gratifies one's intellectual curiosity."
My thought was to show some grace, considering that not everyone's been around here for 20 years or knows that "hacker" doesn't apply only to computer programmers. That was my thinking anyway.
I had no idea it used to be called Startup News! When I joined in 2012 this site was "essentially /r/programming but for more serious programmers and without jokes"
I didn't downvote, and I don't think there's a problem with explaining why something isn't clear. There's a difference between expressing criticism and saying that something doesn't belong here, and which I'd argue is evidenced from the fact that the reaction to my comment critiquing yours doesn't seem to have ruffled many feathers (at least not yet!)
Not sure I'm understanding you correctly, but it sounds like you're saying that I said that this post doesn't belong here? I said no such thing. I said this article is "unhelpful for *me*" but "deeply relevant to this site" and "some HN readers will get value from it".
Imagine a nursing home that serves steak every day. One resident says "this food isn't helpful to me because I no longer have teeth to chew it. Wouldn't this be better for everyone if we had soup?". They're not suggesting outlawing steak, after all some people will get value from it. They suggesting a way to better serve the entire population of the nursing home.
I see plenty of things shared here that don’t fit your preconception of what is a fit for a site you don’t operate.
Have you considered that you are simply not the audience that Alex or speckx had in mind? It would be healthy to recognize this simple fact and move on while letting the intended audience (Hi! Longtime HN member for over a decade!) enjoy it.
"If you don't understand something, shut up!"
Got it. Stay classy HN.
Please do not put words in my mouth. Did I say to shut up? I said to move on, since this is clearly stressing you out, and additionally because you are ostracizing other members of the community who are just fine with this content. This isn't Harrison Bergeron, the community as a whole does not have to cater to your own intellectual shortcomings. There is no need for sarcasm or snark.
> I said to move on
They're the same thing on an internet forum. There is no space to move through, so while in the physical world "move on" is different from "shut up", on an online forum they both mean exactly the same thing: "don't say anything".
And yes, this is stressing me out. I took the time and effort to think about and explain how this post could reach a wider audience on hackernews, citing an example from my own learning experience, and nearly everyone has attacked me for it. The original article was clearly meant to explain/educate. You'd think "here's how you can do that for more people" would be useful feedback.
FWIW, I found the idea of interference-to-signal ratio as a way to think about memory capacity to be intuitive and was really interested in getting a better sense of how models increase capacity, until it hit the first math notation formula. My disconnect was based on the approachable tone of the intro, from which I assumed it would be a more generally accessible article.
To be clear, I have no problem with math people conveying math stuff with math notation but it seemed like the type of article which, even if it will get into notation, first at least explains "the main idea of it" without notation, then expands with notation as necessary when fleshing details or implementation.
Wait, you're saying that mathematics isn't useful to software engineers?
You should give it a go.
That is not an accurate read of my post. My post was about two things:
I'm not saying they should remove any of the content, just put it in a form more accessible to us. For example, I can read and mostly understand a news article in French, but it will take a lot of time and effort. If it was written in English, it would be easy for me to read. The two news articles have exactly the same content, one is just written in a form easier for me to understand.I guess you're not the target audience for this article then.
This is pretty approachable maths, and explain really well. I've seen far worse in programming language theory papers, which would qualify as "software development" in my mind. There are plenty of users of this forum that would find this paper useful and interesting, with sufficient math background to read it to boot.
The author has a link to the actual code behind the blog post. https://github.com/KeAWang/associative-memory-blog/blob/main...
Those are valid bits of feedback to make an articel more accessible, but it's totally fine and apprpriate as it is
Well, you could tell your AI of choice to read the article and explain the math. I did that with ChatGPT and it helpfully translated a lot of it into Python for me.
Upvoting you for this is quite fair. Mathematicians do seem to suffer from the Feldspar Problem:
https://xkcd.com/2501/
>It's easy to forget that the average person probably only knows the formulas for Olivine and one or two Feldspars
That being said the llm is indeed the universal translator — the babelfish supreme — and is excellent at translating whatever you want into pseudocode in your language of choice.
Send the link to Claude or your favorite alternative, and cut-and-paste your comment into the box, and you'll get exactly what you want.