LAION-5B: 5 billion image-text-pairs dataset (with the authors)
#laion #clip #dalle

LAION-5B is an open, free dataset consisting of over 5 billion image-text-pairs. Today's video is an interview with three of its creators. We dive into the mechanics and challenges of operating at such large scale, how to keep cost low, what new possibilities are enabled with open datasets like this, and how to best handle safety and legal concerns.

OUTLINE:
0:00 - Intro
1:30 - Start of Interview
2:30 - What is LAION?
11:10 - What are the effects of CLIP filtering?
16:40 - How big is this dataset?
19:05 - Does the text always come from the alt-property?
22:45 - What does it take to work at scale?
25:50 -When will we replicate DALL-E?
31:30 - The surprisingly efficient pipeline
35:20 - How do you cover the S3 costs?
40:30 - Addressing safety & legal concerns
55:15 - Where can people get started?

References:
LAION website: https://laion.ai/
LAION Discord: https://discord.com/invite/mVcgxMPD7e
LAION-5B: https://laion.ai/laion-5b-a-new-era-of-open-large-scale-multi-modal-datasets/
img2dataset tool: https://github.com/rom1504/img2dataset
LAION-400M: https://paperswithcode.com/dataset/laion-400m

Links:
TabNine Code Completion (Referral): http://bit.ly/tabnine-yannick
YouTube: https://www.youtube.com/c/yannickilcher
Twitter: https://twitter.com/ykilcher
Discord: https://ykilcher.com/discord
BitChute: https://www.bitchute.com/channel/yannic-kilcher
LinkedIn: https://www.linkedin.com/in/ykilcher
BiliBili: https://space.bilibili.com/2017636191

If you want to support me, the best thing to do is to share out the content :)

If you want to support me financially (completely optional and voluntary, but a lot of people have asked for this):
SubscribeStar: https://www.subscribestar.com/yannickilcher
Patreon: https://www.patreon.com/yannickilcher
Bitcoin (BTC): bc1q49lsw3q325tr58ygf8sudx2dqfguclvngvy2cq
Ethereum (ETH): 0x7ad3513E3B8f66799f507Aa7874b1B0eBC7F85e2
Litecoin (LTC): LQW2TRyKYetVC8WjFkhpPhtpbDM4Vw7r9m
Monero (XMR): 4ACL8AGrEo5hAir8A9CeVrW8pEauWvnp1WnSDZxW7tziCDLhZAGsgzhRQABDnFy8yuM9fWJDviJPHKRjV4FWt19CJZN9D4n
 Hi, this is an interview with people from Lion whose flagship projects are datasets, specifically datasets to train models like Dali or Clip. So pictures and text that goes along with the pictures. They scrape these from big internet scrapes. The first dataset had 400 million images and their newest dataset has 5 billion images. These are unprecedented scales to be open-sourced as datasets. The creators of Dali or Clip, OpenAI, they never disclose their dataset, they never put it out there in public and Lion does so this is a big service to the community and I was super excited to have them on here. Another thing is just how grassroots this movement is. The founder Christoph, who's also here today, is a father and a teacher and does this on the side just as a hobby and sort of wants to demonstrate a little bit how anyone can take part in open source research. Now multiple times during the interview his kids would actually come in and be like daddy play with us and so on. YouTube is very strict on this, I cannot show the kids even though the kids themselves would have loved to appear in this YouTube video. So you know kids please, I'm very sorry. Open invitation. I thought this was really cool and inspiring. In addition to learning what Lion is about, enjoy the interview. Let's dive right in. Hey everyone today I have the team behind Lion 5b with me. Christoph Schumann, Romain Beaumont and Kate Gordon are here who contributed to this project in various ways which I hope they'll just tell us about in a second. This is a giant dataset, it's over 5 billion image text pairs. So not just images but image text pairs and along with that an open clip model, open sourced clip model that matches the performance of OpenAI's clip model which is really cool. These big companies rarely give out their biggest models if at all and if they give out their biggest models they usually don't give the dataset behind the model. So it's really cool that we have a large dataset. There has been some controversy around your smaller data set that you released I want to say half a year or a year ago. I hope we can get into all of that today. But first of all, thank you very much for being here. Welcome to the channel. Welcome. Nice to be here. Yeah, just maybe tell me a little bit. What is Lyon and what is Lyon 5b? So it all started like 10 months ago I guess on the Eleuthe AI server when we talked about how could we eventually replicate Dali and where could we get like 200, 300, 400 million image text pairs. And there was this idea of going to Common Crawl and looking for all the image links and only take those that have an alternative text. And we have been talking about this in the multimodal channel there together with Aran and Van Van and they got a little bit distracted with the project of GPTJ. So they ended up focusing totally on GPTJ and I was sitting there and was a little bit upset and thought why don't they pursue this? Because I compared to them felt like someone who is not that good programmer. And then I thought okay screw it. I'll just do it myself. And I sat down and wrote everything down in one collab and began crawling from Common Crawl and filtering with Clip. And then more and more people joined me. At first Teo Combs, he was the first to join me and so we called it crawling at home because at first we had some collab notebooks and some GPUs somewhere from some people on the discord servers and they were all like downloading and filtering and uploading the results to a rented server. And after a while more and more people joined like Richard who is not here at the moment but he's also a very valuable cool contributor, Richard Benku. And we optimized the code so that we could filter and crawl with one 3090 in one day 30 million image text pairs after the filtering, not before. So in the end we ended up like at the peak with like 30 and no 60 or 100 small mini servers downloading the images, sending them to Richard's GPU in his bedroom, filtering everything and spitting out in the quality of like conceptual captions, 12 million, what was the biggest then at the time, and 12 million image text pairs of decent quality. And we could generate with one 3090 within one day 30 million. And at this point we said oh wow, we should really scale this up and I asked someone, like we already had some people on discord who gave us the CPUs, GPUs and so it grew and grew. But then it was clear that we could get, with only the nations but from the community, could get to 400 million. What would be like the scale of OpenAI Clip data set because Clip was trained initially on 100 million image text pairs. And I said okay, we can get to one billion if we would get like maybe $5,000 of donations for paying for small CPU servers and maybe some GPUs somewhere, I don't know. And I asked on the Illutha AI server and within like 10 minutes someone said oh if it's only 5,000 I will pay it upfront. Someone who has like a startup, it's Jack from Doodlebot AI and yeah he ended up giving us in the end like $10,000. So he was our first official sponsor and I have to say the I.EU also provided us with some compute but the first sponsor who gave us money and then I said okay I don't want to have this money on my bank account and we probably for now and for the future should start a non-profit. And then came Jena who is not here at the moment, Jena Jicev, he's the lab leader of the deep learning laboratory at the Yulich supercomputing facility. And yeah we had been in touch and he said okay we will join with our people because we want to train models like Dali or Clip on the Yulich supercomputer like Juvels. It's a giant machine with almost 4,000 A100s and he cannot directly access it and train it Dali but he can access it for proof of concept, small projects and then apply. And so we said okay let's start a non-profit and we take this as a shell for basically getting money, getting resources officially and then spending it for creating cool data sets and training models and giving them away for free, no fees, 100% open. Because we were, I mean we were a little bit disappointed by the promise that OpenAI made by the name of OpenAI and many people had been joking about closed AI and I totally understand that if you get two billion dollars of funding that you have some strings attached and that you have some protocols and problems and that they have security, safety concerns. But we said okay we don't have the means to do all the basic research but we can try to do what they were doing, what Microsoft is doing, what Google terrain is doing and just taking the code or replicating the code and releasing such models for free. And then we started a German non-profit, FRAEIN, Germanizier FRAEIN in Germany. And yeah ever since everything took off we released the 400 million data set and less than one hour later I got mail from Thomas Wolf from Hanging Phase and I got also in contact with many more people and everyone wanted to talk to us and now we also get some monetary support from Hanging Phase that also enabled us to do the big data set and we have Stability AI who is providing us with GPUs and will provide us in the future with more GPUs. We have an ongoing application for 600 000 GPU hours on jewels. We don't have like the result yet but in one month we should know for training a big clip model and applying this to some downstream tasks. So yeah everything is moving very fast and one year ago I was just like a family daddy and a computer science teacher so I'm a computer science teacher and everything developed very quickly and now Romain who is also like an awesome guy who has much of experience and the cool tools like image to text, image to data set tool that you already introduced in your ML news I remember and Kate who is a really brilliant computer science student who is really into clip and he helped us to train a clip and replicate the results of the vision transformer 32 base and we matched roughly with a small variation sometimes a little better sometimes a little bit worse on several data sets the performance of the original clip. So yeah everything's looking really nicely. We have no intentions of going for profit. We agree that we want to stay open. We agreed that we want to stay non-profit for several reasons and everyone who likes to contribute or to talk to us maybe someone has some questions maybe someone is curious about something everyone can join our discord server and just ping us and ask us. Cool so I want to dive into sort of the biggest criticism that I would have with this project in that your data set essentially crawls common crawl for image text pairs and I'm going to guess that's image and the associated alt text or whatever text you find with the image and then you have this filtering step is what you say you can do a lot of images on a single GPU but you're essentially using OpenAI's clip model to filter image text pairs which clip deems to be you know fit together well. So how much of a bias does that introduce into a data set especially now if you say well we train a clip model on this data set right and we are able to match the performance of OpenAI's clip model one could ask you know is this are you essentially replicating their result or are you simply matching their performance because the data set is already essentially filtered to you know the data points that are conducive to that model so could you dive a little bit into your choices there and how much do you feel that is an important step this filtering what does it like what's the what does it give to the data set to use that and do you have plans to maybe switch that up or improve that part so no one claimed that this would be perfect but before I did this I started with JFCC 100 and I filtered this also and I filtered it basically on colab and yeah whatever and I checked a lot of image text pairs manually and I just got the feeling after looking at thousands of images and text pairs that point 28 was a pretty good threshold like that if you go above the threshold with the clip B32 from OpenAI then it really seems to match pretty well it's still a little bit noisy but it's rule of thumb and if you go above 0.3 it's even a little bit better not perfect but a little bit better and this is what we have this is not the ultimate solution for everything but I think because we are going so big and crawling over so many images that are you made by humans the annotations are made by humans that in the end we will still get like a lot new information in and it could be that some people maybe some names of people that the original clip has not learned or some concepts some nouns or some adjectives that has not learned could go below this could always happen but yeah I mean from the standard benchmarks that we ran the results are pretty good and everything is work in progress yeah I don't I don't doubt the quality aspect of filtering with OpenAI's clip what I'm a bit worried about is that you're essentially replicating what how this model sees the world as a whole and that's the reason why this model sees the world right this model isn't perfect either and so it will it will sort of replicate its own you know vision of the world into your data set and especially if you then train a clip model right that would that would be replicate have you tried just training a clip model on let's say an unfiltered data set or what could also be possible if you have many different such models that somehow estimate quality of images and text that you could build some sort of an ensemble I don't know if you have plans in the future to to replace this filtering step or make it better is that something you have on your radar I guess one thing we do have is the unfiltered pairs like we have actually 10 times this like we have 50 billion unfiltered pairs and yeah there could be some work to that could be done analyzing these pairs and trying to see if it's different but the problem of just using them is then you lower the quality a lot and I don't know if you do what it would do but yeah it's definitely an interesting point and we don't fully have the answer on that I think this is one of the points that will become more apparent when we start to train the larger clip models so at this moment it was like line 400m so that was the initial data set that we had just that subset and getting in the range of open AI is at least sufficient enough to prove that we've at the bare minimum been able to replicate the exact inferences of the model and get into that convex hole so to speak of its confidence threshold I think the more interesting result will come into play as soon as we hit the 5 billion scale and we get up to that larger threshold if we're able to push the numbers that open AI got before it could also be in response to the fact that we have like maybe different image towers and text towers sure that but if we can outperform what's opening I did within their original models it could be a sign that the data set was able to get like just enough stochasticity to go outside of like perfect confidence again it's in the future and it's not a result that we have but we're optimistic in seeing what it lies did you like how big is your data set just give me some some numbers in terms of like gigabytes like what what can I expect if I work with this thing so 240 terabytes 240 terabytes yeah if you download it in 384 resolution and you have you have different so you collected if different images can you give me some numbers on that like what kind of resolutions do you have how long are the descriptions usually just kind of some so people can imagine a little bit what what this looks like I think if you could open the the blog post yeah yeah yeah yeah so like for example the english part is 200 is 2 billion samples and then if you count only the one that are bigger both in width and height than 256 it's like a billion and then alpha for half this resolution and yeah so it's a lot of images which have a decent resolution but if you want to train like a like let's say a highly quality high quality generative model or maybe segmentation model maybe you want to use a high resolution subset set yeah in terms of caption lines yeah I want to add the precise number in that in that section but yeah it's around like I think it's around 200 characters but yeah that's the good question I should add that I computed it at some point but I think I didn't yeah I didn't add this in the blog post yeah and yeah you have this language distribution as well which is interesting for the mbtlanguages that I said oh I saw it just a second ago yeah it's very good yeah so it's a long tail actually because like we have like 100 languages and yeah the first one we have a lot of samples but then yeah you have this long tail of many other languages that are available but yeah for example you have 70 you have a 7 percent of the multilingual data set which is french wow that's interesting do you always have one piece of text with an image or do you sometimes have multiple because a lot of these datasets that are captioning datasets and so on they provide kind of multiple labels for one image there it's just one image one piece of text okay and that is it always the alt text of the image or do you sometimes like grab text around this is like work for the future so in the future we want to build an audio text data set with a similar approach so currently we have some people working on training a small or mid-sized audio clip model on existing data sets and once we have one of sufficient quality we could go through all of common crawl filter out all links to audio files and try to somehow get something like the alt text because usually there is no alt text but we could like look if there immediately before the link or after the link is some text that has a sufficient audio clip similarity and there are many ideas but if anyone would like to join us and work on this everyone can join we are truly open just get onto the discord server and say here so yeah also go ahead yeah and two things that you had been talking about previously so what could we do to make clip recognize more things that had not been in the original clip data set and one interesting perspective for this that is still work in progress but that could maybe work is we are experimenting currently with a training clip with a frozen image encoder and one idea that we have is to train a masked image of the encoder something like simmim or the mae from facebook meta and then we could train it on many many images without texts and so the basic idea is that if you have a really good image encoder that can be trained in a self-supervised manner without any text there then the limit is the sky because like in theory we could get like 50 or 100 billion images from common crawl we do not pursue this at the moment because like five billion is enough for the next few years i guess but so the idea is to train a really good image encoder in a self-supervised fashion and then we freeze it and we can train it with text train the text encoder and i guess in this case we would have much knowledge from the self-supervised training about what is actually an image and we wouldn't need the clip filter data we could take any data set and this could help with this so we're exploring we are cooperating at the moment with a clope team with andreas first who is the first author of the clope paper like this improvement of the original clip architecture with some hopfield layer magic so let's see what happens so tell me a bit about what it takes to because these are unprecedented scales for for most people by the way there's a nice overview here over the over the entire acquisition of pipeline which is is really nice distributed and all and then you train this clip model now the clip model you have currently you already said it is on the on the 400 m data set which is the let's call it the old it's not super old but it's it's your previous data set which is on the scale of clip and you trained a clip model on this what does it take to work at let's call it at that scale right image net is one million images and that's already considered like a rather large data set for most researchers that have like a gpu or something like this right 400 million is almost i would say most people probably aren't working with this size of data is it easy is it hard like how how do you go about training this model this model so there's like two large contexts for this this is whether or not you're in like your large hbc cluster or if you're in more so just like your generic data farm so at least these results were supported by jewels booster and the foundation which upholds that there it's also a very large institutional barrier of even like getting to the batch size that they offered so in terms of data set alone you have to have everything like stored on disk and that is a nightmare in itself getting it collected and that just in terms of memory is probably not accessible to most researchers then you get an extra layer which is the exact batch size of clip there have been other papers that have shown that these large multimodal contrastive models are like extremely batch size dependent basic has a really good table on this and it's hard enough to get to your data set alone hard enough to get the infrastructure just to support that but on top of that can you get your massive a100 cluster to actually spin this up and one thing they don't talk about is the massive engineering struggle that goes into actually doing contrastive loss on this let alone if you just take a 32 000 by 32 000 matrix it's like two gigabytes in fp 16 or four gigabytes if you're doing full precision and that just becomes a nightmare of overhead and so the wonderful team that i've been working with this model is just as much mine as it is theirs we've been putting a lot of our time into just how to optimize the small things like for instance when doing contrastive learning you don't actually need entire global patches you can do only certain calculations that are necessary for your local gradient routine so on and so forth but to achieve this scale there are a lot of challenges that these large research labs don't like talking about because they're not as pretty to write on the paper but this isn't very accessible immediately for like everyday researchers and we think this is something very important for other people to get their hands on and so hopefully this will inspire more companies to give out the compute necessary to accomplish results like these and inspire further researchers to uptake in this direction you also mentioned that your original plan was to train something like dolly right and clip is an important component of dolly is this still on your radar to eventually train something like dolly because there are other projects going on i know there's like mini dolly and other people trying to replicate dolly like what's your your thoughts on replicating dolly yeah there's so much going on and it's incredible so they had been from lucid rains the pie torch dolly project and we actually tried this on jubil booster so we got this to run on i don't know maybe 256 100s for 10 minutes and it would work in theory but the thing is ah my son is here one second he has rubber balls okay i need time okay okay kids are important so this is very really awesome about all of this you know what i'm doing like on the discord servers i'm doing this when i'm on the playground i'm doing this while i'm playing minecraft with my kids i'm doing this when i'm at the shopping center like for my mobile so i can do this in my free time and this is really amazing but um what was i talking about what is dolly yeah so the thing is with dolly um we could have pursued this and we had to make the decisions at first we wanted to apply for a compute on jubil last august for like a half a million gp wars for creating dolly but we missed the deadline because we were so busy with line 400 and then i had a realization others are what no darling dolly mini is there and min dolly and you have like ru dolly and now the fusion models and i said hey clip is actually not that amazing in the on the first glance but on the second glance it's far more amazing because you can use it to guide generative models you can use it to make huge data sets you can use it to create um semantically meaningful embeddings and this alone is very interesting because like um i had this idea and luther people had also this idea that maybe one could like take images and texts and do sequence modeling on the clip embeddings so you wouldn't do the sequence modeling on the image tokens or on the text tokens but maybe on the abstract ideas so i compare it like it's not 100 percent accurate maybe but it's like a metaphor so if i'm thinking about i want to go to the fringe and get some food and want to do this i'm not really imagining everything in full hd resolution and i'm not thinking oh i will go to the fridge so i'm more like having the idea in a kind of mixed embedding space idea space and so um one thing that we have in mind is like something in the future maybe not now but if it would eventually work to take embeddings from audio from video from text from from all modalities and bring them into the same embedding space and then somehow bring a transformer to model them this would be really interesting because you could like train it on a text on video and everything and could do it in a very efficient way and elusa people had been working on this they got many not number errors from feeding in the direct clip embeddings because it's probably just like too too big to instable with all the noise in the clip embeddings but i have the hunch that clip is really powerful and i didn't realize this when i first read about clip i think so the idea you have gpt kind of models they have sequence loans they can model sequences of whatever of images of text of all kinds of data and you have something like clip that can take different modalities basically any modality and convert it somehow into a shared embedding space and i think these both topics are a little bit disconnected in the at the moment but in the future there's very much room left to the ceiling to combine them maybe do something like quantization of the clip embeddings or whatever like i i have no clue exactly but i could really imagine that in the future if we could get all modalities into a semantic shared semantic space and find a sequence learner to model this this i have no idea i maybe i don't dare to dream of a gi or so in this connection but i can really see similarities that in my stream of consciousness when i think okay i want to go there then happens this and i do action x and action y this is not so different yeah well there is a debate of whether you need to actually interact with the world to achieve a gi right i think that's the the big hurdle the other thing is there's this model or this paper called cm3 i don't know if you've seen that they are doing something very similar to what you just suggested with actually quantizing the the images after encoding them with it with an image model and then using an autoregressive model in order to to model that so maybe that that might be some ideas maybe i can i can say a few words about your initial or your previous question of about the the size of things and how do we handle it i think maybe i have a slightly different perspective because for me what was interesting in in this project is to be able to do all of this with actually little resources because yeah it's pretty big but for example the 400 million data set just with some python codes pretty optimized you can actually download it with like only one machine and three days which i think yeah that's that's pretty good and at this scale you only have like 10 terabytes of data so you can actually store it at home and it's not that expensive and i think that's pretty interesting because i think that was one of the things that made it possible for like many researchers to get ion 400m and start applying to various ideas like we had a bunch of papers trying to that took it and train some generative models train some contrastive models that kind of things and and yeah and the story is a bit similar but of course a bit more costly with new this new data set so i had to make everything distributed so now it's like 10 nodes and not one to download it in a reasonable time but still it's in the in the mind of reasonable like you can you can have it without being a very large company yeah and and yeah and following up a bit on this idea is so one of the things we did as post-processing of these data sets is like downloading everything and computing all the clip embeddings out of that and then putting that in a canon index and that's the the ui the demo and i think one of the idea uh beyond that is sure you can explore the data set you can look for cats or whatever you want but you can also use that kind of index to extract new sub data sets that are much more much smaller and that can be interesting to to to train let's say smaller things and uh solve more specific problems so maybe you want to build to find all the pizzas from the world and i don't know get inspiration for your restaurant yeah yeah or you can for example try to build some kind of subset out of lion 400m or lion for bay like for example christopher has been starting a project to find all the humans in the data set and see what's there what can we understand from that and yeah and i think what's interesting is that all of this democratize uh research like it becomes possible to actually uh build that kind of stuff without having too much resources and uh yeah i hope that we can it makes it possible and uh and yeah and that people pay always are the tools on the data sets tools on the data sets you i see you you're storing the uh the data set on s3 which does i know like uh eluthor stores their data set on on the eye which which supplies these resources i know s3 has like significant charges for egress right if people download this that you incur quite some cost uh i think they have like 20 cents per gigabyte which would be like 200 bucks per terabyte so at 200 terabytes someone downloading the data set would cause you something like uh 30 000 40 000 dollars or so um what so this is this is what your sponsors are are there for or do you have like a deal with with amazon no we we are very lucky so we are very lucky um um our sponsor for compute at the moment or our main sponsor for the gpus and for the s3 s3 storage is stability ai and their plan is actually to gather resources from different companies investors who actually want cool multimodal models openly available because they want to use them but they don't want to build an ml team or hire people or so and he has many connections a much he's the the ceo or the founder of stability ai and he has a very good deal with aws and um we won't share the aws files that we have because we don't own the copyright of the pictures but we are sharing the metadata the urls and so everyone on his own his or her own liability and risk could download them from the original sources we recommend that if you do this you make sure that the data set is shuffled nicely it's or it's already shuffled i guess right yeah yeah and um so when we started the project we got problems because we didn't properly shuffle them and sometimes some web masters complained that we were downloading too much from them and the data set where we were renting the machines got some complaints but if you shuffle it properly and you download it over all the five billion image taxpayers there is no problem usually and um with a wonderful tool tool image to data set that romaine programmed and that now also supports distributed downloading with a swarm of cpu workers one could um download it for relatively small money i mean you're making us tell more about this yeah yeah uh for sure yeah that's a big um thing i think that makes it possible for us to share the data sets like uh lion 400m is 10 terabytes in images but the metadata is only um 50 gigabytes which is quite handleable uh and same for lion 5p the image is 240 uh terabytes but the um the metadata itself is about uh one terabyte which is handleable and then yeah you can use that image to the asset tool to get the data which works well of course there will be some link hots and you will start losing a bit of data with time but it's a pretty reasonable given the total amount of data and about the cost yeah to do not like lion uh 5p if you use some other various instance i think the cost should be like a thousand dollar which is not nothing but it's not like a 40k you have mentioning about i guess yeah okay so it won't it won't cost it won't bankrupt you and it won't bankrupt me if i download this data yeah exactly yeah i see that's and for the future there's a new direction that we are exploring at the moment or the hive mind project is exploring so um they working they are working on some code that would allow you to directly stream the images from the urls so you download them you buffer them somewhere and if you have like a decent internet connection that that this should actually work so um last time lxp from the hive mind project he's also on this code he told me that they could reliably um train like 50 to 60 images per second and for a small model this would not be sufficient so we would get a bottleneck but if you go to something like a vision transformer capital g or capital h the training takes so much time that it wouldn't matter so you could like train a capital h vision transformer with this and you would need only maybe 100 gigabyte or so storage on your machine that is interesting that the models they get so big that essentially that the bottleneck shifts away from the internet connection to the to the cluster forward propagation that's pretty cool um but you you mentioned a good point in terms of releasing these kinds of data sets and the the uh not technical challenges but let's call legal challenges social challenges and so on uh you you already mentioned there's obviously issues with copyright uh so any image that that you have if you want to reproduce it you technically uh need to have some sort of a a license to it or you'll be a criminal in some country on the world for sure uh so you only have the links you solve that part pretty well um d but there has been there's been criticism i think with respect already to your earlier data set specifically i remember about two weeks after it was released like insanely fast there was a paper uh why like criticizing it was it was framed in a weird way like it was half criticizing your data set and half criticizing the large companies for not releasing their their tools to filter these data sets and could you maybe um summarize a little bit what that criticism was of your data set and and what what was the issue so basically the issue was that um the authors said if i remember correctly that our data set is not properly filtered and that if you go to our web demo or to the raw data you could find stuff like sexual content or hateful content or really disturbing content in it because um the content is not manually filtered by humans and that training on this data could eventually lead big models to behave in a toxic way or maybe in a biased way and um i don't think they criticized only us for this problem but they said that we were at the moment not careful enough about these topics and i guess i guess that's one reason why these big apart from competitive advantage right a reason why the the large companies might not release a data set like this because inevitably i there's even like there is legit adult content in image net right like this this data set has been used over and over there's legit just uh full-on adult content i've seen it um it's and i guess these larger companies they might not release the data set also because yeah copyright issues um because of of these types of things i also remember they specifically refer to the fact that a lot of um a lot of adult websites they use this alt text to do search engine optimization so what they would put in the alt text would be just terms that a lot of people search for if they search if they frequent these websites and that would make it such that a seemingly on like either a seemingly unsuspecting image would go together with offensive terms or seemingly unoffensive terms would would be like associated overly with adult themed images um you know they had some some examples right there sorry but i interrupted you so to put everything in a appropriate light i want to make um some things very very clear first we do not recommend anyone to train models with the raw lion data sets and put this into production without without really careful um either filtering or and thinking about how to make them safer so this is just a research data set that could also be used by companies for research purposes or maybe for pre-training and later making really really thoughtfully sure that it's safe this is the first the second from the initial version i already had some filters in that tried to generate tags for non-circuit for work and to filter out obviously illegal content through clip scores and this time we improved the non-circuit for work model to become really good we have now a clip embedding based classifier where you can run inference over tens of thousands of images within a second if you have the embeddings and it has on a test set so i made in november a manual test set for non-circuit for work and the test set has around 3 000 images and it gets an accuracy of 96 above 96 percent so it's already pretty good and it's really fast and thirdly we are also cooperating with um tu damstadt with christian kerstling and um petrick schvadovsky i hope i pronounce this name right to use their existing offensiveness classifier because they have an offensive content there's a file based also on the embeddings of clip that also detects things like violence hate speech things like dead animals and it is really conservative so it tends to also filter out like like halloween costumes but we will soon provide also these and i think what we are really doing by releasing all these samples and of filtering them out in the first place is we generate a huge opportunity for safety researchers to create openly available non-suitable for work classifier datasets so everyone who wants to get toxic content out and non-suitable for work content out is invited hereby to work on our raw data to generate subsets and train better tools in the future to filter those things out more reliably than we can currently do and i remember your you're not safe for work classifier initially was already pretty good so in this um in this uh so this this ui you have right here you i think you have it maybe not here but i remember you had a not safe for work button oh safe mode here obviously can't show this here since this is going up to to youtube but i tried to reproduce some of the results in that paper and you know for the kind of egregious results you really had to actually untick that that that box and select the the correct sub model right here because you have you have different sizes and also different models of clip that you um that you had now that is that's probably gone now but i remember i could select a different smaller clip model and the really egregious results i had to untick the safe mode box i had to select the smaller clip models which would probably be less nuanced and more more prone to these kind of things and then i could reproduce it so um yeah i'm certainly i'm certainly in favor of people you know looking and saying you know look alt text is often used for search engine optimization and that you know can play into that can can kind of poison the data set um yeah but i also feel there's a big opportunity to use this in a constructive way although if you if you like the implication is because you filter with clip initially and you still get these images in your data set that means clip itself must have been trained on a lot of data like this right like it also means that open ai hasn't managed to to filter out these types of of images right by implication which is pretty interesting to think about yeah there's something related to that which is interesting is so to train this safety model christophe mentioned the training set but for the model we tried several things and the first thing that christophe tried was just training hand-to-hand efficient net model and it worked pretty well and but then the the issue is that kind of model is then you need to spend a lot of gpu resources to do the inference so then we also tried to use a model a small model based on clip embeddings which is then much faster like you can run the world inference over the ligand 5b in one day with just cpus and what's interesting is that it works almost as well as the efficient net model which means that indeed clip has that knowledge like you can tell if you add a few layers of dance a few dance layers on top it can tell you whether it's unsafe or not which actually is a good feature like you want clip to be able to tell you that so yeah that's uh and yeah in that way yeah if you uncheck or check safe mode it will enable or not this inference over the clip embeddings and in live filter out what the model considers as unsafe and there is a big opportunity in actually having clip models that are trained on toxic data because it helps later to detect this and maybe even to generate synthetic data sets to combat this so i have been in contact with unis and rudis from aleph alpha the ceo of alpha and they have their model magma magma takes as an input a clip the clip output of the frozen clip and projects this into a gptj and then can generate captions and do visual question answering and i have seen very interesting results where jonas showed me where i had been toxic memes about racial discrimination and then magma was asked why is this toxic or why is this eventually offensive this mean and magma generated plausible sounding explanations for this and i bet this was cherry picked but nevertheless if you would have like potentially toxic or offensive content you could take any vqa model maybe that's based on a clip so you wouldn't have to train it again and then generate potential candidate explanations why is this toxic or why is this non-significant work or or things like this and you could take these candidates show them humans and let the human just click okay or not okay and by doing this this kind of work one could generate easily with far less human resources huge safety data sets to explain basically why something is potentially harmful or offensive or whatever so i think to have such kind of models for the research community this is a really good idea and if there maybe could be some bad actors i am very sure that they would find other ways to find you safe models that we think are safe but maybe i'm not so i think the illusion of believing that my model is perfectly safe just because i excluded all the harmful data from it is a little bit naive because there could be gaps in the filtering or harmful actors could take them and find you in them easily so this is a false safety instead we should rather train the research models with a huge disclaimer and be aware that true safety only can come from really careful thinking and engineering i i'm a i think this is a common way in i don't know like psychotherapy or something like this that actually exposure to danger and exposure to what you're afraid of and so on is the best way of of doing it is the best way of of handling these things and you know i think as these models get bigger i'm more and more convinced that we should eventually apply of course if i have a linear classifier there's not too much to do but i think these large models they're capable enough that if if they actually encounter such data if they incorporate it and so on they're large enough i believe that to discriminate internally oh as you say like you know this is this is probably not a picture that i should serve at this particular you know for this particular search query right here i'm i'm at a i'm at a i'm being used at a wedding to uh portray you know pictures of the wedding pair the bride and groom and and the one where as a child they smear poop in their face might not be super appropriate or so um yeah i i think this is in my that's just my opinion but i think this is a good way to go do any of your sponsors uh have any kind of like concerns or strings attack you know when maybe they see criticism coming your way was this ever an issue with any sponsor or do you do you have did you have like sponsors that were like hesitant because of these things no we don't have so many sponsors we have doodle body i we have huggy face right thanks to huggy face and we have stability ai and um i think when they read these concerns on twitter they probably instantly had opinions that resonate with our pay conlis cool so where can people get started with this like i'll link everything in the in the description what do you think is the best entry point for people if they just kind of want to check out what you're doing just come on our discord server read through all the channels that exist we have channels for data set creation for audio data set now there's a audio clip effort going on we have dahli several dahli channels we have several clip variant channels about clope and lit and d philip and d clip and what all of this exists we have some channels where just people post the generated art the generated results from the available dahli variants and glide variants and so just join basically i mean you could just reach out to us and ask me or someone else if there's a project where some help could be needed or you could propose your own project and if it's cool um we can try to connect you to some of our sponsors to get to be useful whatever cool anything else you want to get out to viewers listeners yeah don't hesitate just like even if you're a high school student or a university freshman or whatever like anyone can join like seo comes who was the first to join the project when i started he actually i always believed that he was something like a master student or so and later it turned out that he's a 16 years old high school student from loner and yeah he didn't know anything about deep learning at this time now he catched up but he was really good at doing all the server communication and he learned on the fly so we have many many stuff and if you have your own idea if you would like to to try to train the style again or fine tune a dahli version or whatever just ask us all right in this case kade roma christoph thank you so much for being here um thank you for doing this for anyone yeah check out the data set it's pretty cool it's a nice contribution very very cool contribution to the community uh thank you and i hope i hope this continues thanks thank you so much for having us
 Hi, this is an interview with people from Lion whose flagship projects are datasets,
 specifically datasets to train models like Dali or Clip. So pictures and text that goes along with
 the pictures. They scrape these from big internet scrapes. The first dataset had 400 million images
 and their newest dataset has 5 billion images. These are unprecedented scales to be open-sourced
 as datasets. The creators of Dali or Clip, OpenAI, they never disclose their dataset,
 they never put it out there in public and Lion does so this is a big service to the community and
 I was super excited to have them on here. Another thing is just how grassroots this movement is. The
 founder Christoph, who's also here today, is a father and a teacher and does this on the side
 just as a hobby and sort of wants to demonstrate a little bit how anyone can take part in open
 source research. Now multiple times during the interview his kids would actually come in and
 be like daddy play with us and so on. YouTube is very strict on this, I cannot show the kids even
 though the kids themselves would have loved to appear in this YouTube video. So you know kids
 please, I'm very sorry. Open invitation. I thought this was really cool and inspiring. In addition
 to learning what Lion is about, enjoy the interview. Let's dive right in. Hey everyone today I have
 the team behind Lion 5b with me. Christoph Schumann, Romain Beaumont and Kate Gordon are here
 who contributed to this project in various ways which I hope they'll just tell us about in a
 second. This is a giant dataset, it's over 5 billion image text pairs. So not just images but
 image text pairs and along with that an open clip model, open sourced clip model that matches the
 performance of OpenAI's clip model which is really cool. These big companies rarely give out their
 biggest models if at all and if they give out their biggest models they usually don't give the
 dataset behind the model. So it's really cool that we have a large dataset. There has been some
 controversy around your smaller data set that you released I want to say half a year or a year ago.
 I hope we can get into all of that today. But first of all, thank you very much for being here.
 Welcome to the channel. Welcome. Nice to be here. Yeah, just maybe tell me a little bit. What is
 Lyon and what is Lyon 5b? So it all started like 10 months ago I guess on the Eleuthe AI server
 when we talked about how could we eventually replicate Dali and where could we get like
 200, 300, 400 million image text pairs. And there was this idea of going to Common Crawl
 and looking for all the image links and only take those that have an alternative text.
 And we have been talking about this in the multimodal channel there together with Aran and
 Van Van and they got a little bit distracted with the project of GPTJ. So they ended up focusing
 totally on GPTJ and I was sitting there and was a little bit upset and thought why don't they pursue
 this? Because I compared to them felt like someone who is not that good programmer. And then I thought
 okay screw it. I'll just do it myself. And I sat down and wrote everything down in one collab and
 began crawling from Common Crawl and filtering with Clip. And then more and more people joined
 me. At first Teo Combs, he was the first to join me and so we called it crawling at home because
 at first we had some collab notebooks and some GPUs somewhere from some people on the discord
 servers and they were all like downloading and filtering and uploading the results to a
 rented server. And after a while more and more people joined like Richard who is not here at the
 moment but he's also a very valuable cool contributor, Richard Benku. And we optimized the code so that
 we could filter and crawl with one 3090 in one day 30 million image text pairs after the filtering,
 not before. So in the end we ended up like at the peak with like 30 and no 60 or 100 small
 mini servers downloading the images, sending them to Richard's GPU in his bedroom, filtering
 everything and spitting out in the quality of like conceptual captions, 12 million, what was
 the biggest then at the time, and 12 million image text pairs of decent quality. And we could generate
 with one 3090 within one day 30 million. And at this point we said oh wow, we should really scale
 this up and I asked someone, like we already had some people on discord who gave us the CPUs,
 GPUs and so it grew and grew. But then it was clear that we could get, with only the nations
 but from the community, could get to 400 million. What would be like the scale of OpenAI Clip
 data set because Clip was trained initially on 100 million image text pairs. And I said okay,
 we can get to one billion if we would get like maybe $5,000 of donations for paying for small
 CPU servers and maybe some GPUs somewhere, I don't know. And I asked on the Illutha AI server and
 within like 10 minutes someone said oh if it's only 5,000 I will pay it upfront. Someone who has
 like a startup, it's Jack from Doodlebot AI and yeah he ended up giving us in the end like $10,000.
 So he was our first official sponsor and I have to say the I.EU also provided us with some compute
 but the first sponsor who gave us money and then I said okay I don't want to have this money on my
 bank account and we probably for now and for the future should start a non-profit. And then came
 Jena who is not here at the moment, Jena Jicev, he's the lab leader of the deep learning laboratory
 at the Yulich supercomputing facility. And yeah we had been in touch and he said okay we will join
 with our people because we want to train models like Dali or Clip on the Yulich supercomputer
 like Juvels. It's a giant machine with almost 4,000 A100s and he cannot directly access it
 and train it Dali but he can access it for proof of concept, small projects and then apply.
 And so we said okay let's start a non-profit and we take this as a shell for basically
 getting money, getting resources officially and then spending it for creating cool data sets and
 training models and giving them away for free, no fees, 100% open. Because we were, I mean we were
 a little bit disappointed by the promise that OpenAI made by the name of OpenAI and many people had
 been joking about closed AI and I totally understand that if you get two billion dollars of funding
 that you have some strings attached and that you have some protocols and problems and that they have
 security, safety concerns. But we said okay we don't have the means to do all the basic research
 but we can try to do what they were doing, what Microsoft is doing, what Google terrain is doing
 and just taking the code or replicating the code and releasing such models for free. And then we
 started a German non-profit, FRAEIN, Germanizier FRAEIN in Germany. And yeah ever since everything
 took off we released the 400 million data set and less than one hour later I got mail from
 Thomas Wolf from Hanging Phase and I got also in contact with many more people and everyone wanted
 to talk to us and now we also get some monetary support from Hanging Phase that also enabled us
 to do the big data set and we have Stability AI who is providing us with GPUs and will provide
 us in the future with more GPUs. We have an ongoing application for 600 000 GPU hours on
 jewels. We don't have like the result yet but in one month we should know for training a big clip
 model and applying this to some downstream tasks. So yeah everything is moving very fast and one
 year ago I was just like a family daddy and a computer science teacher so I'm a computer science
 teacher and everything developed very quickly and now Romain who is also like an awesome guy
 who has much of experience and the cool tools like image to text, image to data set tool that
 you already introduced in your ML news I remember and Kate who is a really brilliant
 computer science student who is really into clip and he helped us to train a clip and replicate
 the results of the vision transformer 32 base and we matched roughly with a small variation
 sometimes a little better sometimes a little bit worse on several data sets the performance
 of the original clip. So yeah everything's looking really nicely. We have no intentions of
 going for profit. We agree that we want to stay open. We agreed that we want to stay non-profit
 for several reasons and everyone who likes to contribute or to talk to us maybe someone has
 some questions maybe someone is curious about something everyone can join our discord server
 and just ping us and ask us. Cool so I want to dive into sort of the biggest
 criticism that I would have with this project in that your data set essentially crawls common crawl
 for image text pairs and I'm going to guess that's image and the associated alt text or
 whatever text you find with the image and then you have this filtering step is what you say you can do
 a lot of images on a single GPU but you're essentially using OpenAI's clip model to filter
 image text pairs which clip deems to be you know fit together well. So how much of a bias does that
 introduce into a data set especially now if you say well we train a clip model on this data set
 right and we are able to match the performance of OpenAI's clip model one could ask you know is this
 are you essentially replicating their result or are you simply matching their performance because
 the data set is already essentially filtered to you know the data points that are conducive
 to that model so could you dive a little bit into your choices there and how much do you feel
 that is an important step this filtering what does it like what's the what does it give to the data
 set to use that and do you have plans to maybe switch that up or improve that part
 so no one claimed that this would be perfect but before I did this I started with JFCC 100 and I
 filtered this also and I filtered it basically on colab and yeah whatever and I checked a lot of
 image text pairs manually and I just got the feeling after looking at thousands of images and
 text pairs that point 28 was a pretty good threshold like that if you go above the threshold with the
 clip B32 from OpenAI then it really seems to match pretty well it's still a little bit noisy but it's
 rule of thumb and if you go above 0.3 it's even a little bit better not perfect but a little bit
 better and this is what we have this is not the ultimate solution for everything but I think
 because we are going so big and crawling over so many images that are you made by humans the
 annotations are made by humans that in the end we will still get like a lot new information in
 and it could be that some people maybe some names of people that the original
 clip has not learned or some concepts some nouns or some adjectives that has not learned
 could go below this could always happen but yeah I mean from the standard benchmarks that we ran
 the results are pretty good and everything is work in progress yeah I don't I don't doubt the
 quality aspect of filtering with OpenAI's clip what I'm a bit worried about is that you're
 essentially replicating what how this model sees the world as a whole and that's the reason why
 this model sees the world right this model isn't perfect either and so it will it will sort of
 replicate its own you know vision of the world into your data set and especially if you then
 train a clip model right that would that would be replicate have you tried just training a clip
 model on let's say an unfiltered data set or what could also be possible if you have many
 different such models that somehow estimate quality of images and text that you could build
 some sort of an ensemble I don't know if you have plans in the future to to replace this filtering
 step or make it better is that something you have on your radar I guess one thing we do have is the
 unfiltered pairs like we have actually 10 times this like we have 50 billion unfiltered pairs
 and yeah there could be some work to that could be done analyzing these pairs and trying to see
 if it's different but the problem of just using them is then you lower the quality a lot and
 I don't know if you do what it would do but yeah it's definitely an interesting point and
 we don't fully have the answer on that I think this is one of the points that will become more
 apparent when we start to train the larger clip models so at this moment it was like line 400m
 so that was the initial data set that we had just that subset and getting in the range of open AI
 is at least sufficient enough to prove that we've at the bare minimum been able to replicate the
 exact inferences of the model and get into that convex hole so to speak of its confidence threshold
 I think the more interesting result will come into play as soon as we hit the 5 billion scale and we
 get up to that larger threshold if we're able to push the numbers that open AI got before it could
 also be in response to the fact that we have like maybe different image towers and text towers
 sure that but if we can outperform what's opening I did within their original models it could be a
 sign that the data set was able to get like just enough stochasticity to go outside of like perfect
 confidence again it's in the future and it's not a result that we have but we're optimistic in seeing
 what it lies did you like how big is your data set just give me some some numbers in terms of like
 gigabytes like what what can I expect if I work with this thing so 240 terabytes 240 terabytes
 yeah if you download it in 384 resolution
 and you have you have different so you collected if different images can you give me some numbers on
 that like what kind of resolutions do you have how long are the descriptions usually just kind of some
 so people can imagine a little bit what what this looks like I think if you could open the
 the blog post yeah yeah yeah yeah so like for example the english part is 200 is 2 billion
 samples and then if you count only the one that are bigger both in width and height than 256 it's
 like a billion and then alpha for half this resolution and yeah so it's a lot of images which
 have a decent resolution but if you want to train like a like let's say a highly quality high quality
 generative model or maybe segmentation model maybe you want to use a high resolution subset
 set yeah in terms of caption lines yeah I want to add the precise number in that in that section
 but yeah it's around like I think it's around 200 characters but yeah that's the good question
 I should add that I computed it at some point but I think I didn't yeah I didn't add this in the
 blog post yeah and yeah you have this language distribution as well which is interesting for
 the mbtlanguages that I said oh I saw it just a second ago yeah it's very good yeah so it's
 a long tail actually because like we have like 100 languages and yeah the first one we have a lot of
 samples but then yeah you have this long tail of many other languages that are available
 but yeah for example you have 70 you have a 7 percent of the multilingual data set which is french
 wow that's interesting
 do you always have one piece of text with an image or do you sometimes have multiple because a lot of
 these datasets that are captioning datasets and so on they provide kind of multiple labels for
 one image there it's just one image one piece of text okay and that is it always the alt text of
 the image or do you sometimes like grab text around this is like work for the future so
 in the future we want to build an audio text data set with a similar approach so currently we have
 some people working on training a small or mid-sized audio clip model on existing data sets
 and once we have one of sufficient quality we could go through all of common crawl filter out all
 links to audio files and try to somehow get something like the alt text because usually
 there is no alt text but we could like look if there immediately before the link or after the
 link is some text that has a sufficient audio clip similarity and there are many ideas but
 if anyone would like to join us and work on this everyone can join we are truly open just get onto
 the discord server and say here so yeah also go ahead yeah and two things that you had been
 talking about previously so what could we do to make clip recognize more things that had not been
 in the original clip data set and one interesting perspective for this that is still work in progress
 but that could maybe work is we are experimenting currently with a training clip with a frozen image
 encoder and one idea that we have is to train a masked image of the encoder something like simmim
 or the mae from facebook meta and then we could train it on many many images without texts and
 so the basic idea is that if you have a really good image encoder that can be trained in a
 self-supervised manner without any text there then the limit is the sky because like in theory we
 could get like 50 or 100 billion images from common crawl we do not pursue this at the moment
 because like five billion is enough for the next few years i guess but so the idea is to train a
 really good image encoder in a self-supervised fashion and then we freeze it and we can train it
 with text train the text encoder and i guess in this case we would have much knowledge from the
 self-supervised training about what is actually an image and we wouldn't need the clip filter data
 we could take any data set and this could help with this so we're exploring we are cooperating
 at the moment with a clope team with andreas first who is the first author of the clope
 paper like this improvement of the original clip architecture with some hopfield layer magic
 so let's see what happens so tell me a bit about what it takes to because these are
 unprecedented scales for for most people by the way there's a nice overview here over the
 over the entire acquisition of pipeline which is is really nice distributed and all and then you
 train this clip model now the clip model you have currently you already said it is on the on the 400
 m data set which is the let's call it the old it's not super old but it's it's your previous data set
 which is on the scale of clip and you trained a clip model on this what does it take to work
 at let's call it at that scale right image net is one million images and that's already considered
 like a rather large data set for most researchers that have like a gpu or something like this right
 400 million is almost i would say most people probably aren't working with this size of data
 is it easy is it hard like how how do you go about training this model
 this model so there's like two large contexts for this this is whether or not you're in like
 your large hbc cluster or if you're in more so just like your generic data farm so at least these
 results were supported by jewels booster and the foundation which upholds that there it's also a
 very large institutional barrier of even like getting to the batch size that they offered so
 in terms of data set alone you have to have everything like stored on disk and that is a
 nightmare in itself getting it collected and that just in terms of memory is probably not accessible
 to most researchers then you get an extra layer which is the exact batch size of clip there have
 been other papers that have shown that these large multimodal contrastive models are like extremely
 batch size dependent basic has a really good table on this and it's hard enough to get to your data
 set alone hard enough to get the infrastructure just to support that but on top of that can you
 get your massive a100 cluster to actually spin this up and one thing they don't talk about is
 the massive engineering struggle that goes into actually doing contrastive loss on this
 let alone if you just take a 32 000 by 32 000 matrix it's like two gigabytes in fp 16 or four
 gigabytes if you're doing full precision and that just becomes a nightmare of overhead and so the
 wonderful team that i've been working with this model is just as much mine as it is theirs we've
 been putting a lot of our time into just how to optimize the small things like for instance when
 doing contrastive learning you don't actually need entire global patches you can do only certain
 calculations that are necessary for your local gradient routine so on and so forth but to achieve
 this scale there are a lot of challenges that these large research labs don't like talking about
 because they're not as pretty to write on the paper but this isn't very accessible immediately
 for like everyday researchers and we think this is something very important for other people to
 get their hands on and so hopefully this will inspire more companies to give out the compute
 necessary to accomplish results like these and inspire further researchers to uptake in this
 direction you also mentioned that your original plan was to train something like dolly right and
 clip is an important component of dolly is this still on your radar to eventually train something
 like dolly because there are other projects going on i know there's like mini dolly and
 other people trying to replicate dolly like what's your your thoughts on replicating dolly
 yeah there's so much going on and it's incredible so they had been from lucid rains the pie torch
 dolly project and we actually tried this on jubil booster so we got this to run on i don't know maybe
 256 100s for 10 minutes and it would work in theory but the thing is ah my son is here one second
 he has rubber balls okay i need time okay
 okay kids are important so this is very really awesome about all of this you know what i'm doing
 like on the discord servers i'm doing this when i'm on the playground i'm doing this while i'm
 playing minecraft with my kids i'm doing this when i'm at the shopping center like for my mobile
 so i can do this in my free time and this is really amazing but um what was i talking about
 what is dolly yeah so the thing is with dolly um we could have pursued this and we had to make
 the decisions at first we wanted to apply for a compute on jubil last august for like a half a
 million gp wars for creating dolly but we missed the deadline because we were so busy with line 400
 and then i had a realization others are what no darling dolly mini is there and min dolly and you
 have like ru dolly and now the fusion models and i said hey clip is actually not that amazing in
 the on the first glance but on the second glance it's far more amazing because you can use it to
 guide generative models you can use it to make huge data sets you can use it to create um
 semantically meaningful embeddings and this alone is very interesting because like um i had this
 idea and luther people had also this idea that maybe one could like take images and texts and do
 sequence modeling on the clip embeddings so you wouldn't do the sequence modeling on the image
 tokens or on the text tokens but maybe on the abstract ideas so i compare it like it's not
 100 percent accurate maybe but it's like a metaphor so if i'm thinking about i want to go to the fringe
 and get some food and want to do this i'm not really imagining everything in full hd resolution
 and i'm not thinking oh i will go to the fridge so i'm more like having the idea in a kind of mixed
 embedding space idea space and so um one thing that we have in mind is like something in the
 future maybe not now but if it would eventually work to take embeddings from audio from video
 from text from from all modalities and bring them into the same embedding space and then somehow
 bring a transformer to model them this would be really interesting because you could like
 train it on a text on video and everything and could do it in a very efficient way and
 elusa people had been working on this they got many not number errors from feeding in the direct
 clip embeddings because it's probably just like too too big to instable with all the
 noise in the clip embeddings but i have the hunch that clip is really powerful and i didn't realize
 this when i first read about clip i think so the idea you have gpt kind of models they have sequence
 loans they can model sequences of whatever of images of text of all kinds of data and you have
 something like clip that can take different modalities basically any modality and convert
 it somehow into a shared embedding space and i think these both topics are a little bit
 disconnected in the at the moment but in the future there's very much room left to the ceiling
 to combine them maybe do something like quantization of the clip embeddings or whatever like i
 i have no clue exactly but i could really imagine that in the future if we could get all modalities
 into a semantic shared semantic space and find a sequence learner to model this this i have no idea
 i maybe i don't dare to dream of a gi or so in this connection but i can really see similarities
 that in my stream of consciousness when i think okay i want to go there then happens this and i
 do action x and action y this is not so different yeah well there is a debate of whether you need to
 actually interact with the world to achieve a gi right i think that's the the big hurdle
 the other thing is there's this model or this paper called cm3 i don't know if you've seen that
 they are doing something very similar to what you just suggested with actually quantizing the
 the images after encoding them with it with an image model and then using an autoregressive
 model in order to to model that so maybe that that might be some ideas maybe i can i can say
 a few words about your initial or your previous question of about the the size of things and how
 do we handle it i think maybe i have a slightly different perspective because for me what was
 interesting in in this project is to be able to do all of this with actually little resources
 because yeah it's pretty big but for example the 400 million data set
 just with some python codes pretty optimized you can actually download it with like
 only one machine and three days which i think yeah that's that's pretty good and at this scale
 you only have like 10 terabytes of data so you can actually store it at home and it's not that
 expensive and i think that's pretty interesting because i think that was one of the things that
 made it possible for like many researchers to get ion 400m and start applying to various ideas like
 we had a bunch of papers trying to that took it and train some generative models train some
 contrastive models that kind of things and and yeah and the story is a bit similar but of course
 a bit more costly with new this new data set so i had to make everything distributed so now it's
 like 10 nodes and not one to download it in a reasonable time but still it's in the in the
 mind of reasonable like you can you can have it without being a very large company yeah and
 and yeah and following up a bit on this idea is so one of the things we did as post-processing of
 these data sets is like downloading everything and computing all the clip embeddings out of that
 and then putting that in a canon index and that's the the ui the demo and i think one of the
 idea uh beyond that is sure you can explore the data set you can look for cats or whatever you want
 but you can also use that kind of index to extract new sub data sets that are much more
 much smaller and that can be interesting to to to train let's say smaller things and
 uh solve more specific problems so maybe you want to build to find all the pizzas from the world and
 i don't know get inspiration for your restaurant
 yeah yeah or you can for example try to build some kind of subset out of lion 400m or lion
 for bay like for example christopher has been starting a project to find all the humans in
 the data set and see what's there what can we understand from that and yeah and i think what's
 interesting is that all of this democratize uh research like it becomes possible to actually
 uh build that kind of stuff without having too much resources and uh yeah i hope that we can
 it makes it possible and uh and yeah and that people pay always are the tools on the data sets
 tools on the data sets you i see you you're storing the uh the data set on s3 which does
 i know like uh eluthor stores their data set on on the eye which which supplies these resources
 i know s3 has like significant charges for egress right if people download this that you incur
 quite some cost uh i think they have like 20 cents per gigabyte which would be like 200 bucks per
 terabyte so at 200 terabytes someone downloading the data set would cause you something like uh
 30 000 40 000 dollars or so um what so this is this is what your sponsors are are there for or
 do you have like a deal with with amazon no we we are very lucky so we are very lucky um
 um our sponsor for compute at the moment or our main sponsor for the gpus and for the s3
 s3 storage is stability ai and their plan is actually to gather resources from different
 companies investors who actually want cool multimodal models openly available because they
 want to use them but they don't want to build an ml team or hire people or so and he has many
 connections a much he's the the ceo or the founder of stability ai and he has a very good deal with
 aws and um we won't share the aws files that we have because we don't own the copyright of the
 pictures but we are sharing the metadata the urls and so everyone on his own his or her own
 liability and risk could download them from the original sources we recommend that if you do this
 you make sure that the data set is shuffled nicely it's or it's already shuffled i guess right yeah
 yeah and um so when we started the project we got problems because we didn't properly shuffle them
 and sometimes some web masters complained that we were downloading too much from them and the data
 set where we were renting the machines got some complaints but if you shuffle it properly and you
 download it over all the five billion image taxpayers there is no problem usually and um with
 a wonderful tool tool image to data set that romaine programmed and that now also supports
 distributed downloading with a swarm of cpu workers one could um download it for relatively
 small money i mean you're making us tell more about this yeah yeah uh for sure yeah that's a big
 um thing i think that makes it possible for us to share the data sets like uh lion 400m is 10
 terabytes in images but the metadata is only um 50 gigabytes which is quite handleable uh and
 same for lion 5p the image is 240 uh terabytes but the um the metadata itself is about uh one
 terabyte which is handleable and then yeah you can use that image to the asset tool to get the data
 which works well of course there will be some link hots and you will start losing a bit of data
 with time but it's a pretty reasonable given the total amount of data and about the cost yeah
 to do not like lion uh 5p if you use some other various instance i think the cost should be like
 a thousand dollar which is not nothing but it's not like a 40k you have mentioning about i guess
 yeah okay so it won't it won't cost it won't bankrupt you and it won't bankrupt me if i
 download this data yeah exactly yeah i see that's and for the future there's a new direction that
 we are exploring at the moment or the hive mind project is exploring so um they working they are
 working on some code that would allow you to directly stream the images from the urls so you
 download them you buffer them somewhere and if you have like a decent internet connection that
 that this should actually work so um last time lxp from the hive mind project he's also on this
 code he told me that they could reliably um train like 50 to 60 images per second and for a small
 model this would not be sufficient so we would get a bottleneck but if you go to something like
 a vision transformer capital g or capital h the training takes so much time that it wouldn't
 matter so you could like train a capital h vision transformer with this and you would need only
 maybe 100 gigabyte or so storage on your machine that is interesting that the models they get so
 big that essentially that the bottleneck shifts away from the internet connection to the to the
 cluster forward propagation that's pretty cool um but you you mentioned a good point in terms of
 releasing these kinds of data sets and the the uh not technical challenges but let's call legal
 challenges social challenges and so on uh you you already mentioned there's obviously issues with
 copyright uh so any image that that you have if you want to reproduce it you technically
 uh need to have some sort of a a license to it or you'll be a criminal in some country on the world
 for sure uh so you only have the links you solve that part pretty well um d but there has been
 there's been criticism i think with respect already to your earlier data set specifically
 i remember about two weeks after it was released like insanely fast there was a paper uh why like
 criticizing it was it was framed in a weird way like it was half criticizing your data set and
 half criticizing the large companies for not releasing their their tools to filter these data
 sets and could you maybe um summarize a little bit what that criticism was of your data set and
 and what what was the issue so basically the issue was that um the authors said if i remember
 correctly that our data set is not properly filtered and that if you go to our web demo or
 to the raw data you could find stuff like sexual content or hateful content or really disturbing
 content in it because um the content is not manually filtered by humans and that training on
 this data could eventually lead big models to behave in a toxic way or maybe in a biased way
 and um i don't think they criticized only us for this problem but they said that we were at the
 moment not careful enough about these topics and i guess i guess that's one reason why these big
 apart from competitive advantage right a reason why the the large companies might not release
 a data set like this because inevitably i there's even like there is legit adult content in image net
 right like this this data set has been used over and over there's legit just uh full-on adult
 content i've seen it um it's and i guess these larger companies they might not release the data
 set also because yeah copyright issues um because of of these types of things i also remember they
 specifically refer to the fact that a lot of um a lot of adult websites they use this alt text to
 do search engine optimization so what they would put in the alt text would be just terms that a
 lot of people search for if they search if they frequent these websites and that would make it
 such that a seemingly on like either a seemingly unsuspecting image would go together with offensive
 terms or seemingly unoffensive terms would would be like associated overly with adult themed images
 um you know they had some some examples right there sorry but i interrupted you so to put
 everything in a appropriate light i want to make um some things very very clear first we do not
 recommend anyone to train models with the raw lion data sets and put this into production without
 without really careful um either filtering or and thinking about how to make them safer so this is
 just a research data set that could also be used by companies for research purposes or maybe for
 pre-training and later making really really thoughtfully sure that it's safe this is the first
 the second from the initial version i already had some filters in that tried to generate
 tags for non-circuit for work and to filter out obviously illegal content through clip scores
 and this time we improved the non-circuit for work model to become really good we have now
 a clip embedding based classifier where you can run inference over tens of thousands of images within
 a second if you have the embeddings and it has on a test set so i made in november a manual test set
 for non-circuit for work and the test set has around 3 000 images and it gets an accuracy of
 96 above 96 percent so it's already pretty good and it's really fast and thirdly we are also
 cooperating with um tu damstadt with christian kerstling and um petrick schvadovsky i hope i
 pronounce this name right to use their existing offensiveness classifier because they have an
 offensive content there's a file based also on the embeddings of clip that also detects things like
 violence hate speech things like dead animals and it is really conservative so it tends to also
 filter out like like halloween costumes but we will soon provide also these and i think what we
 are really doing by releasing all these samples and of filtering them out in the first place is
 we generate a huge opportunity for safety researchers to create openly available
 non-suitable for work classifier datasets so everyone who wants to get toxic content out
 and non-suitable for work content out is invited hereby to work on our raw data to generate subsets
 and train better tools in the future to filter those things out more reliably than we can currently
 do and i remember your you're not safe for work classifier initially was already pretty good so
 in this um in this uh so this this ui you have right here you i think you have it maybe not
 here but i remember you had a not safe for work button oh safe mode here obviously can't show this
 here since this is going up to to youtube but i tried to reproduce some of the results in that
 paper and you know for the kind of egregious results you really had to actually untick that
 that that box and select the the correct sub model right here because you have you have different
 sizes and also different models of clip that you um that you had now that is that's probably
 gone now but i remember i could select a different smaller clip model and the really egregious
 results i had to untick the safe mode box i had to select the smaller clip models which would probably
 be less nuanced and more more prone to these kind of things and then i could reproduce it so
 um yeah i'm certainly i'm certainly in favor of people you know looking and saying you know look
 alt text is often used for search engine optimization and that you know can play
 into that can can kind of poison the data set um yeah but i also feel there's a big opportunity
 to use this in a constructive way although if you if you like the implication is because you filter
 with clip initially and you still get these images in your data set that means clip itself must have
 been trained on a lot of data like this right like it also means that open ai hasn't managed to to
 filter out these types of of images right by implication which is pretty interesting to think
 about yeah there's something related to that which is interesting is so to train this safety model
 christophe mentioned the training set but for the model we tried several things and the first thing
 that christophe tried was just training hand-to-hand efficient net model and it worked pretty well and
 but then the the issue is that kind of model is then you need to spend a lot of gpu resources to
 do the inference so then we also tried to use a model a small model based on clip embeddings
 which is then much faster like you can run the world inference over the ligand 5b in one day
 with just cpus and what's interesting is that it works almost as well as the efficient net model
 which means that indeed clip has that knowledge like you can tell if you add a few layers of dance
 a few dance layers on top it can tell you whether it's unsafe or not which actually is a good
 feature like you want clip to be able to tell you that so yeah that's uh and yeah in that way yeah
 if you uncheck or check safe mode it will enable or not this inference over the clip embeddings
 and in live filter out what the model considers as unsafe and there is a big opportunity in
 actually having clip models that are trained on toxic data because it helps later to detect this
 and maybe even to generate synthetic data sets to combat this so i have been in contact with
 unis and rudis from aleph alpha the ceo of alpha and they have their model magma
 magma takes as an input a clip the clip output of the frozen clip and projects this into a
 gptj and then can generate captions and do visual question answering and i have seen very interesting
 results where jonas showed me where i had been toxic memes about racial discrimination
 and then magma was asked why is this toxic or why is this eventually offensive this mean
 and magma generated plausible sounding explanations for this and i bet this was cherry picked but
 nevertheless if you would have like potentially toxic or offensive content you could take any
 vqa model maybe that's based on a clip so you wouldn't have to train it again and then generate
 potential candidate explanations why is this toxic or why is this non-significant work or
 or things like this and you could take these candidates show them humans and let the human
 just click okay or not okay and by doing this this kind of work one could generate easily with far
 less human resources huge safety data sets to explain basically why something is potentially
 harmful or offensive or whatever so i think to have such kind of models for the research community
 this is a really good idea and if there maybe could be some bad actors i am very sure that
 they would find other ways to find you safe models that we think are safe but maybe i'm not so i think
 the illusion of believing that my model is perfectly safe just because i excluded all the
 harmful data from it is a little bit naive because there could be gaps in the filtering
 or harmful actors could take them and find you in them easily so this is a false safety instead we
 should rather train the research models with a huge disclaimer and be aware that true safety only
 can come from really careful thinking and engineering i i'm a i think this is a common
 way in i don't know like psychotherapy or something like this that actually exposure
 to danger and exposure to what you're afraid of and so on is the best way of of doing it
 is the best way of of handling these things and you know i think as these models get bigger i'm
 more and more convinced that we should eventually apply of course if i have a linear classifier
 there's not too much to do but i think these large models they're capable enough that if if they
 actually encounter such data if they incorporate it and so on they're large enough i believe that
 to discriminate internally oh as you say like you know this is this is probably not a picture that
 i should serve at this particular you know for this particular search query right here i'm i'm at a i'm
 at a i'm being used at a wedding to uh portray you know pictures of the wedding pair the bride and
 groom and and the one where as a child they smear poop in their face might not be super appropriate
 or so um yeah i i think this is in my that's just my opinion but i think this is a good way to go
 do any of your sponsors uh have any kind of like concerns or strings attack you know when
 maybe they see criticism coming your way was this ever an issue with any sponsor or do you do you
 have did you have like sponsors that were like hesitant because of these things no we don't have
 so many sponsors we have doodle body i we have huggy face right thanks to huggy face and we have
 stability ai and um i think when they read these concerns on twitter they probably instantly had
 opinions that resonate with our pay conlis cool so where can people get started with this like i'll
 link everything in the in the description what do you think is the best entry point for people if
 they just kind of want to check out what you're doing just come on our discord server read through
 all the channels that exist we have channels for data set creation for audio data set now there's
 a audio clip effort going on we have dahli several dahli channels we have several clip variant
 channels about clope and lit and d philip and d clip and what all of this exists we have some
 channels where just people post the generated art the generated results from the available
 dahli variants and glide variants and so just join basically i mean you could just reach out to us
 and ask me or someone else if there's a project where some help could be needed
 or you could propose your own project and if it's cool um we can try to connect you to some of our
 sponsors to get to be useful whatever cool anything else you want to get out to viewers listeners
 yeah don't hesitate just like even if you're a high school student or a university freshman or
 whatever like anyone can join like seo comes who was the first to join the project when i started
 he actually i always believed that he was something like a master student or so and later it turned
 out that he's a 16 years old high school student from loner and yeah he didn't know anything about
 deep learning at this time now he catched up but he was really good at doing all the server
 communication and he learned on the fly so we have many many stuff and if you have your own
 idea if you would like to to try to train the style again or fine tune a dahli version or whatever
 just ask us all right in this case kade roma christoph thank you so much for being here
 um thank you for doing this for anyone yeah check out the data set it's pretty cool it's a nice
 contribution very very cool contribution to the community uh thank you and i hope i hope this
 continues thanks thank you so much for having us