106 karma · joined Oct 24, 2019 (7y ago) · 32 submissions
comment 9mo ago · link · parent
https://github.com/glassroom/sata_attention
That toy example is not practical with the quadratic formulation, because it would require computing and storing 1K attention matrices, each with 1B×1B dot-product scores. For example, at Float32 precision, those attention matrices would consume approximately 1K x 1B x 1B x 4 bytes = 3,725,290,298.5 Terabytes of memory, which is not practical.
Like every other proposed method, this one must be tested too. If it performs well in practice, AI service providers who ignore it will find themselves at a disadvantage.
Otherwise, the mathematical techniques introduced by this work are likely useful for other applications besides Transformer attention.
comment 9mo ago · link · parent
The github repository's first toy example is with 8 Taylor terms, applied to a context of 1B tokens, with attention computed over 1K heads per token. (Note that applying the quadratic formulation to 1B tokens, each with 1K heads, is not practical with current hardware, because it would require computing 1K attention matrices, each with 1B×1B dot-product scores.
Like every other proposed method, this one must be tested too. If it works, AI service providers who ignore it will find themselves at a disadvantage.
It's worth mentioning also that the mathematical techniques introduced by this work are likely of interest for other applications besides attention.
comment 9mo ago · link · parent
comment 9mo ago · link · parent
comment 9mo ago · link · parent
comment 9mo ago · link · parent
I ask because in practice, for inference, attention is typically computed with low-precision (4-bit, 8-bit, 16-bit) floats.
Numerical error, in fact, may be a key factor as to why quadratic attention, in practice, exhibits context rot as context gets longer, analogous to an RNN:
https://www.anthropic.com/engineering/effective-context-engi...
9.
Attention at Constant Cost per Token via Symmetry-Aware Taylor Approximation(arxiv.org ↗)
164 points · by fheinsen · 9mo ago · 96 comments
comment 1y ago · link · parent
comment 1y ago · link · parent
The formal definition stops short of inducing an isomorphism between GOOMs and R, to allow for the possibility of transformations that leverage the structure of the complex plane, e.g., deep learning models that process data in C and apply a final transformation from C to GOOMs, thereby allowing the data to be exponentiated to R. The library in this repository makes implementing such a model trivial, because it ensures that backpropagation works seamlessly over C, over GOOMs, and across mappings between C, GOOMs, and floats.
Take a look at the selective-resetting algorithm in the manuscript too. To the best of our knowledge, it's a new algorithm, but we opted not to claim as much, out of an abundance of caution. You will appreciate reading about it.
13.
A non-diagonal SSM RNN computed in parallel without requiring stabilization(github.com ↗)
9 points · by fheinsen · 1y ago · 1 comment
comment 1y ago · link · parent
> This implementation enables you to operate on real numbers far beyond the limits of conventional floating-point formats, for effortless scaling and parallelization of high-dynamic-range computations. You no longer need to scale, clip, or stabilize values to keep magnitudes within those limits.
16.
Generalized Orders of Magnitude (GOOMs)(github.com ↗)
2 points · by fheinsen · 1y ago · 4 comments
comment 7y ago · link · parent
As it turns out, I posted it and answered a few questions about it on HN a few days ago, on this thread:
https://news.ycombinator.com/item?id=21397444
Please feel free to ask questions here too. I would be happy to answer them.
comment 7y ago · link · parent
FWIW, a while back I reimplemented and tinkered a bit with the Sabour et al. version too... and did not see much promise in it.
Note that the routing algorithm I've proposed generalizes to vectors (by setting the dimension of the covector space d_cov to 1).
comment 7y ago · link · parent
comment 7y ago · link · parent
I'll take a look at submitting it to CVPR.
In the meantime, please circulate my work. It's on record, online. The more people who are aware that others have seen it, the less likely someone will try to plagiarize it.
I'm not under any kind of academic pressure, so I don't need citations, conference slots, etc. But I do deserve credit for this, don't you think?
PS. And now that you mention it, a couple of people to whom I reached out mentioned they were under deadline over the next two weeks.
PPS. Send me an email!
comment 7y ago · link · parent
Yes, I think this has legs.
Maximizing "bang per bit" (a) seems truly a new idea, as opposed to some minor tweak on the same old thing, and (b) the evidence so far shows it works better than previous methods.
(FWIW, we've been using this algorithm internally at work with similar outperformance over other methods, in yet another domain that is neither vision nor language... but I cannot share those results publicly.)
Before submitting this anywhere, I'd like to get more informal feedback from other AI researchers. I've reached out to people at Google Brain, Facebook AI, DeepMind, OpenAI, and a handful of top academic institutions and research groups. So far, the response has been positive, but I expect it will take everyone at least a couple of weeks, and probably longer, to read and understand the draft paper in sufficient detail to give me more than superficial comments.
New things often look like toys at first. :-)
comment 7y ago · link · parent
Actually, I'm comparing it to recent models, including XLNet, MT-DNN, Snorkel, and (of course) BERT. AFAIK, convnets have not been able to outperform multihead self-attention, even on pretrained embeddings.
> Re learning reverse graphics - ok, maybe it is indeed the main feature of your work. I’d need to look into that, because from skimming your paper it’s not immediately clear what’s going on there.
I agree, it's not immediately clear. Nonetheless, I find it kind of unbelievable that a model with so few parameters can seem to do it. (I was shocked when I first saw the plots.)
> Re convnet accuracy on Norb - I’m willing to make that effort for cifar-10 as soon as you have the results.
That's a little disappointing... but OK.
Thank you so much for all your questions :-)
comment 7y ago · link · parent
As far as I know, regular convnets have failed to outperform query-key-value self-attention models (i.e., transformers based on Vaswani et al.'s work) on pretty much every sequence task, including natural language tasks.
> Learning to do “reverse graphics” is only useful if you can show it is the reason behind performance improvement.
I would strongly disagree. Building systems that can learn "reverse graphics" on their own has long been a goal of computer vision. It seems a prerequisite for building machines that can build internal representations of the state of the physical world around them. Hinton et al.'s 2018 paper has a summary of recent efforts on this front on the "Related Work" section.
> What I’m saying is - no one has yet demonstrated a clear superiority of any capsules based model to the best available plain convnet.
No one is saying otherwise. :-) Convnets are still the right tool for most production systems in visual recognition today.
That said, I don't think a convnet can achieve 99.1% accuracy on smallNORB with only 272K parameters, after training from scratch without using any additional data or metadata of any kind -- like the model using my routing algorithm. If you think you can do that with a convnet, do it and put it up online (I'd love to see it :-)
comment 7y ago · link · parent
Here are the answers to your questions:
1. The final, published version is stamped “ICLR 2018,” so I used that year.
2. I don’t know if a conventional CNN can do this with 10x fewer parameters, while also learning to do a form of “reverse graphics” without explicitly optimizing for it. (I wouldn’t know how to get a CNN to do that without explicitly making it a training objective.)
3. IIRC, the convnet model from 2011 accepts 96x96 images. As to why Hinton et al. downsample images to 9x smaller, I suspect (but don’t know for sure) they had no choice to conserve memory and computation using their version of EM routing. I was able to reduce memory and computation with my variant of EM routing (by between one and two orders of magnitude) by setting the first routing layer to accept a variable number of inputs, without regard to location in image.
4. Me too. But you asked me about work other than Hinton’s, and that’s all I could find!
5. CIFAR10 is on the to-do list (work permitting!) :-)