Federal and military retirees, including more than 150,000 in this area, would get some form of inflation protection -- guaranteeing a 2 percent raise in 1986, 1987 and 1988 -- under a very shaky budget compromise that will go to the Senate later this month.

The compromise was worked out by White House aides and Senate Republican leaders to take some of the heat off members of Congress who were reluctant to go along with a tougher Senate Budget Committee proposal. It would have frozen all civil service and Social Security benefits next year.

The latest plan must clear the full Senate and House.

Its complexity shows how difficult it is for Congress to cut spending in politically explosive areas such as retirement benefits.

Under the congressional budget-setting system, the Senate and House Budget Committees are supposed to come up with their own deficit reduction proposals. Those plans are sent to committees that decide how the cuts are to be made.

The Budget Committee earlier rejected a Reagan administration plan to raise the federal retirement age to 65 and cut federal pay 5 percent next year. It recommended that savings be accomplished by cutting 80,000 federal jobs, raising employe pension contributions and freezing federal salaries next year.

But in reaction to the outcry against freezing Social Security and civil service retirement benefits -- now being paid out to nearly one of every six Americans -- the White House and GOP Senate leaders came up with their complicated compromise. It provides for a 2 percent minimum and a 2 percent offset. This is how it would work:

Retirees would get a minimum raise of 2 percent in January 1986, 1987 and 1988 -- even if the cost of living did not go up that much. That is the minimum guarantee part.

The offset would click in when living costs exceeded 2 percent. For example, if the cost of living is 4 percent, retirees would get the minimum 2 percent raise. If it is 5 percent, retirees would get a 3 percent raise; if living costs go up 6 percent, retirees would get a 4 percent raise, and so on.

There is no guarantee that this compromise will survive the budget process, or that the Senate and House will even approve a budget of their own this year as an alternative to the one submitted earlier by the president. But for the moment, this is what is on the table.