HANOI -- Vietnam's Communists have lost their first war. Their leaders do not acknowledge that the autumn withdrawal from Cambodia was a defeat, but neither do they argue seriously against that interpretation when it is pressed on them.

Instead, Vietnamese leaders shift the discussion to what must be done to allow both Vietnam and China face-saving exits from the Cambodian quagmire.

Vietnam's decision to seek better relations with China after 15 years of direct confrontation is a key part of a developing strategic shift in Southeast Asia that could end a generation of slaughter and horror in Cambodia. Also key is the lessening of Soviet aid and sympathy for Vietnam. As Moscow turns inward and adopts political reforms that are anathema for Asia's Communist regimes, Hanoi and Beijing may be tempted to put aside their ancient conflict and commiserate.

Cambodia has been the main arena of the conflict since the Vietnamese invaded in 1979 to depose Pol Pot's blood-soaked Khmer Rouge regime. Aided militarily by the Chinese and diplomatically by the United States, the Khmer Rouge regrouped and denied Hanoi a clear military victory. Facing economic disaster at home and frustrated on the battlefield, the Vietnamese troops who had outlasted the French, Americans and Chinese in battles on their own territory during the past 50 years pulled out in late September.

Khmer Rouge advances against the forces of the Hun Sen regime -- and the lack of meaningful economic and political responses by the West to the Vietnamese withdrawal -- appear to have caused Hanoi to send 3,000 military advisers and technicians back into Cambodia, according to Thailand's well-informed intelligence services. That figure is accepted by Western intelligence sources in Bangkok as a ''consensus figure.''

Foreign Minister Nguyen Co Thach denied in an interview in Ho Chi Minh City that Vietnamese combat troops are in Cambodia. But he acknowledged for the first time that were ''some technicians still there, in heavy artillery or other things.'' Thach could provide no numbers, but he said that they were insignificant. The United States, he said, could easily verify the Vietnamese withdrawal but appeared to shy away from doing so because Washington does not want to admit that the withdrawal had taken place.

Vietnam ''will continue its supply of arms'' to the Hun Sen government ''as long as other powers continue their supplies to the other forces,'' Thach added. But he repeatedly returned to his view that the war was now in a stalemate and would end in a peace accord late this year.

The Khmer Rouge ''will get weaker and weaker as they try to occupy more and more territory'' and as Thailand makes it more difficult for the Pol Pot forces to use Cambodian refugee camps on the border as staging areas, Thach said. Hun Sen was prepared to accept the participation of Khmer Rouge political cadre in a new coalition government as long as Pol Pot and seven of his closest associates were excluded.

He and other Vietnamese officials interviewed here were unusually restrained in their criticism of China's role in Cambodia. Thach confirmed what Western diplomats here had told me: China and Vietnam have pulled back their armies 25 miles or more from their common border during the past six to nine months. Trade now flourishes across the frontier, mostly to China's economic advantage.

''It was not done by mutual agreement. The interests of both countries dictated that both sides pull back,'' Thach said. ''In some places it was the Vietnamese troops who pulled back first, in others it was the Chinese. It was good for both.''

China, which is not yet prepared to admit that it may be ready to cooperate with its smaller Communist neighbor, denies that it has pulled its forces back and puts the burden for any improvement in relations on Vietnam. Significantly, Vietnam accepts that burden. Hanoi twice sent a deputy foreign minister to Beijing last year for talks on improving relations and would make a third trip as soon as Beijing agrees.

Vietnam is prepared to go a long way to reduce tensions on its borders as it pursues an ambitious turn to free-market economics at home and as foreign help dries up. The Soviet Union is believed to have told Vietnam that economic aid, estimated to run $2 billion a year, will now start declining. Moreover, Moscow has asked the Vietnamese to begin repaying 8 billion rubles in debt that falls due this year.

Thach denied that all this adds up to a strategic retreat by Vietnam. But his argument was not the forceful kind that he can summon up when the occasion demands it. ''If our withdrawal will help the Cambodian government to stand on its own feet, it is not the same as the American withdrawal from South Vietnam. We must look to the final outcome. We do not believe the Phnom Penh government will collapse.''

The United States has blocked a package of economic help from the International Monetary Fund that the Vietnamese withdrawal from Cambodia was supposed to unlock. Such obstructionism will not encourage Vietnam to continue pulling in its horns, which should be a U.S. objective.

This time, the United States should be wise enough to let Vietnam declare defeat and get out.