The field of AI, intelligence seen in machines or software, was not a well known one at the time, and so Legg researched it however he could.
"I mostly taught myself from a variety of sources. I remember an article in the Encyclopaedia Britannica on something called 'Alpha-Beta Search' at the Rotorua public library. I figured it wouldn't be too hard to build a chess-playing programme based on this algorithm, so that's what I did."
Over the next years he continued programming, developing models that could play games. But it wasn't until 2000 when, after completing degrees in maths, statistics, economics and computer science at the University of Waikato and the University of Auckland, Legg decided to pursue AI as a career.
"While artificial intelligence was not very advanced at the time, I figured there was a reasonable chance it would develop into something important in my lifetime."
He did a PhD in Switzerland, his thesis proposing a formal definition for machine intelligence, before doing a post-doctoral at University College London. It was then that Legg met neuroscientist and former teenage chess prodigy Demis Hassabis and former video game designer Mustafa Suleyman. In 2010 they founded DeepMind Technologies.
"Some people thought we were a bit crazy, but our timing could hardly have been better. Only two years after we'd raised our first round of funding and hired an extremely strong team of researchers, some of the areas we were working in suddenly became commercially important," he said.
DeepMind's technology aimed to mimic human thought processes and the company got early investment from the likes of Tesla Motors chief executive Elon Musk, and entrepreneur Peter Thiel. One of the biggest breakthroughs for the company was creating a system that could teach itself to play a wide range of computer games including Space Invaders and Pong. It could see what was happening on the screen, use the game controller and figure out when the score went up or down.
Legg helped build a company that was bought by Google for as much as $1b. Photo / AP
The programme is in some cases better than a human player - a significant achievement and one that put DeepMind on the radar of several of the world's largest corporations.
DeepMind quickly became well known in the AI and robotics community and Legg said it wasn't long before Google came knocking at the door, Google founder and chief executive Larry Page offering to buy the company in 2013. Page convinced them by joining Google they would have better support and access to resources to further the company's goals. DeepMind joined Google at the start of last year.
"The arguments for joining Google were pretty compelling, and also a bit complex in places. So while we thought very hard about this decision, in the end our analysis clearly supported it," Legg said.
At the time, Facebook was also rumoured to be in negotiations to acquire the company, however this fell over and the deal with Google was formalised in January with the added proviso that Google set up an AI ethics panel to oversee the use of the technology.
The acquisition also increased Google's portfolio of robotics and AI companies, after it spent several billion dollars at the end of 2013 buying up eight robotics firms and stakes in several other robotics and AI companies.
The DeepMind deal was said to be Google's largest European buy.
Legg is now the chief scientist at Google DeepMind but despite the significant deal (which he could not comment on in detail), he said his lifestyle had not changed too much, adding that the most extravagant thing he did now was fly business class rather than economy.
On running a successful company, he said there was no one thing that made a perfect company, but all the little things added up to a lot.
"For people from a technical background, such as myself, the biggest mistake is to assume the success of the company depends a lot on hard skills and using these to deliver a superior product."
"While this is important, I think the reality is that a company depends mostly on soft skills such as negotiating, persuading, inspiring people, resolving conflicts and doing a good job of interviewing candidates," he said.
"If you can do these things well and build a highly effective team, this team will be able to solve the technical challenges required. On the other hand, all the technical brains in the world aren't going to get far if they aren't working together effectively."
He also believes coming from New Zealand has helped.
"For people thinking of doing [a start-up or business] in the US or UK, I don't think being a New Zealander puts one at any disadvantage. It's very common for tech start-ups to have foreign founders and New Zealanders, and New Zealand, enjoy a very positive reputation around the world."
The Kiwi connection
• Kea connects Kiwis' businesses with over 500,000 Kiwi expats and friends of New Zealand around the world.
• Kea recently launched an app which allows Kiwi expats to locate fellow Kiwi expats, businesses and events near them wherever they are around the globe.
• Kea also runs the World Class New Zealand Network, comprising more than 360 of New Zealand's most connected and globally influential people who help Kiwi businesses succeed faster and smarter.
• Kea connects Kiwi businesses and entrepreneurs to these World Class New Zealanders, helping them achieve their global ambitions.
Soaring Kiwis
A series on high-achieving New Zealanders with a low profile here doing big things overseas
Coming up:
• Privahini Bradoo - CEO and founder of BlueOak, recycling and mining precious materials from e-waste.
• Craig Nevill-Manning - Head of engineering at Google, co-creator of Google Maps.