Senate Republicans retreated yesterday in the face of certain defeat and abandoned their four-month filibuster of major defense and arms-control legislation, breaking a legislative logjam that has gripped the Democratic-controlled Senate since last spring.

But they quickly rebounded with a counteroffensive, seeking to capitalize on next week's visit to Washington by Soviet Foreign Minister Eduard Shevardnadze to push an amendment that would put the Senate on record against any arms-control provisions that would "further the interests of the Soviet Union."

The GOP retreat, announced by Minority Leader Robert J. Dole (R-Kan.) after consultations with the White House, came as a surprise to Democratic leaders, who had been planning a parliamentary maneuver to bring the issue to a head yesterday morning.

Instead of fighting the maneuver, the Republicans decided to cut their losses, knowing that even if they succeeded in blocking the Democrats yesterday they faced almost certain defeat Tuesday, when Democrats were expected to muster the 60 votes necessary to shut off the filibuster.

With Dole in the lead, most Republicans voted with the Democrats to move immediately to begin debate on the $303 billion military authorization bill for fiscal 1988. The measure includes restrictions on the Strategic Defense Initiative (SDI) that are adamantly opposed by the White House. This initial hurdle was cleared 77 to 4; only Republicans Jesse Helms (N.C), Gordon J. Humphrey (N.H.), Phil Gramm (Tex.) and Arlen Specter (Pa.) were in dissent.

While the GOP retreat gave Democrats a rare victory in months of trench warfare over the agenda on the Senate floor, cancellation of the cloture vote spared President Reagan a potential embarrassment on Tuesday, when he will be meeting with Shevardnadze on final details for a treaty to eliminate short- and medium-range nuclear forces. Republicans can also be expected to exploit Shevardnadze's visit to argue that any congressional action now would undermine Reagan's position at the bargaining table.

Underscoring that point, Dole and Sen. John W. Warner (Va.), ranking Republican on the Armed Services Committee, proposed language to be considered Tuesday that would oppose any actions "to further the interests of the Soviet Union by unilaterally adopting Soviet negotiating positions that have been rejected by the United States government."

The Dole-Warner proposal would put the Senate on record against legislation dealing with all the major arms control initiatives that Democrats are pushing in Congress, including interpretation of the 1972 Antiballistic Missile (ABM) Treaty.

The ABM treaty is at the heart of the arms initiative in the defense bill and was the focal point of the GOP filibuster. A provision sponsored by Armed Services Committee Chairman Sam Nunn (D-Ga.) and committee member Carl Levin (D-Mich.) would require congressional approval for reinterpretation of the treaty to allow expanded testing and development of the president's space-based SDI

The Dole-Warner maneuver gives the Democrats a painful choice: Vote for what the Republicans call "unilateral concessions to the Soviet Union" or vote against their own key arms proposal. Democrats could delay action on the proposal but at the risk of halting the bill's progress, which it took them four months to win.

In an opening skirmish over implications for the U.S.-Soviet arms talks, Warner argued yesterday against moving "the negotiations on arms control from Geneva to the floor of the Senate," prompting a pointed retort from Nunn.

Nunn reminded his Virginia colleague of the constitutional principles of "the famous Virginian by the name of James Madison," contending that Madison envisioned an important role for the Senate in advising the president in making treaties.

"While the administration negotiates treaties, the president of the United States does not change treaties that are the law of the land any more than the president of the United States changes other laws that are on the books without the approval of Congress," Nunn added. He said he was confident that Warner joined him in wanting to teach the Soviets that "this is a government that has more than one branch and that we are not a monarchy, nor are we a dictatorship."

The Senate's debate on the defense bill is expected to last a couple of weeks, with most of the debate focused on arms control. The committee-approved draft of the bill includes only the ABM provision, although senators may bring up other constraints approved by the House in its $289 billion version of the measure, including a nuclear test ban and renewed adherence to the unratified SALT II treaty.