AS YOU MAY HAVE noticed the last time you passed a supermarket cash register, the price of food is going up again. After months of relative stability last year, this winter it has been moving upward at the brisk annual rate of 13 percent. One reason is that prices paid to farmers are also rising again. But wait a minute. If farm prices are already going up, why did Senate pass that recklessly inflationary bill last week to raise farm prices?

The answer is, unfortunately, that the senators fell into one of those periodic panics in which they compete fiercely to see who can hand out the most benefits fastest to a small but noisy constituency. The farmers' demonstrations finally got some results. Who was responsible for that dangerously bad bill? There was Sen. Herman Talmadge (D-Ga.), the Agriculture Committee chairman, who lost control of the bill. There was Sen. George McGovern (D-S.D.), who has never been good at arithmetic.

But the star performer was Sen. Robert J. Dole (R-Kan.), who induced the Senate to adopt a weirdly complicated amendment that would vary each farmer's gain-support prices according to the amount of land that he might choose to set aside. Congressional budget analysts calculated that the Dole amendment alone would add half a percentage point to the nation's inflation rate, would increase consumers' food costs by $3.5 billion to $6 billion and would add $2.5 billion to the federal deficit over the next two years. The next time you hear Sen. Dole lecture the nation on the evils of the deficit and assail the Carter administration for failing to control inflation, you might keep it in mind that he is the author of the Dole amendment to the Senate's proposed Farm Fantasy and Food Inflation Act of 1978.

The bill is still a long way from final passage. The House, so far, has taken a more restrained and useful position. It is working on a bill to expand emergency farm credit - which would help farmers in distress without firing up further inflation. But the White House fears that the Senate's panic could spread to the House. That's why Vice President Mondale called a press conference Wednesday to launch the administration's counterproposal.

First of all, Mr. Mondale relayed the warning that the president will veto the Senate bill if it gets as far as his desk. He offered the Senate one major concession: The Agriculture Department will pay farmers directly, for the first time since the early 1970s, to take limited acreages out of production.Beyond that, the administration proposes mainly to rely on building reserves.

The difference between the administration's policy and the Senate bill is crucial not only to consumers but also to the farmers themselves. It's the worldwide weather patterns that determine the size of harvests and the prices that farmers get. Building reserves now, in a time of plenty, will raise prices a little, but it will buy insurance against severe leaps in prices when harvests fail. The Senate bill abandons the whole idea of reserves and merely pays farmers to cut production this year to a point at which prices would move up very sharply even in normally good weather. If the world were unlucky in its weather this summer, with American grain production held way down by the Senate bill, the result would be dire shortages and another great surge of inflation as in 1974.

The past year's low grain prices are the result of three huge American harvests in a row - a very unusual sequence. The farmers' protest movement is reacting to last year's prices, and the Senate is reacting to the farmers. But grain prices have been moving up steadily since the low point last summer. They have moved up significantly since last December, when the protest movement started. It is very likely that they will keep moving up, slowly but steadily, over the coming spring and summer, with no new legislation at all. But some of the farmers think that they are entitled to catch up faster than that.

The last word here belongs to Sen. Edmund Muskie (D-Maine), who led the losing fight to beat the farm bill last week. On the day after the bill was passed, he talked to the Senate about inflation: "What sustains it is the determination of every individual in our economy, every group in our economy, to catch up. . . . We seem to embrace - and I am not talking about just yesterday - every attractive opportunity to help somebody catch up, refusing to recognize that that catch-up effort is itself inflationary."