WHEN Warren Buffett and Bill Gates held a banquet for Chinese billionaires in 2010, they hoped to win them over to philanthropy. They got the cold shoulder. Many wealthy industrialists stayed away, and none of those who attended signed their “Giving Pledge”. This meanness was not due to penury: China boasts more dollar billionaires today than does America. Asked why he and his compatriots rebuffed the evangelisers, Jack Ma, boss of Alibaba, an e-commerce giant, insists it is not because they were stingy. At a conference on private-sector philanthropy hosted by his firm this month in Hangzhou, he explained that China’s charitable sector was then still in its infancy.

The outlook has since improved. Charitable giving in China still lags that in America, but it is rising (see chart). Oscar Tang, a Chinese-American billionaire and philanthropist, tells of another banquet for fat cats in Beijing, this one hosted earlier this month by Ban Ki-moon, secretary-general of the United Nations, and the C100, a group of prominent Chinese-Americans. Unlike at the frosty meeting in 2010 with the “two white men” telling them to give away money, he recounts, the mainland bosses were enthusiastic about his exhortations to share the wealth.

One reason for this shift in attitude is a generational change. Scholars at Harvard University have looked at patterns of giving among China’s top donors. In the past, the most generous were property tycoons who gave to educational outfits, especially elite universities in their home provinces along the wealthy coast. It was a careful approach, suited to a political system where making pots of money had only recently become normal. But it meant poor schools and indigent interior provinces lost out. As the economy modernises, a crop of youngish technology billionaires, keen to “democratise” philanthropy, has emerged. On the eve of Alibaba’s initial public flotation in New York two years ago, Mr Ma and Joseph Tsai, the firm’s co-founder, donated options worth about 2% of their firm’s equity to a new charitable trust (Alibaba’s market capitalisation today is around $200 billion). Pony Ma (pictured), founder of Tencent, a Chinese gaming and social-media giant, said in April that he will donate shares worth over $2 billion to his firm’s charitable foundation. Many entrepreneurs are following their lead. The younger generation is much more likely than older ones to give money to more politically sensitive areas such as the environment and public health, as the two Mas are doing with their respective foundations. They are also applying whizzy digital tools, from the mobile internet to cloud computing, in order to help charities to modernise their operations.

Such beneficence is helping to address some of the flaws in the non-profit sector. There is a lack of proper management and not enough transparency. Governance is weak. Various prominent charities have been ensnared in corruption scandals in recent years. Numerous research institutes and academic training programmes have sprung up of late to address the problem.

The last, and most surprising, push towards philanthropy comes from the government. Chinese rulers have long viewed private philanthropy with suspicion, worrying that the public might recognise in it the manifold failings of the state. Many would-be donors also resisted giving money, or did so furtively, for fear of attracting unwanted official attention. But the government has pushed through a sensible philanthropy law, due to come into force later this year, that makes it easier to donate. It also clarifies regulations governing local charities and pushes for transparency. If the implementation is as good as the framework, China’s corporate giving will surely surge.