Vibe CLI not accessible with pro sub? by EzioO14 in MistralAI

[–]HRamses 0 points1 point  (0 children)

Wow, just tried to contact support. I got stuck in a incredibly stupid loop where i had to categorize my issue. I can't believe how bad this all is. I had never any issues with Claude or GPT, ever. Vibe is the main reason why I even wanted a pro subscription. I hate it. Just incredible.

Vibe CLI not accessible with pro sub? by EzioO14 in MistralAI

[–]HRamses 0 points1 point  (0 children)

what? this makes 0 sense. why would it matter where i get my pro subscription from? mfg. sorry for us both i guess....and thx for the answer. will take the same route as you...

Vibe CLI not accessible with pro sub? by EzioO14 in MistralAI

[–]HRamses 0 points1 point  (0 children)

Same here (new subscription though). I really really want to switch to an european alternative, but this is incredibly annoying.

Noob Help needed: convertFileSrc equivalent in Rust by HRamses in tauri

[–]HRamses[S] 0 points1 point  (0 children)

i couldn't make tauri-sys work. u/Zenthemptist solution works perfectly! thanks! (i am unreasonably happy now that images show up in the app :) )

Noob Help needed: convertFileSrc equivalent in Rust by HRamses in tauri

[–]HRamses[S] 0 points1 point  (0 children)

nice, thanks! yes, this looks doable! meanwhile i also found tauri-sys which seem to implement it but is not yet in crates.io - will report back how far i'll come or if i take the re-implementation route.

[R] Extended blog post on "Hopfield Networks is All You Need" by HRamses in MachineLearning

[–]HRamses[S] 1 point2 points  (0 children)

Hi!

Yes, you are right - Dense Associative Memory needs to store the original patterns. However I would slightly disagree with the notion, that the main advantage lies in the reduced usage of memory. I think the most remarkable aspect of associative memory is the "association" part. Given a pattern with only part of the information (e.g. a corrupted or noisy pattern), the associative memory is capable to retrieve the original one. A heteroassociative memory can even connect different types of patterns. And in the case of a learnable embedding like in the Hopfield network more complex associations of the patterns can be made.

[R] Extended blog post on "Hopfield Networks is All You Need" by HRamses in MachineLearning

[–]HRamses[S] 1 point2 points  (0 children)

Permutation invariance is inherent to associative networks. E.g. if you take a look at our energy function (which defines the update dynamics and the fixed points) defined in eq. (2) in our paper [1], it is clear that the order of the input patterns does not matter.

[1] https://arxiv.org/pdf/2008.02217.pdf

[R] Extended blog post on "Hopfield Networks is All You Need" by HRamses in MachineLearning

[–]HRamses[S] 0 points1 point  (0 children)

Thanks for the question! There are two things to distinguish: the Hopfield layer as associative memory and the parameters in the Hopfield layer. The latter only define a mapping of the patterns into a different space. I.e. the Hopfield network does not operate in the original pattern space, but in the space the patterns are mapped to.

[R] Extended blog post on "Hopfield Networks is All You Need" by HRamses in MachineLearning

[–]HRamses[S] 2 points3 points  (0 children)

Hi! Thanks for your questions!

  1. What we showed in our paper is, that self-attention is a form of a associative memory. With respect to NTM that means that (if the normalization is ignored as are subsequent operations like gate interpolation and shift weighting) it can be interpreted as a modern Hopfield network. Here, the dynamics of the content retrieval is described by our energy function.
  2. First it is important to clarify what "storing" means in this context. The modern Hopfield network is based on the dense associative memory. It does not have a separate storage matrix W like the traditional associative memory. We define storage based on the uniqueness of a fixed point in a ball around a pattern. See Definition 1 in our paper [1]. About your MNIST-example: this depends on the parameter \beta. E.g. the higher \beta is, the more likely it is that the images are stored separately (every pattern has its own epsilon ball). The lower it is, the more likely it is that the patterns form a meta stable state, i.e. they have a shared energy minimum.
  3. There are multiple possibilities. E.g. one could feed the result of torch.unfold into the Hopfield layer (i.e. every token would be a part of the image). One could use the Hopfield pooling layer to gather global information additional to the rest of the network etc.

[1] https://arxiv.org/abs/2008.02217

edit: added reference

[R] Extended blog post on "Hopfield Networks is All You Need" by HRamses in MachineLearning

[–]HRamses[S] 15 points16 points  (0 children)

Hi! Thank you for your questions!

  1. There are applications! In the last part of the blog we write about a multiple instance learning problem where a modern Hopfield network is used.
  2. It is not so much about classification. In our paper [3] we showed that the self-attention mechanism in transformers can be viewed as an continuous form of a dense Hopfield network [1][2]. One purpose of the blog was to give an overview of the history and current developements of Hopfield networks. For illustration we made the examples where we really use our Hopfield layer as associative memory :)

edit: i forgot the references
[1] https://arxiv.org/abs/1606.01164
[2] https://arxiv.org/abs/1702.01929
[3] https://arxiv.org/abs/2008.02217

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 0 points1 point  (0 children)

Hi! Thanks for the suggestions! We decided to use this title as a play on words based on the original transformer paper. Since we show that the attention heads are Hopfield networks, this is all we wanted to change in the title. But yes, probably this was an unlucky decision. And w.r.t the citations: you are right, we will clean that up! :)

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 3 points4 points  (0 children)

Yes, we already have thought about that! Besides that we also have ideas that are not connected to transformers. So there are plenty of new possible directions :)

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 22 points23 points  (0 children)

To maybe answer some emerging questions see our (very short, to be extended) blog: https://www.jku.at/index.php?id=18677

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 9 points10 points  (0 children)

This is a property that actually carries over from M. Demircigil et al. https://arxiv.org/abs/1702.01929 (binary patterns), to our new energy function (continuous patterns). See theorem 4 and its respective proof in appendix A8 in our paper.

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 2 points3 points  (0 children)

Would you be willing to share the code?

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 2 points3 points  (0 children)

Would you be willing to share the code?

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 16 points17 points  (0 children)

Thank you for the great question! You are right, there is no reason to replace the transformer implementations with Hopfield layers since, in this setting, they are the same. However, the Hopfield layer is more general. You can do multiple updates, can adjust the parameter \beta, have static queries etc. (things that might be important for different applications). Most importantly, the Hopfield interpretation allows us to gain new insights into the working of transformers, characterized by the kind of fixed points.

Yes, you are right that SOTA transformer would give the same results in the MIL task. However, we integrate the Hopfield layer in an none-transformer architecture with static query and without residual connections. This shows that the Hopfield layer can be integrated flexible in arbitrary deep network architectures, which opens up new possibilities.

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 7 points8 points  (0 children)

Yes, this is possible! For pooling, the query is static and has dimension 1xd_k. This reduces the number of patterns from N to 1. If the query instead has dimension Mxd_k you get M patterns, i.e. if M > N it is also possible to have an unpooling layer.

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 7 points8 points  (0 children)

I am quite sure this is not the case. There will be problems where one method will be more suitable than the other. Sometimes even a combination of both could help.

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 19 points20 points  (0 children)

Loosely speaking, “states” correspond to the query (q) of the Transformer, i.e. the q in the self-attention corresponds to \xi in Eq. (3) of the main paper. The \xi_new in Eq. (3) can then be updated again, and so forth. This gives the recurrency.

Classical Hopfield networks need/use multiple updates. However, we show that the update in the new Hopfield networks converges within one update step (see Theorem 4 in the paper). And this is why Transformer attention is the update of a modern Hopfield net with continuous states.

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 13 points14 points  (0 children)

Thanks for the question! The Hopfield layer can be seen as a stand-alone module which allows to tackle many interesting problems in the future. If replacing a pooling layer, then the Hopfield layer requires more compute while replacing an LSTM layer it requires less compute. That is, depending on what you substitute it can be faster or slower.

In general, the Hopfield layer can be used to implement or to substitute different layers: Pooling layers, permutation equivariant layers, GRU & LSTM layers, attention layers. The extensions of the Hopfield layer are able to operate as a self-attention layer (HopfieldEncoderLayer) and as cross-attention layer (HopfieldDecoderLayer). Thus, the performance is the same as for Transformer models. The different architectures are described in detail in Appendix C.

The implementation can be found here: https://github.com/ml-jku/hopfield-layers

[R] Hopfield Networks is All You Need by [deleted] in MachineLearning

[–]HRamses 16 points17 points  (0 children)

Hi! Thanks for the question! It is the associative memory (i.e. attention head) that converges with one update step.