The gross national product fell at a 2.5 percent annual rate in the fourth quarter of 1982, after accounting for inflation, as businesses slashed inventories and exports to other countries fell sharply, the Commerce Department reported yesterday.

The year-end drop left real GNP--the nation's output of goods and services adjusted for inflation--for all of 1982 down 1.8 percent compared with 1981, the largest decline for any year since 1946, when World War II defense production halted.

However, economic forecasters said the unexpectedly large cut in the level of goods that businesses have on hand makes it even more likely a recovery from the longest recession in postwar history will begin soon, perhaps even this month. With stocks low, any increase in consumer sales is apt to spur production of goods.

Monthly figures for personal income and consumer buying, released earlier this year, remained weak, and analysts are uncertain just how much of a gain in real GNP is likely this quarter.

The 2.5-percent decline in the final three months of 1982 followed a 0.7-percent rate of increase in the third quarter and a 2.1-percent gain in the second quarter. Real output had fallen at a 5.1-percent annual rate in the first quarter.

Prices, as measured by the GNP deflator, rose at a 4.3 percent rate in the fourth quarter, compared with a 5-percent rate in the third. For the whole year the deflator climbed 6 percent, the smallest increase since the 5.8 percent recorded in 1976. The deflator, the economy's broadest measure of inflation, had risen 9.3 percent in 1980 and 9.4 percent in 1981.

The reduction in inventories was much larger than most analysts had predicted, and accounted for 1.4 percentage points of the 2.5-point GNP drop. Much of the reduction in stocks came in the auto industry, as sales increased because of cut-rate financing offers, while production rose much less sharply.

Business investment in plants and equipment also fell, at a 9-percent annual rate. It was the fourth consecutive quarterly drop in this sector and, according to most forecasts, probably not the last. In a speech last night at a tax policy forum, Martin Feldstein, chairman of the Council of Economic Advisers, said such investment "is expected to decline another 5 percent between 1982 and 1983."

Both imports and exports fell in the fourth quarter, but exports fell more sharply, according to the GNP estimates prepared by Commerce's Bureau of Economic Analysis. The difference lopped another 0.4 percentage points off the level of real output, since there was less demand for American-produced goods and services.

The surge in auto sales in the last quarter was also responsible for a large portion of the increase in personal consumption expenditures in the fourth quarter. Sales of durable goods, including autos, jumped at a 19.9-percent annual rate, while sales of non-durables rose 2.6 percent, and services 2.7 percent.

Purchases of goods and services by the federal government rose at a large, 28.4-percent annual rate. Much of that gain was due to a large increase in purchases of farm products by the Commodity Credit Corp.

A number of forecasters expect a slow recovery this year, with real GNP rising between 1.5 percent and 2 percent. The Reagan administration, at the conservative end of that range, is predicting a 1.4-percent increase in output.