Microsoft founder Bill Gates said on Tuesday that technology could "accentuate" the difference between the rich and the poor.

Speaking at the Misk Global Forum in Riyadh, he said that the benefits of technological advancements, may not be felt by all if developed in the wrong way.

"If we're not careful, technology will actually accentuate the difference between the well off and the poor because if it's expensive, if you learn about it only in a rich country school, then you'll have the difference between the well off and the poor people even worse," Gates said.

The billionaire also addressed concerns over artificial intelligence (AI), and said its benefits will outweigh any potential pitfalls.

"We are in a world of shortage, but these advances will help us take on all of the top problems," he said at a CNBC-moderated panel in the Saudi Arabian capital.

"We need to solve these infectious diseases ... We need to help health care workers do their job."