Tech giants Tencent (OTC:TCEHY) and Baidu (NASDAQ:BIDU) are currently engaged in an ongoing O2O (online-to-offline) ecosystem war in China. Tencent is turning WeChat -- the most popular messaging app in China -- into an all-in-one platform for making payments, hailing cabs, playing games, ordering food, and making online purchases. That social-centric expansion forced Baidu, which owns the biggest search engine in China, to add similar services to its mobile app.

Those battles are now moving toward the growing artificial intelligence market. By adding AI capabilities to their platforms, Tencent and Baidu can boost the analytics capabilities of their services and set the foundations for next-generation initiatives like driverless cars. Let's take a closer look at the arms race between these two companies and see if one can eventually gain the upper hand.

A "headless" businessman with a cloud-based brain depicting artificial intelligence.

Image source: Getty Images.

A look at Tencent's AI investments

Tencent first announced the establishment of its AI Lab last April, and 50 AI specialists now work there. Tencent recently poached the chief of machine learning research at Baidu's Big Data Lab, Tong Zhang, to lead the unit. Prior to joining Baidu, Zhang cut his teeth at IBM and Yahoo. Zhang will also lead a team of 200 product engineers to convert AI advances into usable features for Tencent's apps and services.

Tencent wants to apply AI to four key areas -- its content, social apps, online games, and cloud services. The company notes that "over a hundred" of its products -- including WeChat, QQ, and the Tian Tian Kuai Bao news app -- already rely on AI. To strengthen its cloud-based AI processing capabilities, Tencent installed NVIDIA's (NASDAQ:NVDA) high-end GPUs -- which are better for machine learning purposes than CPUs -- in its cloud servers.

The traditional game of Go.

Image source: Getty Images.

Tencent also developed a Go-playing AI to follow Alphabet's (NASDAQ:GOOG) (NASDAQ:GOOGL) Google. Google's AlphaGo AI beat Go world champion Lee Sedol last year. Tencent's Go-playing AI, Fine Art, recently beat high-ranking Japanese Go player Ryo Ichiriki.

AI scientists believe that Go, which requires players to surround opponents' pieces with their own, is a better test of problem solving than chess because it has many more possible moves.

Like Google, Tencent believes that AI, ride hailing apps, EVs, and driverless cars will eventually converge. That's why it recently invested in Chinese EV maker NIO and bought a 5% stake in Tesla Motors. It might even tap its existing partnership with NVIDIA, which develops CPUs for connected and driverless cars, to eventually produce its own driverless platform.

A look at Baidu's AI plans

Baidu founded its Big Data Lab in July 2014. The division focuses on improving its machine learning algorithms, core search technologies, and big data applications. Its products include the Siri-like virtual assistant Duer, which was recently given its own business unit, and predictive analytics tools for businesses. Like Google, Baidu wants to process the data it receives from its search, mapping, and cloud services into useful information for companies and consumers.

Baidu is aggressively expanding this unit with investments, partnerships, government backing, and big hires. Like Tencent, Baidu invested in NIO during its last funding round. It partnered with NVIDIA and HERE Maps to create a cloud-connected mapping platform for autonomous cars, and plans to launch its own autonomous cars -- which are being produced by a Chinese automaker -- by 2018. It also formed the dedicated Intelligent Driving division for those efforts earlier this year.

A driverless car cruises down the highway.

Image source: Getty Images.

In late February, Baidu obtained approval from the Chinese government to launch a state-backed engineering laboratory for deep learning technologies like computer vision, machine hearing, biometric identification, and human-computer interactions. It also recently acquired Raven Tech, a Beijing-based start-up which develops an AI platform for smart homes.

Baidu has hired many top AI researchers to lead these efforts, but it recently lost two major leaders. In addition to Tong Zhang's abrupt departure for Tencent, Baidu's chief scientist Andrew Ng, a former Googler who led the AI group since 2014, also resigned. Those departures have raised serious concerns, since Baidu's AI group has grown to around 1,300 people -- and those employees need experienced leaders.

Which company has the upper hand?

Tencent and Baidu's AI arms race will likely continue for years, but I doubt that either company will completely outmaneuver the other. That's because the battle between Tencent and Baidu closely mirrors the ongoing clash between Facebook and Google -- one company owns the dominant social network, while the other controls the dominant search engine.

Since neither ecosystem will completely consume the other, there will probably always be people who prefer using Tencent's WeChat over Baidu's app as all all-in-one platform, and vice versa. However, investors should keep an eye on how much money Tencent and Baidu are spending on these AI and O2O efforts, since both companies have posted rising expenses in recent quarters.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.