AI writes code that runs 70% faster than ours

AlphaDev has generated sorting algorithms which can run up to 70% quicker than the same code written by humans
09 June 2023

Interview with 

Daniel Mankowitz, DeepMind

ARTIFICIAL INTELLIGENCE

Artificial intelligence (AI)

Share

It has been revealed that AlphaDev - an artificial intelligence agent from DeepMind - has been able to discover new and improved computer sorting algorithms widely used in common computer programming languages. Essentially it’s writing new computer code from scratch, which runs up to 70% faster than the manmade counterpart. The man behind the breakthrough is Deepmind’s Daniel Mankowitz…

Daniel - We live in this increasingly digital society and with Moore's law coming to an end and chips starting to reach their fundamental physical limits, we need to find new and innovative ways of optimising the computing stack because there is this increasing demand in energy usage. And this got us to think, well, can we go and optimise some of the fundamental algorithms that are called trillions of times every day by applications and companies all around the world?

Chris - I suppose it's a bit like historically when we wanted to make a car go faster, we just slammed a bigger engine in it and now we find ourselves constrained by the fact that fuel is getting expensive. That's like the electricity. So we're in a situation now where we are making the engines we have got better and therefore they can be smaller and more efficient, but we get the same performance from them. You are saying with software we've been able to rely on the fact that processes just kept getting juicier and could do more, so we didn't have to worry about how well we wrote the software, but now we do.

Daniel - Yeah, absolutely. Everything kind of needs to be streamlined if we want to really generate sort of the maximum performance. And you can think of the car as also analogous to the computing stack where there are different parts of the computing stack that we can optimise. There are different parts of the car that we can streamline.

Chris - In the old days, I call it the old days, but before you came along, what did we do to optimise software we'd written?

Daniel - Yeah, so a lot of the things and advancements that have been done has been from humans looking at these programs and figuring out how to improve them. And then it sort of moved to the next stage of can we start to find ways to automate this way of discovering improved algorithms? And so approaches started to come out that would try to actually search the program itself and to try and figure out 'if I change this in the program or that in the program, what happens?' What we have with our approach AlphaDev is the ability to go and search starting from scratch. So in other words imagine you're building an engine from scratch. We want to build an algorithm from scratch. We tell it, we want the algorithm that you build to be correct and as fast as possible. And then AlphaDev goes and searches through the space automatically to build an algorithm that does that.

Chris - When people talk about AI, they talk about training it with a data set. Usually information that we've already generated, but it ends up being constrained by the fact that there are limits to what we know and therefore there are certain limits to what it knows. So can you transcend those boundaries with what you've done then? Because you are just saying to this thing, 'this is what I want you to achieve, just go and explore.'

Daniel - Yeah. There is that capability now with this type of technology and this was something that has sort of been built on from previous technologies coming out of DeepMind. So there was the famous system AlphaGo that beat the world champion at the game of go in this game. It did what's called the famous move from number 37. All the experts looked at this move and said, 'no, this is a mistake. Why is it doing that? This is not the right thing to do.' And it turned out that that actually was the right thing to do. But not only that, it was so impactful that it started to influence the strategies in the game of go and how people taught it and really transcended something that humans had assumed was impossible. Similarly with AlphaDev, what we found is that when saying to it, ‘go and build an algorithm and figure out how to search the space so that you end up finding something that's faster than what exists,’ it also discovered these types of moves that when you look at the algorithm, you might not expect that you could do these types of moves to make the algorithm more efficient.

Chris - To be clear then this thing is essentially writing its own computer code.

Daniel - Correct, yeah.

Chris - So you basically say the aim of the game is I want to do this lap of the circuit in the fastest time possible. That's your goal. And how will you choose to run around the circuit? Whether you take the hurdles or you cut right across the middle or something and cheat, that's up to you. But the aim is to get the shortest possible time and then just let it get on with it.

Daniel - Yeah. That's exactly it. And so we devised the game and you define what it means to win the game and in the case of building an algorithm, it's making the algorithm correct and fast. And in terms of the circuit, it's about, as you say, the game is to move around the lap and winning it is doing the lap in the shortest amount of time.

Chris - When you look at what it produced compared to what we had produced, how much better was it

Daniel - When we started testing it, we found that there were performance improvements all the way from 2% up to 70% sorting items faster.

Chris - Good grief. 70%, some of them. That's incredible. Does this mean, well, I suppose the obvious question is why stop here? Can you deploy this at other common computer problems that can be optimised and tweaked and potentially cut the carbon footprint of computing? Some say the internet has a carbon footprint equivalent to the airline industry. Does this mean we could make significant inroads all over the place with this?

Daniel - This is what we would hope. We actually did take it a step further. We identified an algorithm called hashing. If you imagine in a library you have a librarian and you call a sorting function. Sorting could be used to, for example, sort the books from A to Z. Hashing is more about finding a book. The idea is that for each book you give it a special unique number, which we would call a hash. And what that means is that when a librarian goes to find a particular book, they know that they're looking for a particular number corresponding to that book, which is the hash. And so instead of having to go and search through the entire library of books, they know exactly where to go. And so we applied AlphaDev to improve a hashing algorithm and we managed to find an improved algorithm that's was 30% faster. And it's now available to developers, companies, and users around the world.

Comments

Add a comment