Washington — The size, shape, and apparent role of American military forces in the Middle East are changing significantly. Some of the United States Marine Corps ''peacekeepers,'' caught in the battle between Lebanese factions, and in some cases a target themselves, have pulled back to safer positions. Following the recent bombing of their headquarters with heavy loss of life and faced with daily threats of similar terrorist attack, the marines are increasing security there.
But while the 1,600 US ground troops hunker down in Beirut, the American military presence in the region is increasing by tens of thousands of personnel, manning some of the most powerful and sophisticated US weaponry. These are the naval forces that by week's end will have the potential to launch what would be the largest air and sea attack since the Vietnam war.
The armada includes the battleship USS New Jersey, with 16-inch guns that can reach targets more than 20 miles inland and cruise missiles that extend the ship's firepower much farther. Two aircraft carrier battle groups are standing by in the eastern Mediterranean with nearly 200 warplanes. A third carrier and its escorts are en route to the area as well. In total, these ships carry some 30,000 sailors, marines, and airmen.
Officials here insist that this confluence of naval power is at least partly coincidental, that one of the carriers will be proceeding to the Indian Ocean and that a second is to be replaced by the USS Independence, now steaming eastward from the Caribbean.
But from President Reagan and Defense Secretary Caspar W. Weinberger on down, administration spokesmen pointedly do not back away from their earlier assertions that retaliation could follow the attack on Marine headquarters last month. And there is no doubting the message this massive naval gathering sends to Lebanese opponents of President Amin Gemayel, to Syria, and to the Soviet Union: America will not stand idle in the face of attacks against its citizens or its interests.
Washington finds especially worrisome the growing military presence it faces in the Mideast.
Not only has the Soviet Union resupplied Syria with jets and other equipment lost to Israeli attackers last year, but it has provided newer, ground-launched missiles as well. These include the SA-5 antiaircraft missile (controlled by Soviet personnel) and, more recently, the SS-21 surface-to-surface missile. The SS-21 can reach targets 75 miles away, nearly twice the range of the older missile it is replacing and with greater accuracy. It is also capable of carrying nuclear as well as conventional warheads. Such missiles could threaten not only Israeli targets but also US Navy ships.
If the confrontation were to come to that, Soviet military officials (who have provided satellite battle management equipment to Syria) would be directly involved. More immediately, US military commanders in Lebanon are concerned about the artillery controlled by Syrian-backed forces, guns that can now reach marine positions.
For the moment, both sides are apparently trying to avoid direct conflict. Syria says it was not responsible for the earlier devastating attack on the marines. US carrier-based jets have done nothing more than fly reconnaissance missions around Beirut.
The fighting that had involved US marines Monday was not repeated during daylight hours Tuesday in Lebanon. ''We hope that all parties will do their utmost to observe and respect the cease-fire,'' said State Department spokesman Alan Romberg.
So far, Mr. Reagan is riding high politically following the fierce but short military action in Grenada. But military aggressiveness in the highly complex Middle East would be another story altogether, with goals much more difficult to achieve by force.
Fierce fighting among Palestine Liberation Organization factions around Tripoli, US officials say, heightens concern for the safety of US troops in Lebanon and is one reason for moving a naval force of unusual size into the area. At the same time, the ships have been the object of terrorist threats, according to the Pentagon.
While no military match for American and Israeli forces, potential US adversaries in the Middle East are much better equipped than those that briefly opposed the US in Grenada. It is not forgotten here that an Israeli ship was sunk by a Soviet-made surface-to-surface missile during an earlier war with Arab countries.