Bill Gates introduced Warren Buffett to OpenAI's ChatGPT seven or eight months ago. Buffett told CNBC in an interview in April 2023 that he was impressed. However, he also wanted to ask the chatbot how it's "going to ruin the human race."

Earlier this week, Gates raised a similar question about artificial intelligence (AI) in a blog post. He wrote:

What happens to people who lose their jobs to an intelligent machine? Could AI affect the results of an election? What if a future AI decides it doesn’t need humans anymore and wants to get rid of us?

Although the Microsoft (MSFT 1.05%) co-founder thinks these are all concerns that should be taken seriously, he also believes society can manage the risks in these scenarios.

So despite predicting that AI's "benefits will be massive," he also called out five big risks with the technology in the near term that are worth discussing.

Warning symbol with paper torn to reveal the words Artificial Intelligence AI.

Image source: Getty Images.

1. Deepfakes 

AI can create audio and video that sounds and looks like real people but actually isn't them. These deepfakes can be eerily convincing.

Gates expressed concerns that deepfakes could be used to influence elections. He noted that AI-generated videos of famous politicians saying things they never said have already circulated online. The billionaire worries deepfakes "could tip the scales, especially in a close election."

2. Helping hackers

Hacking is already a big problem. Gates thinks AI could make it worse. He predicts AI will help hackers be more productive by finding potential security vulnerabilities more quickly. 

3. Eliminating jobs

One of the greatest worries around AI is that it will eliminate jobs. Gates acknowledged in his blog that AI will replace human workers in some cases.

He stated there's a risk these workers could be left behind. To prevent this from happening, governments and businesses must effectively manage the transition to an AI-centered workplace.

4. Biases and hallucinations

AI apps sometimes "hallucinate" by making up things that aren't true. Relying on what they tell you could be problematic, according to Gates.

Another related issue is that AI can reflect biases included in their training data. Gates noted that AI could even worsen existing biases.

5. Student cheating

It's possible for students to turn in work to their teachers that was actually done by AI. Gates acknowledged that such cheating is a valid concern.

He compared the current situation to the period in the 1970s and 1980s when electronic calculators became widely used. Some math teachers were worried their students wouldn't learn how to do arithmetic without a calculator.

Investors beware?

Gates is a vocal proponent of AI but highlighted these significant risks of the technology. So should investors be hesitant to invest in AI? I don't think so. Neither does Gates, as he wrote, "I believe there are more reasons than not to be optimistic that we can manage the risks of AI while maximizing their benefits." 

New technology has presented challenges in the past. Those challenges have always been overcome, though. Gates thinks "the best reason to believe that we can manage the risks [of AI] is that we have done it before." 

Gates' own Microsoft is likely to be among the big winners in this industry. Microsoft has integrated OpenAI's GPT-4 technology into its products. Its Azure cloud platform should especially benefit as organizations develop cloud-based AI systems.

Two other cloud leaders also stand to reap the rewards from this trend. Amazon currently has the largest market share in cloud hosting with its Amazon Web Services segment. Alphabet's Google Cloud is rapidly gaining ground on the bigger players.

AI doesn't just present a huge opportunity for these tech giants. Smaller companies such as SoundHound AI, which markets AI-powered speech recognition systems, could also be big winners.

AI is "the most transformative innovation any of us will see in our lifetimes," in Gates' view. If he's right (and I suspect he is), there's a tremendous opportunity to make a lot of money over the long term by investing in AI stocks.