266 points · by quibono · 3y ago · 140 comments
I am comfortable with autograd/computation graphs, PyTorch, "classic" neural nets and ones used for vision-type applications, as well as the basics of Transformer networks (I've trained a few smaller ones myself) and RNNs.
Do you know of any good resources to slowly get back into the loop?
So far I plan on reading through the original Diffusion/GPT papers and start going from there but I'd love to see what you think are some good sources. I would especially love to see some Jupyter notebooks to fiddle with as I find I learn best when I get to play around with the code.
Thank you
You can view this approach in the same way that a beginner learns to program. The best way to learn is by attempting to implement (as much on your own as possible) something that solves a problem you're interested in. This has been my approach from the start (for both programming and ML), and is also what I would recommend for a beginner. I've found that continuing this practice, even while working on AI systems professionally, has been critical to maintaining a robust understanding of the evolving field of ML.
The key is finding a good method/paper that meets all of the following
0) is inherently very interesting to you
1) you don't already have a robust understanding of the method
2) isn't so far above your head that you can't begin to grasp it
3) doesn't require access to datasets/compute resources you don't have
of course, finding such a method isn't always easy and often takes some searching.
I want to contrast this with other types of approaches to learning AI with include
- downloading and running other people's ML code (in a jupyter notebook or otherwise)
- watching lecture series / talks giving overviews of AI methods
- reading (without putting into action) the latest ML papers
all of which I have found to be significantly less impactful on my learning.
Most of the cutting edge papers are trained on several $100k worth of GPU time, so does it even make sense to implement the algorithm without the available data & compute? How can you be sure that your implementation is correct, if you can't train it (hence you can't run proper inference with a good model)?
Compare that to e.g. reimplementing a pure CS paper, almost anything can be reimplemented in a simple way - even something like "distributed database over 1000 nodes", well you don't technically need 1000 servers, you can just, you know, simulate them quite cheaply.
Of course there might be similar techniques for ML but I'm just not aware of them.
The whole objective here is personal learning and this advice would be wildly different for how to practice ML professionally. The approach is directly analogous to advising a beginner programmer to get better at programming by actually writing computer programs.
> Most of the cutting edge papers are trained on several $100k worth of GPU time
Its besides the point, but I said nothing about a requirement that the methods that you choose to implement and learn from having to be cutting edge. More to the point, unless we have a different definition for what "cutting edge" means, you're wrong that "most of the cutting edge papers" require high computational resources. If that were true it would be nearly impossible for the field to make progress at the pace it does. There is a plethora of research in purely algorithmic approaches which do not require massive compute resources, and in fact this is the most productive portion of research to learn from because there the focus is on theory and progress in how to conceptualize / frame ML problems. Works which amount to "we took method X and massively scaled it up" are (in my opinion) less intellectually interesting to someone seeking to grow their knowledge in ML (though the results may might be extremely impressive and impactful, and it may be intellectually very interesting for the working directly on that project).
> How can you be sure that your implementation is correct, if you can't train it (hence you can't run proper inference with a good model)?
This is like asking how you can be sure that you've correctly implemented a B tree if you haven't used it to serve a distributed database to 1 million users. The answer is small isolated tests.
One of the best ways to really test your knowledge of an ML algorithm is to design and write unit tests to assert it behaves correctly on trivial cases. You'll find bugs in your implementation, but you'll also be forced to think carefully about what the core characteristics of the algorithm are that must be asserted in order to convince yourself that its correct. Its a common beginner mistake in ML to just run/train your model and have that be the only test of its correctness. Its like deploying a web service with zero tests and letting "do I get X number of users" be the only test of your code's correctness. It sounds insane but its basically equivalent to what most beginners do in ML (my former self included).
Do you have a few of these cutting-edge algorithmic advances papers in mind, could you list them?
I guess I got too pessimistic because of things like "emergent features" [1] / "grokking" [2] that seems to happen only with a lot of compute, and also the fact that the original (vanilla) transformer architecture remains (one of) the best, despite many additional ideas and "advances" (but that is only evident at large scale) [3].
Because of the points above, it's really hard for me, as a non-expert, to assess which papers are true advancements, and which were only published in pursuit of vanity metrics (e.g. publication counts) but actually represent overfit/cherry-picked results rather than robust progress.
[1] https://timdettmers.com/2022/08/17/llm-int8-and-emergent-fea...
[2] https://www.lesswrong.com/posts/N6WM6hs7RQMKDhYjB/a-mechanis...
Seems impossible to know for sure. Best I can think is to train your model to overfit a small amount of data
You can scale some things down. VGG 16 is basically a stack of CNNs, there's no reason you need 16 of them with an input size of 224x224x3; you can just as easily watch a 4 layer CNN learn filters on inputs of size 64x64x1. Obviously if the paper's result is achieved from sheer compute this won't work, but plenty of results come purely from the architecture.
You could also implement and run networks that are designed to be really cheap to compute. ResNet/InceptionNet, for example. I think this is a pretty important part of the space right now, considering how performant, general, and therefore inefficient Transformer architectures are.
No, you got it right. This is EXTREMELY prevalent in modern AI/ML papers, to everyone's detriment. In the majority of interesting cases, reproduction is only possible with the original code.
On top of that due to its dependence on data and the ability to 'fudge' statistics, a lot of AI papers aren't really that replicable even if there aren't any implementation subtleties. For example, I've run into papers on image generation which describe some trick to improve quality, but focus entirely on standardized scores without providing any visual comparisons (and thus as feared turning out to not have as much of a visual improvement as the scores would suggest on other datasets).
While in a lot of sciences or engineering many things can be attributed to being standard practice for experts in the field, AI moves too fast to have such standards and tends to be a bit too arbitrary for such standards to mean much.
- Score-Based Generative Modeling through Stochastic Differential Equations https://arxiv.org/abs/2011.13456
- Structured Denoising Diffusion Models in Discrete State-Spaces https://arxiv.org/abs/2107.03006
- Efficient and Modular Implicit Differentiation https://arxiv.org/abs/2105.15183
- Scalable Gradients for Stochastic Differential Equations https://arxiv.org/abs/2001.01328
- Bayesian Optimization with Unknown Constraints https://arxiv.org/pdf/1403.5607.pdf
- SE(3)-Transformers: 3D Roto-Translation Equivariant Attention Networks https://arxiv.org/abs/2006.10503
- DiffDock: Diffusion Steps, Twists, and Turns for Molecular Docking https://arxiv.org/abs/2210.01776
> To the extent that you provide User Content, you hereby grant us (and represent and warrant that you have the right to grant) an irrevocable, non-exclusive, royalty-free and fully-paid-up, worldwide license to reproduce, distribute, publicly display and perform, prepare derivative works of, incorporate into other works and otherwise use and exploit such User Content, and to grant sublicenses of the foregoing rights.
So not only can Meta use these cutting edge techniques in their products without needing to request permission from the implementer, they can also sell those derivatives to anyone and practically have full ownership over what was submitted. Furthermore:
> You assume all risks associated with the use of your User Content.
and
> For the avoidance of doubt, Meta Platforms does not claim ownership of User Content you submit or other content made available for inclusion via our Website.
So, if anything goes wrong, it is the implementer’s fault entirely, but Meta may freely profit from those submissions in any way they see fit.
Sure, this is a cynical reading of the ToS, but I’m assuming the ToS will only ever be used in Meta’s favor…
Some of the stuff I'm currently reading/watching or have recently
Practical Deep Learning, though it sounds like you may know this stuff already (https://course.fast.ai/)
Practical Deep learning part 2, more about diffusion models. Full course coming early next year (https://www.fast.ai/posts/part2-2022-preview.html)Hugging Face course (https://huggingface.co/course/chapter1/1)
Diffusion models from hugging face https://huggingface.co/blog/annotated-diffusion https://huggingface.co/docs/diffusers/indexAndrej Karpathy's Neural Networks: Zero to Hero. He goes from the basics up to how GPT etc, so you can start wherever suits you (https://www.youtube.com/playlist?list=PLAqhIrjkxbuWI23v9cThs...)
3blue1brown's videos. I've found all his videos on neural networks and math worth watching, even for stuff that I already know, he sometimes has some new perspectives and nice animations.brilliant.org. Nice math refresher and the courses there are almost like fun little games.
Looks like it's a companion to this YouTube series that looks pretty interesting https://youtube.com/playlist?list=PLQVvvaa0QuDcjD5BAw2DxE6OF...
I will check it out for sure
https://compneuro.neuromatch.io/
Recent research like "Relating transformers to models and neural representations of the hippocampal formation" might make it more relevant though (https://arxiv.org/abs/2112.04035v2)
quote from the abstract of that paper: "Many deep neural network architectures loosely based on brain networks have recently been shown to replicate neural firing patterns observed in the brain. One of the most exciting and promising novel architectures, the Transformer neural network, was developed without the brain in mind. In this work, we show that transformers, when equipped with recurrent position encodings, replicate the precisely tuned spatial representations of the hippocampal formation; most notably place and grid cells. Furthermore, we show that this result is no surprise since it is closely related to current hippocampal models from neuroscience. We additionally show the transformer version offers dramatic performance gains over the neuroscience version. This work continues to bind computations of artificial and brain networks, offers a novel understanding of the hippocampal-cortical interaction, and suggests how wider cortical areas may perform complex tasks beyond current neuroscience models such as language comprehension."
For some context, something I should have mentioned in the original post but failed to do: I was not intending to do a professional pivot to an AI role; it is more of a personal interest. I used to be really excited about this stuff and am looking forward to getting involved in it again just because I find it interesting.
Thank you, I really appreciate everyone's responses.
I am an ML researcher working on generative modeling. I think you have enough experience that you'll catch up quickly. But the question is most what you're interested in? With that I can give better advice. Don't let anyone stop you from learning just to learn. Not everything has to be a career. A lot of us got here because it's fun.
I do think you'll pick up diffusion models quickly. I like the explicit density side of things more and density estimation. So I like Song's works and similar with Kingma. Also check out Lilian Wang's blogs. They are a wealth of material and sources. Can't go wrong there. You'll find that diffusion and VAEs are kinda similar. The difficulty you'll have in understanding something like stable diffusion is actually the programming (at least this was the hardest part for me).
Good luck and let me know if I can help.
Quite honestly, the opportunity all seems to be on the front end. The idea that you are going to airdrop yourself as a hands on AI programmer into this market doesn’t make a huge amount of sense to me from a career perspective.
The opportunity is with the tools and how they are applied. Building front end experiences on ChatGPT and integrations and applied scenarios.
You actually doing the AI yourself means competing with PHDs and elite academics immersed in the field.
I think knowledge of AI is far less valuable than knowledge of the emerging landscape combined with a broad understanding of different tools and how they are applied.
The new trend here is very strongly Large Language Models (LLM). You should be far more specific with what your goal is and where to spend your time.
A lot of the “AI” you are referring to seems to be no longer relevent or interesting to the market.
If you are spending time with Jupiter notebooks I would say you are probably completely wasting your time and heading in the wrong direction.
LLM is the major trend. Focus entirely on that and the tools landscape and how to integrate it and apply it. It feels like you are navigating using an out of date map.
Example 1: have a look through here: http://synapticpaint.com/dreambooth/browse/ for some examples of dreambooth models people have created
Example 2: you can merge different dreambooth models together to varying degrees of success (the idea being, you train model A on subject A, model B on subject B, and now you want to generate pictures of A and B together). My understanding is that this doesn't work too well at the moment, but it's possible that a different interpolation algorithm can yield better results.
I do agree with the general sentiment that you wouldn't necessarily be training your own models or creating your own architecture, just want to provide the perspective that understanding the AI side is valuable because it can lead to different capabilities and products.
Can you explain the value of these models, please?
This is a serious question. My eyes just see one horrendously ugly (and dystopian) eyesore after another.
And this: "If you are spending time with Jupiter notebooks I would say you are probably completely wasting your time" And how do you suggests one performs data analysis on any problem that's not an LLM -- data analysis of any kind, such as "is the model I am trying to build a front-end for even works for my problem?"
Also you‘re wrong. Look at what the OP wrote and then look at how the latest models are actually built and you would see at least 2/3 of their knowledge is relevant.
My impression is that the field is more disciplined in terms of knowledge now than it was ~8 years ago - the fundamentals are better understood and more clearly expressed in literature.
Also there are still plenty of topics on which the new techniques can probably be fruitfully applied, especially if you have some domain knowledge that the math/CS PhDs don’t have.
For OP - I’m in a similar situation and have been going through Kevin Murphy’s “Probabilistic Machine Learning”, which is pretty massive and dense but also very lucid.
Is that really true? That's not my impression at all (though to be fair I haven't been keeping up with current research as much as I used to). My understanding is that there is still hardly any knowledge on what deep learning models (and large language models in particular) actually learn. The loss surfaces are opaque, one still doesn't know why local minima reached by gradient descent tend to generalize fairly well for these models. The latent representations that generative language models learn is, with the exception of the occasional paper that finds some superficial correlations, hardly investigated at all and overall extremely poorly understood.
Very much interested in any references that contradict that sentiment.
The previous version of this book was from 2012 though and I'm not 100% sure how much of the material in the current edition is new (there is definitely a _lot_ more deep learning stuff in it).
So yeah it could be that my impression is wrong, or that I made the scope at which it applies sound bigger than it is.
Yes, LLMs are amazing but they won't be winning every single Kaggle competition, displacing every other ML algorithms in every setting.
Also, are you aware that one of the most prominent AI tools of this month (ChatGPT) was obtained with RL!
For anybody intrigued, here are those Reith Lectures:
In general, it is thought that physics knowledge transfers better to ML than math because it's less abstract and physicists are more likely to be used to dealing with large datasets and software.
If you're already in the field you'd likely have to take a pay cut, but the federal government is always interested in research physical scientists and will snatch up anyone who knows the physics and also knows ML.
Upgrading existing systems with AI is probably where it's at using existing models like stable diffusion, GPT-3 or some of the smaller downloadable language models if the task is very simple and the economics of using GPT-3 don't make sense.
I think it'd be fun to use vision models to pick up the interesting parts of an image, describe only the high-yield context as English text, and put them in a sort of Unix pipeline or node graph to connect it to other models that can input/output text. With fine-tuned or prompt-engineered LLMs as the intelligent centerpiece.
>Fine tuning models is where the future will be
Who would request fine tuning? Businesses?
Are you suggesting to build some sort of data set broker?
Rather than jump on the same horse that everyone is jumping on, maybe one should start looking at where language models fail -- and from the very nature of how they are conceived and what they are made of -- will most likely never be good at.
MS and PhD students start out behind and they’ll spend most of their time during the next 2-5 years on irrelevant things (e.g. 95%+ of their graduate coursework will be behind the state of the art; most PhDs will focus on a niche project that fails to have major impact or relevance by the time they graduate).
It sounds like OP just wants to learn out of general interest, which is fine. But others shouldn’t be discouraged. A sufficiently-dedicated person with talent and a strong classic ML foundation can catch up reasonably fast, to the point of getting their foot in the door professionally.
"knowledge of the emerging landscape combined with a broad understanding of different tools and how they are applied."
I just read Francois Chollet's Deep Learning with Python and found it to be a fantastic high level overview of all the recent progress. There's some code, but not a lot. I mostly just appreciated it as a very straightforward plain-language treatment of RNNs, CNNs, and transformers.
Now I'm going through Stanford's CS224 lectures.
I'm sort of planning to read papers but as some other comments have pointed out, I'm less sure of the ROI on that since I'm not sure how feasible a future in AI is for me
I am a research engineer/applied ai person building vision models in healthcare domain. I am currently preparing to transition to engineering roles like you did. For that, I am currently going through web dev - both frontend and backend. Would love to get some pointers from you on my approach and any recommendations from your side. Thanks!
Build out your portfolio so you have projects that you can speak to and show your tech depth.
FWIW, I do AI backend at FAANG and mentor as tech lead.
Also there's no cost, no book to buy, no email signup, it's just a guy sharing knowledge like the old days. Great course.
It sounds like you're into it already. And you already know which new papers are interesting to you.
As someone with 10 years of professional experience in software, I find every AI "trend" that has come up in that time to be incredibly odd. It is certainly remarkable what chatGPT, StableDiffusion, and other examples are doing today... Ultimately people are giving waaaaaaaay too much credit without understanding the technical details. These are pidgeon-holed examples that still aren't solving any real problems.
AI is still just statistics with marketing.
I’ve found that what ChatGPT comes up with is often a great start and has already saved me hours of time. Is it as good as paying a professional? Probably not. But I think it’s fair to say these models are already solving real world problems, even if they still need a bit of a helping hand. Just my thoughts, I’m not an expert on the models themselves.
Now I just ask ChatGPT.
> mostly as a favor to folks I know personally
Scale is where the rubber meets the road. I'm glad ChatGPT has been helpful to you, but it is still a gimmick for the majority.
Considering OP mentioned a lot of recent hype trains relating to AI, it's perfectly reasonable to assume they are chasing dollars, rather than contributing to the underlying technology without further expectations.
So, OP comes off as very disingenuous when they lead with the hype and provide nothing of substance.
Maybe it is and he's simply somebody with an interest for the topic and some progress to catch up with.
I would say AI is the opposite of statistics, for good or for bad.
When this course becomes public next year, I think it will be a great way to get caught up. In the meantime, you might still be able to pay the AU $500 fee and watch the course content, which was all recorded, if you are anxious to get going.
Also, if they ever make another dataset like the pile, don't expect to get your own data into it (even if they say that they will add it).
I'd work with other groups if I were you.
You have two options:
1. Work full-time for companies doing this state-of-the-art stuff (OpenAI, Meta, etc.)
2. Work full-time for a (good) AI company that is doing interesting AI work, but most likely not based on GPT/SD/etc.
In both cases, you will learn a lot. Anything else seems like a costly and dangerous distraction to me.
Most medium and low-quality papers are full of errors and noise, but you can still learn from them.
Get your hands dirty with real code.
I would take a look at those:
I've done some work in the field, and I've seen errors in almost all papers.
Sometimes they are not really errors, but they give a solution that only works in the very specific context they tested it and completely falls apart anywhere else.
I've lost countless hours and days studying and replicating papers. Of course, ML could be an entirely different experience.
Just use Hugging Face.
The OP wants specifically sentence-transformers, which are hosted on huggingface but it's a separate library.
You'll want to go with whatever models that the sentence transformers documentation recommends.
Maybe I am a bit off the track. But how do someone reach this state?
Also there is a youtube series by Andrej Karpathy that goes into much more detail and builds a library from scratch.
But understanding AI fundamentals gives me a fresh perspective on how to build applications that leverage ChatGPT (for example).
Crafting the inputs to achieve desired outputs. Training the models with a corpus of data relevant to a niche industry, etc...
For example, do you want to develop models as a hobby? Make models or software for a living? Use AI in some particular problem domain?
If you're the same, is there something more specific to help you focus and put in the time?
1) Refresher: RNNs, deep net classifier
2) LSTMS
3) Self Attention anything
Any other suggestions for getting back in the loop?
There are a few non equivalent universal approximation approaches. I’m not sure I fully understand why this is will end up being the one even on a 10 year horizon.
This is the way to start a PhD research (assuming OP is trying to stay up-to-date in this area by "get back").