# Workshop 23982

- Kind: Workshop
- Talk page and recording: https://iclr.cc/virtual/2025/workshop/23982

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

to the workshop on associative memories. Um just a couple of announcements to start with. If you have a poster um feel free to put up the poster anytime during the breaks. Um there should be some blue masking tape that's going around. I don't know where does someone know where it is right now? There was a roll of blue masking tape somewhere.
You have it? Okay. So there should be some we'll leave it on the back desk there. You can pick up then the blue masking tape. Make sure that the only thing that goes on the wall is that tape. They they really don't want any other tape or any of your other sticky stuff on the walls here. Okay? So, um you know welcome to this uh workshop. Um I'm one of the co-organisers and but I'm here to introduce our principal organiser Dima Krotov. Um it's my pleasure to introduce Dima.
Um he's if you think about the embodiment of kind of this modern uh associative memories, then Dima is certainly you know the realisation of that. Um Dima received his uh physics P_H_D_ at Princeton. He he was I think John Hopfield's last student there. Um he then worked at the Institute of Advanced Studies and now he's currently a research scientist at uh I_B_M_ Watson. So Dima will uh tell us a little bit about what he hopes to see and some of the goals out of this workshop this morning. Alright? Thanks.
Ah, well, good morning. Welcome to the new frontiers in associative memory workshop. As Dan said, I want to spend the first uh ten-ish minutes briefly introducing to you the concept of associative memory in case some of you are not uh super familiar with it. So what is associative memory at the very high level?
If I show you an image of a strawberry, you might be able to recall what that strawberry smells like or tastes like. If I show you an image of this gentleman, most of you would be able to tell me what his name is. These are examples of associations or links between inputs and outputs and are sort of canonical examples of computational abilities of associative memories.
The other important aspect of associative memories is the notion of the error correction. So if you try to read this text that you can see at the bottom of this slide, hopefully most of you can do it without much problems.
At the same time, if you pay attention uh to what is written there, n almost no words in that paragraph are proper English words. And in fact, the only reason why you are able to comprehend the text is because there are powerful error correction mechanisms constantly working in your brain. So essentially, associative memory is a content-addressable information storage system that is capable of error correction.
And I also took the liberty of highlighting three landmark papers at the bottom of this slide that were the most influential papers that formalized this notion that comes from psychology and neuroscience in the form of mathematical equations. Associative memory played major role in the history of AI.
If you talk to historians of science, typically people refer to the period of time between 1974 to 1982 as the so-called AI winter. So that period of time was triggered by the famous book written by Minsky and Papert in 1969, where they have shown that simple perceptrons without hidden layers cannot compute even elementary logical gates such as XOR.
And the public perception of that statement led to the bias or opinion in the community that artificial neural networks is just the wrong path towards, you know, sufficiently capable AI. And essentially that long period of time ended in 1982. And you can ask why that happened. And of course the reason why that happened is because of the Hopfield network.
So that idea was so powerful that it brought artificial neural networks back to life. It brought funding to the community and enthusiasm. So what was so special about this idea and why was it so powerful?
The main idea is that you can think about computation of artificial neural networks in terms of energy landscapes. So you can essentially think about the state of the neural network as a ball that initially is located somewhere high up on the energy landscape. And then the computation that this network is doing happens when this ball rolls down the hill. And that ball stops once it reaches the local minimum. So essentially you can think about the initial state
it of that ball is the question that you give to the neural network. And the final state uh that this ball ends up being in the limit of time t goes to infinity, you can think about as it uh as the answer that this network gives you to your question.
And what was so cool about this idea that on the one hand it was sufficiently simple to be mathematically tractable and on the other hand it was sufficiently rich to convince the community that artificial neural network is in fact the right idea, is the right path forward towards capable AI.
Another key ideas that were emphasized in this work are the ideas of collective and distributed computation. So what does that mean? Collective means that the computation does not have

It means that the computation does not happen at the level of individual neurons, but rather it happens at the network level so all the neurons need to talk to each other for meaningful computation to happen.
Distributed means that you can take these networks and you can mutilate them in pretty drastic ways. You can kill neurons, you can kill synaptic connections, and up to a certain degree this does not kill the collective computation that this network is performing. So essentially the confluence of all these ideas has made this proposal a really successful idea that was popular in the early and late 80s.
In the past few years, there has been a lot of enthusiasm.
Directed toward extending Hopfield networks to a more broad class of associative memory models. And here I'm talking about energy-based associative memories. So this new class of models are called dense associative memories. And essentially dense associative memories include Hopfield networks as limiting case, but they are much broader. And the key question that this class of models address is the following.
They try to retain all the good properties of Hopfield networks, but at the same time try to solve some of the problems. And the main problem of the conventional classical Hopfield network is that it is impossible to store a large amount of information. In the dense associative memory, it turns out that you can store an exponentially large amount of information in the size of the network.
Another nice aspect of this class of models is that in certain limiting cases they can be reduced to many of the architectures that we like to use in mainstream AI, such as transformers, attention mechanism and even diffusion models.
And the reason why this is important is because by using this correspondence between conventional architectures and dense associative memories, you can bring in the energy -based perspective on the computation that standard architectures are doing. Now, finally, I want to explain why we thought that 2025 iCLR is the right time and place for hosting this event.
So if we talk to cognitive scientists, psychologists, neuroscientists, they would tell us that memory is essential computational module for intelligence. So for us to have this information exchange, this conversation that we are having right now, you know, a handful of memory systems need to work in accord to make that happen. At the same time, if you look at the landscape of mainstream AI today,
Hopefully you would agree with me that by and large the concept of memory is missing or minimal. And we believe that this is an opportunity for our community to contribute to the development of next generation AI architectures that utilize memories in more intelligent ways.
Second, within the associative memory universe there is at least two broad classes of associative memories. The first class is energy based associative memories. The second class are various kinds of uh differentiable look-up tables. And currently both classes of networks have certain benefits and drawbacks. And uh we thought that it is important to discuss these benefits and and drawbacks and we try to bring
uh speakers representing both these two paradigms to these workshops, you so we'll hear about them uh from them today. Third, in the past few years there has been a substantial effort directed towards augmentation of transformers with various kinds of memory systems. And uh it's an interesting idea, and it does solve many of the limitations of conventional transformers and conventional L_L_M_s.
And today we're going to hear from many experts who are leading scientists, leading this effort. But there is a broader question. Is associative memory is barely an augmentation of existing architectures versus maybe associative memory can open up entirely new world of new architectures that are better than transformers? And we believe this is also an important question that is within the scope of today's.
is workshop. Finally, associative memory is a highly interdisciplinary field.
And it's tense in the middle of at least three large disciplines, such as physics, computer science and AI, and neuroscience and psychology. If you go and talk to people representing these three disciplines, you would quickly realize that they speak entirely different languages. And it's very hard to understand what each community is talking about. So the major goal of today's workshop is to try to develop a common language.
of a common language or at least try to start understanding the language used by these three communities so that we could jointly work towards bringing associative memories back to mainstream AI architecture development. So I'm going to stop here. Thank you for joining us today and I very much hope that you would enjoy the program.
Next we have an invited talk by Pariyaram. Yep. Want to come up?
Thank you. Thank you so much uh for organising this workshop uh Dmitry. And thank you so much for inviting me. Uh I am Pari Ram I am uh part of the mathematics of computation group at I_B_M_ research. And uh I am I'm going to talk about the symbiosis of associated memories and machine learning. But I and I know like this workshop is called the new frontiers of associated memories.
But what I'm going to talk about is going to take us back. Take us back to topics in machine learning that were of interest when I was a grad student, which is almost two decades ago. And so I apologise beforehand if this is not about all the exciting new stuff that we are doing right now. And I'm also glad that Dima over there gave a really nice introduction of what associative memories are. Because it's my turn to completely butcher it.
I view associative memories from a machine-learning viewpoint. And I think of it as a model, so like if if you're if you're m if if if
Worked in machine learning, you're probably thinking okay, a model is something that maps something to something. So I view a society memories as a model that maps say a vector in the R_D_ to another vector in the R_D_ um and they're parameterized with something called memories. Um and then it's an interesting concept, but to me I just view them as parameters that I can learn. Uh but they have a nice interpretation as memories. Uh and a critical part of this model is that it has an energy function.
which uh consists of a similar a notion of similarity between inputs and memories or the parameters. Um some kind of a non-linear activation. Uh I'll get into what what these are soon. Um and then a monotonic function like a log or something just to keep things in scale. Um and the interesting thing about this model as being an energy-based model is that the model prediction is actually performed by an by a via an energy descent.
where you compute the gradient of the energy, pick a step size and you use that to generate the output of the model. And of course what Deema was showing, that you can apply this recursively to get to say some kind of a local minima which does your error correction for you. And again, um if you wanna learn more about it, you should look at the seminal paper by uh Dmitry Kronodov and John Hopfield on the modern version of these associative memories.
Um um and of course like when you for the moment you talk about energy, you always think about um probabilities, because they are like inversely related. Um and when you're doing an inference through energy descent, you're effectively doing some kind of like a maximising maximisation of likelihood. And that this is because I'm thinking of it as a machine learning person. Like I'm just trying to maximise my likelihood. And when you
said uh the energy descent with say a certain initial state and you keep applying this energy descent, uh eventually you get to a local minima, which corresponds to the local maxima of the log log likelihood. Um and and so the and that would be the fixed point of this energy. But an important aspect here is that um the
The m more memories or more parameters you add to your model often lead to more local minima of your energy, but up to a point. Oh, okay. Um and like this video over here is uh showing that you have the energy landscape and as you're adding more memories to this landscape you create more and more local minima, but you're also increasing the size of your model um.
So you're getting more expressive and you have more local minima, but you're also increasing the size. So there is this uh and this is a trade-off that I understand from a machine learning perspective. I'm trading off

learning perspective, I'm trading off expressibility for model size or generalisation.
Now uh as as Zima mentioned, this expressivity is related to model capacity and that capacity is often tied to this activation function F_ which if it's a quadratic one takes us to the classical regime and you have a capacity which is usually linear in the dimensionality that you're operating in. Um but when you add more faster increasing activations, you go to a regime where you have more capacity.
And once you get to exponential capacity, that's usually enough for universal approximation of any pra function that you're trying to um uh learn. But again, imagine having to store exponentially large number of parameters in your model. This is usually not feasible. Um at least I from coming from a really old machine learning background think of that as not feasible. Um
Ah, but another thing that I view machine learning the a associated memories is as a contractive layer. It's an interesting property that intrigued me. The fact that it's a model that operates independently on inputs. The it it doesn't try to talk to multiple inputs at the same time, it talks it all the inputs individually, yet has a collective contraction effect.
And um I'm gonna give you an like walk you through an example of of why what's happening. Um so you here I have like some num some inputs and the energy function gives me a energy landscape here. You're looking at uh energy landscape and when you start doing energy descent on this landscape you see that the points are slowly move close uh uh moving close to each other. It's because they're all trying to move to a local minima, so it it makes sense, it's not surprising.
raising, but it's an interesting property. Yeah. And so uh I I I like to think of A_M_s as a contracted layer. Just like you have convolutional layers, you have uh pooling layers, A_M_ is now a contracting layer, uh or could be viewed. But once you um do that um you need to keep in mind certain things. So that
When it's contracting, the parameters of the layer is what's controlling where the local minimas lie and uh thus where the inputs contract towards. Uh and and this is very powerful, or at least to me it's very powerful, because then I can create the right objective. It lets me learn the places where I want to put these local minima. Um and
And with that capability, um I started thinking like what are different applications of this this kind of a layer. Where can we throw it in? Um and that w while you're looking at this picture, you probably already thought of something on your own and it's probably clustering. Um because they're contracting the point, they're kind of automatically creating clusters for us. And we can show that uh there's let's let's look at this K-means clustering problem. This is probably the most
Widely studied but yet an M_ NP-hard problem, even if your K_ is two. Uh so it's a very hard very long studied problem. It's been studied since before the nineteen fifties. Uh there are applications like facilities, location, placement and such and uh what the problem in this math equation is showing is that we are given a set of points and we want to learn centres, these uh red stars, um so that uh
The distance of each point to its closest centre, the sum of that over all the points is minimised. Um and if you think about it, this is not a simple ob uh optimisation problem. This is what's known as a bi-level optimisation problem. You have the upper level objective which is minimising the distance to the closest centre, but finding the closest centre is an optimisation problem.
You have to find which one is though. Um this violent problem actually makes it pretty challenging. And again, since your making that selection um
Um you're you're making like a a discrete selection of which centre you're going to consider your closest. It's a discrete optimisation problem. And then they're like the classic law of algorithm which is everybody probably learns at their first um class of computer science, or or maybe the first class of data mining and machine learning. Um but what we saw this as an opportunity um to emulate this discrete assignment
using the contraction properties of a s associated memories. And to visualise this this this uh idea you can think about uh having the points again, but once we have the centres, instead of assigning points to centres discreetly, how about we move them towards the centre by doing energy descent. So I can create an
I can craft an appropriate energy function which moves my point to the local minima which corresponds to one of the centres. And then my objective effectively is finding these local locations of the local minima the memories which uh and then I see how much does this system move my point.
Um because I know that where it ends up in the fixed point is one of its closest centre. And this and the fact that these layers are differentiable, they are neural network layers, you can differentiate through them, you can learn them and so it's a differentiable clustering algorithm and you're almost doing discrete assignments. So it's emulating that fact and yet can be solved by something like S_G_D_ And this is the main idea behind our paper that we had in I_C_M_ a few months
a few years ago um with um Vishwajeet Sah, Dima here and a Professor Zaki from uh R_P_I_ Um again, you can take the same idea and combine it something more from modern machine learning task of representation learning. You can think of when we are learning representations, say like a classical auto encoder, you are just putting points in the latent space and then decoding them.
But you're not enforcing any structure in the latent space. There are some modern versions which try to put some structures like VQVAEs and such. But generally, they are just allowed to be anywhere in the latent space. And
What what we we thought is what if we wanted to give latent space a nice structure? What if we wanted the latent space to have clusters in them? Um and then uh we we followed a a pipeline of this form where we take m our input, which could be some images of birds as in here, we pass them some through some uh encoder,
uh which puts it in some latent space. So they look like points in some latent space and then you pass them through a few layers of the the associated memory which contracts them, giving them this clustered structure in the um latent space. But one is that we don't really take it to the fixed point, we kind of just move them close. And then we f we push the system to decode these
uh contracted points. And what this then gives us is a single objective where I can learn all of this jointly with a single uh forward and backward pass, which
Takes care of both the fidelity of these learned representations in the latent space, that they have all the information that's needed, because I can decode back the right thing. But it also is giving some structure to the whole latent space collectively, because of the contractor property of this associative memory model. And this is the topic of our workshop paper here, uh deep clustering with associative memory. Again with the same uh
set of co-authors and uh you c you can learn more about this uh at our poster. Uh now like b it talked about clustering, but I wanna go back to this associative memory energy again. And uh any anybody who looks at this probably will figure it very quick very quickly that
The energy function contains a kernel sum in it, it's essentially a kernel sum. Where if you take the similarity function and the non-linear activation and call that your kernel function, you have a kernel sum. And kernel sums were very popular when I was a grad student. Um they were they they were usually very expensive uh and naively to even do inference with them, like do
the created output for a test point, you would have to keep all your training points around. Naively, uh of course there were many different amazing techniques developed to make this more efficient. But more training points usually implied better expressivity. And so you can see some parallels between what we have seen in A_M_s and kernel machines is that you can think of the training points as memories and um unfortunately at at least in in this current form, we have to keep all the memories around.
Um One one note here, when I was a grad student this is a book I looked at, large scale kernel machines and we are very fortunate that one of the authors of the pape of that book is right here, uh Doctor who is who we are very fortunate to have in this workshop with us. Um
Um but one thing changed in 2007 that kind of changed the story about kernel machines. Um which is random Fourier features. So Rahimi and Recht came up with random Fourier features uh which presented a nei new way to make le uh kernel machines scalable. And I think they were recognised for this in 2017 with the NeurIPS Test of Time Award. Um now
Again, you can see where this is going. Then we asked the question, what if we how can random features help associative memories? And

There's health associated memories. And again, what you can think of random features as a function phi which takes a d-dimensional vector and creates wide new random features for you. And the property that gives you is that it approximates the kernel value for any pair of inputs by just a simple dot product.
The moment you have a simple dot product just in a different space, then you can just do some elementary math, and you realise that the true energy which requires us to keep all the memories, which you can think of as calling uh memory representation dense A_M_ or as one of my co-authors came up with, Mr. Dam, um and then you do the math and what you see is that you don't need to keep all the memories, all you need to keep is a sum of the random features of
The random feature representations of the memories, which is essentially a single vector in this random feature space, which we were calling distributed representation uh dense ems or mr damn graduated to dr damn. Uh and again, this is a nice visualization uh for a very specific kernel. So this is um in in kernel speak, the r_b_f_ kernel, but in uh em speak, the log sum x energy function.
And you can show that uh very simply you can just use random features to simplify the energy function by just keeping around this sum of the random features and here's one set of random features that Rahimi and Rec proposed which use trigonometric functions along with uh random samples from the uh from from a Gaussian uh from a d-dimensional Gaussian.
And that's that's that's enough um for our uh so then the idea is pretty st um straightforward, uh that we have random features. One of the cor important things is that this approximation has a cost. Like how many random features do you need? You can't just
You do small number fender features and think that this will magically work, right? So you pay a cost and what has been shown is that you need about order D by epsilon squared uh random features which implies that all your kernel products or the kernel values are approximated up to a additive error of epsilon. So with the
If memory representation energy function we are moving it to the an approximate energy using a distributed representation, so what the how does it help up help us in terms of the number of parameters? So it's effe effectively taking about if I have M memories all in D dimension, that's taking us from M times D to order D by epsilon square. Of course like this is not necessarily better. Like if epsilon is needs to be small enough, then we aren't
we are not in a better place, but if you think about kind of the large uh larger uh scenarios where we want high expressivity, um the memory is usually um if we go to the extreme regime of polynomial or exponential number of memories, then this could be advantag advantageous. Um but the
The other thing is it's always important, like that was the idea, and it seems very very straightforward, but it's also need to understand we need to understand that this is not for free. This will not just magically always work, and it's always important to think about the situations where this will work and places this won't work. Um so kind of if we are thinking about doing energy descent, then what we can show is the difference between this energy descent on the true energy
And the energy descent on this approximate energy which uses the distributed representation, we can uh we can bound this error. This is essentially like you're taking two different networks and approx finding the difference in their outputs. Uh
Uh uh the bound depends of course on the square root of D by Y, which is tied to that a relationship that we need Y to be D by epsilon squared. So that is definitely one factor. So you if you're D, the number of features in which your operating grows, then you need more number of random features. Um uh and more mu and features implies better performance, but there are some other factors that play a role.
One factor is the quality of the random features. So Rahimi and Recht came up with one set of random features. But since then there has been a really amazing line of work which have created all richer and richer sets of random features, which improve the constant in terms of the square root of d by wye. And that constant can be very critical.
Another th sorry, another thing that this uh depends on is kind of the learning rate of the step size that you use for your energy descent. If you're using a small step size, um you you you will you are you're not gonna your ener error does not accumulate as fast and you're able to uh have better approximation guarantees. Mm. But one final thing which plays a critical role is the initial energy of the input. Like where does where does my
my system start the energy system. Is it near one of the memories or is it really far from everything else where we have no memories and no idea about where to go. If it is really far away so it has a high energy uh it this gives us a b much worse um guarantee, approximation guarantee versus the situation where it's kind of in the domain of the data it's starts at something close by then this will this will do really really well.
And this was the subject of our paper. Uh we have uh quantitative and qualitative results uh both showing how this works in general and how this is tied like how our theory theory is also somewhat validated uh like that we we have the right ideas of what factors matter. And this was with my collaborators uh Ben Hoover who did the all for me these amazing videos that I've been showing. Uh I wish that to learn how he does that from me from him some day soon. Um
His advisor, Paul DeChow at Georgia Tech and uh Henrik uh Strobel. And of course uh Dima Krotov over here. Uh Now coming back again to this notion of kernel sums. Um another thing if you ever thought uh ever spent time working on kernel machines is the choice of the kernel. Which kernel should be used. Uh of course like
If you use the Gaussian kernel, uh which is very common in in in kernel sums, then that gives us also a very common energy function. It's it's known as a log sum exp or L_C_ energy function. It's like ubiquitously used. Um and it's it has nice properties and one is that it has a exponential activation function. So the activation function F_ that I was talking about, that's the exponential function. Um and it has been shown that this
Um energy function has an exponential memory capacity, so it's it's really expressive. And that's really nice. But the final question is is this enough to make it a good good kernel? Um and um I mean honestly I don't know. I asked around and uh there uh c again, this is where Dimas's comment about
Uh connecting language is important. Physicists think of this as in a very different way, so if they don't think about it as kernels they think about it as variational functions or or terms that I don't even remember or ye uh or nor am I using improperly. Um uh but it is interesing it important to think about what kernel function should be used um
So I go back to my old machine learning uh thought process. So I go to a problem that has been studied in the machine learning called density estimation and a common carnel sum is what's known as the carnel density estimation.
So effectively that's it's a specific kernel's sum where you try to approximate uh a given density and the quality of the density um is is actually well studied and and characterised. It depends, it's characterised by this notion called the mean integrated squared error. Like how bad is my approximation uh given the true density and one of the things it depends on
Or o two things it depends on is this term um bias which is given by integration of Z_k Z_ by D_Z_ and the variance which is the integration of the square of the kernel value. Um and what this characterises is is is it tells us that the quality depends on the shape of the kernel.
So there is a so now we can think about what should the shape be. If I optimise for this quantity, I should get better and better results, and um and people have done that. So uh
Two things here. One, they have found the optimal kernel. It's the F and Nashnikov kernel all the way to the right. Um and it has a shape, it's a truncated parabola effectively. Um but the Gaussian kernel, uh if you do this computation, will see it's only ninety five percent as nice as the F and Nashnikov kernel. Of course, um the it's the Gaussian kernel is better than the uniform kernel, but then a simple triangle kernel um is better than the Gaussian.
uh and of course there are many other ones which the different shapes that people have come up with that better and better efficiency, but nothing beats the Betterneschnekov. And um for density estimation we it's understood that Gaussian kernel is not the best and there are many others that are better. And uh so that what we we thought about is what if we tried to use this for um A_M_S_ I mean there is a connection between probability densities and energy, so it might what what does
the best kernel for probability density estimation give us for uh A_M_s. So so we create uh we we we found a new um energy function we call the log-sum shifted ReLU or the L_S_R_ energy. Uh there are some terms in there which are a little bit more nuanced and I'm I'll talk about it more.

nuance and I'll talk about it more when we add our poster today
But if you compare it to the uh L_S_C_ the more popular ubiquitous L_S_C_ kernel, you can see that they're the main change is the use of the ReLU activation instead of the exponential activation. And so if you compare these two uh activation functions, on the right you have the shifted ReLU and on the righ left you have the exponential um activation. You can see that they se have similar shapes but then one has a truncation and the other has infinite support.
Um and what we show is that this energy function has exponential capacity without using an exponential activation. But the what we've realised thing about this area
Um energy is not only do we retrieve the memories, but in that same state we are able to generate many new local minima, which is very odd. But it's I a I wanna show this to you in in this toy example where we have two memories um uh which are one and minus one and uh the top row is with the L_S_R_ energy and the bottom row is with L_S_C_ energy. I mean you have a low beta, which is corresponds to the inverse temperature, uh
you just have a single local minima and and you can't retrieve the memories. On the other hand, all the way to the right, you have a low temperature, high beta, you have separate basins of attraction, and you can retrieve both the memories. Um but there is a middle point where um for the log-sum-relu energy we can retrieve the original memories, but we create a new me new local minima.
It happens to have lower energy than the energy at the actual memories, which is, at least to me, intriguing. I don't know what this means from the physics perspective. Maybe some of you will tell me, but this is just very it was like we were very excited to find something like this. Like, what does this mean? What is this? What do we do with such a local minima?
And this is not just oh like in one one dimension, you can show the same effect in two dimensions, where we start with three memories and we are able to uh
The entire states of the system where we are able to retrieve the original three memories must also create four new memories. Not memories, sorry, I don't want to call them memories, but four new local minima. Again, v uh uh v very very intriguing, and this not just happens in toy examples, we also like create random memories, and then we start uh trying to find like states of the system where there are a lot of new local minimas, and we get to a place where um
Uh we can get al almost an order of two or three magnitudes more local minima while still recovering the original memories. And this is not something that at least I have seen in the literature of associative memories.
And if you if this is of interest to you, come see us. Uh we have a paper at this workshop, again, that Ben Hoover and Dima, and also with uh Krishna Bala Subramanium, who is uh a professor at U_C_ Davis. Uh and uh with that I I wanna thank you for your time and I want to and come talk to me uh at at our poster. We have a couple of them here today, uh deep clustering with associative memories and dense associative memories with epi-nephric of kernel.
Thank you. Some questions? Any questions? Do you have a question?
Yeah, for the last part. So uh you mentioned that when you varied the parameter value of theta, uh so you you can get different kind of things. Um so I wonder for the in in intriguing phenomena of adding new uh noble local minima like what's the range of the theta? How large is the range and how So do you find that? Yeah. so that is that is a great question. So we are in the phase right now where we know that these local
these local minima exist. Uh we have an idea, so we uh we can Mm. check if something is a local minima very easily, but we can't enumerate all of them. And also, the number of there will be a uh a large range, so if I go go back, there'll be a significant range where it can be more than what's originally there, but the range varies. And the peak where we find the peak is something that we have not characterised yet. Right now we are just doing it numerically, um but it would be great to
like characterize that more mathematically as to what's the optimal beta which gives me the maximum new local minima. Uh that would that's an really open um that's a open question that at least I don't know how right now how to address that. Thanks. Uh Elvis, if you wanna get set up and then we can take another question while you're setting up. Um question?
So you said that the Apennine Apennine nickel of energy or function is uh optimal for kernel density estimation. Do you think here similarly there is some sense in which it's optimal as a as a kernel, or do you think it's just particularly good? I mean, I I'll be honest.
I don't think it's optimal, but I don't know what the notion of optimality means in this space of A_M_ And that's this why we are at this workshop, that we can talk about it, we can figure out how this is good or not good or is there something better out there like is just finding new local minimums a good thing? Oh uh good, sorry, sorry. Um so yeah um I I th th th that's why this is at a workshop and I I want all of you to give me ideas of how to figure out why this is good or bad. The thing
Yeah, you seem to be a bit on the thin Slicer onto the screen. sorry? The slicer onto the remote control. I can't breathe. I'll just give it to you. One Oh. Okay. question. Uh yeah. I don't know if they're on the screen. No, I So I don't repeat. So I have a comment. I don't really. Oh oh. Okay, okay, okay, In okay. the early times of optical networks, so the normal ones not the new ones, um people noticed that you could store all the things than what you and that was called parasitic memories. Was considered bad at the time.
And I believe that the replica analysis of Elizabeth Gardner, the one that gives the capacity of the pile gives you also some handle about uh characterising when this happens, the basic regime that shows up there. Yeah no, that that's true. I think so that is definitely something.
Uh that is definitely something that we we will probably uh we we will consider. But this is a little bit different than the original phenomena because you would get these new memories but you're also losing old ones. This is a different phenomena where we keep all the old memories but we simultaneously in the same state of the network have new local minima. And and that that I mean I'm I'm sure this old analysis will help us in some ways, but this is
a slightly nuanced there's a slightly different set up here to the best of my understanding. But but thank you, thank you for your comment. Alright, let's thank Pari again. Thank you. Elvis, you also? Okay. So next we have an invited talk by Elvis Duomatov. Cool. Uh so thanks uh to the for inviting me to this uh workshop.
So I'm going to talk about provable Noga for uh uh uh associative ma uh memories. So this is uh uh joint work with a bunch of people. So Vivienne uh cabannes, Alberto Bietti, uh Yunzeng uh Feng, Julia Kempe, who's one of the organisers, Francois Chatron, uh Pu Yueng and Arjun uh uh so Ramanian.
So the the the um the objective of this work is to find a solvable uh a setup where this so-called Kaplan-Schröding laws are actually laws and not just empirical observations.
So just so we are all on the same spee uh on the same page, let let me recall what are the Kaplan uh uh uh scaling laws. So uh a few years ago Jacques Kaplan and other people observed that if you look at the energy s u uh error for a large language model as a function of the the number of tokens or uh um the data set size, uh so if you look at this uh for a given fixed uh uh model size uh the irreducible error
uh decays as a power law with respect to data set size, so if you plot um uh the irreducible error versus the data set size uh on a log-log scale it looks like a straight line. Okay, so you have this uh this two uh laws here which are double power, so T_C_ and D_C_ are constants, take them to be equal to one for simplicity and you have the error is decaying as uh T to the minus A_ plus D to the minus uh B_
b where C is the s size of the data and D is the quote unquote the size of the model, the number of parameters in G_P_T_ uh this kind of stuff. Um and on the on the left-hand side I'm talking uh we're um uh talking about the irreducible error. So the error that you cannot uh so think of it as E minus the bias error.
Uh these laws are all over the place. So people have seen that you can see such laws in in images for image uh problems for text, video and uh many other scenario. So you the the ideal line the the uh uh uh corresponds to uh some exponent and uh do uh the the um the different curves are actual experiments uh which all cross the um
uh along uh do uh just lines. What what are s now has killing laws so good for? Well, uh people actually use this at We companies like Google or Meta and other places to strategically decide how to allocate resources. So if you want to do the v the next version of uh ChaGPT and you have a certain budget uh of of computer it's not clear what is uh the the optimal compromise between this exercise and model size.
place. So if you use this no rescaling loss, you can

So if you use this non-scaling laws, you can eliminate so if you fix C_ times D_ which is roughly the complete budget, you can eliminate one of the the things on the uh on the on the right-hand side to get uh such a curve. So there is a sweet spot for model size or there is a set size given a certain complete budget.
And okay, no Raskin laws have been shown by people like uh Horace and Eve uh that uh they are sufficient to um to to exhibit uh the phenomena. Oh, and so the the objective of this work is to actually find a scenario where this actually laws, not uh empirical observations. 'Cause uh as they they say if you plot
Uh most things in low block scale looks like a straight line. So maybe it's not clear that this actually looks okay.
Uh so we are going to look for a solvable set-up which is close to transformers. Transformers are very complicated and uh, I mean if you look at what's happening in D_P_T_ or Lama, it's uh even more complicated. So we are going to look at a a toy model which captures what we think is the inductive bias of transformers. So there are many inductive biases, but one of which is actually the name of this workshop, associative memories.
Also I'm going to look at a very theoretically simplified uh set-up where I'm trying to learn an unknown function f star from a large uh discrete set X, input set uh X, input space X, and a large uh um output space uh uh Y. For simplicity I'm going to assume that the mapping from X to Y is deterministic.
So a few examples just to set the stage, you could think of things like modular um uh arithmetic with some large uh P_ you can think of things like G_C_D_ you could think of uh of X as uh trying to co uh uh to uh to do some sort of uh behaviour modelling or you could think of X as maybe a b a a bunch of text or a prompt and you're trying to maybe predict the sentiment or the topic of the text. So many things.
are going to fall in this category. Now for the model that we are going to uh uh analyse uh consider we have a system of uh embedding vectors e_ and u_ uh so E_X_ uh it's an embedding for each uh input X_ and U_Y_ is uh embedding vector for each uh output uh Y_
Now these embeddings they leave in G-dimension, this is going to be important because later the D_ is going to play the role of the model size. So I'm going to get scaling laws in terms of D_ and the model uh and the the data set size. And so what is the model? The model looks uh it has a memory matrix which is a D_ by D_ matrix, okay? So if you have an input uh um X_ you compute what you could consider as syndrome, which is E_
Extranspose times the memory, okay, so it gives you a vector that has as many components as there are possible outputs. Okay? And then you look for the output which is which maximises that stuff.
So, should we uh so this is a well this is an associative memory matrix. Um for concreteness if we assume that we were or Oracool had uh who knew the perf the perfectly the distribution of the X_is the m the marginal distribution of the X_is one possible choice for the memory matrix is this stuff. So you look at at out-out products of uh input embeddings and output uh embeddings, okay
And uh so uh you've your summary over all of these uh things, of course you can write these as a weighted um a sum of uh one uh matrices like this and this is b uh by the way linked to something which was proposed in the a very long time ago in the called uh uh outer product uh models for language by Smolenski and other people. Um
Now of course we don't have access to P_ so P_ is the two distribution of the maybe the context or whatever in the world. We don't have access to that. Uh what we have access to is uh a data data set of size uh T_ from this distribution. And so for example where one thing one could do is to estimate this weight by simply counting for each X_T_ how many times it occurs in the data set. So we form a histogram.
And with that what we get. So with such a histogram where you compute, remember X uh sorry uh H uh comma Y is this stuff, and if you block um the memory matrix I just defined, you get uh this quantity uh on the right hand side, and if you simplify these
uh under the assumption that the embedding vectors are fairway orthogonal in the input space and the output space, okay. So these uh a w a warmup where we consider the D sufficiently l large so that you can actually pack orthogonal vectors uh in D dimensions, okay. Exactly, this is very important. Uh then you get this of course uh uh these in our products between input embeddings is uh Dirac delta. Okay, this is also Dirac delta, so you get this, which is equal to zero.
Uh if uh X uh is different from I or Y is different from uh F_ star I, otherwise it is the probability the empirical probability with which you observe I in the data set, okay? And you are summing these over all possible I_s. So you get this. And uh well, so if you look at this quantity you're looking at what is the act-max on Y of this quantity of course it's equal to this.
So if you saw uh X at least once, so if P_t is greater than zero, this quantity of uh w uh uh maximise of our Y is m uh it uh is going to give you um uh F star uh X, otherwise well it's zero. So the maximum is uh o
Uh and is uh F uh star uh the maximum is F_ star X_ if you saw X_ at least one time in the in in in during training, otherwise well everything is zero. Uh the syndrome is completely zero, I you don't know. So you you predict uh you don't know what to predict.
Now if you pack this and you try to compute what is the test the the the generation of this stuff you're looking at probability that for a random test point X your memory model uh disagrees with the ground truth F star. Okay?
Of course, given that F_ had is given like this uh this is precisely the sum of these probabilities uh um times the probability that X_ is not observed in D_T_ Okay, so you have a data set, a high data set of size T_ the probability that you don't observe X_
Even once, of course, it's uh one minus P_X_ the power T_ okay, and you can simplify this uh you can approximate this uh this way, which you can identify as the the the derivative of this quantity with respect to T_ Okay, save you all the details, but we finally get to this quantity. So the error varies as T_ to the minus C_ where C_ is an exponent which depends on the the tillness of the distribution of the X_s. So if you assume that the X_s are
these are from a Z_F_ uh distribution. Then these uh you have this uh this uh calculation and what you get is the fast toy, not a scaling law which actually results for something which looks like a transformer. Uh yeah so so this uh law uh so this recovers uh uh
As uh this this recovers a generalisation of for something which was proposed by by uh Hutter in two thousand and twenty, two thousand and twenty one but to uh uh Hutter considered D for to infinity. Yeah, we just want D to be sufficiently large so that you can pack uh n dimensional vectors uh uh and m dimensional v vectors orthogonally in Rd. Okay, so
Here we go, we have the fed or a Fesanova scaling law. So the th the the irreducible error E_ of the eig of your memory model varies as teach the minus C_ where C_ some exponent.
Now okay, we want to do something more interesting, so we want to get scaling with respect to data set size and also with respect to the size of the model. As I said in the beginning, the size of the model is going to be controlled by the size of the embedddings that you us of course if you have very large embeddings, it's easier to separate different things. Uh if you have uh smaller embeddings where you might start having collisions where different things uh they map to vectors which are very correlated.
So we like this condition uh which required that D be bigger than N uh and M. It was a softer condition which only requires that uh that that also that removes the d the condition on D_ but we only want that those vectors are orthogonal in an approximate sense. And where there's a textbook way to do that, you simply take random vectors
Um uh and you can consult the the the the the correlation between distinct embedding uh vectors. By this case that's one of a square root of N_ square root of Z_ for distinct uh indices. Otherwise it's equal to one. So you sample distinct I_I_D_ on on the units here in R_D_
Now with with that uh we with this uh relaxation everything goes on as before, but now there is a possibility remember this is only holding with high probability, okay. So it's possible that uh um
Uh you might get uh different outputs or different inputs okay which kind of by luck they have a a high uh co co-relation. Uh because you have many many outputs, okay, we take the if we take the maximum of uh a bunch of tiny stuff, it can eventually be very big. So this for example is an example where okay you take uh random uh uh uh uh embeddings uh for

uh uh embeddings uh for the input and the output, and you can be in this unlucky case where the the predicted output for an input uh X equal to one is uh w uh w y equal to three set of uh y equal to one. Okay. So uh in this law
Uh E_ we did the minus C, we are going to have a second term which is precisely controlling for the fact that using the random embedding you are going to from time to time uh make errors, okay, and this is what is going to give you like uh uh the this is what the this what to give you uh scaling with respect to model size. Um okay. So
Yes. So okay now, so we generalize uh stuff, uh so now we consider general m uh memory matrix. So remember before memory matrix was simply looking at uh at this output looks weighted by the empirical frequencies for the axis, okay. Now we are going to consider a general setup where the weight could be anything anything which sums to one and is non-negative. So you can decide to weight the memories differently b for different reasons. And it's going to turn on that if you try to learn
This memory matrix W, different algorithm they're going to lead to different ways of weighting the memory. So is Right. going to give you something different from Adam, which is going to give you something different from your favourite optimiser. So if you do that, everything goes on as uh before. And now well the first uh so this are what of our main result. So if you define this quantity
Which is like an L two norm of the cume vector restricted to uh the pre-image over on the the two uh unknown function of the output Y_ what you get is that this error so the the the generation error of the of your memory model uh would be weighting strategies Q_ so defined as a probability of mismatch with F star.
Is given by uh this so here P_ is the true frequencies of the context or the forms or whatever. Are you taking this sum uh over uh a subset of uh of indices. In particular if chi uh and P_ are kind of uh uh like one another, for example if chi is uh the empirical uh version of P_
Uh or a quasi-cauchy p, so if you have an oracle, then you can write this as this composition of the quant the survivor function of p and the quantile function of chi evaluated on something which clearly shows the dependence on the model size here, uh d. Now with such a a result we have uh we can uh
uh obtain the scaling uh low exponents for different algorithms, okay. So for stochastic gradient descent, a stochastic gradient descent in this set-up are basically corresponds to q which simply keeps a histogram of how many times it see different things, okay. So this stochastic gradient descent, so uh with the batch that's equal to one.
So you have uh of course C to the minus C. This term's always there. It's limited by how much data you have. You've by making your model big and you have just ten samples, you're not going to uh be able to solve the problem. So this term is always there. And you have this term
uh whose exponent depends on the algorithm you are using. So for example if you use S_G_D_ you have an exponent which is C_ over two, so it's something between uh z one and one half, which is very small. Compared to Adam you have a much uh bigger exponent. So alpha here is the the tireness of the the empirical distribution of the of
of the data. So it's bigger than one, because you're looking at long tail data. So for example there's a sharp separation between the scaling law for L_G_D_ and the scaling law for Adam in this uh toy uh scenario. And by the way we can recover some other
Uh chirurgical works which have been proposed s as uh a way uh to exhibit no Raskin loss or by uh Eric Michaud and Max uh TechMach uh on that what they call the quantization hypothesis. You can record this as a special case. Um
And actually uh we can actually track uh uh what is happening uh uh with with this moment matrix. So if W_T uh is this um the weight matrix which evolves according to this uh this uh uh uh uh this iterates this uh this iterates this uh dynamics uh um
Gradient descent. So here uh L is the c cost entropy loss and uh p here is uh uh is uh the softmax uh uh uh induced by the h uh x_ uh y s which which tell you the the quality of each output for a given input x_
Okay, turns out there are benefits also. Remember in all of these the embeddings are random and they are fixed on the sphere. Okay, and what is your your learning is how to combine those so weights. So remember the only thing in this model that you actually control is the Q -axis. So how you combine different M_ okay. But the use the the E_s the E_ one up to E_ and and E_ uh U_ one up to U_M_ are fixed.
It turns out that if you actually lend uh the embeddings uh you the embedding vectors you have uh better uh uh scale with respect to the dimension D, but it comes at the cost of keeping track of a large uh parameter matrix which is P times D, where P is exponential. So by lending the embeddings you get exponential capacity,
But uh at the price of uh having to store exponentially many uh parameters during optimisation. And uh so for this problem, if we look at the scaling law of curves for a simple ex uh example of modular add add addition, we see uh that they are all Kapran type with exponents which correspond to actually what we proved uh here as a corollary. Okay uh so how much we have in this?
Five minutes. Okay. Uh okay, I should be fine. Thanks. Okay so what are we saying here? Okay yeah, cool. Now okay so the idea of the proof. I maybe some people are more interested in that. Uh so the the idea of the proof, so what's the test? The test, or you are looking on average uh how how many times your memory model uh produce the p a prediction which is different from the ground truth, okay.
And so what we want to show is that it's given by this quantity on the right-hand side. Now uh for correct prediction you want that the H_ uh X_ corresponding to the true label, F_ star X_ you want it to beat all the other things which are different from the from the true label. Okay, so you have you you you uh uh these quantity which is competing with this uh maximum over the all possible wrong labels. Okay?
Because of uh the the comp the way we constructed the embedding vectors, uh in for large D this uh uh H for the true or label is going to scale as a Q of X where Q is like how much weight you put on X in your uh how much weight are going to put on X. And the noise term is a Gaussian process which has maximal variance A bar square divided by D where A is given by this quantity, okay.
No, the key insight is that uh for large D_ and M_ scaling uh in this uh form, you can recognise G_Q_ as the low temperature um partition function for uh um uh a random energy model in the sense of the data uh um and and all the people. I want you to do this as es uh this identification, it becomes quite clear how to control this uh term.
And well, how does that work? Well for the low temperature limit is well known in statistical physics that uh you are going to have um this partition function for your for your um uh random energy model, this partition function as the inverse temperature tends to
To infinity or as the temperature tends to zero so when you are freezing, uh is going to be given as the critical temperature times this uh A uh subscript here which is uh controlled by the particular optimization algorithm. And so with that uh you can now compute the probability that uh this term is bigger than all of this. So it it becomes
Up to leading higher order terms, it becomes just a probability that Q of uh X is less than or equal to this uh the the p the the participation function which, as I said, is the so you get that exactly the error for any optimal solution algorithm for the memories is going to be given by uh the probability over a random test point X that the weight you put on X by algorithm is less than or equal
gonna equal to this constant which depends explicitly on the dimension d, okay? Uh and okor though, okay, so all of this is stati uh statistical physics inside. But you can make all of this regards by uh using the so-called Bohmian sheets inequality to compute the maximum

It is inequality to compute the maximum of an uh Gaussian process.
And uh so I was told I had five minutes, uh so I think I have minus five minutes now. Um uh so it turns out that in the case of synthetic data the story changes a bit and the scaling laws need to be modified. So account for the fact that data generated by A_I_ contents most of the bulk, but uh if you go deep into the tail, you you ca it's difficult to generate data from A_I_ uh in the tail simply because the A_I_
W w like you didn't see enough examples in the tele-training. And this leads to c scaling loss where instead of having a plateau, you eventually reach a plateau. So eventually you are not going to get any improvement by increasing the amount of data.
And uh yeah, confirming your remarks, so Kappa like uh uh uh scaling laws can be proved precisely as theorems uh in uh the setup of associative memories which are a proxy for at least some of the aspects uh in real transformers. And the second insight is that the the exponent uh in the Kappa like Kappa uh type scaling laws, they depend on optimisation choices so for example i at least in this setup
The uh the step size and Mm. order hyperparameters are going to have an impact on the exponents uh with respect to the model size. And uh this uh the key uh references for this work. So thank you, and sorry for going slightly above time. Time for some questions before the break.
Hi uh what one uh small question. So if I understood the model correctly, you're looking at like the classical Hopfield associative memories, um Yeah yeah uh you know. But uh the transformer is more closer to the more dense associative memories. Uh so Yeah. it w Well, it depends uh you can there's a sense in which self attention
can be uh uh there's a duality between self-attention and and uh the so-called dense associative memory so this has been showed by uh Seth uh I forgot your name. So it's uh all you need. So this there uh I there is kind of uh a correspondence it's not an exact correspondence but uh yeah um the the the correspondence more that uh transformers capture up among other things, one of the things they can do is associative memoryisation.
Perhaps not saying this is the only inductive bias of uh transformers, but this is sufficient for it. Hey, one last question, O's. Uh Th thank you for your talk, and uh I think it's a very impressive. Uh maybe a little technical question. Uh on the twenty fourth page. Yes. Twenty fourth slide? Twenty fourth slide, yes. Yes.
Uh uh I don't understand why uh like uh w why why is the algorithm optimising our c optimising algorithm is related to the the cues that we obtain like why atom leads to the uniform distribution in S. Uh uh it's because so for example, at least in the in the case of where my in the case of uh of P_S_ So so this for L_G_D_
This is H_G_D_ for Adam, which is uh it's close to what is called side uh H_G_D_ okay. So for each uh dynamics that you put on W_T_ it's going to induce a certain dynamics on the weights, um on the way you are weighting the m the the the memory making. So this thing here um is playing like the role of Q_ So if you fix a certain dynamics on the on the weights for example induced by H_G_D_ or some other algorithm, it it maps to a certain choice of cure.
for weighting the the so so if you want S_G_D_ and Adam they lead to different uh weight. And we can show it and uh the details are in the paper that uh Adam uh corresponds to such a choice.
So so maybe it's time for our break. So maybe you guys can take this Yes, into sure. the break. Um so yeah, so if you're have posters, please make sure you can put up your posters. There's some blue masking tape to use that, so only use the blue masking to put it anything on the walls. Um if you're in a speaker at the next session, may come early before the break ends and you can test your A_V_ your laptop, um and then I think we're gonna reconvene at ten thirty. Dima, anything else for
announcements? No, no. Uh so so like the general idea, there will be a dedicated poster session later today. But we would like all the posters to be on the wall for coffee breaks as well. So just so that, you know, people could explore. So that's only comment. Alright, see you at ten thirty.

You

We'll get started with a a series of contributed talks. So the first one will be given by Chris here, and uh Chris uh must come from U_C_ Berkeley. So alright, take it away Chris. Thank you so much. Great. Can everyone Huh? hear me okay?
So thank you very much for the organizers for inviting me to present my work here. I'm very excited to present some kind of new and like preliminary results on oscillators, associative memories, combinationality, and combinatorial optimization. And I wanted to motivate this by thinking about solutions to the binding problem, whether we're thinking about them in terms of artificial neural networks or in terms of the brain.
Um so in artificial neural networks it's known that um if you have representations of different objects, for example a red circle and a green square, you want the different attributes to be associated or bound to the right objects, so that you know that your representation has the red circle as opposed to the red square um in particular. And it's known that, for example, tensor product representations or vector symbolic architectures among others are possible ways of solving this binding problem.
by adding multiplicative structure that can then be summed or superimposed to create a representation of a particular scene. And then in brains, I think it's really exciting that in the hippocampus and enterine cortex, we seem to face a similar version of this binding problem where different information from lateral and medial enterine cortex are creating content and context tags for specific episodic memories.
Of course, another solution to the binding problem, which I think is notable that it's not mutually exclusive, is binding with oscillations. So including this acorn or artificial coromoto oscillatory network that was presented at this conference a few days ago. But this comes from a longstanding practice in neuroscience of looking at oscillations, which are widespread in the brain, and thinking about their computational function. So in terms of synchronization as one possible mechanism.
And so now I want to present a couple ideas that are tying these two ideas in a concrete way. So the first for binding by multiplication are resonator networks, which are a compositional associative memory. And one thing they can do is unbind entangled representations. So here I have a demo and this is based off of previous work by myself and others where we take a visual scene, for example, with five different objects, and we want to figure out for each object its position.
and its identity within this visual scene. And what you can see is that we have three different associative memories here, one for horizontal position, like context locations, one for vertical position, and then one for different objects. And then we have an outer product matrix along with higher order interactions between each of these code books or different factors to create a self-consistent solution for what we're estimating is in the scene.
So the interesting thing I think that might be interesting for those working on dense associative memory is that we're working with these higher order interactions within an associative memory model and that these higher order actions also give you better than linear scaling in terms of the time and in terms of the number of neural memories that you're needing to store.
So just to show this animation in a little bit more detail to say how we're finding one object iteratively at a time and performing explaining away, you can see here are just the different inner products with different items in the associative memory for digit and for position at every time. And at first it's a little bit uncertain of what object to converge to because it needs to figure out, it's a chicken and the egg problem to figure out, okay, if I want to focus on one particular digit.
Which particular location should it be in? But over time it's able to narrow down these solutions that it's searching for in superposition to come to an estimated result.
So notice that this is all working in discrete time, and so we wanted to see if oscillators were able to improve the performance and bring in a better principled understanding of how these networks are able to work. And so for here, I've turned to inspiration from some older work, so like literally taking a screenshot from this older paper from 1987 in the first NURIPS, where Andre Nist is promoting what's called a phaser associative memory. So if you're familiar with the two-state associative memory model with
with minus one and plus one as the two possible states. Then you can think of the phasor associated memory as the generalization to the complex plane for all states with unit magnitude. So that's all a phasor is. It's a complex number with unit amplitude. And in this paper, Ness proposes several types of dynamics, but the one I'll focus on here are continuous time parallel evolution dynamics where the angle of this phasor, which is denoted as this like slash SI.
is updated by the sign of the difference between a pre-activation term from other associative memory states, and then it's weighted by the amplitude of this particular pre -activation. So it has a fixed point when these terms are equal to each other and you can create a associative memory with outer product learning.

associative memory with outer product learning rule where the weights are Hermitian symmetric and show that it converges and so forth. And I use this to motivate how we're going to create a what I call factorized oscillator associative memory or foam is just a convenient acronym for this. Where if we want to take the principles of a resonator network and implement them in continuous time, then if we suppose that we just have two factors for simplicity, X star and Y star, and X star and Y star come from a discrete set.
set of possible options. So you can think of if each of them has m possible vectors that they could be, then the total search space in this case would be m squared.
And our goal is to factorize S into X star and Y star, so to figure out the optimization. It's a bit like integer factorization where once you have the solution, it's easy to verify it's correct, but until then it would be difficult to find or to search for the right solution. And we do this by factorizing or evolving these phase vectors phi X and phi Y so that they converge or that they're similar to X star and Y star.
And we do that with dynamics that are very similar to those that are presented in the NIST model, except here we now have this interaction or multiplicative interaction for the X term based off of the estimates for Y, and then the Y is similarly coupled to X. So it's a coupled oscillator that's also coupled in the sense that we have modular structure within the attractor network where different modules correspond to estimates for different codebooks and different vectors.
And we can also use an outer product learning rule to form the dynamics.
So what we find is that this network, it exhibits higher memory capacity compared to the baseline resonator. So let me explain what's going on in this figure. So as we increase the number of patterns per module, then the search space is growing as m squared, because we have two factors. And we just look to see if it is closer to the ground truth solution for the factorization compared to any other factor. And if it is, we call it accurate. If it's off, we say it's inaccurate. And this is just applying the empirical accuracy.
for different dimensions, for both the continuous dynamics and then the discrete time dynamics. And what we find is that the continuous time dynamics, regardless of the improvements that you get in dimension, are having a higher accuracy or the cutoff for which they can solve problems accurately is going to be at a later or a higher number of patterns per module so they can work with a higher pattern load. And so this indicates that the memory system, we can say it has a higher capacity as a result because it can deal with larger.
factorization problems even with the same dimension. And we were curious as to, this is an intriguing result, but why is this? So previous work from Spencer Kent at the Redwood Center noticed that as the problem gets harder, so as we're in this regime where the trajectories are failing to converge, we're actually seeing that there are limit cycles that are happening. And we speculated this was because of these discrete jumps that happen from normalization in the discrete time dynamics.
So we wanted to see if it's possible for the continuous-time dynamics to alleviate or address this problem. So what we did is to look at in both low-pattern regimes and then high-pattern regimes, so for increasing number of patterns, how the oscillatory dynamics are able to deal with convergence properties. So I think...
The first two limits of the stable case with low patterns and the later case with high numbers of patterns are more or less what you'd expect, in the sense that when stable patterns is very quickly converging to the right solution and when there's too many patterns, it has a limit and it's not able to do well. But the surprising fact is that in this regime where there's a higher number of patterns than the discrete updates are able to account for, we have what I term this benign instability, which means that the pattern is not...
not exactly staying at like one particular pattern, but it's staying within the right basin of attraction. So you can also see this from the correlation across time and the accuracy. And this is why we speculate that it has a higher capacity as a result. So finally, I just wanted to, so this is the main result, but I wanted to share a couple other things that we found exciting. One is that with adaptive step size solvers, you can simulate these systems efficiently in terms of a discrete.
yet a simulation with adaptive step sizes and in doing so the accuracy curve to get to 100% in a regime where both this oscillatory memory is able to do well and where the discrete oscillatory discrete systems are able to do well it's a comparable in terms of the number of iterations so this shows that there are efficient implementations and we're also curious being in a neuroscience environment on how oscillators could be implemented with neuromorphic computing devices given
even combinatorial optimisation problems that are being solved by Ising machines. And in addition to that, we can also solve discrete optimisation problems by using sub-harmonic injection locking, which means that we add an extra term to the dynamics in order for the phases, these are unwrapped phases to converge to discrete roots of unity. So this shows that the continuous dynamics can also solve discrete optimisation problems. And finally, we can use these for more than two factors. So
So there's a long history and associative memory of using hopfield networks or hopfield-like networks to solve combinatorial optimization problems such as traveling salesperson. And here we consider a subset sum problem where we want to say we have a binary choice of including a particular item in a set or not, and we want to see if there is a subset that sums to a particular target. Here the answer is that 3, 17, and 22 is the correct sum for 42.
And then we find that our network is able to converge in terms of its inner product to the decisions to include those factors to solve this particular problem. And so we're very interested in investigating further scaling and I'd be happy to talk to you about other like scaling and robustness results that not including in part of the talk.
So in conclusion, we started off with thinking about binding with oscillators and then binding by multiplications, which are two kind of key ideas that emerge not just within thinking about neuroscience, which is my background, but then also in thinking about artificial intelligence. In this work, I think the exciting connections we found are that firstly, oscillatory dynamics are improving memory capacity, regardless of the dimension, you see a consistent ability to increase.
is the number of patterns and still factorize these systems accurately. But in addition to that, this multiplicative structure is contributing compositional structure to the associative memory models. And so there's a lot of open and interesting questions as to how you can use this multiplicative structure to create more interpretable representations and structured representations that will generalize to new kinds of cases. I've shared briefly some additional results, but hopefully now the eventual title for...
oscillatory associative memories facilitating high -capacity compositional inference makes sense in light of the claims that I've presented. So with that, I'd like to thank my collaborators at the Redwood Center at UC Berkeley more generally, and then thank you for your attention and the organizers again for this opportunity to present this work. Time for some questions.
I've a quick one so with the phaser network do you actually have a Liapunov function for that network or is it or do you have other types of dynamical behaviors? Oh, great. So the original phaser network has a Lyapunov function in the sense that if the weights are Hermitian symmetric, you can show the proof of how it's descending the energy function. In these like coupled like modular attractor networks, we're not aware of an energy function because you can show that if you write down the states, they're actually asymmetric coupling.
uplinks, which makes, you know, the usual strategy difficult. Like intrinsically, I didn't talk about this too much, but if you just look at what it would be as if it has the hop field energy function, and which it's not always descending, at least in the low pattern regimes, it looks like it's monotonically decreasing, at least numerically. But then when you have higher numbers of patterns, that fails to hold. Okay. All right. Let's thank Chris again.
And uh can can have the next speaker come up and set up. Is it? Yeah. Hello?
All right, next talk will be Chris Hiller. Hi uh thanks uh for letting me speak here. Uh I'm gonna talk about a connection between uh the classical so we're going back to the eighties, between classical uh Hubble networks and uh graph isomorphism. We'll get there uh uh after first presenting some
Some classical s stuff that uh we worked on. So I'm really interested in this problem. So suppose I give you three of these pictures, what are they? There are three graphs. We'll call the graph as a binary vector. What would you guess as the fourth picture? This is called generalisation. So it's kind of like a mini IQ test. Does anyone here have an idea what it could be?
It's this one, right? This is kind of the missing one. So these are called three cliques. That's fully connected graphs uh uh uh sub-graphs with three vertices. They're called three cliques and this is all three cliques in a four four-vertex graph. So I'm interested in this in this problem. How can we get a a Hochf classical Hochf one uh network to learn how to do this. Um so just for uh to set ideas here. So this is uh we're going back to the back to the eighties again here. So what I call a Hochf network is a symmetric weight matrix of real numbers and a threshold vector. Um

numbers and a threshold vector one for each neuron. The states are just binary vectors. This energy is very important, it's the statistic telling you essentially how likely or how stable a pattern is given the parameters of the network.
What is a dynamics update? This actually goes back to Macaulay-Pitts in nineteen forty three. Uh it's also perceptron and so forth. It's it's basically uh you look to see what your feed forward input is from your neighbours and you check to see if that's bigger than a local threshold. And that determines whether you fire or not at a particular neuron. That's a classical way to understand dynamics. Uh and it's really important in this of the hot field uh one of his main insights in eighty two was that uh every initial state in any
mean Hartfield network will converge to a fixed point of the dynamics after a finite number of steps. And that's proved by essentially showing that, yes, the energy is a Lyapunov function for dynamics and so dynamics does not increase energy.
Um in the classical version of the Hopfield network he he uses something called the outer product rule to one shot fit the weights. Uh I will skip there's many other ways to fit w uh the weights in in a classical Hopfield network but I'm gonna skip them and just jump to the the end here which is this is an uh an uh an objective function that we've been using in the Redwood Center.
Uh for theoretical neuroscience at Berkeley for a while, uh since two thousand twelve, it's called minimum energy flow. Uh if you wanna know more about it, I I recommend you look at these two papers at the bottom of this slide. Um but here's the summary of this pr of of the work up until I'm gonna the the work I'm gonna talk about now. It's that uh if you
If you consider all k-cliques as patterns that you want to store, turns out that you can find a Hopfield network, classical Hopfield network, which stores all k-cliques in graphs robustly by minimizing this objective function. So another way to say that is that you can have a Hopfield recurrent neural network that performs Shannon optimal error correction.
And I'll show you an example of that in a second. And then another corollary, which again, these are all the same problem, is that a Hopfield network can learn to solve the hidden clique problem in computer science. So what I mean by the hidden clique problem
So here's here's like an energy landscape a dream you know a dream energy landscape for this problem. So energy is on the y axis, states are sort of on the on the x axis. And of course given a a pattern so for instance uh look at the the pattern on the left here, that's a that's one one edge removed from a fore clique in a graph. Uh the idea is that could I make a landscape
Energy landscapes such that that that noise for clique through the dynamics goes to the to the complete four clique. Okay and and more generally can I put all four cliques as energy minima of this landscape. That would be awesome because then you would be able to do this which is solve the hidden clique problem, right? So here's a on the bottom here that's that's the adjacency matrix of a clique. That's what it looks like when you take a clique and you you
make a j60 matrix of it above is a something like a 20% noise remove and add edges at random of that clique and what I'm saying to you is you you plop the hidden clique on top of the network the dynamics recovers the original clique denoises and creates an original clique and the point here is that clique 1 clique 2 clique 3 are something on the order of you know 10 to the 23 different cliques when when you even have a small graph of size 80
So properties, so I think this is important to just go over really quickly, super quickly, is that suppose I have 40 cliques in 80 vertex graphs that I'm trying to learn from data. So suppose I have 100 cliques that I train on, I'm not going to learn all cliques from that. If I have 1,000 I start to almost learn everything and 10,000 gives me the entire set of 10 to the 23 as memories.
Just to see this visually, so imagine all cliques, all 40 cliques on 80 vertices are these little squares, and that little red dot is the training samples that got me to learn all of them.
Uh another property uh very quickly is that these weight matrices that are learned look very very special. Uh they in fact they they end up being three parameter uh families of weight matrices. So on the left here at the bottom imagine I I train on a hundred cliques, I get some a noisy weight matrix. I train on a thousand cliques, I get a less noisy one. And then ten thousand I get this three parameter kind of exact looking matrix. So now how are we gonna generalize this? In the last ten minutes I'd like to generalize this to
what we did in the workshop as a preliminary work.
So what is graph isomorphism? So recall that two graphs A and B are isomorphic if you can relabel the vertices to go from A to B, right? So on the left, that's the same graph as this because the pictures are the same, but their vertices labels are different, which means their adjacency matrices are actually related via a permutation matrix P. This is kind of the hidden structure that you don't know. You try to, is there a P that makes A go to B? And that's the complexity of this problem is find that P. Is there a P or not?
not that makes a the same as b. 'Kay? This called graph isomorphism classical problem. So let's look at this in the in uh in the lens of our clique stuff. So think of like a single clique, that thing on the right is a single clique, three clique in a four node graph. If I act on it by permuting the vertices, I get a collection of all cliques. And in fact that's the isomorphism clas class of that clique. 'Kay? That's the isomorphism class of of of cliques. And so now the question uh again this m may sound
Crazy, but we asked it, what other isomorphism classes besides the set of all cliques can be stored in a Hopfield network? And it turns out that we still have not found one that doesn't get stored. So this is an open conjecture of ours that essentially every isomorphism class of graphs has a corresponding Hopfield network which stores that isomorphism class.
Um so an another question that you know given the history of this of our work uh do you need only a few number of samples to to generalize to all of them? Uh yes, uh so here's an example, there's a class of graphs called Paley graphs on eight vertices, I pick one of them and in the isomorphism class there's something like twenty thousand other ones and on the X axis I'm just giving you number of training samples to t to to train on and in orange you're seeing the test error mean ha
over all the isomorphism class, how many did you get right? And with only uh something like eight hundred uh samples, you get everything. And just just to be clear, one thousand at the at the lower right, there is five percent of all the the twenty thousand. Um you can do this for circular graphs. It kind of fun, do this all day. Uh do this for here's a random graph on nine vertices, just pick a random graph. It has this particular one has three hundred sixty two thousand different isomorphic
Graphs do it. And even here, look, you only need 0.3% essentially of those examples from that class to store all of them. So that's really exciting. Another question is do these learned weight matrices that we get also limit to what looks like a three-parameter family?
Uh and in fact we can prove this is true, that yes indeed they do. Uh so here's three examples after training on some number of samples what the matrices look like for three different classes that uh we we hadn't we hadn't uh exposited on before, bipartite, circulant and Johnson. And indeed they do look like these three parameter uh uh families that we got in the in the clique case.
And this is something we have the inventor here of dense associated memory. I'd love to talk to him more about this finding. We wanted to ask the question, like what if you threw samples of isomorphism classes to a dense associated memory and what kind of learning figures do you get? And we got this one on the right versus, you know, what our...
categorical ones look like on the left. This was just a particular Erdős-Rényi graph that we chose at random that had 180 isomorphic graphs to it. And here's what we got when we threw a dense associated memory. And I'd love to talk to Dima about this and others to understand if we're maybe we're not doing this right. I'd like to understand better. This is why this is a preliminary work. But we're very excited about
um, about this final final aspect of this of this uh of this work, which is I think quite, you know, quite exciting that you could maybe say something agou about graph isomorphism using uh classical Hopfield networks. So what does that look like? So so we we call this the not graph iso not graph i isomorphic check. So what does that mean? So say I have two graphs, A_ and B_
I'm going to, for A, I find this special matrix, this weight matrix that stores all of the isomorphism class of A. Great, I do that. And then now B comes in. Here's B is another graph. Well, I can just check to see if it's a fixed point of the isomorphism class that we learned. And if it's not, right, then we know that they're not isomorphic.
And so in fact you can uh you can work out that this is, you know, on average this is not a bad way to to determine if your graphs are not isomorphic. Uh and I think uh the connection to graph isomorphism for Hopfield networks is I don't think has been realised in this form. So I would love to get people's um thoughts on on what they think about this approach uh using these classical methods.
And yeah, so I'm newly at a company called New Theory. If you want a t-shirt, come talk to me. We are also hiring, so please chat with me if you're interested in new opportunities in the world. So thank you very much for your attention.

Questions? Uh No. I would like to to comment is it me? I would like you to comment a bit on the note that you put in the in the bottom of one of the few slides b that one. So um I didn't really get if you have spirit states si with with in the setting. Because i if if you have that thing wouldn't work right?
Yeah, exactly. So I kind of put it even in this picture here. You see the top there? Yeah. A little snuck in some spurious states. So yes, these structures will store all these combinatorial objects, but you will not be able to avoid these spurious states and you will not be able to avoid them here in this graph isomorphism problem either. So...
That's the problem, right, for the for the last uh That's right, for the that's conjecture. right. That's why it's not graph isomorphism check. Oh, okay, so I Yeah. understand. Thank you. Good yeah, good question. Okay. Let's think uh let's uh one more question. We quick. And if the next speaker can come up and switch over while we're taking the question, that'd be good. Uh yeah, thank you for the talk. Um do these earliest memories Can you hear me? Yeah. Ah.
Uh do the spurious memories maybe give you like a weaker notion of equivalence? Like I dunno, Weiss-Feller Levin equivalence of graphs? Or like are these spurious uh graphs still somehow related to the graph? Or is it just some random graphs that I put in? Right, right, that's a good question. Um so
This is preliminary work. We haven't, you know, worked this all out. But I would say that there is a deterministic relationship between what the spurious minima are for a given graph isomorphism class. And we have some ideas, but we haven't worked it out. But that's a good question. I mean, one thing I can say is that if you
If you took, like, the number of vertices to infinity, then it does appear that this actually is like a generic graph isomorphism test. But you're gonna have to g y you know, go to the infinity limit basically, yeah. 'Cause it because of the spurious minimum, yeah. Thank you. Thank you. They'll put it up on Okay, I think we next we have a zoom talk, is that
Well, am I audible? Okay, awesome. Are my slides visible? No, we don't see your slides yet. Okay, I have shared my screen. Yes, this is actually.
All right. Hi, everyone. I'm Akshat Gupta. I'll be presenting our work titled How Linearly Associated Are Memories in Large Language Models. And firstly, apologies, I could not be there in person. This is a preliminary work, so I'm hoping that as a part of this workshop, I'll be able to get some feedback, comments, thoughts from our audience that is way more.
knowledgeable about this uh topics than i am and i'm happy to also chat offline um so yeah so
So motivations. So where this work started was it's a follow up to a paper called Rome, which is a popular sort of paper that proposes the knowledge editing method Rome, which is titled Locating and Editing Factual Associations in GPT. And they treat, well, what they say in their paper is that they hypothesize the second MLP matrix in the feed forward module as
type of linear associated memory and how they show that is that well if the second MLP matrix is a linear associated memory and if we want to if we have a fact that model recalls for example the capital of Malaysia is Kuala Lumpur and we wanted to change it to Singapore can we do that by swapping out a single value output from the second MLP matrix
And they were able to show that. So then we started thinking, well, how appropriate is this characterization and what are the features if the second MOP matrix follows?
a linear associated model what would be the feature of such lamb model and can we characterize that so that's kind of the motivation of our work and our plan of attack here is that we represent three different variants of linear associated memory models and in each variant we progressively relax certain constraints until we're able to observe the behavior that we see in LLMs.
And then we make certain conclusions and what would be the implications of such a thing. So just to...
Bring everything together on the same page, we're looking at decoder-only models where each decoder there has an attention and an MLP module, and each MLP module has two MLP matrices, an up-projection matrix, and a down-projection matrix, and this second MLP matrix is what's referred to as or hypothesized as a linear associated memory with the inputs as the key vectors and the output as...
as the value vector and so yeah so this is kind of a illustration of exactly which matrix in the LLM we're talking about
And mathematically, just a quick background, we refer to the K vectors as K or so the K vectors represented as K and the value vectors represented as V and the linear associated memory as W, then the memory storage mechanism in linear associated memories is it's an outer product of the keys and values and the memory recall mechanism is we multiply the corresponding.
corresponding g vector by the stored matrix and we get back a value vector so right here i want to uh propose like the first variant that we look at which is an ideal linear associated memory with perfect recall so as soon as we have this perfect recall condition on the linear associated memory model that we're considering
um we want this bj hat to be equal to bj which was stored with the corresponding key vector and this perfect recall condition comes with an orthonormality condition which is that the key vector used to store the memories should be orthonormal and that also caps the number of memories we can store
because there are only so many orthogonal vectors in a vector space. So that makes us immediately reject this model as being a valid, as being a model that appropriately explains the LLM memory recall behavior or the second MLB matrix. And so we move on.
Then propose a second variant where we make some relaxation. What we say here is that, well, let's see if a linear associated memory model with approximately orthogonal key vectors aligns better with how we see memory recall happening in LLMs at a higher level.
And this approximate orthogonality immediately allows us to store way more memories than the dimensionality of the key vector space. It also links back to the idea that in high dimensional spaces like the ones we're dealing with in LLMs, there are way more approximately orthogonal vectors than exactly orthogonal vectors. So like high dimensionality and
The approximate of technology also allows us to recall those stored memories with high fidelity. So then we ask the question, okay, does this
variant where we say that we have linear associated memories with approximately orthogonal t vectors. Does this align with how factory call seems to be working in LMs? And what we need to make an assumption here, which is that we need to define what key vectors we're considering. So if we also say that the key vectors, we can consider any token representation as a key vector for this linear associated memory matrix.
Then the appropriateness of this model just depends on if the representations are orthogonal or not. So what we measure is, what we check for is the average angle between the representations corresponding to the different tokens that are input to the model.

tokens that are input to the model and we check this in two scenarios in one scenario scenario one we take two random tokens from the same context and we look at their representations at the input of the second MLP matrix and we calculate the average angle between them and in the second case we look at two random tokens from two different contexts so they they do not so they belong to two different inputs
that were given to the model and we look at if they seem to be orthogonal or not so these results show
The average pairwise angles between internal representations at the input of the second MOP matrix as a function of the different layers in the model for GPU to Excel and Lama to 7 billion. And we see that they're far from being orthogonal in both the models.
And we also look at representations for tokens that were selected randomly for different contexts, and we see orthogonality seems to increase, especially for LAMA-2, but this indicates to us that the approximated orthogonality condition for key vectors may not be what's going on here in LLMs.
Basically what we conclude is that either we cannot consider every token representation at the input of the second MOP matrix as a key vector, or we have to let go of the approximately orthogonal or like the representations are not going to be approximately orthogonal.
And while we also want to move beyond this model because we care more about factual associations and thus we move forward and look at how factual associations are stored in LLMs. And so that's why we look at a third variant of linear associated memory model where we say that the subject open representations are the key vectors.
um so let's say going back to the starting example we're editing the fact that the capital of Malaysia is Singapore now rather than Kuala Lumpur what the Rome paper does and a lot of follow-up works is that they look they take the representation of the token Malaysia at the input of the second MLP matrix as the key vector and then they swap the corresponding value vector.
So we're saying, okay, let's look at this variant of a linear associated memory model where the subject opens are, or their representations are the key vectors. And under this, under this
model modeling features uh we asked the question well what kind of associative memory do we have here do we have orthogonal key vectors well if that's the case we would have perfect recall but that model can only store a fixed number of memories or do we have approximately orthogonal key vectors which will mean that we can store a lot more memories but they would
And they would have minimal process, which is good for knowledge editing because we can just replace one stored information with the other. But then sometimes we want the implications of edits to change as well, which is what we call referred to as a full effect sometimes, or are the key vectors going to be non-autogonal completely?
So we test for that, basically looking at the average angle between representations corresponding to subject tokens and here are the results for that. The first row is...
We graph from the previous variant where we had the representations of random tokens as key vectors and here we have the representations of subject tokens as key vectors. So we see that the orthogonality decreases for subject tokens compared to randomly selected tokens, which means that at the input of the second MLP matrix, their representations do have some sort of overlap, some sort of cross-dock.
which is in a way also expected if we expect the language model to be encoding some sort of semantics in its representation orientation. So to conclude with this study, if
We think that the second MLP matrix in LLMs is functioning as a linear associated memory, then the model that fits the behavior that we observe is that the second MLP matrix is a linear associated memory model where only the subject opens our key vectors and they are non-orthogonal and will have high crosstalk.
and this means that editing representations will lead to large ripple effects which means that if we edit one thing we're likely to change something that is connected to the fact and
Then we can study the implications of this and this can be used to do some sort of editing prognosis, which means that let's say we want to edit a fact E and we have a given set of protective facts B from B1 to BN where we don't want them or any of their implications to change. So does this mean that the angle of measurement between the representations of the fact E that we edit and the fact.
The PI that we want to preserve can tell us the extent of the ripple effects. And we use a metric divergence to measure the number of facts related to the protected fact PI that change after editing E.
And I'm not going into detail of that metric because of the lack of time here, but what we see is that, so in this plot we show the angle between the edited fact representation B and the protected fact VI and the mean divergence in percentage. So we see that as the angle between the representations of two facts decreases.
We have a much higher mean divergence, which means that the facts related to the protected fact B.I. change more if they have a higher similarity.
In conclusion, if the linear associated memory model is applicable on the second open matrix and describes the behavior of LMs and the model that fits it is that the representations of the subject tokens should be the key vectors and they have high cost or low or the tonality and coercive representations are interconnected and we do see ripple effects.
um due to editing but just this angle between the representations of different factual associations add the layer that's edited can be can be used as a metric to predict the extent of the ripple effects um so yeah that was uh that was it for me thank you for listening and happy to take any questions uh right now or offline
Ta Any questions from the audience? Uh one question in the back here. Let Hi. Can we think about your linear associative memory in terms of Hopfield model? And if so, is your system in the regime where you have spurious patterns? I'm just asking due to you mentioned that there's a lot of cross talk between the patterns and a lack of orthogonality.
I'm not sure I have thought of them with respect to harmful networks and I'm also not an expert in that so I can you repeat the second part of your question Yeah, so just to give a little more context, in Hopfield model when you have enough patterns stored
Then at some point you'll have a lot of cross-talk or correlations between the target pattern that you're trying to recall and the rest of the patterns. Right, so that's what reminded me of uh your system where you have many um a lot of correlation cross-talk between the patterns. So I was wondering, can Yeah. you can you think of your thing in terms of spurious patterns?
I mean, I think that's what we're getting at. But also, I don't want to get too ahead of myself because this is an empirical study where we kind of like the way I want to frame it is that we're looking at a memory matrix given to us and we're seeing if a linear associated memory fits it by looking at its implications empirically. So if we can definitely think of it as how to.
network with spurious correlations and cross-talk happening, but

happening but um i i would say like i don't think of it as mathematically accurate it's the only reason i'm hesitating Shot again. Thank you. And we'll set up for the next speaker.
Okay. Next speaker will be s submitted from I_I_T_ Hyderabad. Um okay, so hi everyone. So today I'll be presenting our work uh of can memory networks play a role in task-specific modulation of neural circuits, right. So this is done uh along with my collaborators Christian, Madhumita and my advisor Professor Vineet.
Right, so um before I get into the main presentation, let me just give a brief overview of what we mean by task specific modulations. Right, so we know that the brain can actually do a do a wide variety of tasks, right? And um Yep, so the brain can actually do a wide variety of tasks, and in many cases we know that those tasks actually uses s uh no.
those tasks actually use the same base neural circuits. So one example of that would be uh cases in the hippocampus for example where uh you have the place cells and the and the same place cells actually get activated for multiple different locations. Right? So essentially what we mean by task specific modulation in this case is it's about the brain re-purposing its own circuitry for multiple tasks without dismantling uh dismantling its uh dismantling its core wiring. So
So we do not want any large-scale synaptic changes here, but brief short-term changes. Right, so is there one underlying model for that the brain follows for such short -term changes, right?
Um so to my knowledge there is not much information in neuroscience literature that actually model um proposes such models. So there are some uh topics known as uh like for example short-term synaptic plasticity that explains it to some extent but there's no clear model for it and especially not on the computational side. So what do we do? We make an educated guess based on what we know from deep learning literature in this case. Our hypothesis is that
Essentially, the brain can store information about the uh about the neuromodulatory changes that happen at a short term, which can actually be stored and retrieved and overlaid on the base network on demand for specific tasks. So let's take a running example for this. Right? Um it's Yeah. Okay.
So yeah, uh let's take a running example for this, where we have um where we have a Oh whoa. So maybe I try to rec um different edit there. Sure.
Okay, yeah, sorry about that. Uh all right, let me just start now. So uh let's take a running example for this. Let's consider a task where the b uh where a network essentially has to classify a given image, right?
Let's find okay. Um See. Yeah. It's working. Okay, now it's working. Okay. Yeah, thanks. Yep. So Uh yeah, let's take an example of a case where the base where the same base network has to be adapted for different tasks, right? And so let's take the base network that classifies uh the input image as just a generic term of say an animal.
Uh we can then train the model on some set of examples to make it for example classify birds, right? So it for this given image it would classify it as a duck. And the same network can also be adapted to uh essentially classify mammals with some different weights being changed.
The ideas that we do not want these changes to last for a long time, but quickly be adopted as and when required. So we want the same set of uh we want most of the ways to remain the same between these tasks and only the ch uh weights that need to be changed for either classifying birds or mammals have to be stored or retrieved to adapt the base network to specific tasks, right. What we propose is that associative memories can actually play a role in mod in such weight modulations.
So this will allow us to actually store and recall on-demand change on on-demand changes oh sorry on-demand seg oh. This will allow us to essentially store and recall the modulations on-demand as and when required. So we can uh so the synapses can be either the m either adapted to classify mammals or birds without having to relearn how to do the same task again and again.
So this, the idea of why we propose this is essentially from deep uh from the um approaches in deep learning where similar architectural ideas have been explored under a different acronym. So essentially this is very similar to what we see in parameter efficient fine tuning methods in deep learning, specifically in low rank adaptation methods. So just a brief overview of what we mean by low rank adaptation.
is that we have a set of pre-trained weights from a base model such as a VIT. And we train a small set of parameters uh as a what we represent here with the delta w matrix. And it is these small set of parameters that are updated and then stored and retrieved for different tasks on top of the base network itself.
So if we actually just see the similarities between these approaches in the uh we have a base network in case of uh deep learning, which is maybe something like a vision transformer. And we have the base neural circuits in the brain which need to be adapted for different tasks. Right, we have the overlays in case of deep learning that would be low rank adapters and in case of um maybe biological systems it would be the task specific modulations that are learned.
What we do not what we essentially lack in the uh biological site is what would serve as a memory in this case. Here's where we actually think that associative memories can directly be plugged in into the overall theoretical framework. Right, so what we do is we uh we tested out empirically for our preli uh preliminary work with two different associative memory models.
One is the standard um modern Hopfield networks and the other is a more biologically plausible model called the predictive coding uh like predictive coding models of memory. So we test with a model called base-PCM to be very specific. And what we propose is this approach where we train each adap where we train adaptors for each different each task separately.
And uh then store these in the uh store these adapter weights in memory. Instead of having um s a specific content, we have the weights themselves as memories. And then given uh task I_D_s or given what task has to be uh essentially performed, we can recall the specific modulations from these memories.
Right. So a few benefits of this is this actually gives us an gives us an end-to -end differentiable approach to actually train uh different uh uh overlays and also suggest a way that the brains might actually switch between different tasks using the same base networks. Right. We test in two different task settings. One is task increment task incremental learning.
And the other is multitask learning. So I'll just come to why we actually use multitask in a minute. But uh let me just quickly explain the task instrumental learning setting now. Right uh so here's the overall framework. We essentially have your uh we have a standard transformer block and we have the two ap two uh overlay matrices that is the

uh overlay matrices that is represented by these delta W_s. So we train different sets of delta W_s uh for different tasks. So for task one we have a set of uh overlays. And this is essentially the flattened um weight matrices themselves. We similarly have overlays for the second task up and so on until the um
Uh and then how my how many uh how many uh tasks we want to perform and we write these weights to memory. So what happens at inference? Uh we g uh we give the task ID or the task identifier and retrieve the weights from the memory th uh memory, which are then reshaped and fed back to the transformer and basically loaded in the base network.
Right, and uh this essentially uh is then used for the in a for the inference of the in input whatever we want to classify. Uh we also look at another use case of multi-task learning, where training is similar to the task incremental setting with an additional meta task of predicting the task I_D_ as well. So instead of knowing the task I_D_ beforehand, we predict this as well using another set of adapter weights.
So in this case we actually have the meta-adaptive weights here which are used to flick the task ID instead of having it known beforehand, right? And then the inference is pretty much similar to the tasking mental learning setting.
So what we see in this case is actually when we compare the quality of beats retrieved from memory versus from disk, we actually see a very little difference between the two. And um essentially uh we see that there's a high uh that memories can be used to retrieve or store rates of models with high fidelity. And one interesting observation here is that when we use uh associative memory models for uh tiny mission here, specifically the Hopfield network,
On this actually an increase in performance. That means uh so for example when we use a ground-truth weights, we actually see slightly lower performance that retrieving from a Hawkwheel network. So this actually indicates that such approaches may lead to you know uh transfer between different tasks. Knowledge transfer between different tasks. Uh we have similar results for uh multi-task learning as well where
We actually see a gap in performance between knowing the task ID and not knowing it. And actually in this case, most of the gap in performance is caused by the task ID prediction, not because of retrieving weights from memory. So conclusion, so what we conclude from these initial experiments is that memory networks may actually play a role in helping
Uh biological systems switch between different tasks using the same basic network. Uh are we sure that this is how it works? Well, not really. We need some more um essentially uh empirical evidence from neuroscience in this case where uh really in vivo experiments would have to be performed. But uh there are a few biological other biological inconsistencies as well when we look at how it may happen in a biological way is that
Uh our model proposes to store and retrieve synaptic overlays directly, which is not really possible in exact biological sense, because these things are usually chemical based. So it's not possible to actually store and uh store and retrieve them directly. There has to be some intermediate stage that actually interfaces between electrical the electrical impulses or that A_M_s can store and retrieve versus the actual chemical signals that uh need to be used for modulations.
Um for future work we are looking at uh um looking at adapting such models in architectures for things like uh domain generalisation or continual learning. And we also can actually study uh such principles for tasks like metal learning and uh in a neural compression, those kind of areas as well. There are uh there are relations that we are currently exploring in these uh settings. Yeah. And I would just like to uh acknowledge the
Acknowledge these organisations here. And yeah, the paper link is available. Thank you. Thank you. Questions? Yep. Uh let me go back here first.
Hi. Sorry, I came in halfway, maybe maybe I've not understood it well. Uh you mentioned that uh when you train and it's a you store the delta weights, Yep. and and then you retrieve it uh based on the task I_D_ that was provided uh as part of the input. Um how is this different from or slash optimise from like Laura adapters that you do uh, you know via frameworks like Laura X_ where you switch out the adapters based on the task that you select.
Alright, so in this case what we are trying to study is whether such switching can happen. So if you think about how it happens in traditional load app, that switching is done essentially with um you know your computer disk. So you store and retrieve dates from your disk essentially. What we are trying to see if is if such switching can be done using memory uh using associative memory models instead of disk based storage. And if that can also be also play a part in training because storing and retrieving from disk is non-differentiable.
Right? In this case you can actually differentiate through it as well. Got it. Thanks. Alright, why don't we switch the next speaker? We we have time while we're switching maybe one more question. Oh one question over here. May I ask what kind of tasks do you have when you verify your model?
Oh, sorry, yeah. What kind of tasks do you have that you show the results of verification? And how orthogonal the adapter weights are for those tasks? So can you repeat the question please sorry? Uh the kind of tasks do you use and you verify your model with? What what kind of tasks Okay. do you have? Uh it's And how orthogonal the adapter weights are for those tasks?
So uh we actually primarily use classification tasks here. So every task independent task is uh every task is an inde independent classification task in this case. So for example in case of uh SIFAR we uh s we do a split like s we use something like uh split SIFAR hundred, right and we split the SIFAR hundred classification to ten different tasks and train one adaptable task. All right, let's thank the speaker again. Thank you.
Okay, our last uh contributed talk th for this session is Ali from uh C_I_S_ L_M_U_ Munich. Mm-hmm. Okay. Yeah. Oh. Let me one sec. This is It's the second second monitor, okay, it's here now.
Hi everyone, uh I'm Ali from L_M_U_ and here I'm here to present uh memolum. Sorry. Yeah. Uh memolum fine tuning L_M_s to use explicit read and write memory.
I'll give you like this. Oh, okay. Yeah, I'm gonna present Memolilm, fine-tuning LLMs to use explicit rewrite memory. And as an introduction, like in standard LLMs, usually when they do their language modelling, they usually tend to their own parametric knowledge. So for instance if we have like a prefix called like dancing on coral is a novel and then it generates an output like by John Doe's Passos. Now
The problem is sometimes this knowledge isn't true, and that's what we call basically hallucinations. And one way around to this is actually what we go for like retrieval setups, RAGs, and we have a set of documents, the knowledge base, which are basically some documents, text snippets that you embed the embeddings or any sort of retrieval setup you want to in a vector DB or like BM25.
And then based on the query which would be sometimes like the prefix that you have here, you retrieve the relevant documents to generate the correct output. Now

correct output. Now the problem of this kind of setup is the unstructuredness of it. So for instance, in the same knowledge base like Wikipedia, you might have the same facts all over different separate documents. So the basic problem would be redundancy like you have similar facts uh here and there. Now
Back to the title, which is self-explanatory, is we have a fine-tuning framework that we're trying to train a model to use an explicit read and write memory. How would that work? We have, let's say for the Memrite mode, we have a document like a Wikipedia page and we feed each of these sentences throughout this document, like scanning the document.
through a instructed uh format like similar of these instruction tuning tags that you see every day and then the model is tuned to generate and extract the facts in triplet format so as i said before we are focusing on having this explicit and structured format so every fact is extracted in this triplet format you can see here
And afterwards we just store them inside this tabular triplet setup, subject relation and object. And every single relation we do have the explicit format. But I should say that we do store an embedding for every single text snippet you could see here, but just for like typos and very close similarities to just make sure we don't miss anything.
Now, how did it work? For memory read mode, we basically have like, for instance, the prefix that we had before. Now the m model would generate an A_P_I_ like it continues its language modelling and then it issues a command of memory. For here it's like commanding the memory to return the author of dancing on coral.
And after this specific API tag that we specified here, the model stops decoding the decoding process and it applies the query to the memory. So the memory should return the relevant triplet to that query. And then there would be a result for that query which would be like the author here and the author would be returned back to the language model.
And afterwards, we will append this closing API so that the model would know, okay, now you have the memory result and you can now continue to your own language modeling as default. And then when the model wants to continue, it continues based on the memory result and here you have like a more rounded result on your language modeling process.
So here we introduce like this API format. We have one for memories, we will have one for memory rights. Each of these two have their own structure that we have to build out some data for this to fine tune our memory.
So based on this API we have here, we use some documents and relations using these doc grid and re-doc grid data sets that are basically corporate that annotated with entities and relations, and we generate two sets of data. The first one would be the memory write training example, similar to the one that you've seen in the previous slides, the first one above.
And they're basically text alongside the related facts of that selected text snippet.
And then when we gather this memory training examples, we fine-tune a memory right train uh fine tune model. And the reason we do that is because in the end the model is going to consume its own memory. So it has to be trained on facts that it generated itself. So we first train a memory right training uh memory right fine tune model to make sure that the model knows its own distribution.
Then, based on that fine -tuned model, we extract all sorts of Wikipedia relations that we could using Wikipedia documents.
Store them in a memory and then we generate a API for memory. So we have the text, we have the potential queries that are based on the annotated data we have in the Docker annotated data and then we get the results. So we have like for instance the Alamia ETA here is a result from the potential memory that you can
that you could have, and the continuation of the text. So that would be the memory read training examples. Altogether this gathered our uh memory Memolum training data that we use to fine tune this whole framework. Now f for some results, um we have the language modelling results here that are basically if I wanna uh give an overview, we have
three different types of perplexity overall perplexity is the general perplexity that you all know so you see that the perplexity even based on the normal language model like the mr7b that we use also got got some improvements but even if you disable the memory so just like after fine tuning we disable the memory so it's simply the language model itself without the memory you still have some improvement and a decrease in the overall
perplexity in normal MAML lab. But also we have this target perplexity and entity perplexity which are basically focusing on those entities or better say whether a model is generating those facts more grounded. So it's more certain on the facts that it's generating and correctly and that you can see it improves by quite a margin in both target entities and target entities and general entities itself.
self. We have like different ablation studies that you could check out in the paper and like we deactivate the memory, change the memory content and see how each of these elements in the whole memory limit framework would affect the results.
But also back to the base that why having this structured memory is that one good output of it would be knowledge editing. Like here we have the results for a 1,000 sequential edits. Like what we do is you have this language model, we apply 1,000 sequential edits, which is actually a difficult task. A lot of these knowledge editing papers that you see are usually based on one or...
or maybe a batch of them. But when you apply sequentially they usually affect each other. And here you could see like we apply one thousand sequential edits and we measure three different metrics. Reliability, which is basically the performance of knowledge editing, the generalisation which you would check if the knowledge edits has been a um applied generally. So you query another format, not
Quite like the edit that you applied, and the locality test, which is you want to make sure that when you apply the edit, you don't harm any other kind of knowledge. That's why you want to also have a high locality. And in average of all these scores, Mellow M gets better score than other these methods. Some of them are like non-parametric, some of them are semi-parametric.
But in general, you could see that this MAML-OM structure would help in terms of like keeping the like original and generalization tests and solve them easily. And also because of that explicitness, you would have also a high locality score as well. One other thing that I mentioned was the redundancy. And that is here you could see the efficiency gains. So if we have those facts.
Instead of storing them in triple formats, store them as text snippets. You would see that you will have like lots of more of the 100% setup. And if you instead of storing those sentences, store the triplets, you can see how much efficiency gain you would have. Like essentially, if you have 10 power of eight triplets, then you would have 20%, you just only use 20% of the memory.
that you would have used if you wanted to use a vanilla RAG. So in conclusion, MelloM helps mitigating hallucinations with especially less popular knowledge. And without the need of like, it doesn't need this fact to retrain new knowledge every time that like...
These language models that you can see every time you have new knowledge, you have to retrain. Now with a fine tuning on the whole framework, you could then just have update consequential updates and with newer knowledge. And this memory structure have interpretability, knowledge editing, compatibility and duplication advantages that you're seeing how it could...
have more advantages than classical methods like rags and so on. Uh also I want to thank my collaborators on this and I'm happy to answer any questions.

Would you answer any questions? Yep. Any questions? Yeah, one over here. Hi, I'm sorry it's me again. Um I just, sort of in generating uh KG's knowledge graph and obviously uh memory uh there is a um underlying need to sort of know how
how big of a chunk you should be using to generate um
Uh j your example showed like uh maybe once a sentence that contain maybe one fact or two maybe that will generate one of these sequence, right? So what's your recommendation on how you should chunk those stuff up? Because some sentences may contain nothing that you want to remember. Mm. Uh in our setup we're actually sc scanning one sentence at a time, but there is a possibility that you might have like facts that are based on multiple sentences.
It usually be the way that we train our model is that if you get like in induce a new fact based on the new sentence that you get, we extract those sentences as well. So for our case, it's a sentence by sentence process. So we want to make sure we cover everything. So if we have a also if we extract any redundant fact, we don't store them like overlay because we already have that in the memory. So.
We kind of make sure of that as well. Yeah, what about those sentences that will contribute to no useful memory? Uh sorry, would you repeat? What about sentences that will contribute to no useful memory? Like things that you would otherwise not extract any memory out of? Uh we just pass them like uh the the memory like if there's no fact inside that
Inside our fine tuning data we already like have those kind of sentences as well. So we just say memorize and close the memory right after. So there's no fact extracted from them. Right, got it. Thank you so much. No problem. Alright, well why don't we thank all the speakers this morning again. Thank you.
So just a couple announcements. I think if you're a speaker, we have a USB stick, so we want to make sure we get your presentations if you're a speaker. And then we're going to reconvene here at 1 .30 after lunch. Anything else? Okay. All right. We'll see you after lunch.









You









Thank you very much for inviting me. So this is a talk about memory mosaics which is work with uh the main author Jiang Yu is just here, so you can ask him plenty of questions. But also Niklas Nord, Bedy Chen from C_M_U_ and Ranajoy Stabukan from C_M_U_ as well. And uh the motivation is that we don't like transformers. There are plenty of things we don't like about them. They they complicated contraptions with a lot of finicky details.
Uh we know that they can learn compositional rules like grammar, which is something new. But we know nothing about why and how they do it, which is annoying. Uh it's a serendipitous discovery. They are no reasons to believe that they're optimal. And also they have a quality cost, but this is not really the focus of this talk. We not trying to increase speed here. So I'm going to describe what we call a memory mosaic.
Then two is something that we understand about how you can actually do interesting rules, it has to do with disentanglements. And three, how well do they work. So one. So a memory for me is something very simple. Uh we stole key value pairs, and we want to retrieve values given an approximate key. So it's exactly what Dima said this morning.
And the only thing I really assume is that the retrieval function, the one that gives you a value for a key is uh invariant by permutation of the thing that's stored inside. And uh basically what you have is a statistical problem now. You can do a Gaussian kernel regression. It's exactly what we're going to do. But it's just the memory. We we could implement memories in different ways, not really the problem. If you normalise the keys, you get a product and it starts resembling things like uh things that we know.
And the idea is that if you have a let's say language model, the task is to predict let's say the next token. Uh we want to have units inside the network which has themselves little predictors. So we want to build little predictors with associative memories. So that's the idea. We have associative memory, key value pairs, and a feature extractor, that's parametric, that computes keys and values.
But the trick so to make them a predictor we're going to say that at a given time the key depends on the past. Can be some function of the past values. The value can peek ahead into the future. So the value is something that comes in the future. So the way it works in practice is that at time T_ uh y one you compute the keys. So I'm going to use a little pointer here. One you compute the keys because you can.
Second, you go into the associative memory, you look at what's stored inside, and you compute an estimate of the value that you cannot compute yet. And at time T plus one you're able to compute the value, and you store a new pair key value into the memory. And we're going to make networks of these things. And what you have to see is that each memory unit is a little prediction machine
And the whole network is a prediction machine as well. So the question is how you decompose a big prediction task into smaller prediction tasks. So the first thing we can do is unroll that networking time. So we have a sequence where we compute the keys at different times. We unroll in time and we get the formula like this that tells you that the output of um a memory unit at time T is going to be the sum of all the previous uh the store values
of just the stem function exactly. And this looks like a lot like mass self -attention with three differences. The first one is that I don't go to T, T minus one. So it's a more aggressive causal mask because I'm peeking ahead so I cannot do attention to myself. There is no distinction between keys and queries. It's a true kernel, it's positive. And no position encoding whatsoever.
So what can we say about this machining over what it does? And uh uh so we want to understand something. The goal was to simplify to understand something. The removing of the positional encoding is basically saying that all this positional encoding, keys, queries that are different is used at the beginning to do induction head and then nobody cares. And and you have to see whether it's a good bet.
Um so we would like to know how you split the big prediction task into smaller ones. And the first thing to look at is the cost function. So the cost function when you have a sequence is the sum

When you have a sequence, is the sum of the negative log likelihood, local cost for each position. So basically it's an area under the curve here. On the left there is nothing stored in the memory, it cannot be very good. On the right there are things stored in the memory, maybe you can use that to predict the future. So basically it looks like this.
And you want to minimise the area under the curve. You could like it like a sum of vertical slices, which is a likelihood. But also a sum of horizontal slices, and that tells you what you want to do is get the memories to predict quickly. With as little theta inside, you want to have a good estimate why of the actual values. So how to make them quick? Well, it's a kernel. You can learn the bandwidth.
You can load the kernel, decide how you're going to build the keys for a particular value. But more interesting, you can learn what to predict. You learn how to split the prediction task into multiple little prediction tasks. And uh this is where there is something to understand. Um Ideally when if you want to make
The memories fast, by splitting them you must split them in entities or sub-problems that are easy to predict in isolation. So it a disentanglement property. It's different from statistical disentanglement where you have statistical independence because statistical independence is not robust when you change distribution. This is different. But you need to split. So, how different and how b how big is effect?
So here is a simple little problem. We call it the three moons problem, because you know that a d so three moons orbit a planet, and you have two astronomers, they're not very smart, they don't know anything. But they want to predict where the moons are going to be. So the first one, by the the brutal one, is making a table and every day it writes the position of the three moons.
And when he sees a configuration of the moons that he has seen, you can read in the table what are going to be the next ones. The smarter one says well no, I'm going to make three tables, one for each moon. And every time I see a moon at the position that I've n seen, I can predict the position of that moon and I put them together. So joint prediction versus independent prediction. And because in that case the moons don't collide.
both are going to work the same way. But one of them is requiring exponentially more data, because the configurations is a discrete multiple of the three periods. So it's an exponential effect. So the question is, can we learn that? Okay, let's make a little uh memory mosaic which one or three heads. Uh it's set up in very simple way. It it has fifty four weights.
So, and uh what you see is that when you have just one head, so the three vertical lines are the periods of each moon and the red one the period of the combination of the three moons, it is data. You need to wait until you see a full set of all configurations, because you c before you can predict. But when you have three heads after seeing one moon, you can predict a bit better. And when you hear, you can predict for combinations of positions that you haven't seen before.
Because you can predict each of the moons, you have seen each of the moons in this position. So basically you do some kind of uh extension beyond distribution. You haven't seen this configuration before. So basically it works. Fifty four weights. Now you hear s people say that you know, transformers they learn grammar because of scale. It's not a question of scale. Fifty four weights, you can do this kind of things.
Now the question is how will they work? Because all this makes sense if if this system works well when you do it on the typical thing that work well for language. So we start small. Memory mosaics for language modelling, first G_P_T_ two scale. So on the left, this is a typical transformer. G_P_T_ two position encoding, let me my thing is it, position encoding, layer norm, attention head, layer norm, fully connected, decoder.
On the right we do the same thing. Layer None, Cmem means contextual memories, a bunch of little heads just the ones that is cracked. And for the F_F_N_ we're going to do exactly the same thing, little memories. The only difference is that for this ones, the set of key values that are stored has it set size, and we go down to run them by gradient. So basically this memory is here.
Our learning things that we collect on the sequence on the fly, and this memory here are learning things that are global to all the data we have. Uh the fact that you have two levels is quite normal, because the data we have is two levels. You have a collection of sequences. So you have things to memorise for each of the sequences and things that are global. So there are some reinforcements like the the the way we uh do the c the keys and the values. The keys is just a leaky average.
of um keys that are computed linearly from the uh inputs. The values, they're just a mix of uh uh something computed at time T_ and something at time T_ plus one. So they can decide whether they want how much they want to look for what basically. And this is going to be trend by gradient. So the persistent ones well they're almost the same except that have they don't have the machinery of the values because everything is set at training time by gradient.
But they're still memories. So um and the work is exactly the same way. So the fact that you can use memories to replace the F_F_N_ is something that's pretty old. It's uh Sainath Sukbata did di this this kind of work in two thousand nineteen. And the uh overall I would recommend to look at the papers of Sainath Sukbata, even though the name is difficult to spell, because it's typically uh showing a lot of good ideas three years before everybody else.
Anyway, for the data, we want to find something where we see a lot of uh semantic and grammatical stuff. So instead of taking general text, we're going to take tiny stories. We call them baby stories, a variant of the Microsoft uh set. Basically stories that are uh that resemble what a a toddler of uh three, four years old could say.
It's a papa, mama, toy, pet, uh weather and that's about it. So it's a very limited world. But the stories need consistency. You know, you cannot i uh introduce new characters. Uh the pets have to have to do pet things and the toys have to do toy things. Has to make sense. And uh you can ask plenty of little questions and if you put yourself in this mindset you can see pretty interesting effects. So you know that this is doing interesting things.
So let's try on tiny stories. So at depth one, one block. So the the mosaic and the transformer, the set-up to have the same number of weights uh th th they're really on an equal basis in terms of learning. At one block, the mosaic is better because because of the fact that you're looking forward, the mosaic can implement a ten-duction head in just one block. The transformer needs two. But when you get more and more blocks, it's really the same.
So, one thing that makes it more the same is that we didn't optimise the hyperparameters for the mosaic. We took those of the the the transformer and put them straight into the mosaic, no change. It's a slight disadvantage, but it's the way to actually check that you're doing the same thing. But now we're going to try to do more interesting things. There is another data set which is simple Wikipedia. So a story, a baby story like this is something like one hundred two hundred documents, max.
And very simple language, limited domain. Simple Wikipedia is written in simple English. It is a simple English Wikipedia. But the articles are much longer, like uh one thousand uh tokens. And uh um it's more difficult, right? So on the x-axis is the token position, and the y-axis the average loss on a bunch of sequences. And you see at the beginning nothing works.
When it progresses, both let's say the mosaic, the mamba or the transformer are learning a little bit about the new distribution, but they they settle at different levels. It's pretty spectacular in the sense that the separation is extremely clear, even though frankly all the three models suck. None of them is very good. But that suggests that in terms of in context learning, something interesting is happening.
So there is a benchmark for in-context learning that's interesting, which is the rec bench by IU Rec and Co, and it's a very synthetic benchmark that is extremely well controlled. So basically you create a lot of artificial languages, each of them probably defined by a random probabilistic method, and you have training languages, testing languages. And the question is, how many training languages you need?
to perform well on testing languages. So the X-axis here, but let's take at the right one, the lower is better. X-axis is the number of languages in uh log scale. And uh this dot dot dot dot curve is a transformer. Uh this is a mamba and all this results were done by the peop the Red Bench people. We just plugged the mosaic in that code and it's a it's a clean sweep, a very serious one, meaning like in one hundred languages we generalise.
The tr transformant did something like two thousand and the Mamba did something like thirty thousand to get the good performance. So that was what was in the paper that we submitted o to ICLEAR. But in the meantime Jan Jou has been busy. In fact Jan Jou defended his thesis uh two weeks ago, last week. And the thesis is on the web, so you you you'll see a lot of uh details uh in the the thesis right now. This is where the things published.

So write down, this is where this is published. And uh the idea was to scale this to the eight bit scale, to a llama three uh small llama three model uh size to see whether how this thing does. Um so eight bit scale, one trillion token, it's it's non-trivial, right? It's it's m you it could be a scale use model uh uh nowadays.
There are some architectural changes that I'm not going to describe. It's m I don't really have the time. They're related to splitting short context and long context memories. And it's not based on the idea of uh a pre-made idea about the fact that these memories are different. But on real observations on the data that suggest that you have to do that. Uh so we trend that. And we look at the benchmark. So the typical benchmark are all these knowledge quizzes that people use.
and nothin knowledge quizzes because if you look at them there is a little context that said sets the format and uh there was a lot of variations in the code, it's not robust at all frankly and the answer is something very short. Basically it's did you read Wikipedia? And on that kind of thing we do about the same. But now we're going to try to be a bit more challenging. Let's look on the longer context. We have no position encoding. We have no position encoding obstacles to longer context.
Well, to have a band-width obstacle that we have to w to the right, but uh okay. So that's the needle in a haystack uh version from the ruler benchmark. So the models are all trained on four K_ context then fine-tuned on thirty two K_ and we evaluate on context length between four K_ and sixty four K_ and uh that's a clean win. At sixty four K_ it still works. The transistor doesn't work anymore because the the the position encoding is broken. You would have to do fine-tuning to make it work.
m the mosaic works out of the box. If you fine tune, it's going to be better, but it works out of the box. And finally, real in-context learning. So there are a couple benchmarks that appear recently and the are there is a paper that describes them, but I never remember what the paper is, so you have to ask Jianyu or read the thesis. But one of them is this banking task. So each example is a little dialogue between a customer and an agent.
And uh you have a class something like balance not updated after bank transfer to try to see the problem, you have sev seventy seven classes. Uh the second one I never know what it is, and the last one is something about recognising emotions. And uh uh the X_ axis is number of shots. A shot is an example for each class. So it's quite long. So when you have something like sixteen shots, you have a context that's something like uh thirty two K_ I believe.
And what you see is that uh the blue curve the mosaic, is well above the transformer, the equivalent transformer. On the second one you see something even more interesting. When you add more shots, the performance of the transformer decreases, because that's problem with the longer context. And the difference is quite big as well.
And also are plenty of variants of these results. But basically at that scale we have the confirmation that what we saw at small scale that it performs the same as a transformer, except for in context the learning where it's far better. Conclusions. So the thing that most I am most excited about is that this model is simpler and we understand a little bit of why and how the split the prediction problem into disentangled components.
And that explains uh a lot of little things, like for instance when you have a piece of text, you know, you can split between what is being said, who is saying it, what is the language, what is the tone, and then you can continue at m higher levels uh in which period is it set and so on. All these things are pretty much independent or almost independent things to predict. It's a good thing to be able to do it.
Now, as you see at the beginning the architecture is is epsilon away from the transformer. With the choice we made which was to use a kind of regression, it's very close to a transformer. So that chance that transformers do more or less the same things. However there is a difference that we see in in uh in context training where it's pretty brutal, meaning that if you want a transformer to then do the same kind of in-context training by increasing the data set, the training set size, you have to multiply the training set size by um
Huge number, but let's say some of these results instead of training on one trillion token, you could train on eight trillion token and still doesn't work. So that's the talk and uh I can answer questions. Oh Oh see. Uh yeah. Uh Is it time for questions? Uh let's see, maybe he back here, I'll start here.
Uh thanks for your talk. Um I was wondering, you didn't have time to describe it of course uh about the long context versus uh short context memory differences that you did. Um uh is that uh maybe affecting the result that you saw uh could you say anything more about that quickly? Oh the the story of splitting the context in long in short context Yeah. and long context,
is best with the fact that the statistics of the um the attention scores are different on the short term and the long term. And uh uh because of the the the short term effects, which are in particular amplified by the the leaky average, the things happen in the short term that are that is good to separate from the long term, so the long term works better.
Uh the best is to read the Janus thesis. It it's from last week. So uh I cannot describe everything. But it's sort of interesting. Uh one thing that's interesting for this attendance is this stuff here. Because if you look at this, now all the model is made out of memories. Y oh sorry, uh Yes.
Uh all the models is made out of memories. If you look where the weights are, I'd say that eighty percent of the weights are in the persistent memories. Uh and you have a little leftover of the weight is in the values where you format the things to and to do the keys and values. So basically it's routing the information between memories. And the key for So you have a kind of architecture which is transformer like, which works like a transformer even at scale.
It's made out of memories. Now frankly, if you replace the persistent memory by fully connected, you don't see any difference. The performance exactly the same. But if you change your attention head for contextual memories, you see the in-context effect, the in-context learning effect which is better with the the the memories.
Thank you for the talk. Uh could you comment a little bit more on how the memory mosaics learns positional information? Why lit propagates information through? Well because you have a shift between uh the keys and the values, the values look in the future. Uh for instance suppose you want to code the diagram. Well you just have to have a memory that stores
the next token, we keep previous token, value, next token, and that does it. Why you don't have to do anything. In a transformer you don't have that. So you have to use some position encoding that's uh going to be let's say a shift or rotation and then you have to rotate the keys and the queries to match this and you can isolate the right one. And then in another layer you can can install them. It's a bit of complicated, right?
Uh just eliminating it, removing the position encoding completely and all its complexities, and just adding this light thing that you each now each memory is a predictor just um solves the problem. Thanks. Other questions?
Thank you for the very exciting talk. Um I was wondering, uh I was a bit confused about the disentanglement part. Like do I understand correctly that um they sort of implicitly learnt by like s independent memory units as opposed to something like identifiability with um yeah. So could you help? Uh it it's really a different form of disentanglement. You disentangle the global production task, that's a predicting the next word in a sentence, into smaller ones
And the criterion is that you want the smaller ones to be predicted quickly. You don't want to memorise much. And the uh the first thing is to see that in the cost function you have that pressure, that the the form of the cost function which is the normal function, right, there's nothing special, implicitly requires every memory to predict quickly. And then you understand that uh if you can disentangle the task in independent component that can be predicted better in isolation than together
is going to do that. Absolutely, and do you observe that these task uh tasks uh like separate tasks like semantically? Well, we observe that in the small moon problem which are designed for that. In the texting it's very complicated to look at these things frankly. You know um frankly, um in the past when we were using CNNs, some people were spending a lot of time looking at the mask and trying to interpret them.
And I call this reading tea leaves. Because you need to find whatever you want. Uh this is not really productive. What's interesting is to understand the mechanisms that lead to this kind of structures. So here I'm very happy about this, this piece of understanding, because it's a mechanism that explains that this kind of architecture is going to do something that really makes sense. And you can wonder whether you can expand this idea in different ways. So this is something we're working actively on.
But the the the thing that excites me here is not that it works as well as a transformer or little bit better in in context training, is that I understand something. Thank you.

I s if I understood correctly this this uh uh separation between contextual and persistent is like a short term uh No, long no. term no? No, no, no, no. Uh it's it's long term. The persistence is uh infinite term. Basically the b what's storing the persistent memory is learn when you train on the corpus. What's learned by the context memory, initially they're empty, and when you start a sequence they get filled.
Is there a a way to uh is this capable of memory consolidation? It transmits Well, more types of memory. Well, first of all you have a problem because the data set is done that way. The data set is made of fragments of text without any particular order. So basically you have two but knowledge, you have two kinds of knowledge. Knowledge that is within each fragment, who is speaking in the fragment for instance, and you have knowledge that's across fragments that general.
Uh unless you have data set that structure differently, you're not going to have that. Accept that you in the contextual memory within the fragment if you have long fragments you can distinguish the co the knowledge that's very recent, which should be k typically grammatical stuff about the lead that's as well or knowledge that's very ancient which could be uh uh if you that is the Bible, who are the characters. There is uh a character named God that plays an important role.
Perhaps we could talk about other kernels, but do you think other I mean, it's a very g very Uh I'm sorry I cannot hear. Can you uh elaborate on if you can extend it to other kernels? Waddle kernels. Yeah. I don't see why I couldn't. We thought about using something like the Ipanishnikov kernels for about the same reasons. Uh but the problem that you have is that uh because they have a finite support,
you kill a lot of gradients, and then make learning more difficult. So, so we had this problem with kernels that were bounded. So And um so you think Gaussian in some in some sense is optimal? Or No, y uh I can't say it's optimal. Yeah. In effect we know that for density estimation it's not optimal. Exactly. But we know it's near optimal, and it has gradient everywhere.
Hmm. So so it's maybe easier to learn. When you have an Apania-Chirikov kernel you want to learn a gradient through it, you're going to cut the gradient everywhere. Oh I beyond the kernel, you cut the gradient completely. Thank you. Other questions?
Hi, thank you for the talk. Uh what about the performance uh during during training and inference? Uh is it s uh the same efficiency as uh regular transformer for instance? You mean speed? Yes, the inference and training Uh speed. okay. So first of all, our code is not as optimised as the code for transformers. No. Thousands of people f smart engineers have been working to making the transformer code fast, and this one is twice slower right now.
Uh in the big experiments we get rid of the pions we were pressed by F_F_N just because the code is faster and we don't want to optimise this. We know it doesn't make a difference. So the the pion is something conceptual. It's conceptually interesting to understand that you can do this kind of architecture with just memories. Okay, thank you. Any questions?
The one there. Hi, thank you for the talk. Um can you articulate what exactly is the kind of minimal or epsilon difference of the let's say contextual memory between the memory mosaic and the one in a multi -hat transformer?
Did you guess? I like to use a slide about that. Uh to find the slide. And like did you all bleed this exact one change, to see if a transformer It here and has uh similar uh it's performance? uh uh here when you enrol in time the operation of the memory mosaic, you find the formula like this, that you can per can compare to self attention in a decoding transformer, right?
And there are three differences. The first one is that you send to T minus one not T. It's because the value is in the future, you want to be Minkowski. So you have a uh the diagonal is removed from the attention mask. The second one is there is no distinction between key and queries. They all object the same, they they all come out from the same uh sub-network. There is no difference between uh uh a weight matrix for keys and a weight matrix for queries. They're the same.
and there is no position encoding whatsoever. And the uh assumption there, the bet that we made, that all this business of position encoding and kids and grades that are different it's only used at in the induction at the beginning to be able to capture the previous ones. So did you oblate all three of these differences to see which like what their contribution No, you to can't. the job?
You can't. If you don't do the shift in the future, the value in the future, which means the causal mask, you need position encoding, because it cannot work. Right? The distinction between keys and queries? Well, you can add it inside. You are adding some more weights, you do epsilon change, uh nothing significant. That I think we tried. Uh there was even a trial where keys and values were the same thing.
just shifted in time. And that sort of works as well. So it's become a not all associative memory, but not associative you associate uh an object at time T_ with the same object at times T_ plus one. And that sort of works, not as well. There is some uh uh work to be done on like say well when you use this, we have to use this formula, we which is how do we compute the keys, how do we compute the values. We did some experiments there, and you can do more complicated things and it works a little bit better.
Uh for the moons for instance we just have a linear operation. For the language, it doesn't make sense to just look at the two-gram before, you want to look at the few two-gram before. So a leaky average is a good way to do it. So we try to use something as simple as possible that worked well. I see, okay, thank you. Oh, you have any others? One last one.
Thanks for a great talk. Can you provide a bit more intuition about this dependence of the previous key or keys? Well, suppose you want to uh I was describing the induction head. Suppose you want to learn bigrams. And you can see the current the key the the the key is the current value, the current input and the value is the next input. Then you memorise direct. Suppose you want to do trigrams. Ah okay, that's becoming complicated.
If you have a leaky average the key is a leaky average of the inputs, you can do it now. And the leaky average is extremely cheap to compute. No, that's that that brings nothing. That does that costs nothing. Not many there are c not many parameters, not many functions. It's easy to do.
The more tricky thing is the value of why do we use a mix of the value at time T_ in the uh the the input at time T_ and the input at time T_ plus one? And somehow it's a kind of uh uh uh we want each head to decide uh how far it's looking in the future. It's only one step in that case, you could try several steps, but we we didn't really try. But even at the s the the level of one, you could decide that uh maybe there is a little bit of leeway there.
Alright, why don't we thank Leon again for his talk. Thank you. Alright, next we have a couple of contributed talks. So if the next speaker could come up. Okay, just plug it into whatever.
Alright, so we're having Bao Pham to Yep. speak. Yep. Very cool. Thank you for this uh opportunity to present our work on the study of memorisation to generalisation in diffusion models to the perspective of associative memory models. Uh first I would like to give an overview of what diffusion models are. These are new form of generative models. They're quite popular now and the goal of these models to gradually breaks down the data over time.
And in an adjacent perspective, you can view this gradual process of breaking down the data as a slow transformation of some targeted complex data distributions, and you slowly transform it into a more simpler distribution, for example, isotropic Gaussian. And of course, these models learn to predict the noise or the score function at each time, which guys, that would be the reverse process.
And now you're kind of like wondering where is this connection being made between diffusion models and associate memories model. Well, when people talk about a score, you can interpret them as part of like the gradient of some energy functions and you can express probability as a function that involves some energy functions. And another interesting thing you can say about this denoising tie is that it's akin to an associate memory retrieval task.
So in diffusion when you train these models you're really telling the models to learn how to denoise and retrieve a clean memory given a noisy queue. And that's what that just give you a brief connection.

That just give you a brief connection between these two models. And another connection that we can make is just coming from the associative memory uh topic. Here we probably kinda know about the phenomenon of patterns. In general, uh these patterns are view as a negative consequence of associative memory. But in our work, we view them as something positive.
Perhaps they serve as indicators of early sign of generalisations and we believe we can use them to study generalisations in diffusion models. In this figure I'm showing you is just like a simple example of what square is pattern could look like, in using the just the classical associative memory model where it fails to store two patterns.
Um Oh my god. the goal of a social memory model is to store the strain pattern as local minima on some energy functions. But here it is failed to do so and this uh so these memories are now sit in not as local minima but they sit somewhere around a local minima minima and they help create something new, a pattern that is a interpolation of these two patterns. And s in some sense with this example it can give us a sense of how
How a super example could play a role in understanding how generation generalisation works in diffusion models. So mathematically we can further refine these connections and make it more precise and luckily for us there are some works that already formulate this basis and through the energy perspective and it allows us to build upon them in our work.
So the visual models uh are typically de described by two equations, the forward process and the reverse process, stochastic differential equations under the variance exploding setting where the trip term vanishes over time and the noise grows with time. We can define a marginal probability of generating a sample at time T_ as a mixture of Gaussians uh centering around a bunch of data points.
So let us assume that we replace this data distribution with uh a strict set of k memories. So then this marginal appr opp probability is now proportion to it uh um proportion to en energy function basically. And now that allow us to derive an energy function for the diffusion models and this energy functions is close
bear a lot of resemblance to a type of dense associative memory energy as we show here. Now the biggest dist distinction I wanna make is that these two system are different in the sense that one is uh have a sharpness or the ba inverse temperature varying over time, the other one has a fixed temperature uh h has a fixed inverse temperature. So one system is non-equilibrium, the other one is an equilibrium system.
But you know to further extend this connection, we can use the mathematical formulation from associate memory and derives an exact energy for this toy example. And this toy example here show us two fundamental results. The first result that we show that with a thousand training points the diffusion model can com can converge to the exact energy here.
as we seen on the left. So it's just for more context. On the left, figure, I'm showing a diffusion model that is trained with a thousand data points on this circular data. Uh the training data are represented as red stars. We also use clustering to get a sense of where the concentration of generated sample f uh fall into. Of course with this example there are way too many training data points, so then it it is covering all the generated sample. So this example is not clear, but for the next result
It will be clearer. So this next resource is actually more interesting. When K is equal to under lower data size regime, the model memorize, it can replicate the training points pretty well. But when you push past that data size, slightly bit at K equal to nine, for instance here, we start to see an appearance of points that do not align well with the training data.
And this is quite interesting, but in to really get a sense of where at these points are spurious, we have to look at the energy, so we also computed the energy of these diffusion models via numerical integrations of the score over time. And now if you look closely at the energy value, you could see that these points that do not align with the training points have lower energy values than um than the nearby training points, right.
So then move on moving on from toy model, we also extend our study to real data. Now there are there is a issue with this. In the toy data it's easy to perform that numerical integrations because there's low dimension. For real data it's tough to do so. So we opt to to quantify the transition from memorisation to generalisation in real data.
So, basically we are just gonna collect the fraction of memorised various generalised samples as a function of training data size. And uh so just to explain for each of the t training data size you see here, we are training a separate diffusion model. For each diffusion model we are ch we are generating a synthetic set along with that. And the synthetic set here is four times the size of the training set, corresponding to each individual training size.
It's a fraction you see here. Uh we are shown a fraction of these sample types w uh with respect to the synthetic set. So in these plots, the left uh the red curve corresponds to memory samples under a low data regime the red curve uh starts high and it is decreases as the training data size increases.
And the blue curve rises when the trend trend data size increases, but there's a middle phase with the green line. The green line represent spears samples, the spears samples quickly rises, but also quickly decreases as you increase the training sample size as well. Now let's take a look at these patterns visually.
So here I have an image showing you memory sample. Memory samples are classifiable as duplicates of the training data points. Uh under the caption where it say memorise I'm showing target samples which are generated sample. And we define these uh samples as memorised by just taking a look at the distant, the distant of the target sample which is X hat to the first nearest neighbour from the coming from the training set. If that distant is below a threshold
We classify that as a memorize. And in this figure I'm also showing you the nearest neighbor coming from the training set, in the synthetic set, top row, training set, bottom is synthetic set. And you can see they are exact duplicate from both sets, even though we're not using a synthetic set here. It's very simple, um are more interesting. They are novel samples, but they represent an early stage of generalizations. You can see that they
don't respond, don't they don't they don't align with the train data points. But they are exact almost like exact duplicates from general example belonging to the synthetic set. They represent very early signs, 'cause you can see the patterns very resembl no, bear characteristics of training points as well. Uh on for that bird, the first example here, uh you look to toward your left, the first example, that bird is a mixture of the cat and a bird.
Think that's pretty cool. And to really to identify these first sample, we take um similar to the memorize we just take the distant of the target sample to the first nearest nearest neighbour in the synthetic set, and if this below a threshold, and also the targ making sure that the target sample does not belong to the memorize set, then we classify as as spurious. So finally, generalize are just points that do not belong to any of these sets.
And they represent truly truly novel patterns that the model can create, but they don't duplicate often. As you can see here. And you know, auto-detecting mecha metric is just take whatever is not memorised and whatever is not spurious as generalised patterns.
So what in my I want to have three last point to conclude this work is the first point is before being a generative models, diffusion models behave like associative memory system. Under a low data regime they memorize as you push past a certain point well they start to generate spurious pattern much like an associative memory system. Although the tasks for these systems are different through the energy perspective we are able to connect them.
Yes, they are different, but they we are able to connect them, and that's pretty cool. And a third point is that we view surface patterns as something negative in our social memory, but in the case of generating modelling, they can serve as a good indication that your model is learning to be creative and generalised to the underlying data distribution. Thank you.
Time for questions? Uh thanks for the for the nice talk. Isn't this transition between memorisation and generalisation already predicted by uh the recent paper by Marc Mesar and others on dynamic regimes for the efficient models where they actually show that as you start the backward process from noise and you're moving towards images, you pass through

based on your moving towards images, you pass too many stages to be actually phases. And the last phase is precisely you collapse into a p uh a scenario where you have uh around every training data as a very strong quadratic basin which attracts uh everything to it.
Yeah, so that's a that's a very interesting paper. But that paper studies a dynamical regime, so it's study based on time, right? We stu our work we focus more on the learning dynamics with respect to the training data size. Um there is yes, th like there the way they study it is with respect to
You which time you start at if you start at a symmetry breaking time you're able to converge to a fixed point fast, right? Yeah. But there's like an exploration there is a exploration phase like the one where you basically start exploring the noise manifold that's what they show on the paper that
Uh th those that is a related paper, but we different w our experiment are different from that. Ah. Yeah, but the in that paper the the the times where this transition happen precisely depend on the sample size and the dimension. Are you seem to be saying some things would uh depending on the size of the mm.
uh uh data set size I think was key. Uh you you Yeah. seem to be saying uh that the picture about the moisson changes, which is precisely captured in this uh phase transition time. Yeah yeah yeah. So as we have low data, model of memorise, but the interesting phenomenon happens is you just s slowly increase the data, past the memorisation there's a certain k, right, when you stop memorising, you start getting these novel patterns.
But they're not good. They're very noise-like. But they looks like things are being mixed uh from the training points, right? There there's resemblance to the training data set. Um but they're novel patterns. And we our focus is to confirm that these patterns are actually spurious pattern and they re are related to the associate memory uh system, right.
Think we should move to the next talk. Um we can take the next questions offline. Thanks Paul. Thanks.
Starting here? Okay. You all set? All right, next we have our Matt Smart who's from the Flatiron. Uh so I'd like to start by thanking the organisers for this uh opportunity and for putting together this excellent workshop. Uh so I'm gonna be telling you about uh in-context denoising with one layer transformers.
This is joint work with Alberto Bietti and Ana von Sengupta at the Flatiron. So I want to start by reviewing two seemingly unrelated architectures. The first is associated memory networks, which many of us know and love. They're designed to store a set of patterns as minima of an energy function.
In Hotfield's original formulation, the energy function is quadratic in the overlaps between the state of the system and the memory bank, these Z mus. While they were well understood theoretically, uh they have this long s long-standing limitation in their capacity. Basically, you can only store linearly many patterns in terms of the number of uh features or neurons. So that limitation has recently been addressed with the elegant trick of uh replacing these quadratic terms with sharper non-linearities for example cubic, quartic or even exponential.
With these sharper non-linearities, you get a qualitative benefit in the number of patterns you can store. So uh the other architecture I wanna mention is uh the attention layer, which is kind of the secret sauce of transformers. Uh the basic idea is you take i in in the typical incarnation with the softmax self-attention, uh you take a stream of input tokens X, you map it to key, query and value matrices. You compare the keys and queries and you use them to project onto the values to return the output of this layer.
Uh-uh. Despite being the key ingredient of this sort of state of the art architecture, I would say, how they operate and how they operate in tandem with the other pieces of these large convoluted architectures is is not super well understood yet, despite the you know empirical success. So it it turns out these these two architectures which look different at first glance are actually quite related. Um this was first noted in a paper from Remsaur and colleagues here at ICLR a few years ago.
Uh they they pointed out that the transformer attention update can be viewed as a single step of a dense associative memory uh landscape. So uh I'll just quickly sketch it out. So they start from what they call the modern continuous Hopfield net, which is basically like a dense associative memory net from the last slide but with exponential uh kernel. You'll see if you take a gradient with respect to X, which is acting as the query and set the step size equal to one, you'll get this update rule for X.
And if you squint your eyes, this looks very similar to the softmax attention update I was showing on the last slide. So they did a lot of stuff in this paper. They focused a lot on deriving things related to convergence. We were very intrigued by it and it was kind of our starting point. We wanted to know how this could be further developed. So we've identified what we think is a natural interface to make this connection as explicit as possible. And we're calling it in context denoising. So I'm going to spend five or so minutes explaining it before coming back to this connection.
Uh so I'll I'll step through uh this new type of in-context learning problem that we're we're studying here. So uh imagine you have some way of generating random distributions from some task set D_ So maybe this is one instance of a of a distribution from this task set, so it's points on this manifold uh according to some P_ of X_ Uh
I wanna imagine sampling finitely many points from this realisations of this distribution. I gonna refer to them as pure context tokens, and denote them by X_I_ And then I wanna take the last one that I sampled and I wanna corrupt it. I have some noising process to move it off of this manifold. What I'm gonna do is take all of this information, all these X_I_s forming this pure context tokens and this one corrupted token and create a task embedding for an in-context learning problem.
Basically we're going to take very, very many of these, sampling different realizations of this distribution from this task set each time, different realizations of these pure context tokens and different different realizations of this noising process to create a in-context learning data set that we're going to ask a network to solve. Basically its objective is going to be to predict the denoise token using all the information stored in this task embedding.
So we're kinda heavily motivated by recent work studying in context learning phenomena and transformers and others' architectures. Uh the thing I wanna emphasise is that every prompt is basically a new instance of this random task. So we study in the paper uh three elementary cases to make things concrete. So in the first case we look at random uh subspaces of our end. In the next we look at non-linear manifolds, specifically sub-spheres.
And then we look at Gaussian mixtures. And in the interest of time, I'm just gonna focus on the first case. I'm gonna walk through it a bit and give you a flavour of the kind of analysis and what comes out. So I'm gonna have to tell you a little bit more about how we generate these prompts. Basically pick a random subspace, at that point you've chosen what the projection onto it is. In order to generate these blue pure context tokens, what we do is we pick a Gaussian ball uh with a given uh isotropic covariance sigma not squared.
And then we just project them down onto that subspace. That's how we generate these blue tokens. And then we pick just one of them and then we corrupt it. And our corruption is just gonna be isotropic Gaussian noise with covariance sigma z squared. So the parameters of this whole sampling process are gonna be L, the context length, D, the dimensionality of these random subspaces, and these two noise parameters. If you plug it back into the cost you'll get a baseline for the best a network can do.
Uh as a function of these parameters of sampling. A more general solution that extends beyond this linear case is to note that the Bayes optimal denoiser is just going to be the posterior mean given this observation of the corruption. For the case of isotropic Gaussian noise that we're using, it evaluates it ends up being that we have to evaluate this ratio of integrals and then P of X is just going to be dependent on the task. So it has a certain structure for this linear task, it's going to have a different structure for other tasks. If you plug it in here and work it out, you'll find you get the same answer as this heuristic.
So we worked through each of these cases in the paper. We derived these optimal denoisers for the case of linear manifolds, sub-spheres and Gaussian mixtures. And what we noticed at this point was that a single attention head is expressive enough to describe all of these guys. So in the case of the linear manifold denoising,
Uh what we're gonna use is linear self attention, expressed here, where we've kind of condensed the key and query weights into one so the parameters of this layer are the uh the value matrix W_V_ the key query matrix W_ K_Q_ and by N_ and what the theory predicts is that the optimal denoiser is just gonna be this guy in the infinite context limit with scaled identity weights and it tells you what the scales should be.
Likewise for the two non-linear problems uh for a re certain reform of the Gaussian mixture problem. A soft-max attention layer is the appropriate structure. Again in the infinite context limit, we know what the weight should be, they should be scaled identity matrices, and this is gonna converge to the base optimal predictor. So uh that was all analysis and uh staring at these kinda synthetic toy problems. If all you know how to do is PyTorch, you can do that too.

All you know how to do is Pytorch, you can do that too. So as a verification of our theory basically, we trained these attention heads from scratch, from random initial weights on these in context denoising problems and we were happy to see that they readily converged to this baseline predicted and they converged to these scaled identity weights that we were hoping to see. Here I'm showing both linear and softmax attention trained on this linear subspace denoising problem.
And likewise for the uh case of sub-spheres and the case of Gaussian mixtures, we see that these layers trained from initial uh random weights are converging uh pretty robustly to these scale identity matrices with weights we would anticipate from the theory. Okay, so we started with associated memory networks and I've kind of forgot about them for a little while, so let's come back. Um
Analytically and empirically, attention layers trained on these kind of elementary denoising tasks are converging to a particular form with these scaled identity weights. So on the left I have the linear attention and on the right the softmax attention. It was clear to us now at this point that we could just take a spherical hopfield net with a particular Lagrange multiplier on the term constrain in the norm of s in order to map to this layer. Basically write down this energy function, take a gradient with respect to the query, the state s.
set the step size equal to alpha and you'll recover this strange uh linear attention layer. And then in the case of the softmax attention, it's very similar to what was pointed out in the Ramsauer paper, how field networks is all you need. Except now we know we have a better idea of what's going on with this Lagrange multiplier and the step size. The thing I wanna emphasise is that uh this connection is basically telling us that the trained attention layers are
are performing uh a single step of gradient descent on a context-dependent energy landscape. Every new uh context-dependent problem you're giving it, it's defining a different landscape, and it's taking a single step of gradient descent. The initial condition for that gradient descent is the query, the corrupted uh vector in this task. And as one sort of uh simple demo of what you can get from w what this tells you, um
coming from the Hotfield network's uh associative memory network point of view, the natural instinct I think is to iterate this denoising process, perhaps in the hopes of improving it. Uh but what we can see is that one step really is optimal and iterating can hurt in at least in these cases. So here I'm showing uh the case of
a circle in in two dimensions let's sample uh 30 tokens ran at random uniformly on the circle. These are gonna induce a context dependent energy landscape through this trained softmax layer just like I was showing on the previous slide. So blue is deeper, red is higher, we can ask what happens if we present corrupted queries that are off off of this manifold, how would the network denoise them? So this is what happens with just the trained single step uh
soft uh softmax attention. It's kind of pulling the point straight back to the query and getting it pretty close to where it was corrupted from. We can also just iteratively uh repeat this de-noising process. We could do it until convergence. Here I'm showing fifty steps and this tells you exactly why you don't want to iterate it. Basically, after the one step you're kind of progressively pulling it towards a spurious memory uh a spurious local minima that is just congealed because of the random sampling of finitely many tokens.
So you're progressively destroying detailed information about the query, uh whereas in the one-step case you're kind of optimally balancing info that was presented in the query with information that was stored in the context. So I'll I'll just wrap up. Um so we showed that single single attention heads are able to optimally denoise certain in-context denoising problems, relatively restricted ones, and uh I think we've refined a little bit this connection between attention and associative memory that was first pointed out in Ramsauer.
Um and it I hope we've also clarified why recurrent iteration, at least in this setting, is uh sub-optimal. Uh overall, I I think that our one of our objectives was to connect uh associative memory networks to the in context learning community, which is kind of getting more and more Ah. vibrant, and I think we've done that. We have some ideas for future work, which I'm happy to talk about. But I'm getting close to time, so I'll I'll close. I'll thank my collaborators who are here.
If you wanna chat with them, uh group at group at the Flatiron and our funding from Simons Foundation. And yeah. We have time for questions. Yeah. Thank you for the talk. I and I'm not sure if you're familiar with the new results on half denoising.
Of who, sorry? Half denoising? Half denoising, no. Yeah, so these are some very new results. First by Oppo and Francis Bach has a follow-up paper on that. So it turns that denoising is not the denoising expression you add is not optimal in in distribution sense. I think it would be nice to take a look at that too. Just Certainly. a mea just as mea a small comment. There is only two papers on this. So it's So it's recent. like half It's called half denoising. half denoising. Happy to chat. Yeah. Yeah yeah.
There questions? I have one actually. Suppose you actually shift the distribution on the manifold. So if you add like the centre of the manifold and the centre of the Gaussian that you're projecting from Yep. are offset, would you actually also be able to learn that within context learning? I think the softmax case would naturally handle that. And the softmax can also approximate the linear attention. So I I I think you would. Yes. Yeah. Okay. Alright. Oh, thanks, let's thank Matt again. Thank you.
Should be working. I All set? Are you okay? Alright. So our last talk of the session is an invited talk by Adriana Bara.
Thank you very much. So, good afternoon everybody and let me thank at first the organiser in particular Dima, it's a pleasure to be here with you again. So even in my talk, the idea is that uh despite it is not evident at the first glance, I want to convince you that uh paradigmatic models for uh biological inspired in neural networks, I will use the opfield model, the opfield network, and paradigmatic models for machine learning and I will use the simplest one uh the restricted Boltzmann machine in
be introduced by Newton, uh Benjo and uh Sienowski are actually two faces of the same coin. So there is not such a big gap between biological inspired model and artificial or statistically driven model. The leitmotif that I will use uh to argue my idea, my thesis, will be statistical mechanics. Before I start, why statistical mechanics can be useful uh in general in machine learning? Well, I have three arguments. Uh the former is
It is theoretical, and another is empirical, and the last is computational. The theoretical one is that if you are interested in neural dynamics typical in your stochastic processes, and as long as you assume detailed balance, you know that you have convergence to the Boltzmann-Gibbs equilibrium of some given cost function. The second one, an empirical argument, is that if you work with data sets and you want to construct the least structured model with momentum in agreement with those that you measure then
that empirically you can use the maximum maximum likelihood statistical inference and again you will find out that your solution can be expressed in terms of a Boltzmann distribution of some given cost function.
And finally, there is also computational reason that is the explicit functional knowledge of this distribution allows you to develop learning rules, as for instance the contrastive divergence that you can find in the in Ton uh uh paper, let's say. So once this is uh understood, let me move on. The idea of MetalCase to spend a few minutes on the op field model, a few minutes on the restricted Boltzmann machine and then go into the main talk and show you that these two objects are the same
game. If time allows I will then show you how to generalize this duality to more complex architectures. Otherwise there are posters from other guys of my group where we can rely on that stuff. So for the opt-field model we want to do pattern recognition, that is uh w the idea is that you supply to the network a corrupted image and the network somehow relaxes to the minimum and in the minimum you find you recover the clean image.
And to convince you that this is something that in the brain we do and we cannot avoid to do, I see here a screaming face, despite that this is just a bottle of Coke, or here I see a hole for instance. While to show you that uh for Turing machines this is another task, Turing machines are our computers, to show you that this is a another task, the captcha are exactly to to avoid that task. So this is the task that the Ophel model wants to do.
do. If we want to work out the upfield model, so we have to write the cost function that typically in our statistical physics is called a Hamiltonian, you have easings spin that interact through the coupling that I call J_ given the Hamiltonian or cost function you can write the stochastic process by relying on detailed balance, that is you take the coupling symmetric, the stochastic process is converged to the Boltzmann-Gibbs distribution and by the Markov theorem if you work with
What we took as thesis that it was by the Lapunov theorem, you know that the existence of the attractor exee is for granted. So now the question is uh how can I choose the correct coupling such that the attractors are the patterns. Okay. To solve this problem uh there is a very intuitive argument by Tank, the Opfield Tank paper, and then there is the Abian learning. Let me at first define the patterns. Each pattern let's say the phase of the guy, but
box, band, whatever you want, take all the pattern, X_I_ those are the vectors of N bits. Plus one and minus one. And you see that the argument can be the following. If you do the scalar product at the power two, working with the parabola, but you can generalise to the dense. But let me take simplest stuff. So add the power two. If you do the scalar product, it

If you do this colour product, if there is no correlation between the neural activity and the pattern by the law of large numbers, that scalar product product will be zero. Otherwise, if the neural configuration aligns to the pattern, then the scalar product will be N or one, it depends how you normalise it, and so it will be more convenient for the network to align to the pattern. If you do this colour product, you do this query, you obtain exactly the cost function of the OPN model.
model where in particular if you write down the coupling explicitly in this way, you recognize the abelian that is in the the one implemented in the celebrated abelian model. Okay, so far so good.
Let just just to be sure that we are understanding it is also useful uh to express the cost function through this other parameter. I have one of this matrix magnetisation for any of the pattern of the network, and this quantifies how the configuration of the network is retrieving is aligned to a given pattern. So in a Toy model uh where the network has a stored these five uh patterns, I start the dynamics
Closer to the face of the guy I let the dynamic reach the steady state that is for granted because this is a Markov process, and the steady state is effectively the face of the guy. So the dynamics start over from here and it it relaxes uh down to the face of the guy. And uh let me say that if the face of the guy is coded by this bits then the neural configuration will be exactly those bits. And in this way the network retrieves I think those are things that we all know.
no. One of the mai of the most important point at least to me uh of the m of the main reward in the statistical mechanical formulation is that we work out phase diagrams. That means that in the space of the control parameter that are the noise of the network and the storage of the network that is defined as the amount of patterns that I want to store divided by the amount of network of neurons that I have to handle such a storage. And this is alpha.
uh we can know that only in this region where you re read F_ and M_ the network will eventually perform a pattern recognition. Far from this region it is just a spin glass or even or even worse. I'm saying spin glass because in statistical mechanics the the correct reference is not ferromagnet. We need spin glasses because synapses are both excitatory and inhibitory and these those are mapped into networks that are frustrated, meaning that the links
things can be both plus or plus minus one or minus one. So the correct reference is spin glasses in statistical mechanics. That includes what I have to tell you to say about the op field model. Now, I open five minutes another discussion on a first glance a completely different argument. That is, learning from examples in the restricted Boltzmann machines. In this model you have a Boltzmann machine that again is an energy model where you have
You have the layer sigma that is called visible layer that interact through the weights xi through the layer z that is the output layer or the hidden layer. The goal is to learn in a I just discussed the supervised setting, but it can be said in general. The goal is to learn a reality that is expressed through this probability distribution of joint variables xi and z. For instance each time
I'm I present to the visible layer a picture of a dog I want one of the output uh neuron to sit to be fighting it to say this is a dog. And uh so this is the reality I want to model. P_ infinity is the inner probability distribution of the machine that has to be the Boltzmann Gibbs again because this one is symmetric. And I can do gradient descent, I can extremize the Kullback-Leibler divergence with respect to the weights
So, and I obtain uh bad, additional learning rules that I explain in the next slide. Those learning rules tells you the following thing. Each time that I present an example A_B of C_ or C_ of the first pattern where the first pattern is the cat, I want the first neuron to be firing. Each time I present an example A_B or C_ of the second pattern, the second pattern being the dog,
I wanted the second new the second output neuron to be firing. And the way in which I achieve this kind of learning that in the output layer is called the hot coding layer hot coding vector because it is just one neuron firing at the other at zeros is through these learning rules that tells you the following. The first correlations these ones tells you clamp the Boltzmann machine, put the example and
And for today, the the the visible the hidden neurons to be firing. The ones with the minus of the standard average is that we do the Boltzmann gibbs averages. And so the learning is over. Once the machine once it once it is left free to operate, it reproduces perfectly the clamped reality. At this point, learning is over and if you present an example of a dog to the machine, it will tell you it is a dog or or eviscerates a
Let's see if it is a cat. Let me just point out, however, that uh while the op-field model is somehow a triumph of the distributed processing as you discussed earlier, here uh this is no longer b uh extremely distributed processing in the sense that once you have the hot coding uh in the output layer, you have just one neuron firing and all the others are zero. So this is what psychologists actually call the grandmother cell setting, that is something very very antithetic.
dedicated to the distributed uh processing. So it is interesting to see that this two f this two aspect are two faces of the same metal. And how can we see that? Well
Before um showing the duality, let me also be sharper on the w on sorry, what I want to use uh inside this cool back library. I need a distribution for the reality, so the couple of examples and labels. And I need the inner distribution of the machine that is the Boltzmann Gibbs with this given cost function.
So my probability distribution is the Boltzmann-Gibbs distribution, and I take just for the sake of simplicity but this can be relaxed, I take those neurons to be real with a Gaussian prior or with an l two regularisation. But this is just to take this slide simple, it is not very an important condition. Why the external reality tells me the following. Each time that I present an example a of the
for the pattern mu on the visible layer, I want the corresponding output neuron z to be fighting. So this ca this product of the delta is how I modelled the external reality that I want my machine to learn. I do the calculation and I the extremisation of the Kulbak-Leibler gives me the learning rule that I've just discussed.
Okay, so far so good. This is what they do in machine learning. This has nothing to share at the first glance with the op-field model that implements the ebbian learning rule that has biological origin. Not a completely different things. However, if we keep in mind Gaussian integration and if you look at the joint probability distribution of the hidden and the visible layer of the restricted Boltzmann machine, so this is the
This is the cost function of the Boltzmann machine and this is the Gaussian weight. You see that this expression is factorised over z and if I integrate over z, if I integrate over z I obtain the square of this object. The square of this object is this one. So the marginal of the restricted Boltzmann machine is exactly the probability distribution of the Hopfield model. So these two objects are essentially from the mathematical point of view the same object.
object. Um and and then if you do if you say you you said that Gaussian neurons now you can use binary neurons to show that it is the same plus the dense network. However there are prob there there are i mean interesting questions in this duality because uh from one side uh people in machine learning wants the weights to be real because they have to work out the derivatives with respect to the weights. People in uh s in biological neural networks wants the c
to decide the answers of the pattern to be Boolean, digital, because in that way you have the maximum larger of a single region. So there is a f uh this first trade-off is to settle this point. This point has been resolved uh three, four years ago and we know that it works, regardless what kind of weights you use, this duality is sustainable. But there is a a much more uh less intuitive problem to be addressed before we can say that these two objects are the same, that is
While the Boltzmann machine effectively it learns from example, you have to supply examples to the machine until it is able to extract the archetype, the Hopfield model per se, it doesn't learn. It simply stores one pattern after another, but it doesn't see series of of examples. It doesn't infer the archetype stemming from the example. He a he just stores the pattern. So to show the duality we have to move from the standard
We have to move from the standard coupling of the uphill model toward the coupling that is able to include examples. So at first I have to generate examples. I start from my previous pattern that I promote as archetypes and from those patterns I generate examples by blurring some of the of the pixel of the pattern. I take a pattern and with some percentage I spin I spin I spin down if I divert a a bit.
bit. In this way I create with the noise R m m different copies of those examples, m different copies of those examples. And now I ask myself, if I want to generalise the Ebion storing toward real Ebion learning from examples, how can I do? There are just two options, because in the we in the way in which it is written uh this matrix there are just two options by

this matrix there are just two options by which we can do that. Or there is no teacher and simply you collect all the picture that you have regardless the animals they are. Pick up the dogs, pick up the examples of the cat, some, all of them and just plug them inside the synaptic matrix in this way.
What there has been a teacher before that took all the pictures and say that this is a dog, this is a cat, this is a dog, this is a cat, it's police information and then provides information separately so you have two different summation, one for the dogs and one for the cat in the simple example I'm sharing. And I would be tempted to call this supervised learning because there is the presence of a teacher. Now that I have this generalized A-Bian couplings,
I can work out the standard I made with some Polinsky again, and with respect to the previous theory where we had just two control parameters, that is the storage of the network and the noise in the network, we have also another parameter that is the entropy of the data set, that is how much information I am providing to the network, and also I have also beyond the standard it is a magnetisation as you heard that parameters and the standard as parameters.
that the spring glass over the Paisley over the parameter, I have another uh that parameter that tells me if the network is retrieving the example rather than the archetype. That is something that I don't want. I t I want to give to the network an example and they want the network to tell me this is a cat, not this is that particular cat. So m tells me when m is equal to one, the network is able to generalise and it is able to tell me it
B_E_T_ is a cut. When N_ is equal to one, the network is not ye but able to generalise. And if I provide an example of a cut, a noise example of a cut, it will just give me that clean example of the cut, but not the general archetype of the cut. You work out the theory, you do the standard statistical mechanical calculation and uh
At first, if you take cut off equal to zero, that is there is no entropy in the data set, so I supply the to the network all infinite information or simply all the examples are exactly the patterns, well I recover the standard Amit Gutmann-Sompulinski phase diagram. Then the larger the entropy in the n uh in the data set, that means the less the informative is the data set, the retrieval region shrinks and shrinks and shrinks as it's increased.
intuitive. Another point is that we can also draw new phase diagrams in the space of the storage versus the entropy of the data set. And below this computational phase transition here the network is able to work where the work to me means that is able to sorry, that is able to learn and also correctly retrieve. So from my point of view there is nobody difference with respect from learning and retrieval because
But if you until you didn't learn properly, you cannot be able to retrieve. So at first the learning has to be over and then the retrieval will be good. In this region the network uh in this region the network is able to work, in this region it is not. And note that in the limit of zero entropy, this point here is exactly zero point one hundred and thirty eight that is the standard limit for the optical model. Okay, so far so good. But
I just want to point out a computational argument and a theoretical argument to say that this duality is over. The computational argument is the following. Now I'm showing as M is the number of the examples that I provided to the network, and different call different blue collars are different noises as you can read here. I want to show in this plot the thresholds for learning, that is the amount of information that
that I have to provide to the network such that it is able to infer the archetype so to correctly generalise. The blue curves are for the restricted Boltzmann machines, while the red the vertical red curves are for the ope field model. And uh note that uh they intersect exactly in zero. All of those curves uh match exactly in zero. And if you see what I'm plotting on the y axis, I'm plotting the logarithm
system of the ratio of M divided by N_M is the quantifier of the archetype. N_ is the quantifier of the example. So when the when the intensity, the quantifier of the archetype is exactly the quand the the same value of the quantifier of the example, that sets the threshold for learning because once M is larger than N_ the network is able to infer the archetype and generalise.
one once N is larger than M it is the contrary. And so the threshold for learning is when M is equal to N and when M is equal to N this is one and the logarithm of one is zero. So this black line is the threshold for learning. And you see that the threshold for statistically driven learning at least in this shallow network and the threshold for the biological learning in the simplest implementation, that is the Hopfield model they match whatever the level of the noise.
So there must be some reason for this duality to hold, and in indeed it is, because if you look at the typical loss function that those guys use in machine learning, the L_ two, they simply ask themself, this is this sigma is the output of the network, see mew is the target that they want, and they measure how how far is the discrepancy between sigma and the target. But if you do this uh this object square, you
This at the power two is one, this at the power two is one and you are left with a double product. But the double product is exactly the Matisse magnetisation and I can write the Hamiltonian of the upfield model in terms of the Matisse magnetisation and indeed we have this this formula that tells you that the cost function that we use in statistical mechanics are linearly related to the loss functions that they use in machine learning. So these two objects are indeed the same.
And it is interesting to note that while in biological learning we think that we use distributed processing indeed we use distributed processing then this is exactly the same of what they do in machine learning when they use hot vector coding that is the opposite of uh distributed processing. And so to me if I have to ask myself is this the first time that I see this kind of uh equivalence uh b no, not at all. Because when we were students and we studied analytical me
mechanics. We saw that there were two parts to this, the question of motion. We can use all the Amil all the Hamiltonian part or the Lagrangian part. If you follow the Lagrangian part you do the derivatives and with the contrastive divergence you do the derivatives. If you follow the Hamiltonian part you do the integral of the action, you do integrals and LBNL learning is through summations. Summations because I'm using binary units otherwise with real values uh with real value at units
units I would use integration. And so uh tho those two ways of achieving the same learning rules are simply the two possible ways that you use if you want to use calculus. So you do the derivatives or you do integrals, but there are no other routes. So uh uh what I told is collected in uh in these papers here.
And now that I understood how to move from one setting to the other, I want to generalize this duality to more complex architecture. The first one is the simplest generalization of the Hopfield model. Hopfield introduces his model in the 80s and a few years later, Kosko introduced the bidirectional associative memories. As the simplest generalization of the auto-associative memory.
We call it upfield is autosociative, costco is heterosociative, the Hamiltonian of the costco model is this one, is called a bidirectional associative memory, where you see that the synap you have two different families of spins, so you have two uh layers of spins, and the synaptic coupling is no longer xi and mu.
Psi j mu. But it's Psi j mu eta j mu. So the Xi are the patterns that are handled by the sigma guys, and the eta are the patterns that are handled by the tau guys. And and so you can see the difference. This is the standard auto-associative memory by hebb, and this the this is the hetero-associative memory by casco. The idea is that if you supply a noisy pattern here, this layer
being helped by this other will denoise the pattern and let the pattern clear on the same layer and it will also retrieve another couple pattern here. So this network retrieves couples of pattern. You provide to one of those layers a noisy example, the network will clean that example and also retrieve the conjugate example on the other layer.
So, from my point of view, from this duality, that is very very simple, and it will be shining to me in the next slide, it is clear how this happens. Because again, I rely upon this integral representation. And the point that I'm using is the following. I use the Gaussian transform to tell you that the op-field model is equal to the restricted Boltzmann machine. And the idea is the following. Take a function, the exponential of a cost function, use its integral representation
the representation. This introduces dummy variables in analysis called the dummy variables the in the hidden neurons. And that's the idea. So you have a cost function, you have the exponential of the cost function, you use the internal representation, you introduce the dummy variables, those are the hidden layers. If you do this uh for the restricted uh for the mm BAM, for the bi-directional associative memory, you have this integral representation. I'm using this mathematic
Thematical uh uh generalisation of the Gaussian integration. And the picture that you have is that this two visible layer have the hidden layers and this hidden

have the hidden layers. And these hidden layers are one to one connected such that if I present a pattern over this layer, let's say the first pattern, this will make this n hidden neurons firing. This hidden neur the firing of this hidden neuron will trigger the firing of this hidden neuron that in turn will help the other layer to retrieve the conjugate pattern. So this idea can be generalised uh thank you very much by the way. This idea can be generalised uh
to three -directional associative memories that are is the same the point is that why three rather than two because there are a lot of stuff that is built up by triplet of pattern for instance in uh if you take an image and a coloured image you can split with the three primary colours or if you take a a a signal b a a chord for instance the C-major chord it is built up by three notes. So it is interesting to use three-directional associative memories.
and again using this trick of the integral representation, you end up with some kind of architecture that are not not even so long as shallow I mean those are not a deep architecture but are some complex object that i can be completely understand that we we understand everything about those objects through statistical mechanics. We control every detail of what those machines do and uh we can solve them but I will skip the mathematical calculations.
these objects do also um phenomenologies uh that are not possible to be achieved by the standard of associative memory. I don't have time to discuss them uh those are in the poster out there we wi I spend a word at the end of my talk. What I want to discuss is that is uh is the last point of my talk is the following. Now I understood that that there are we and we see that that there are out of associative memory and we are we are well aware of
We also saw that there are eteroassociative memory, the ones that have discussed in the past in the past uh in the last of uh slides of my talk. If now I use a a cost function that is the sum of both of them, so I have outer associative terms, three different of field models, so one of field model, one of field model and one of field model. And I couple them through these eteroassociative terms uh that are written here as minus in this triangle. So I have a
have an ensemble of interacting group field model and they are in negative interaction. They are repulsively interacting. And I give to this network as input a nasty object that is a spurious state of the group field model, that is typically a very, very nasty object to disentangle. Yet this object is perfectly able to disentangle. For instance, here you see that we are providing to this network that is a
an auto-ether associative memory, we are providing to this network a mixture of these three numbers. And if I have to see what I'm providing to the network, me personally as a human, I'm not able to perform the disentanglement. While if you provide this information to the network, you can see here the Monte Carlo simulation, one layer keeps the first value, the second layer the second value, and the third layer the third value.
value. Essentially because once the first layer is able to one is understanding that is retrieving one is saying to the other layers look I'm retrieving one, you have to do whatever you want, but not retrieving this input that I'm retrieving. So they forced to search in the orthogonal space. And in this way
What we see is that, as I quoted Hamilton and Lagrange at the beginning, I want to close my talk quoting another uh uh theoretical very famous theoretical physicist that is uh Anderson. And uh there is a famous statement by Anderson that is the more is different. And indeed Oh. a family of opfield network perform task that cannot be performed by a single opfield network. The single opfield
develop a network perform a pattern recognition but not part of this entanglement. A family of network perform part of this entanglement beyond part of recognition. And so there is an emergent capability at the level of networks of networks that is not present just at the level of networks. I do apologise for the uh plot that I skipped uh in for a a matter of time, but you can see the post that's by Albert and by Andrea that are uh
try to split over that if you want to depend add this this this this argument. Thank you for your gentle attention. Oh. Oh. Uh thank you very much. Uh questions?
I can ask one. Why don't you use the microphone on this stage? So you mentioned that you can use this Hubbard -Stuyonovich transformation to turn your cost function into this integration over Gaussian latent variables. What does that exactly give you in terms of it helps with the learning algorithm? It helps you with the representation. What Yeah. are you getting out of that? Well, at first the Gaussian integral is the one you did up on in the top right.
The first point is that the weights, the weights in the restricted Boltzmann machine play the role of the pattern entries in the Hopfield network. You see the Xi mu that is the weight in the Boltzmann machine, it becomes the the entries of the pattern in the Hopfield model. So if the Boltzmann machine has learnt correctly then when you use it to retrieve something it behaves as an Hopfield model, it would it would retrieve the patterns that are given by its weights.
I see so you're mapping the weights there using this trick into the g over the Gaussian weight Yeah, and variables, yeah, that's what you do, yeah. I see. uh y th this is mathematics, Yeah. this is not something that we can agree or not agree. This is Gaussian integration, it is exact. Uh-huh. Okay. Other questions? Dimi, Dima. Yep.
Uh in this example when you disentangle the school year state uh into into individual components, so do I understand correctly that um in order to properly perform this task you need to upfront know how many pure states have been mixed to produce this school years? Yeah. Yeah. Right, so so it's not like you give it any school years and it would decide whether or not it's uh a mixture of two or a mixture of five. Oh oh oh I don't that uh uh to one o to be honest I don't have the experience
experience yet to answer this question. We just saw those are preliminary result. We just saw that part of this entangle is a new feature. We try it with dispersed networks, with three layers and three parts. This work, we are trying with five layer, five part that this work, but the theory is completely under construction at this point. We just discovered there is a new task, Yeah. emergent new task. Thank you. Other questions?
Oh, one moment. Sorry, just just comment on on this thing. I I think intuitively that it would work still if you have three partitions but maybe it's a mixture of five. I think in that case it would still converge. The the nose three of the ingredients. This is just a wild conjecture. Yep. I dug it. Question over here.
Yeah, maybe it is just for the clarification from before. For example in this case of three, do you have to present like the three patterns together? Yep.
I see. Yeah, a and this is typically the the tough situation because if you have already split you that you have no problems the point is that sometimes you have a mess that is a merging of several patterns and you want to split the different components as for instance for the musical code if you play guitar you give to this object the the c major chord and you want to know which are the notes that build up the chord in this way you can disentangle the notes or the colors if it is a colored image
Hmm. Yep. And maybe to follow up, I think you mentioned it, about it you can do this for like five, six any And you have to enlarge the amount of layers. Hmm. My feeling but they have not the whole theory for them at m at the moment, my feeling is that you want to disentangle a five mixture pattern, you need five layers. Thank Roughly. you. Thank you. Any others? Oh, one more.
Thank you. Did you show that the uh the waste that minimises the K_L_ for the RPM is Yeah? analytically exactly the minimum of the energy function in the Hoff field? Nope, it is different. No, no. I I'm thinking of the regime that we have provided enough of examples to the RPM.
Absolutely, they're not too different things. The RBM learns by itself and if you do a work a very bad learning, the pattern that you with the clip and not the pattern that you want. I'm just saying.
The weights in the RBM will be the pattern that you will retrieve once learning is over, because when you train a network you just don't want to train a network to let us know that you are able to train a network. You train a network because you want to use it. For instance, if I train a network to recognise human face, I want to use it later on to recognise human face. So once learning is over, I want to use them to do pattern recognition. In order to do the correct pattern recognition
training must be performed very well. So once the training is over and you minimize the cool back library, ideally you set it to zero, the correct way the weights that you have in the Boltzmann machine are exactly the correct pattern once you use it later on to perform a pattern recognition of the phases and are exactly the the correct pattern of the dual op field model. But if your learning is not a good learning, since the beginning, the op field model that you will obtain
It obtain will have patterns that are not the patterns that you want. I see. Thank you. You're welcome. All right, one last question. Thank you for the very nice talk. Thank you. Uh in terms of obtaining the phase diagrams that you did, you had the phase diagrams that you said it's one of the things you could do using statistical

I'm stat you said this one of the things you could do using statistical mechanics, like could you sh uh sorry, uh y I I didn't I didn't tell you the surprise. I guess I didn't I didn't oh sorry, I didn't uh can you hear? I think it should work.
Okay, great. So you you talked about the possibility of obtaining face uh diagrams uh since you're using such kind mechanisms. Can you uh say what about precisely how you get this? Do you map all of these to some standard uh statistical physical model and then you extract the analysis from it or what are you doing precisely? What kind of analysis? I I don't map them through statistical physics model. To me those are statistical physics model and I solve them through statistical
physical physics techniques that are for instance the most famous one that you probably know is the replica trick. I use Okay, replica, okay, replica trick okay. at the replicas in metric level. Okay. Then there are several other much m better methods, but there are those are not this is not the the correct audience. For instance there are were interpolation, cavity fields, back propagation, those are better than the replica trick. Replica trick is just the most famous one. But this is the ty the the type of mathematical technology that lies behind this cus this
these these uh results, yes. Okay, thank you. You're welcome. Alright. Let's thank all our speakers here today again. Well So I think we have a break now and then there'll be a poster session right after that. Right, poster session uh starting in uh three. Right after the break. So have a good break.

We'll be right back.













Hi everyone, this is just a test preceding the memory and LLM panel that will uh begin in five minutes.
Okay. We have just one person with video and she just closed it again. My colleague is like asking prompting them he's prompting them from zoom to start their video and audio. Okay. Maybe you can tell them to do it and Yep. you should see them on the screen. So you can just check that it's working both ways. Yes. Can if I turn my video on you all can hear me, right?
Or see me. You all would see me. Yes, If I share but they my screen, will could you see? see you here as well. I see. If you share your screen, we can put it there. So if I share my slide over, it'd be one screen here? Uh How'd that not work? well, I can show you if you Yeah, share let's your try. screen. Let's try. Uh let me find my Can you double check with them that they can hear you? And ask them to say something.
Could you all say something? We can test your volume. Hello. Hello? That's excellent. Perfect. Hi, can you hear me? Yes, loud and clear. And I guess I'm And you are no different. Sweet. So now I'm gonna try sharing my screen again.

Could the Zoom participants check if there's another echo by saying something? Hello? Still hear the echo? No, no. All right, perfect. I'll gather the local panelists and then we'll get started.
I'm gonna ask Dan to start I guess. Well, I mean, they can be in a party. Okay.
We're about to start the uh discussion panel, so if you everyone could grab your seats again, we'll start in one minute.
All right, we're gonna start the discussion panel. Um just to get started, uh we have Ben Hoover from IBM who will be moderating the panel, and Ben why don't you introduce then everyone in the panel and who's online. All right, hi everyone. Welcome to the panel on memory and L_L_M_s to close out this uh assistive memory workshop.
Um, again my name is Ben Hoover, this topic of associative memory is very near and dear to my heart, specifically scaling these ideas to the problems that we're facing in the AI community at large, building
foundation models on big data. So it's my honor to introduce, I guess it's hard to see the people in the corner. We'll soon remove the Slido QR code and the code. So if you'd like to ask questions during this panel, please scan that QR code. It should take you to a Slido site where you can ask questions and upvote questions that you would like to be answered. We'll also be passing around microphones for audience members to ask questions as it goes on.
Um but without further ado online we have uh Dr. Zhe-Xue Hua. Uh she recently received her PhD in computer science engineering from U Cal San Diego and is currently a researcher at the M_I_T_I_B_M_ lab and an affiliate with M_I_T_S_C_ sale. Uh in addition, she works with trustworthy NLP like fairness, robustness, interpretability, controllability of L_L_M_s and she's invented techniques like Camelot that augment L_L_M_s with some kind of external memory. So welcome, Zhe-Xue.
Um on the bottom here on the screen we have Dr Eduardo Panty, he's an assistant professor in natural language processing at the University of Edinburgh, and is a visiting professor at NVIDIA. His research centres on efficient architectures for foundation models, learning hierarchical abstractions over raw data, modular deep learning, and computational typology. Um he's also worked on memory augmented knowledge modules and dynamic memory compression for LLMs. Uh so welcome Eduardo.
And finally Exactly. on the screen we have Dr. Maria Tonneva. She's a tenure-track faculty member at the Max Planck Institute for Software Systems, where she leads the Bridging AI and Neuroscience group, the Brain group. Her research lies at the intersection of machine learning, natural language processing and neuroscience, with a specific focus on building computational models of language processing in the brain to enhance our natural language processing system. So we welcome her unique perspective to this panel. Welcome.
And in person we Everybody. have, yes, great. We have Dr. Misha Bertsav, who's a leading researcher in memory augmented LLMs and is currently a Landau AI fellow at the London Institute for Mathematical Sciences. Misha is an expert on many topics, but relevant to our discussion today he has recently written several papers introducing different variants of the memory transformer, like the recurrent memory transformer or the associative memory recurrent transformer.
Um, Lehan Voutil is professor of Bordeaux. He's a research scientist at Meta AI research. He has significantly contributed to machine learning in many ways. Um, it seems like his interests of late have kind of been to understand, reinterpret transformers, what's going on from a theoretically grounded understanding of memory. Um, in his earlier talk today we caught a glimpse into his vision with the memory mosaic class of models. Uh, and for the rest of his very long list of accomplishments, please check out his Wikipedia.
is Wikipedia page. Welcome Leon. Um and finally uh Doctor Parikshit Ram, I've never said your full name out loud, is a research scientist uh with uh at IBM Research with me. I've been working with Pari for almost two years now and I'm continually impressed by his knowledge of classical machine learning techniques, optimization, and a penchant for generating crazy ideas uh on the spot. And I ex invite him to bring as many of those controversial ideas to the panel as uh possible. Um so welcome to our our panelists.
So just a few, you know.
This is a hybrid work uh panel. So it might be complicated or difficult, it might run into technical difficulties. I appreciate your patience throughout this. Um we'll start with a question uh related to the title of this talk, but every question is just a seed for more and more questions to make this as interesting a discussion as possible. Um so we'll start with the following. The term memory in the context of LLMs is interpreted in various ways. Um you can cache activations, um you can store things in external data stores and connect
connected to models? Or maybe memory is the actual mechanism that the LLM does when you go deeper into the layers. So how do you define memory and what are the key distinctions we could we should consider as we go into this topic? This is going to be John, let me invite the remote participants first to answer and then we'll go to the person.
I I have to pick somebody? would say the wicked, I guess. This is my first time moderating, so Eduardo, would you answer that question for us? Sure, so I guess like you can take a kind of broader kind of perspective of memory which would be whichever piece of information the model relies upon to inform its predictions about the future that are internal representations of what was observed in the past.
However, as you said, this is capturing a lot of different things, so to make definitions a bit more precise, I would at least argue that we need to separate short -term in-context memory, which is whatever captures the current context of the model and longer -term memory. And to me at least, one of the interesting questions that relates to this distinction...
is how to resolve conflicts. There may be contradictions between what the model knows, for instance in its parametric knowledge, and what the model observes in the current context and what should be the right strategy to then resolve this conflict and come up with a kind of reasonable belief about the world based on these two pieces of information.
So We having a little difficulty for the in-person panellists hearing the remote panellists. Can we turn up the volume? And another challenge for those uh on zoom is that we're in a big open room and every other workshop is talking over us right now. So it's even more difficult to hear.
I must say we can't hear the in-person panelists. I see they are discussing but we can't hear them. They haven't talked into the microphone yet. I hope that when they do, there will be no issue. I mean, I I I I can um can you hear us now? Yes, yes we Yeah. can. I mean maybe uh I'll I'll give it a try. So me uh I wanna change the discussion a little bit because I d I don't like the term memory.
I I mean we are trying to humanize all these concepts that we think of a memory is I mean I know in associative memories there's a very clear definition of what they mean they mean some attractors but when you come to try on LLMs and transformers as you described there are many different memories

describe their many different memories. To me the most meaningful one in that context is an external database. An external database where you keep certain information that's in there which utilise whether to validate what you're generating or valid or augment what you're generating. To me that is to me the the only precise definition of memory. Again um this is my own personal bias. Um
Beyond that everything else is just you name anything memory, you name anything hallucination, you name anything something humanizing uh and we lose kind of the the value of that word. Um but that that's just my personal opinion, sorry. Uh but for me uh I find it pretty useful to use memory uh
concept to understand and to describe different mechanisms which lies and like underlies transformer mechanism. For example I s I think that we are usually talking about like long-term or procedural memory as a parameters of our network.
It's like encode some function, some mapping uh learned during training and with uh attention and with uh transformers we also started to talk about short-term memory uh network it's our context. And in some sense this short memory is uh
unmutable. So y it's you can just observe your short memory, you cannot change these uh like values which which are written in your short-term memory. But we are not s speaking or I I am not I'm I'm haven't seen many uh papers discussing working memory. And I think that we are talking about these residual connections and we have these diagrams where we have links uh
surrounding our attention block and then uh uh a fully connected block. But I think that this is not residual stream, this is a memory stream. It's like m memory it's current state of the memory of the system and going from layer to layer
Architect like our transformer, it updates its uh current working memory state. And compared to the short-term memory, this is exactly where processing is happening because you can change this memory state. So you then it's for me it's much more easier to interpret for myself how transformer works. So it can first collect some information from the short-term memory, from the context.
And then update its current memory stat uh state like working memory. And then these working memory is used to extract something from the long term memory, some some general memory which were built during training to update memory states. So y in that this is repeated like few times. So this is my understanding how we can apply concept of memory for the c like current most popular architecture.
So two things. Um it's true that the notion of memory is not that well defined. Uh the associative memory is well defined. Uh memory can at least store and retrieve. So I think it's a nice tool to understand some of the operations that are made by uh machine learning systems, because you can discuss because there is a point where you store, you can discuss where the information comes from.
And where is going to be used? It's a kind of localization of the flow. Like for instance if you train a L_L_M_ there is something that I call a persistent memory typically is the forward is the weight. It comes from the training data. Now if you apply you L_L_M_ to a particular case, it's become a specific memory. Could be a contextual memory or something else or something you add on the side.
And the uh the specific memory is going to be about the specifics of the case to which you apply and the the resolution is going to be a mix of what's in the specific memory and the persistent memory. And the understand it it's a way to understand it this phenomenon. It's also a way to control. Even though you don't know what's in the persistent memory, you control what you put in the specific memory.
So for instance um uh suppose you have some kind of fairness issue or something like that, and you don't want your decision for a specific case to depend on some things, just don't put it in the memory. By controlling what's in the memories and like um I give you an example. I in the earliest times of L_L_M_s there was a reporter who complained that the
And some chat bot wanted to make them divorce, make make him divorce with his wife. And uh one week later another journalist talked to the same chat bot and said I asked whether he did that and he denied. And of course it's silly, because you understand that the memories are the same. The persistent memory is there, but there is no way the persistent memory knows about this two events. And uh specific memory was two different contexts.
So the interpretation of the second journalist was not something that was happening in the memories of the chat bot, it was not something that was happening in his memories. Which is sort of interesting to to look at it this way. So this is why I think the concept of memory is sort of interesting.
Maybe we If I may add something to this, yeah, so there was a comment that it may not be useful to humanize the concept of memory, but actually I would argue that. So memory has been studied for hundreds of years in biological systems, right, not just humans, but also other animals that.
don't necessarily share the same biological constraints as humans but do act in a similar environment in the world so it has been shown useful to think of memory and these consolidation retrieval concepts and it's possible that some of these things that we've uncovered over hundreds of years of research may be useful in analyzing another system that has emerging properties that in some
Some cases match human performance and also the representations that we build in human brains. So I would say that even though it's not a necessary condition that the kind of memory systems that LLMs develop have to be the same as in biological systems, it's still useful to try to use concepts that we've developed over many years and to see whether some of them can apply to LLMs as well.
I also want to add something. So I feel the definition of memory, different people will have different standard. For example, the residual memory can be viewed as an internal memory. And for example, your memory bank, external memory bank can be viewed as external. So if you distinguish your memory according to this framework, you can see you have memory like residual memory.
But if you can define your memory, like if it is controllable, if you can do retrieval, you can do forgetting, then probably residual memory is not something you can retrieve, right? This is just a memory stream from the input. So I feel there is no standard definition for different kinds of memory, and we should keep our mind open for that.
memorise. So people that just walked in, panellists were answering the question of how do we define the word memory in the context of LLMs even. And I think from a bunch of the answers from the panellists, I have narrowed down to three-ish categories. Feel free to add on or correct me if I'm wrong. There's this concept of short-term memory, the idea that something evolves throughout the model, learning from the context. There's this idea of a long-term memory, something in training, something that's stored in the parameters, um referred to as quote-unquote the internal memory of the model.
Um and then there's this concept of like an external database that you might be able to attach to the model, and all of these are of interest uh to people at this workshop. Is that generally correct? I mean I agree. I I I um I I think this discussion does like kind of at least improve my own understanding of what how this could be useful.
Um Yeah well this is otherwise that clear. Because what you call long-term memory, I call it persistent memory. What you call a short-term memory, memory I call it uh uh if it contextual. And uh when there is something I call episodic. And so somehow all these names that comes from psychology, and there are clear definition in psychology when you apply them to L_L_M_ well Okay.
Um there was a question on the slide -o um that's very related. So beyond the external memory units, all of the attractors that are imbued into the model, created in the model after learning, those count as a memory, right? Which kind of memory would those count as? Persistent? Okay. Um there's this also they say the word collective memory. Is that also a popular term that you all have heard described or no?
Okay, we got another question. In your opinions, what are the most significant limitations of the standard transformer architecture that this external memory component could solve?

a component could solve. I'll take a short answer here. I would say it one problem it solves is a long context problem, uh because it just you just store it in an external maze. You can like go and look at the first chapter of the book when you're trying to process the last chapter of the book. That that that's the only short interpretation that I can give uh of this.
Yeah, I I think I also think that uh the main problem which are people trying to solve right now it's a long context and this quadratic uh computation cost of uh attention and uh potentially y you also if you have a system which interacts with the user for a extended uh period you want to have something like episodic memory where which accumulates all the specific information about this user.
And this can be implemented as some external memory with a structured uh records which you can call and retrieve uh and put it in a context or probably we we can have uh something like memory augmented transformer which learns and stores this episodic informam information in its in internal uh memory as well. I also think that there is another uh probably overlooked problem of transformers.
And uh this problem is related to these to what I have called working memory. Because when we decode uh when we predict next token in transformer, what we are doing, we are starting from embedding of specific token. So it's s it you can imagine that the task of the transformer to change memory uh which is
related to specific starting last token to the next next token. So in this sense all this processing is biased by the um this initial value of the of the token. Probably it it like guides and biases transformer and limits its expressibility. A another thing is that all the representations
If we will think about our thinking process, probably we can consider multiple hypothesis and like multiple parallel retrieval processes at the same time. But in Transformer all updates they are happening only for this hidden residual stream. So all the information processing happens there. There is no parallel routes for like considering and developing alternative.
uh hypothesis or ar alternative to d to solve the problem. This I also think might be limitation. So it's too dense and you always add up and mix into the single representation all your like thinking, all your processing of the of the information. We have a hand raised on the zoom. Eduardo?
Oh, thanks. Yeah, I wanted to elaborate on this comment and I agree that these are fundamental limitations. I would say to be
even more specific so this problem of quadratic complexity obviously applies mostly to the pre-filling phase of generation which is when for instance transformers populate the key and value cache but during decoding we have kind of a separate problem which is when we generate tokens one by one namely high bandwidth memory access so it becomes more of a problem
of having a very large memory which in transformers is just the collection of keys and values that have been stored and retrieving them which means that we pay in terms of latency and throughput so in terms of efficiency
And I would say also that in general the question is a bit loaded, right, because it makes the assumption that external memory is necessarily the solution. I would argue that there are other promising directions here that kind of try to tackle some of the limitations that have been mentioned. So you can think of, for instance, sparse attention.
As something that goes in the direction of an external memory because you can basically plug whatever context even very long-term into the context of your model and still have a selective way to retrieve pieces of that information that are relevant to the current query. And the reason I say it is going in the same direction is that external databases or, you know, collections of text that you can retrieve with RAG.
are in text form now the assumption is simply that the retrievable items are themselves representations of the model but in a sense if we think of the main limitations of transformers and specifically their memory and KB cache as the pre-filling phase related one which is complexity and the decoding phase one which is memory retrieval then
Directions like sparse attention I think are very promising in tackling them while solving some inherent limitations of having external databases which is there is no guarantee that the model will actually use that information, there is no guarantee that the model will retrieve it correctly. So my answer is basically a way to say well
In addition to external memories, maybe we should also consider whether these foundation models and transformers in particular could be able to even eventually go in the direction of continual learning or extremely long contexts without the need of that external memory and if so what would be the trade-offs of the two approaches.
I think I have something to add on based on that. So I feel currently one limitation of transformer is it is actually static, right? Like the knowledge or everything, it is fixed after it has been trained. But sometimes you have knowledge conflict or even you need to update your knowledge very, very high frequency. So instead of
Like a function in a model, like updating by the weights, weights can be viewed as an internal memory as well. We can try to put something like the some.
some newest knowledge into the external memory so that you don't have to change your model just have to do rec or to do augmented so that is one thing and based on that the immediate gain is we can enable personalization because the idea under underneath that is you can you can move something move some knowledge from your bottle into the external memory then if you move the personalized information into the memory it enables a personalization of transformer
If you move the sensitive information into the external memory, then it enables AI security, like transformer security. So I think if we distinguish the knowledge that can be rapidly changed or it can be editable versus the knowledge that are more fundamental, which should be captured in the weights or in the transformer itself, I think memory can enable, that can improve the limitation of.
of transformer on this side. Slido link temporarily shown again on the Zoom. I would like to take just a minute or two and see if the audience here has any questions because otherwise we can talk and just ask questions ourselves all day. Yes.
Uh so uh uh can you hear me? Yes. Okay. So um I'm I'm curious about uh your thoughts on
not just the uh external versus internal or contextual memory versus persistent memory, but also about the relation between these two components, uh particularly the memory consolidation part uh because it seems to me that this part is missing from current architectures. Um like you know maybe in some cases we can argue that you have like these complementary learning systems like in the memory mosaics for example,
You have this persistent memory that is stored in the parameters, and you have the contextual memory that is doing the in-context learning. But it feels like there's something in the middle that is missing. I don't know if you agree with this perspective or not, but I'm curious to hear your thoughts about uh whether you think this is important. I For example you don't have a way to forget information as well, right? Uh it it doesn't happen naturally.
Well, in the memory mosaic work we had the persistent and the contextual because the data on which we train is done like that. The data is composed of a bunch of text snippets without any particular order. It's a bag of text snippets. So either you record something that comes from the whole bag or you record something that pertains to one particular text snippet. Oh. Doesn't work?
Draw the uh uh should I repeat? So I repeat because but I I'm not sure I'm going to repeat the same thing because my memory fails me sometimes. Um so in the memory mosaic work we distinguish persistent and contextual because the data is built that way. The data is made of text snippets, the training data. It's a bag of text snippets. The bag has no special order.

of text snippets. The bag has no special order. So at a given moment, you can know something that comes from the properties of the whole bag or from the properties of a particular text snippet, the one you're working on. And that's about it. If you want other levels, you have to make other distinctions. So if you have long text snippets, you can distinguish things that are very short term.
That could be called a short term memory or working memory because uh all these uh words that we borrow from psychology don't really mean the same thing when we speak of L_L_L_M_s. And uh a longer term. And the reason why we distinguish them is not just because we want to, it's because we see that in the statistics of the attention it behaves differently and should be treated differently.
Uh but when you speak about external memory, you mean you have an external programme that's going to access or retrieve data using different mechanisms, for instance using an index mechanism. A sub-linear mechanism.
Now how long is going to be external? Uh at some point we might be able to put this indexing mechanism into the internal ones, right? So so the notion between external and internal is not a m notion that's permanent. It's notion that's r referring to a particular state of the technology. So you know it's very uh all these distinctions we sort of understand each other.
But uh we see how it goes. Maybe we we could forget them at some point. I mean uh again, this is not a um answer to the question, but it's just a comment that um
Like as you mentioned like it seems like you're keeping contextual and persistent memory separate But I also think that we are working through multiple layers in the LLM right it's not just a single transformer right so when you work through multiple layers there These things are mixing at a in a way that at least I can't comprehend like are they it's not just a simple sum or nonlinear transformation They're mixing in a much more richer way
And I think in that, as as naive as that is, that might be the way we are m we are combining contextual and persistent memory um to to to the point that you are making. But it's just an hypothesis. I I I don't have a concrete way of saying what if that's what's happening. Um Any other questions from the audience?
Right, new question. Um okay, so we talk a lot about categorising memories and how do we even describe them? Can we use the words from psychology? Do they mean anything? Um what advantages does this perspective of memory actually give us for L_L_M_s, for foundation models? Does it give us theoretical advantages that don't exist uh empirically or in existing transformers? Like what are the main advantages of thinking about these transformers in terms of their memory modules?
Be a good candidate for that I think Maria, you were just nominated. Sure. Yeah. Yeah, happy to talk about that a little bit. So to me, we're still in the beginning of understanding this.
similarities and differences between language models and the human brain so you know whatever I say will probably be wrong to some extent but I would say that really to me the advantage at this point is conceptual so it's about thinking about what kinds of the fact that in biological systems we have different memory systems that were already mentioned actually by some of the other panelists so we have a
We have episodic and semantic memory, we have procedural memory, we have working memory. And so these types of memories are implemented by different systems that are largely disassociated. So you could go into the biological system and alter one system. So via some kind of
issue so there can be a lesion for example in one part of the brain and that does not alter the other systems so there's modularity between these systems so of course that gives an advantage right evolutionary advantage for the organism to still
behave well under certain constraints. So this to me having biological system that implements these modular systems of memory says something right so evolution has reached this solution not just in humans but also in some animals. So we should pay attention to some extent whether you know the same exact mechanism is what is happening in LM or should be happening.
to be happening now since you know another philosophical discussion but one specific point that I think is good to think about is specifically episodic memory because I think this is one big difference between
biological systems and current LLMs. So a lot of people are studying semantic what I'm calling when other people are calling semantic memory in LLMs so facts essentially and how facts are learned and consolidated in models and how they're retrieved. But episodic memory I feel is receiving a lot less of
attention in language models and I think it's also a big part of how we as humans solve this long context problem so the fact that we can in few shots we can learn actually in one shot we can learn information together with everything that it's contextualized with and we can retrieve it whenever it's necessary later on
All right, and this is a lifetime kind of memory. So I would, my answer to that short answer is I think currently we're really more at the conceptual level of borrowing.
And thinking about whether concepts from neuroscience psychology could apply to LLMs and thinking about how to potentially also build models of memory in humans using LLMs and seeing whether this also improves certain types of performance on particular tasks in LLMs.
that that we can learn in one shot, like we as humans are really powerful uh and can learn in one shot like a memory and the context around it. Do you believe that this behaviour is already present in L_L_M_s through inserting a sentence or a question and it being able to refer to that for a long time? Um if it's not there, what would you need to see in our synthetic systems to believe that we've achieved that in L_L_M_s?
Mm-hmm. Yeah, yeah. So when I said one shot, I meant long term one shot. So it's not just putting something in context in an LLM and then when you switch to the next context, it's totally forgotten this, right? So if you meant, okay, let's fine tune on the sentence and then you'll be able to recall it totally later, I think this is not quite.
True, right? Most of the time you need multiple repetitions to recall something exactly correctly. But in humans we do see this one shot.
learning which is episodic memory essentially that can be recalled in a lifetime of course it's not perfect so there is degradation of that memory as well but yes this is this distinction that Eduardo actually brought up in the beginning of short term versus long term memory and how in context in context presentation is really what's thought of as more short term rather than of course being able to be integrated in the parameters yet
Eduardo, I saw your hand. Oh. Oh yes, so if you allow me, I wanted to slightly reframe the question, which I think could be something like how can we design memories in foundation models, possibly inspired by human cognition, that enable...
unprecedented opportunities in the space of foundation models and obviously we've been talking a lot about long context which is the ability to you know extend your horizon into the past but I think another advantage of having more efficient memories for instance or more expressive memories is to look even further into the future which is for a long generation because nowadays long generation lies at the
the heart of test time scaling which is the idea that you can spend more time thinking if we want to define it in kind of very informal terms to then generate better outputs and test time scaling is fundamentally bottlenecked by transformer memory or the kv cache because obviously since it grows linearly there is only so much samples we can generate or
or only certain length we can

only certain length we can reach in terms of reasoning before running out of memory so designing better memory inside foundation models is not only useful for long context but also for reasoning long generation so I want to also highlight this kind of important reason why we care about memories in foundation models
I I can add to that about importance of memory for test time compute. I think that here we are touching another important uh direction uh is a c continuous learning and th these one shot uh learning. So usually, during test type ta test time compute uh we spend a lot of compute on generating hypothesis, testing them and finding solution. But today we just
then throw all of this compute, and if we will have the same problem later on, we will again spend all this t uh test time compute solving the same problem again. But probably the more
Efficient way is to analyse like to has a reflection of all these generated solution, distil what is important and store its in memory, and this will be m much closer to how how animals learn, when they have multiple attempts and then they can learn and remember the most successful ones not to spend times in the future to solve the same problem.
And here we can discuss can we use some uh analogies to how it's happen in a animal's brain with all these memory transfer from episodic memory to long term memory all the other kinds how it can help us to improve our our architectures. So I think that uh uh possibly today everyone is talking about this test time compute, meta generation,
But the next step, and maybe we should start working on that, is a continual learning. And So I was thinking about um the word memory initially. This is a human experience. You have the
So the word memory initially is a human experience. You have the memories of the voice of your children, the memories of your childhood, um memories that are shorter term maybe. And uh are they come with a lot of um personal experience and a lot of r emotional load.
Then you go to the domain of psychology or biology where you try to understand how this actually works. You try to make it more precise, uh episodic, short term, long term. There's also a c complete uh zoo of memories in in uh that have been defined, sometime contradictory. And you're trying to see where this could work. And uh you're studying the human memory.
Now we doing something else. What we're doing is that we have some machines in which a memory can be minimising and energy can be computing uh the Gaussian kernel, something that doesn't resemble the memory of you the voice of your children for instance. It's something different, right? And we make up a story where we try to draw a parallel or an analogy between the way this mechanism work
And the way human memories work, to what extent we know or to what extent we feel. So what we trying to do is we trying to transfer our personal knowledge of how memories work, which is based on our personal experience, to the machines in order to build a theory of how they work. So when we use the work memories for a machine, this is what we are doing really.
Because at the basis, uh if it's a computer uh programme which implements some mathematical models, uh it's not the same thing as the memory of our children, right? Or the memory of our childhood or the mem or the memory of the voice of our children, the smell of our lover or whatever you want. Something different. But we trying to transfer the thing that we know from our human experience about memories to the machines. Which makes sense because we hope that the machines are going to do human-like things.
But this transfer might work or not work. Whether it's going to last or not last depends on whether this is the right model to think about it. And so we shouldn't uh uh fool ourselves in thinking that we're doing memories in the same way that the memories that have been discussed in literature or the memories that we actually experience.
I agree, yeah. So it definitely is an empirical question and it needs to be studied deeper. And there are many scientists who are doing this actually and they are finding very interesting parallels and also differences. So for example, this one very interesting finding that has been
discussed in a couple of recent works is that this question of in-context memory, is it really short-term or long-term? So for example, Eduardo mentioned in the beginning that in-context we should think of it as short context, short-term memory, but actually some of the literature, very recent literature from the last half a year or so at this intersection is finding that
Some of in-context memory actually has properties of episodic memory in humans, which is long-term memory. So, for example, the kind of properties that it has in terms of...
retrieving information and also keeping information and for example if you have two segments in the context provided in context and you ask the model which one came first you see very similar kinds of accuracies between humans and models when you push those segments further away in the context so we see that some of this our intuition about what is short
term memory versus long-term memory models versus humans may not totally hold but functionally we do see similar behavior at least at some levels so I agree that you know the parallels may not be exact but there does seem to be some functional equivalents so the question of like is the mechanism the same which is still there and people need to keep working and investigating it.
Um I'll ask a follow-up question uh to Mischa. You started talking a little bit about continual learning and how we should be pursuing that. How close are we to having those systems work, and what are the most promising methods to for continual learning in in the things we use? Uh I I don't think that we have right now we have any methods which are close to what we see in animals and animals and and humans.
So I don't know, maybe some other panelist know something interesting in this area.
Again. Uh I I wanna uh first uh clarify that I I this is a speculation. But I wanna bring forth this this notion of task vectors. I don't know if anybody any one of you've have heard about task vectors in L_L_M_ but these are essentially where you have a base L_L_M_ that's trained by some big companies spending a lot of money and then you can like fine tune on top of it. Um what what often there's this new line of work where you fine tune
in tune for a task, and then you keep the delta of the weights. So in fact, like one can interpret that as a task memory. And then you do it for another task, you fine tune it, you keep the delta, and then what they have seen and is that if you have a third task, which might be somehow aligned to your task one and task two, instead of fine tuning for task three itself, you can literally pick task one and task two deltas, tune for some coefficient and add it back to the model and you get
performance under third task. So I mean they don't call it memories, but in this context to me, this seems like this is a task memory, which we can combine to continually learn and enhance our capabilities. Um
That so I'm not saying that's the way to do continual learning. It's not like we can maybe or maybe not, we can keep a bunch of me uh task memories and we can keep combining them to keep moving forward. Um but at some point uh just like every other memory we have to consolidate some and forget some. Um but this could be this is a just my own interpretation of how we can continually learn with the help of memory.
And I'll I'll pivot to a question that's I've been asked a couple time at this conference. Um we had a presentation on it earlier today. Um this word memory really is kind of loaded because it kind of assumes that what we are doing is we're reaching into a memory to retrieve something from that memory to return it. Um and when we actually use the systems like generative modelling often the task is to do something completely new, something that hasn't been stored in the memory. We want to generate uh a
a poem in the style of some of Shakespeare about a topic that's related to cell phones, you know? Um so I guess the question is, how would you clarify to someone who's at

To clarify to someone who's asking this kind of question, this this div slightly um difficult topic of how does memorisation lead to generalisation, um is it possible for a pure memory system to generate novel things? through this entanglement of the memories.
We add this in the moods, right? Uh when you disentangle the moods, you can predict mood configurations you haven't seen before because you can predict each of the moods. In your example, if you decide that style and content are largely independent, now of course speaking of uh uh using your cell phone in the language of Shakespeare is not something that you can have in your data set.
Because Shakespeare couldn't have done that. Uh but you can do it because you consider them to be independent. So what's happening is when you factor your knowledge in uh independent or conditionally independent components, uh you do it so that you model better what you know, but at the same time
You give the possibility to imagine something that doesn't exist, which could be hallucination or genius reasoning. It it's about the same thing. So that that basic mechanism is something that explains a little bit these things. It doesn't explain what is hallucination and what is uh genius reasoning, right. But
That's another story.
Maybe to add to this as well, when we talk about memory, we touched a little bit on this, that there are different types of memory. And so one is this knowledge part, like facts and events and different things the model has encountered during training. But another one is procedural knowledge. So the memory of how to do something, not specifically what the something is, but how to do it. And so this combined with what Leon was saying.
thing. If we factorize the knowledge, this is one thing. Another thing is to know actually how to use this factorized knowledge. So the memory can still be part of this and produce new things using the factorized knowledge.
Yeah, so I have a couple of comments. One actually refers to the mention of Tassi vectors before the pivot and I just wanted to come over quickly and say that I agree with that take.
There is indeed evidence that you can compress in the form of a delta in terms of parameters or adapters more broadly, not just knowledge related to specific tasks, but also even compress contexts into a delta of your parameters. So instead of concatenating a very long document into your model, you can first compress that into parameter delta and then just plug it into your model.
to sort of recover the memories associated with that document. And the analogy with associative memories can be pushed even further because instead of a priori determining which documents or cast knowledge is relevant you can also learn that end-to-end. So this in modular architecture is usually referred to as a router which is basically a function that tells you which of these
Parameter deltas of task vectors has to be plugged into your model to again recall knowledge related to specific task or skill. So I agree with that and wanted to expand on it to say that indeed there are many similarities between modular and adaptive architectures and memory structures.
The other comment I had, since also Maria had very interesting comments on the kind of different kinds of memories, I guess one axis is the temporal axis which is, you know, how far into the past those memories refer to. The other, which I think we haven't really discussed yet, is the distribution of the data we want to recollect. Because for instance...
very long sequence can contain information that is either very localized or scattered across the sequence it may need to be integrated through reasoning or there might be different degrees of similarity between the information you want to retrieve and the confounders or you know the rest of the knowledge included in your sequence so I guess
When we discuss memories we also have to take into account that it's not just the kind of memory but also the kind of data we want to retrieve that is important to sort of disentangle all these different aspects of defining memory.
I also want to follow up with what Maria just said, like there are different kinds of memory and those memories can help in the generalization. So in some of our work, like we also define another type of memory that is, for example, after consolidating several specific experience or event, the memory becomes more abstract.
becomes more general. And I think that kind of like abstract memory will offer evidence or foundation for memory extrapolation or for
For generalization, you don't know how Shakespeare is going to use the cell phone, but you know how Shakespeare is like the style of his writing and you know how cell phone is. They are more abstract and I think the language model is able to, as Mariah said, is able to tell you how to use those facts, to use those abstract memory to generate a reasoning path or to give you an answer.
So I think like this type of memory is abstract memory or foundational or those general memory is also another type of memory gives the generalization. Eduardo, you brought up the concept, the topic of architectures.
I guess I'm a little curious. Everything on in this current year basically is running on the transformer architecture and it's achieving state of the art results in a ton of stuff. And uh at least we in this room are, you know, thinking a little more critically about how we design these architectures. Um so this is a question to everyone in this in on this panel is um
Do you think that the things we want to see from a human-like memory is achievable by an architecture like this transformer? Or do we need to take some large modifications to start? Certainly the memory mosaics is one example of kind of reformulating and rethinking these, but is it possible to achieve this with what we currently use?
The pick one of you I will, but I'll let you all talk brief look at each other awkwardly for a second. I'll I'll make one comment here, I mean uh I I d I d I like I don't like to say whether it will be possible or impossible, but I think one thing that's uh I I think could be important is building upon Leon's comment about disentangled memories. I think there needs to be a notion of hierarchy of memories, um which
Given that we deal with everything in a vector, maybe implicitly there is some hierarchy. But it would be nice if we can somehow put an inductive bias of hierarchy in the memories, which are whichever memory we are talking, whether it's contextual memory, whether it's persistent memory. If there is a hierarchy, maybe that will benefit.
uh the the whole overall system and make it more like what you're what we want to get to. But I don't know how to get there, but I would h like to hear the thoughts of the panelists about how we could make the memory in some some b somehow hierarchical. So for me the answer to the question is I don't know because I don't have memories of the future. Um
Uh the the way to give a positive answer would be to show that whatever architecture we find is final can implement all variants of memories in a certain way. But we are far from that. We don't have the no no evidence of that. So we'll you know the the discovery of the transformer is serendipitous.
It's doing things that are interesting in ways that were absolutely not for for seen when it was formulated. It was formulated as doing something more efficiently, doing the recurrent network things faster. Uh there was earlier work by a signase at about memory networks where there was the idea of having memories and having uh trainable memories. The memory systems were trend.

The memory systems were trend, uh and uh that was nowhere as powerful because they were only one who could disentangle them. Um so if you look at in the past uh you see that things have been done and then we have something that works only. There is no reason to believe it's the last one. But we could believe that maybe it's general enough to implement everything we need.
But we have no evidence for that. So the necessary conclusion that we cannot answer the question. Uh I think that I also cannot answer this question directly and uh but
Uh I think that probably transformer is not uh the final architecture for certain, because it we still need some functionality which is not in this architecture and I think that we as a community will try to implement this faster learning, better memory and we will change it to suit our needs.
Um I guess I'll invite one more chance for audience to answer or ask questions. Yes, in the corner. Uh can you hear me online? I have a specific question for Maria. It's like I'm curious to know more about this episodic memory in animals. And more specifically I want to see how
At close, they are mathematically true the exotic memory in human brain. By that I mean it's like the exotic memory for human brain has for instance four dimension, when, where, who, what.
And then all the fixed points and memories are just in these four dimensions, happening in a space with only four dimensions. Is it something that you see in elements when you look at the space of fixed points or memories? Are they really embedded in only four dimensions or not really, if they are more so it's really difficult? Because if you lose one axis, probably you're moving all the fixed points.
But for us, if we lose time, we are still able able to remember the what who and where.
Mm-hmm. Yes, very rich question. Yes. So actually time, as it turns out, is one of the major parts of episodic memory for humans. So this is actually one way that neuroscientists and psychologists test for episodic memory in humans a lot. So for example, they show, so let's say you've read a book and then they ask you, okay, which
Which sentence of those two sentences happened first in the book? So this like recency judgment. So time, it seems to be a very critical component of episodic memory, as well as contextual information. So spatial information and also emotional content of things that you learned that's also part of episodic memory. So I think this definition of like who, what.
where and when is part of context so it's part of contextualizing the memory for humans as well but it's currently I would say it's not super well understood for models so this like studying episodic memory in models is very new it's a new direction so so far people have focused a lot on time because again it's a big dimension of human episodic memory
And what they've been finding is some interesting positive results, again on the in-context side, so people have studied this with also RAG augmented systems and showing that that's not sufficient to have the kind of episodic properties that in context memory can give.
But in terms of these other questions that you asked about the other contextual components of episodic memory, those are a lot less well understood in models. So this is like very open research questions to pursue in this area. So maybe it's a bit of a joke, so four dimensions, when, where, what, how.
Four dimensions only. Why? one dimension. Actually think there's only one dimension and perhaps that's only place or only time and I cannot even distinguish between place and time. And the rest I think they could also be just one category.
But it's very conventional that they say there is one when, where, what, who. Uh uh just maybe a quick comment before you said uh as a possible direction, right, to introduce this uh hierarchy of memories or uh uh couldn't we count that somehow this hierarchy somehow establishes by itself
uh in this emergent way in LLMs. I mean that this is my my impression. Why uh because uh there's analogies right work really well, much better. So if we have different types of reasoning, I don't know deductive, inductive, abductive and so on, we have also no logical reasoning. And this is far the best, right, um in LLMs. And this suggests in a way that the hire is hierarchies are sort of
established to some degree, right. Uh it's more like hypothesis conjecture, right. Um so seems like this L_L_Ms or transformer models are generic enough that they establish this kind of uh thing by itself, right. Also if you analyse activation vectors, right, throughout the layers of uh L_L_M somehow you see that there is uh
possible hierarchy in there right so we didn't go that deep yet right but it suggests it's more like a comment not question really Thank you. Thank you. Yeah, I mean I can speak to that from the human perspective a little bit. So people have shown
at this intersection of neuroscience and language models that as you go through the layers of a model up to about two-thirds into the model starting from the bottom, so the earlier layers, you see a hierarchy of activations in the model that map onto a hierarchy of processing in the brain starting from early sensory cortices to sort of the most semantic areas of the brain.
we see a decrease in this alignment later on in the model so sort of towards the middle of the model is where you get the most.
abstract level of alignment with the brain. So I agree with the person I think in the audience who made this comment that it seems like at least some degree of abstraction is emerging already in hierarchy in the model and it maps surprisingly well onto our understanding of both how audition and like reading works in the brain.
I want to go back to the question about what's missing, but maybe to ask it in a different way. If you had to bet whether the current kind of transformer-like architecture and LLM paradigm whatever will successfully address whatever memory-related issues there are versus we need something fundamentally new, how would you place that bet?
Like as a percentage for example 50 50 or 60 40 or something. Hmm. Let's see. Can you clarify if 60-40 is leaning towards the transformers are enough or if we need Let's something else? let's sa let's say transformers are enough is the first one. Uh w one
Maybe controversial comment. Are we accounting for the sunk cost on what we've already spent on transformers? And we have the incentive to just continue with them, because I think that would bias the the odds for us to try something completely new. We have like invested so much time and resource on this at this point that inertia will just keep moving us in that way. But that's it's not a scientific comment. It's just my personal comment.
That's why I think it's worse than 50-50. I think we'll just continue with this for the foreseeable or next short term until there is we feel a need to give up on some sunk costs and try something new.
Till then I think it'll just be incremental gradient changes to this architecture, um but that's my opinion. Like we'll just keep making smaller and smaller changes, um augment it. And then and then these are brilliant pieces of work like I'm not trying to downplay them. It's not trivial like what we have what where we are is pretty amazing.

have what where we are is pretty amazing and improvements will be there and small improvements is not a bad thing not everything can be a big step change we can we can steer this in the right direction and some of the work that Misha here is doing is taking us towards that and some of the work like the mosaic is also like it's a it's a delta change as as mentioned by Leon which is taking us towards that and I think though I bet
I bet more on those than I bet on a completely new architecture coming out of this. Ninety ten. This stays around around a ball around transformers. Forty two. Forty two. We can discuss the unit.
But it depends on time scale. If we think really long in the future, it's for sure we will get something totally different. So I would say that to me architecture is a way to put an inductive bias in a model that can battle let's say constraints in data or constraints in computes that we have.
So I think as we reach amounts of the limit of amounts of data, new data that we have or amounts of compute, then we'll be forced to rethink the architecture a little bit. But until then, I don't think we have an incentive to rethink architecture too much because if we have wildly expressive architecture given huge amounts of data and compute, it can learn.
an emergent, there can be an emergent architecture inside of this like very expressive architecture that leads us to the right solution at the end. But yeah, this constraints of data and compute I think will force us to rethink the architectures a bit. So I'm less pessimistic but maybe something like 70-30.
Personally, I don't like to place bets on this kind of black swan event, Because if you will. the neighboring workshop just started talking at high volume. I apologize. No worries, no worries. Can you hear me now? Good, we're good.
Yeah, so I was saying I don't like placing bets on this kind of black swan events where, you know, it's a change of paradigm if we completely abandon transformers. What we can say is, I think at least three things. There already exist architectures that are trying to challenge transformers.
state space models, for instance, that have their own limitations. They have finite capacity because they have a fixed size memory which is their state, um and there are hybrid architectures that try to combine the strengths of both transformers and S_S_M_s, I don't know if that would count as a completely new architecture. The second thing is
To build on the comment that, you know, people, there is like a sociological reason why we'll keep using transformers, which is, you know, people have, you know, spent money and resources on them. It's also even at a finer grained level true because
There are a lot of hardware constraints that now facilitate transformers, CUDA kernels that are designed explicitly for transformer -specific operations that are not immediately available for alternative architectures. So as was already said, there is going necessarily to be a bit of inertia in that respect.
And I guess the third point I wanted to make is also that a lot of the changes that were advocated during our discussion
I would argue can already be integrated into transformers without fundamentally changing their nature so if you want you know dynamic memories which is for instance what we've been trying to do at Nvidia where you can not just control the content but also say the size or the structure of your memory which is KV cache and transformers or states of SSMs you can already do that with
well minimal modifications so again it depends a bit on what you count as completely new this is you know the paradox of arthritis from you know the Greeks you know there are minimal changes we're making that are changing the architecture but not fundamentally so if you don't count these I think for the next few years we are safely remaining you know in the space of transformers but that's just my expectation
Thank you. Also, I mean, all the panelists already gave them very valuable insights, but I want to offer one.
new perspective so even under the scope of transformer there are a lot of things need to be done for example the training and optimization so one of our recent work in sml 2025 we're submitting the paper we actually enable transformer with huge memory back when i say huge we actually want to enable 10 million slots as external memory however it's not
It's not possible to put so large memory back into either GPU. You either have to move it offload it to CPU, which means you have to communicate between CPU and CPU. Otherwise, you have to do memory parallel, which is not enabling either training parallel.
like pipelines such as deep speed or whatever so we notice that is actually the immediate bottleneck for training your model with huge memory and I think to achieve that it also requires effort from a lot of you know community not just the memory memory research or language model research so even my point is even within the scope of transformer there are a lot of things we have to do
so I also like do not be very positive of changing the architecture dramatically. So one comment, and this is for all the panelists or even people in the audience. I would be interested in trying to think about an interpretation of.
The M_L_P_ layer in a transformer has a persistent memory and square that with the recent interest of mixture of experts interpretation of M_L_P_s where we are not going like where we treat a full M_L_P_ layer as a bunch of small experts and then we selectively pick what is the memory interpretation of such such a uh architecture.
So there is a two thousand nineteen paper that I mentioned in my slides that uh expresses F_F_N_ as persistent memories in an explicit way. And shows that you can do it by appending them to the K_V_ cache essentially as memory blocks that would be submitted to gradients so they would be trend persistently. And you can do that without loss of performance.
So that totally sits the fact that the F_F_N_ is a persistent memory. And that is not different than the contextual memory, because it can be just appended to the contextual memory. So that part is pretty clear. Uh the part uh about um Mixture of experts. mixture of expert is a bit less clear.
Because um uh but when you prepare a mixture of expert you are just trying to save computation essentially. And there is no uh requirement in the cost to have experts that are consistent in their opinions, you just you just spread things uh and hopefully it's going to work.
Uh so it's a bit less clear. Uh when we implement the F_F_N_ as memories in the memory mosaic, uh we have a lot of memories then dependent in there. But this is very similar to what's happening when you have a F_F_N_ and you can interpret each hidden so suppose that the F_F_N_ is a two-layer M_L_P_ you interpret each hidden unit
As a memory uh as a as an entry in the memory, the key is the first layer, the value is the second layer, the weight of the second layer. The the input weight of the key, the output weight of the value. Uh there is a change on the activation function, which is no longer a release, it's a soft max. And the soft max means you're making groups. And the question is how many groups? So there is a bit of modularization there.
And you can prevent it that way. But it's not exactly the same as the mixture of expert in terms of uh how you distribute the work. Uh you could see that the mixture of expert is also a distribution of the work in which um so if you start grouping the the hidden unit in the middle of the M_L_P_ layer in groups on which you're going to have soft max instead of having global relu,
You could have something that guess which one is going to be the which ones are going to be the ones that are interesting at off sparsity. So all this is it's not clear that it's that deep. Uh I think the sign-up paper does

I think the sign-up paper that shows that what the FFFN does could be implemented equally well by adding entries into the K_V_ cache and letting gradient field them. Uh that one is very cool. I am going to briefly say we have about a minute to two minutes left in the panel. Eduardo's raised his hand, so I might let him say his final thing and I'll make a closing comment, and then we will close.
And so very quickly, I don't know if the person in the audience read this paper, which is called mixture of pirates. That is, I think, an interesting piece of evidence for the question because they compared the performance of mixture of experts on different kind of tasks and they find that they scale in terms of performance.
for factual tasks, so not word knowledge tasks where you have to recall facts about the world, but the number of experts does not linearly correspond to improvements in tasks that require reasoning like math or common sense knowledge and reasoning. So I think this is a piece of evidence that tells us that FFN has a role in factual knowledge but not in other
the skills like reasoning and I think that could be a way to say that they are an important piece of the memory of the model but just captures a subset of what memory is meant to do in LLMs.
I honestly I thought your question was great, I've been itching to answer it, so I'll say it as my final comment. Um there's two main ideas with transformers. One is this idea that everything can be represented as a token, your text, your images, whatever and dumped into the same model, learn associations and out comes beautiful magical working thing. I'm about a hundred to zero, ninety nine to one that that will continue to be the paradigm for a long time. The actual transformer itself, I think that for everyone in this room working on memory, on
on all sorts of architectural improvements. There's, you know, maybe we're close, but we're not exactly there. There's a lot of room for improvement on the architecture itself. And I hope that ideas from this workshop will make its way into the mainstream. So thank you everyone for attending the panel. I want to thank the panelists, remote and in present person, um for their comments. And especially to Zishua who is uh been up since four a m for us. So thank you.
Six months been for moderating. Thank you so much. Thanks everyone. Bye-bye.
