As the Cambodian war churns closer to this border village, Amorn Anantachai has noticed a radical change in the Khmer Rouge soldiers he has to deal with.

The amiable top Thai official here used to find the Cambodian troops across the border tough and arrogant. They buried land mines in fields near the border and provoked shootings in which Thai peasants were injured.

"They are very different now," he says with a smile. "They are becoming very gentle."

The reason is that the Khmer Rouge have their backs to the wall, or at least to the Thai border, and this dusty crossing point 130 miles from Bangkok is probably their main escape hatch when the Vietnamese tanks come rolling up.

An unknown number of Khmer Rouge troops and former Cambodian officials are hiding just across the border, apparently with the intention of coming over to this side before they are mopped up.

There are midnight meetings between them and Thai officials to work terms of their escape. Small groups of soldiers pop out of the woods and shrubs occasionally and Thai officials wander across the border bridge to chat with them.

Nobody knows how many troops of the deposed Pol Pot government will try to escape. Thailand is flooded with rumors that thousands will come pouring through Aranyaprathet and other border points at any moment. Heavy gunfire is heard intermittently and each day it sounds a little closer as the Vietnamese-led forces close in.

What Thailand plans to do with the fleeing Cambodians when they come is the crucial question for the Thai government.

"That is a military secret," said one officer stationed near here.

Thailand's official position, announced by Prime Minister Kriangsak Chamanand, is that no refugees or former officials of the Pol Pot government will be accepted. Thailand already has thousands of Cambodian refugees who fled when Pol Pot's insurrection led to mass killings in 1975. And the government, which hopes eventually for peaceful relations with Vietnam and the new Cambodian rulers, does not want to appear to be harboring their enemies.

On the other hand, Thailand fears that defeated Pol Pot loyalists may regroup in guerrilla bands on the Thai side of the border and use Thai territory as a staging ground for assaults on the new Cambodian government. That could turn the long Thai-Cambodian border into a battleground for years to come.

The apparent Thai policy, judging from incidents here, is to round up the escaping civilians and soldiers and keep them under lock and key. Forty-five men who claimed to be peasants, but who probably were soldiers, were picked up near here and taken to a military compound.

They are locked up only a few miles from a refugee camp filled with Cambodians their former government had driven out three years ago.

One reliable source said the Thais are considering a plan to turn the large former U.S. military base at Utapao into a huge new refugee camp.

The ambiguity of Thai policy was illustrated here when a Foreign Ministry official crossed the border bridge to interview five Khmer Rouge soldiers who emerged from the woods.

The official signaled them to come forward and asked if they wanted to pass through into Thailand, apparently oblivious of the government's stated policy of turning back fleeing soldiers from Pol Pot's army.

"I asked them if they wanted to come on through," the Foreign Ministry official later told reporters. "They said no. They said they wanted to stay and fight and kill all the Vietnamese."

Some Western officials in Bangkok believe that most of the remaining Khmer Rouge forces will not leave the country but will try to regroup and fight a guerrilla war. The most likely place for that is in the mountain ranges south of here on the Cambodian side, an area used in the past as a guerrilla refuge during previous periods of Cambodian turbulence.

It is possible, sources say, that Pol Pot already is gathering his retreating forces at a site in the Cardamon Mountains. A statement issued in his name and promising continued warfare was released yesterday by the Cambodian Embassy in Peking.

For a region that risks becoming a new battleground, the Thai side of the border is remarkably calm. No large contingents of Thai troops are visible and most of the work of collecting stray Cambodian soldiers is left to border police.

Military officials and local peasants listen carefully to sounds of gunfire each night to judge how close the war has come. On some nights, the crackling of small arms fire continues for hours. In the past two days, the sounds of heavier fire, possibly of tank cannon, also have come drifting over into Thailand.

It is assumed that the sounds come from skirmishes between retreating Pol Pot forces and the attacking Vietnamese. It has intensified since the Cambodian town of Siem Reap and the nearby ruins of Angkor Wat were reported seized.

The largest collection of Cambodian soldiers and former government officials is believed to be gathered around the town of Poipet, just over the border from this village. Thai officials are in contact with them, but refuse to say who is there.