A new bull market may be upon us, and there's a simple reason for it: artificial intelligence (AI). 

Investors have been piling into AI stocks, and some top tech leaders predict that the emerging technology could be as transformative as the internet, fire, or electricity. While it's impossible to know where the developing technology and the business opportunity will go, some estimates say that AI could unlock a new market worth more than $10 trillion.

If you're looking to capitalize on the transformative potential of AI, keep reading to see two stocks that could generate massive returns.  

1. Upstart

AI-backed lending platform Upstart (UPST -3.10%) stock went through the wringer last year as the top-line growth turned negative, profits disappeared, and the stock price crashed, falling more than 97% from peak to trough. The stock is on the rebound this year as investors give a second look to its AI-based consumer lending technology and as the macroeconomic environment improves, which is a bullish signal for Upstart.

Much of the challenges the business faced lately can be explained by the sudden jump in interest rates and the tightening in credit markets. That's made it harder for the lending facilitator to approve borrowers. It also discouraged banking partners from putting as many Upstart-initiated loans on their books.

However, the big banks generally reported strong quarters, showing resilience in the economy, strong consumer spending, and a decline in loan losses, a positive sign for Upstart as it would be a major beneficiary from an increase in consumer borrowing and easier loan approvals.

So far this year, the stock price is up nearly 300% due to excitement about AI, the economic recovery, and also a short squeeze as 38% of Upstart's float is sold short.

Upstart's market cap is still only $5 billion, so the stock has plenty of upside potential, especially if it can disrupt the FICO score as its model claims to be more effective at determining creditworthiness. 

Keep an eye on the upcoming second-quarter earnings report, as the stock could soar if it impresses. Wall Street sees revenue falling 41% year over year to $135 million and a per-share loss of $0.07.

2. General Motors

General Motors (GM 0.06%) might seem like an odd choice for an AI stock to buy, but the legacy automaker owns 80% of Cruise, the autonomous vehicle technology company, even though its stock valuation seems to completely ignore that exposure.

Investors seem to have forgotten about autonomous vehicles, but after a long delay, self-driving cars are becoming a reality before our eyes. 

As of April, Cruise's driverless vehicles are now operating 24/7 on the streets of San Francisco, and in total, it has 240 driverless cars operating in San Francisco, Phoenix, and Austin.

Cruise is also developing its own driverless vehicle, the Origin, which is fully designed to be an autonomous shuttle and has no steering wheels and subway-like doors. Cruise currently uses Chevrolet Bolts to ferry passengers around.

While significant monetization of autonomous vehicle technology is likely still years away, self-driving cars are one of the most promising applications of artificial intelligence, and investors are making a mistake by ignoring it.

Cruise was valued at as much as $30 billion, and GM itself is currently valued at a market cap of just $55 billion and trades at a rock-bottom price-to-earnings ratio of just 6.

Cruise is still a big money loser, but if the transportation service starts to successfully scale and the Origin is approved, GM stock could take off. 

Making the transition from a legacy automaker to one focused on electric vehicles and autonomy won't be an easy one, but if GM can pull it off, there's a ton of upside potential for the stock as it re-rates as a tech company. Cruise could help it unlock that potential.