Along the way, Beijing tamed the industry’s ambition and blunted its innovative edge.

But tech companies and investors also have themselves to blame for falling behind their Silicon Valley counterparts. Even before the government started to impose a stronger hand on them, Chinese tech leaders were laser focused on making money and reluctant to spend on research projects that weren’t likely to yield revenue in the short term. After the government’s onslaught in the past few years, executives are even less inclined to invest in long-term ventures.

In 2021, the United States led the world in total private investment in artificial intelligence and in the number of newly funded A.I. companies, which was three and two times higher than in China, according to Stanford University’s A.I. Index 2022 Annual Report.

But the government has been the biggest barrier to A.I. — its obsession with censorship perhaps its heaviest club. The availability of a wide range of data is crucial to developing technology like ChatGPT, and that is increasingly harder to come by in a censored online environment.

Today, jokes circulate that capture the dark mood among tech people. A popular one: “We need to teach machines not only how to speak, but also how not to speak.”

Beijing has punished companies, sometimes severely, to enforce its censorship protocols. Duolingo, which is in the seemingly noncontroversial business of teaching people new languages, was taken out of Chinese app stores for nearly a year to “enhance its content regulation,” according to Chinese media reports.

“Many of us in the internet industry are faced with two problems when making a product: Either our products don’t involve speech, or they have to undergo a lot of censorship,” said Hao Peiqiang, a former entrepreneur and programmer based in the northern city of Tianjin. “Big companies can afford it, but smaller companies can’t,” he said. “If small companies can’t do this, it stifles innovation.”

OpenAI, which has developed ChatGPT with the help of Microsoft’s money, hasn’t made the tool available in China. Mainland Chinese users need to use virtual private networks, or VPNs, to access it.