if you guys think this is insane, it took this guy like 2 weeks to make this all start to finish this man is a MACHINE
ChatGPT playing minecraft: ❌️
Minecraft running ChatGPT: ✅️
Yeah bro they'll make a server, represent the internet, someone will then recreate chatgpt with redstone make it learn alot and people would be able to use it, but the problem is redstone is very slow, so they have to speed up the time so much, that it even responses in a "ok" time.
Someone NEEDS to make a chat GPT in minecraft, I Don't care if it uses command blocks, it would be so cool!
@@Centorym The GPT language models are so huge that, if we convert the whole model into redstone, the scale of the redstone machine will be so large that it will not even fit within render distance!
For comparison chatGPT model size is somewhere about 10 million~10 billion times larger than the number-recognitoin model.
Yeah I think command blocks is the only way to go, but even that the amount of command blocks would be monumental!
And the labor of copying the entire model by hand...
I think the conversion process has to be automated to be feasible
@@tung-hsinliu861 then we must settle for a very barebones version that has predetermined responses - although that'll be more of a magic 8ball ngl
10 neurons? Bro just built me
@@priyank5161Oh that means 10 of me = 1 of you (100 of original commenter’)
Bro, people out there creating neural networks in Minecraft, and I'm struggeling opening a chocalate bar while watchin them
if it makes you feel any better most really advanced ai robots really struggle opening a chocolate bar as well
I still have a small wound on my finger after trying to open a water bottle
In 16-bit logic, you can replace division by 15 by a multiplication by -30583 (32 bit result), three shifts, and two addition operations. You can easily figure this out by compiling a function that returns its 16-bit argument divided by 15 on clang with -O2, and what's efficient to do on silicon fabric (integers over floats, and multiplication over division) is almost always efficient in minecraft too.
As for softmax, in 2021, researchers at nvidia created a hardware-efficient softmax replacement called "softermax" that is realistically implementable in minecraft.
I'm not a minecraft expert, but I love seeing hardware implementations of functions, and minecraft is no exception.
Just because a function is hardware-efficient doesn't necessarily mean it can be easily or efficiently implemented in Minecraft, but it's an interesting point.
@@law1337 "what's efficient to do on silicon ... is almost always efficient in Minecraft too."
Java: *raises eyebrow*
Your transcript for college, internships, and future jobs in computer science is gonna be so stacked
the ONLY person on youtube that managed to explain neural networks in seconds, it took me days of research to understand them, be able to make and explain them
@@libertyjensen6321 If a particular pixel on the input is lighted up, chances are you can make a list of numbers that could have that pixel included in their final drawing, as well as a list of numbers that are very unlikely to have that one included in theirs. If you combine all of these lists from each pixel on the input, then you can get on the output how likely it is that each of the numbers was the one actually drawn.
Everything else (hidden layers, weights, biases, etc) is just an algorithmic way to process and combine the "lists" of information made in an ingenious manner that allows you to automatically pre-generate the lists (a.k.a. get the values for weights and biases) by "training" the network beforehand (which in reality is as simple as than taking every possible final drawing to begin with, looking at the pixels that are lighted up in each of them and storing that information).
@@libertyjensen6321 its multiplying a bunch of numbers (the input pixels) with a bunch of set values (the weights), then adding a bias (should the neuron be biased towards negative or positive activation) then adding a nonlinearity (any function which cannot be plotted as a single line)
You solved a number of difficult problems elegantly, but your amazing ability to communicate those ideas both visually and with narrative ease really stands out. Fantastic piece of content my dude.
my brother in christ, IT TOOK ME TWO MONTHS TO MAKE A NETWORK FROM SCRATCH THAT SOVLED THE MNIST DATASET IN PYTHON AND YOU DID IT IN REDSTONE IN 2 WEEKS, i applaude you, you redstone genius
lol there is a video i love of some bloke just writing it in like half an hour :> watching it is great way to lose confidence in your abilities
@@GustvandeWal yt doesn't play nice with links, but its called "Building a neural network FROM SCRATCH (no Tensorflow/Pytorch, just numpy & math)"
I just did a machine learning course last semester, and your 2 minute explanation for an MLP network was way easier to understand than our textbooks chapter that covered it. This entire build is insane, amazing work!
I approached the topic years ago when I was doing a perceptron for playing tic tac toe. I had problems with keeping neurons and it's weight in a small enough size not to add too much of delay. Today it's solved by saving it as a signal strength in a barrel. It's such a genius thing that was impossible back in my day. Mine perceptron was five times bigger and had shit accuracy as I had to limit hidden layers (every weight and bias had to be saved in a separate RS NOR Latch bases 8-bit register plus every neutron had a 8 bit multiplicator and summator). Eventually I circled back to a rule based solution as the tic tac toe is simple enough to implement it in a smaller factor size, but it was deterministic and not really "very AI". I'm so proud and happy to see that quality redstone engineering is still alive and well and now you can do those things in a very nice and compact way.
We’re getting to the point where pretty soon someone is gonna recreate the nes in minecraft, or make doom in minecraft, im betting that within 10 years someone will get either doom or super Mario bros or the legend of Zelda running just off redstone
Idk about other games but doom already exist, someone ran it on his redstone computer (I believe it was called IRIS) I'll get back and edit this comment with the code of the video
(edit) _SvLXy74Jr4 Also I have no idea if this has been done before
Modpunchtree already ran doom on his cpu iris you can look up the video
I’m struggling on a 2x2 this dudes making a Neural Network.
dont worry dude! it just takes time! You should watch his logical redstone reloaded series. (both new and old). they’re really helpful in understanding how computational redstone works. After that, just try to make an ALU. Its an amazing starting goal and once you’ve made your own, you can confidently say you’re proficient. I wish you luck on your journey
That's super cool ! I like that you explained the difficulties you had and how you overcame them, makes everything less mystical and really helps understand why you do what you do
Amazing project, congrats. Note: instead of multiplying the weights by 100, you can perform post-training int8 quantization to maintain most of the original accuracy.
14:19 Exponentiation is pretty simple, just convert the exponent to a binary number, then for each bit that is turned on you add the corresponding exponent, and to get the list of corresponding exponents you just start with the number you're raising to the power of the exponent and multiply by two each step. Here's an example, if you have 5^7 then it will convert 7 to binary which is 111 then it will multiply 5, 25, and 625 to get 78,125 which is the correct answer.
@@skaleee1207 Nice! I didn't know its official name. Originally, I thought I was the first person to come up with it, I remember being quite proud of it, later on I learned that it already existed, but I didn't know the name until now! That name is a lot simpler than my explanation and will allow people to find more information on it too, thanks!
This is an exponential with eulers number. Any output would be irrational and very messy. I understand why he would avoid this.
You could do it with base 2 (or 4), its just changing the "temperature". In that case exponentiation is trivial (bitshift). But you still have to do division.
The internet is such a cool place, imagine having a degree and choosing it to build real video games and software into minecraft and share it for a job, instead of actually building the video games and software, and making a living from that. The internet is so cool.
Gaming companies are so scummy and exploitative that honestly that's ain't really a bad deal after all
@@VortexFlickens Not much of a flattering comparison for stupid kids don't ya think?
Wow look at the stupid kids hating on Elon cause he’s successful. Someone made a joke, cope
So a really cool detail is how you handle the floating point limitation, this is actually really close to some quantitation solutions, look at the paper : "The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits" if you have the time, you might find further optimizations there
Great work! You helped me gain a better understanding of the weights. I don’t know why i was having a hard time grasping how the weights worked. Thank you
This is such a good demonstration that every hard problem is just a ton of smaller easier problems.
This is also a good demonstration that there is always someone out there smarter than you could ever be lol
We got real AI in Minecraft before GTA 6
😭😭WE ONLY HAVE A COUPLE YEARS TO MAKE THESE JOKES; EVERYTHING WILL STOP BEING IMPRESSIVE SINCE ITS AFTER GTA 6
Congratulations, that's so cool! I used to do a lot of redstone back then, so I love seeing people pushing the limits further and further with it :)
This taught me about implementing neural networks better than a lot of learning resources I've watched. Good work
I will likely never fully understand these videos, but man are they impressive 👏
Incredible work! My brain is fried
The way you explained all of those deep learning terms in simple words is just marvelous!
This is absolutely insane, keep up the good work!
offtopic but recently started second semester on my computer science in college and was like "omg it's mattbatwings thing" the whole lecture because i already learned most of the stuff they were talking about from you 💀
Actually you only need to be continuous for training, for deployment you can drastically decrease the precision
Without losing accuracy, if you do it right
There's a paper where they reduce it all the way to one bit per neuron, which is a perfect fit for minecraft
(And I'm pretty sure also to 4 bits, which would fit signal strength applications)
@@user-yi8uz2ph1y Imagine getting a binary quantization good at mnist lol
Even for training, you can use quantization-aware or non-differentiable methods and meet parity on inference during training.
I'm guessing this is the BNN paper by Courbariaux et al. from 2016? I'm skimming through the claims and it's insane what quantization can theoretically do.
This is such an amazing work I even applauded when the video ended. While watching the showcase I noticed that the 8 was always on the same confidence range, could this be a bug? Anyway this is incredible, Congratulations!!
That was inCREDIBLE. I'm floored. Not just by the redstone prowess but also by the ingenuity to be able to dissect these concepts and then rebuild them from scratch. Seriously impressive.
At this rate in 5 years I'm going to see a video on my homepage from mattbatswings where he ports the entire Linux kernel into Minecraft
The first thing that comes to mind is a recent cutting edge implementation of QAT (quantization aware training) called Bitnet 1.58; it operates on different principles than a standard MLP. It replaces the Matrix multiplication with binary operators (addition, subtraction, or no-ops), so it's fast in inference deployment and cheap in that you can sort of fit a single "unit" of weights into 1.58 bits (though it's easier to just do it as a 2bit implementation with one state unused). It'd probably be way faster in a Minecraft context as one of the biggest disadvantages in IRL deployment, that you need custom hardware to take full advantage of the speed improvements, isn't really a disadvantage in a bespoke system.
Anyway, the biggest difference is in the training process; it's trained at Int8 or FP8 (if memory serves, it's been a little while), and is then downscaled to the 1.58bit representation, but the information lost in that conversion to ternary values is preserved in a weight reconstruction matrix, basically. The end goal is that the network is made aware that it will be converted to a ternary representation. Hence, "quantization *aware* training", so you might be able to preserve more of the accuracy of the floating point model than you thought.
Strictly speaking, the full bitnet implementation is a Transformer network, but it should still apply to raw MLPs given that they started with the FFN (essentially an MLP placed inside a more complex network with self attention and a language head).
Just another comment saying I'm thoroughly impressed, both in your execution and your explanation of neural networks. Thank you!
I just started the first few seconds of the video... the Minecraft soundtrack remix is awesome! Gives you a liiitle bit of the nostalgia of the original soundtrack but it feels so cool
I never thought a Minecraft video will teach me neural network better than my teacher, thanks for the upload
Brother.
I spent a while learning how to make neural networks as a school project, and just doing this from scratch, in redstone is absloutely astonishing. Legend, Mattbat.
Wow, How kind of you to give the world download!!!, appreciate it! ❤
Really great video. Also you demonstrate how easy making a neural network can be. You just explained everything very well. Will inspire people. Inspired me.
That's incredible! Combining neural networks with Minecraft is pure genius. Keep up the amazing work!
This is really good bro for visualising how computers work deep down in their tiny chips. Like ur essentially blowing up a cpu to its full size and literally WALKING thru the details and wiring. U can be a goated CS major bro, u have so much f**ING talent bro. How old are you dude? Did you do UNI, or are you currently doing uni? Like bro, go do a CS major or smth, you could make a shit ton of money from just research and development. U got like bottomless talent levels bro
Dude this is so amazing. To have the skill to make a machine like this, understand the math and computations behind it, minecraft knowledge, and the video production after it all? That's amazing
Nice i also thought at first that your going to train the model in Minecraft but it seems that if its going to happen its going to be a whole other story
mattbatwings in 1 year: I Made a Technological Singularity with just Redstone!
I'm always happy to see what wizardry you come up with. Keep being awesome man!
Your work is incredible! I have a lot of trouble working with PyTorch to create a neural network, and the fact that you were able to do it in Minecraft is mind-blowing.
I was trying to come up with a project to add to my resume and you just simplified me to focus on ML. Thank you! :)
Ok, now make an AI assisted shape drawing tool for your paint program.
e.g. draw a bad square, it draws a good square with the same width and height.
draw an ugly number, it fixes it by converting it to the closest possible number with correct dimensions.
@@alluseri i like how google translate assertively translates this to "Now"
the multiplication and division portions can be simplified by taking the binary input and bit shifting them
This was so cool man. Great job!
This is honestly incredible. I wish this was around when I was studying these concepts, would have helped me understand back propagation and softmax so much quicker
You just reinvented the integer quantization! Nice job🎉
Very comprehensive explanation on neural networks. Appreciate it man
Very cool video, you may want to look at quantization for weight, it's a technique use to reduce the model side (for smaller device exemple) which is perfect for your case :)
We got AI in Minecraft before GTA 6
AI with redstone* ai has been in minecraft since the first mobs.
This is great work! I never thought we would have machine learning with just Redstone.
@@bintangramadan3217 Yeah but Mattbatwings is aware of that so maybe there will be something new?
You could npt have seen it yet, stop saying stuff just to get like. It was before premiere
its not machine learning, he just pasted the weights and biases into the neural network, not making it learn itself like a machine learning algorithm would
I love that you can recreate digital logoc in minecraft. I remember making adders and logic gates after learning about them in my digital logic circuit design class.
could also do the bar chart at the end by doing log scale by taking the highest binary digit of each and cascading the signal down so all the lower values are 1s so it looks like a solid bar, or just map each digit to a signal strength and OR them together
Congrats, you passed your PhD thesis.
Wow, that's actually crazy, good on you!
Cool video! Also you can try to implement the Hopfield network. This network use discrete weights by design, so you won't need to round it.
This video was awesome!! It taught me the basics of machine learning but related it all to Minecraft. The perfect combo!
Can't say enough about how great it is that you showed prior work from others in the community before digging in to your version. That's what we want to see in the community ❤
respect for the sponsor's dish at the end of the episode
That’s a marvelous creation to be able to feature on your portfolios.
this is absolutely crazy, as someone who took machine learning in uni i never thought that this was possible in minecraft, mind blown!
WHAT THIS IS THE VIDEO I’VE BEEN WAITING FOR OMGGGG
Bro is bout to build a quantum computer in Minecraft… 💀
I’m currently in my second year of computer engineering who’s spent the past 12 months learning about AI, transformers and LLMs. This has to be the coolest implementation and application of the things I am learning I have ever seen. Combines my favourite childhood game with my career aspirations.
1 step closer to google in minecraft
There is a mod that uses block's as a screen and it connects to Google's url so thechnicly you can wach TH-cam in Minecraft
Now please make a calculator where you can draw the numbers yourself (using a neural network and calculator) that would be awesome
That would be so cool. It would also be fun if you could draw the plus sign (Or whatever operation you were doing) as well.
Dude your project just made me fully understand MLPs and neural networks thank you.
this is so cool, if there's even the slightest possibility to collaborate on a similar idea or project I'd be honored at such an opportunity
NO DONT TAKE OUR REDSTONE ENGINEERS JOBS
at this point bro is gonna make hooman brain in redstone dang good job
this is amazing showcase of what a NN is and how it works. i worked with NN's for years and i still struggle sometimes lol
This is amazing bro. Great job!
Amazing
I hope you mention the first guy who did a neural network thing in minecraft, recognising numbers
Edit: he did
Why would you comment this before watching the video. He mentioned the other guy very early on in the video
How did u get around the network being bad at actual digit recognition, due to the MNIST data set all being perfectly centered?
A simple MLP can learn a pretty good representation already for this dataset, but one easy approach would be to transform the input images (e.g. skew, rotate) and add these as additional training samples, this makes the learned representations even more robust :)
The first time I understood such a viedo! thanks! and please keep going!
Okay the bit shift caught me off guard. Absolutely amazing work
We are getting AI in minecraft before GTA VI comes out 💀💀
Wait what!???? Please tell me that this is just uploading the model into redstone and not all complex things like backpropagation to train the NN inside Minecraft...
For simple nural networks you dont really need backpropagation, you can just randomize the values until it gets better, itll take longer to train and wont be as efficient but its way easier to do
Bro there's a guy from Chinese who made neural Network in mine5 1 year ago lol
Brooooo this man is crazy he be pumping out content at a crazy rate and he makes some of the craziest things. Does bro ever not touch his pc? I think he sleeps while designing his crazy builds.
massive kudos dude, seriously impressive!!!
I’m a time traveler and mattbatt has recently made a human brain in Minecraft
He also made a Time Machine in Minecraft which is how you’re here I assume
So... For all of you without experience with neural networks, this isn't a whole thing (not even close). He is placing weights which he already got from training in Python. Even though this is impressive, it's way less impressive than some of his other builds. Training a neural network would be impossible in Minecraft because of all the math it requires which isn't possible (or extremely hard and slow) in Minecraft... I hope I cleared things out :)
It's not impossible, maybe with a lighter neural network the training process will be possible.
I mean it pretty obviously isn't the whole thing, and regardless it is still impressive. Logical redstone is pretty much "just" how you chain different circuits together so saying that it is any less impressive doesn't really make sense. Also even if it is just hard coding the weights, it is STILL a valid neural network model. Weird comment.
I'm not extremely familiar with Minecraft, but I suspect that second half of what you said, "extremely hard or slow" is more accurate, though there would of course be memory limitations of the computer itself being unable to store all of the redstone. However, assuming the world file isn't too large Minecraft should be Turing complete.
Yep definitely cool. You just said about integers being needed for minecraft and I'm thinking so you just multiply it up... sounds obvious but its only because you were already talking about it. So good.
You have really nice project to add in your Resume.
bro casually invented quantization by himself 💀
so basically you're creating AIs from binary 💀
I'm IT student too and it's soo amazing to watch!
I think you create videos that are worth subscribing for. Good job!
Man, that looks so fun.
Congratulations.
I finished a CNN machine learning model on ENSO’s (El Nino Souther Oscillation), a weather phenomenon in the southern Pacific Ocean, prediction for STEM fair, it didn’t make it past regionals because I’m still in junior league, and it is not as a easy as this man explains and showcases in this video. Props to you!
I remember having my mind blown when I saw the first working computer in minecraft... the redstone was so enormous for the time. To see neural networks in minecraft a little over 10 years later is truly staggering. I'm no one of any real note but I just want you to know that you have impressed me and I am not easily impressed.
It felt like I am watching Alan Turing solving making enigma. Keep creating this kind of content.
I finally understand how these neural networks work. Thank you!
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/mattbatwings
You’ll also get 20% off an annual premium subscription.
ok man we got to address your genius 💀😭🙏
"Why should we try brilliant if we have you?"-me
i mean, neural networks, brilliant, it's all connected
Did you use a cnn to make the mnist image reduced and input the weights in a feed forward neural network?
Thanks I love brilliant