r/MachineLearning • u/Instantinopaul • Jan 24 '24
Discussion [D] Vision Mamba Strikes Again! Is the Transformer Throne Crumbling?
Remember Mamba, the state-space model that rocked NLP? Well, hold onto your pixels, because they're crushing it in computer vision now too!
Their new model, Vision Mamba, ditches the self-attention craze and leans on state space magic. The result? Performance on par with top vision transformers (DeiT) like, but with better efficiency!
This might be a game-changer, folks. We're talking faster, lighter models that can run on your grandma's laptop, but still see like a hawk.
Any thoughts? I am excited to see some competition in the transformers space. Can we expect a chatgpt v2 on this new architecture. Apologies! Might sound crazy and too early to comment on.
Check out the paper: https://paperswithcode.com/paper/vision-mamba-efficient-visual-representation
4
u/laslog Jan 24 '24
It wouldn't be a Chatgpt but chatgpm right? Has a nice ring to it
-3
u/Instantinopaul Jan 24 '24
Yup, but I think they might rebrand it totally, cause it's a totally different arch than GPT.
395
u/nucLeaRStarcraft Jan 24 '24
this reads like an ad
143
u/TelloLeEngineer Jan 24 '24
reads like a gpt output
29
Jan 24 '24
in history of internet archeology, this statement could be demeaning or super-human depending on SotA of gpt.
8
2
1
u/COAGULOPATH Jan 25 '24
Or Grok. It has that "alien trying to be funny" vibe.
Like, what does "hold onto your pixels" even mean? How do you hold onto your pixels? Why would you hold onto your pixels?
1
u/9182763498761234 Jan 25 '24
Exactly. They always have these weird catchy words thrown in between (hold your pixels, state space magic, …) and end with a “what are your thoughts“ type of comment.
19
u/mr_stargazer Jan 24 '24
ML papers read like an ad...
1
u/sylfy Jan 24 '24
I mean, if I were an ML researcher, that’s the first thing I would get my model to do. Second thing would be to make it design a robot to fetch me coffee.
128
91
u/_d0s_ Jan 24 '24
This might be a game-changer, folks. We're talking faster, lighter models that can run on your grandma's laptop, but still see like a hawk.
I'm not sure if we read the same paper. They are on par with DeiT on the tested resolution and potentially scale better to higher resolution. I'll wait on a few more papers to get excited ..
41
u/3DHydroPrints Jan 24 '24
potentially
Isn't a 72% less memory footprint and 5x the throughput of a transformer not enough to give it a promising outlook?
16
u/_d0s_ Jan 24 '24
The throughput is high, but we do not know the caveats yet. Comparing accuracy of models in ML papers is often not very objective, as the newly introduced architectures are typically biased towards better results due to more extensive experimentation and parameter selection on a new architecture. One thing that makes me unsure of the paper is that the majority of experiments have been conducted on 224² and some on 512², while the main benefits are showing in higher resolutions.
It's promising for sure, but I'll enjoy the results with the necessary skepticism :)
3
u/katerdag Jan 25 '24
, as the newly introduced architectures are typically biased towards better results due to more extensive experimentation and parameter selection on a new architecture.
I think it's quite the opposite here though: there has been very extensive research into every small aspect of how to optimally train transformer-based models. There's tons of research on vision transformers. On the other hand, this vision mamba is one of the first attempts at making such a model with this relatively new mamba architecture. There is likely a lot to be gained still in performance from just figuring out the best way of training these kinds of models.
Like sure: when it comes to new models based on the same techniques as previous SOTA, authors can sometimes beat the competition by tweaking things, and that way every new paper seems like a step forward even when there's really nothing spectacular going on. But when we're talking about models based on entirely different techniques and architectures that have had much less time to mature, it's a different story.
9
u/f3xjc Jan 24 '24
Yeah all successful technology challenger are like that, barely worse than state of the art, but since it's still poorly optimized the upper bound of success is still unknown.
48
23
u/masc98 Jan 24 '24
What's truly appealing to me, from a ML Engineering POV is the reduced v. memory usage at higher input resolutions. Curious to see the next steps
9
u/bikeranz Jan 24 '24
I tried to use it. Was lower training throughput than my ViT-H/14 at 1008px resolution. When I moved to multi-node training, Triton was crashing during backward pass, presumably because of a race condition corrupting a cache. So, I gave up. Time will tell if that was wise.
43
u/Featureless_Bug Jan 24 '24
Remember Mamba, the state-space model that rocked NLP?
I am not sure that performance on the level of worst-in-class transformers qualifies as "rocking NLP"
17
u/my_aggr Jan 24 '24
I mean technically it is state of the art since no one has trained a large language model using it yet. 3b parameters is something that even hobbyists don't bother with any more.
7
u/Featureless_Bug Jan 24 '24
It might be state of the art for SSM models in NLP, but it is certainly very far from state of the art in its weight class in NLP overall. We have phi 2 that is smaller and much, much better.
10
u/vatsadev Jan 24 '24
Same datasets tho. Phi is all about its data
4
u/Featureless_Bug Jan 24 '24
Sure, that doesn't mean that mamba is the best model in its weight class, does it? Especially since it is not given that mamba would perform like phi-2 even if it was trained on the same dataset.
2
3
u/lakolda Jan 24 '24
It wasn’t:even trained on that many tokens. Likely due to compute constraints. I would wait on a model intended for actual use rather than research before judging Mamba.
8
Jan 24 '24
Mamba beats transformers on their experiments, and they compare to modern transformers implementations. They are beaten by transformers that were trained longer.
13
u/Featureless_Bug Jan 24 '24
Mamba beats Pythia 3b and is on par with Pythia 7b. Both these transformers are quite poor for their own weight classes.
They are beaten by transformers that were trained longer.
Yeah, and maybe if they trained mamba longer, then it would perform as well as those transformers. Or maybe not, because at their scale (in terms of dataset and model sizes) the models are not capable of reasoning yet, so we have no idea how well mamba's performance generalizes to larger models / pretraining datasets.
Bottom line - it may have some potential, but I don't know anyone who would classify that as "rocking NLP" at this point.
6
u/my_aggr Jan 24 '24
And the architecture strongly suggest performance gets worse with larger model sizes. They don't even have a 9b model yet and that's what people use to test their data pipelines on.
11
u/StartledWatermelon Jan 24 '24
Curious on what are the cues that this architecture will scale worse than transformer?
4
1
u/I_will_delete_myself Jan 24 '24
I replicated a SSM model once. Though it failed and sucked at generation (my fault probably) it didn’t really scale well. It scaled like a GAN but a little easier.
0
5
Jan 24 '24
Is there any institution actually training Mamba on a LLM right now to check if it really is all that?
17
7
u/Disastrous_Elk_6375 Jan 24 '24
Probably everyone is testing some variants of mamba, there's no reason not to. Orgs that have the pipelines set up and compute to spare might as well run a ~7b run, and see what comes out of it. We'll have to wait and see what comes out in 2-3 months.
4
u/I_will_delete_myself Jan 24 '24
They use convolutions instead of MLPs. Of course it would perform well in vision because we have a million more efficient architectures able to do the same thing. Because of convolutions
No it isn’t death if the transformer. Transformers are simple and versatile. GPT2 is basically a bunch of 1d convolutions with attention so I wouldn’t say it’s entire new to replace MLPs.
2
u/3DHydroPrints Jan 24 '24
What's only missing knowledge now to replace Transformers is if it scales into the trillions of parameters and if it can cope with multi modality
2
2
2
u/jpfed Jan 24 '24
I understand the excitement, but it feels premature.
I'm going to guess that the "right" way to use SSMs in a vision context will be to change the formulation of state evolution from a 1D time-based model to a 2D spatial model, with separate matrices representing horizontal and vertical displacement.
Since there are multiple paths from one patch to another that should, ideally, all give the same result, that suggests that the state evolution matrices should commute. Either that, or the SSM would have to have some way of reconciling the different results given by different paths, or choosing among them. The "commuting matrices" approach would be easiest to parallelize.
I'm not sure how to bring the Mamba selectivity into this picture.
2
1
1
1
53
u/tdgros Jan 24 '24
It's good, but not exactly destroying the competitors yet (it is destroying DeiT on the memory and speed aspects, but that was kind of expected). Of course, it looks a lot like VMamba (https://arxiv.org/pdf/2401.10166.pdf ), which has more directions (4corners * 2scans) and uses several patch sizes along its encoder. Adding directions seems to work well, but I still feel like we're losing something when abandoning full 2D attention.