President Reagan's hope of halving the federal deficit by the end of his term appears to hinge on a complex argument about the progress of the military buildup in his first term and its prospects in the second.

Reagan's goal of lowering the deficit to $100 billion by 1988 has become entwined in an argument about defense spending between two of his most determined Cabinet members and long-running protagonists, Office of Management and Budget Director David A. Stockman and Defense Secretary Caspar W. Weinberger.

Given the domestic spending cuts already approved, officials said Reagan must approve large defense savings to meet his deficit goal. These Pentagon savings probably would be far deeper than any cuts during his first term, holding procurement to its current pace and freezing military pay, all part of a Stockman proposal.

But Weinberger has won almost every round of this four-year contest. Earlier this week, he promised some contribution toward reducing the deficit next year, and administration sources said yesterday that they expect it to be far less than Stockman's plans for deep cuts over three years.

Reagan "came down for cuts but never said how much," one participant said. "He told Cap [Weinberger] to work out something. It's all a matter of degree."

Stockman and Weinberger tangled after Reagan left a meeting in the Cabinet room Monday. Today, Reagan's 12-member budget "core group" is to meet again on defense spending.

Yesterday, White House officials said that, if Reagan rejects Stockman's plan, he may also quietly abandon his goal of reducing the deficit to $100 billion, or 2 percent of the gross national product, by 1988. The official said this is because Reagan is unlikely to order domestic-spending cuts beyond the $34 billion he has approved for next year.

A senior official predicted that most Americans will not notice if Reagan abandons the deficit goal and simply emphasizes the idea of a total spending "freeze" at last year's levels.

The internal administration debate on the defense budget centers on what ought to be a simple question, but is not: How much has the Reagan military buildup been trimmed previously?

The president and Weinberger often cite figures showing that the Defense Department has made a big contribution toward reducing the deficit; Reagan pegged it Friday at $116 billion over five years. Weinberger has urged Reagan not to make major compromises before the budget is printed but to bargain hard later for what he can get from Congress.

But Stockman and others say virtually all of the savings so far have come from adjustments in inflation and stretch-outs of existing programs, leaving the major weapons systems in the Reagan buildup virtually intact.

Stockman and Republican congressional leaders have told Reagan in recent weeks that, given the likelihood that Congress will trim the defense buildup, he should make the trims now to ease the way on Capitol Hill for his other budget cuts. These would not be actual cuts in defense spending but much slower annual growth.

Stockman's proposed defense slowdown, dubbed the "standstill" plan by officials, undoubtedly would pinch procurement accounts that have been largely unscathed in the first term. Officials say Stockman's plan also envisions a one-year freeze in military pay and savings in military pensions.

The defense budget runs on two tracks: budget "authority" approved by Congress each year, reflecting policy choices, and actual spending. The latter lags behind spending authority because, though many Pentagon contracts are approved in one year, the money is not spent for several years. The actual spending, or "outlays," counts in determining the federal deficit.

The arguments are complex because Reagan has repeatedly compromised since his original plan, provoking an argument about what spending figures should be used as a starting point each year. For example, officials are using the administration's August defense spending estimates for future years as their starting point, although Congress has approved lower numbers.

Stockman is proposing to trim $8 billion from outlay projections of $286 billion for fiscal 1986. But officials say more than $20 billion in budget authority must be cut from the projected $324 billion in 1986 to produce the $8 billion outlay savings.

Moreover, much of the outlays each year stem from budget authority approved in earlier years, and officials say the Pentagon's outlays are likely to accelerate next year no matter what is done with budget authority.