The balance of current international transactions between the United States and the rest of the world shifted $8.1 billion into the red last year as the U.S. merchandise trade deficit worsened and the surplus in services declined, the Commerce Department reported yesterday.

With the economic recovery here expected to boost the merchandise trade deficit sharply this year, Commerce Undersecretary Robert Dederick said the nation's balance in these transactions--known as the balance on current account--would likely be more than $20 billion in 1983, well above the $14.8 billion record set in 1978.

In 1981, the United States had a $4.5 billion current account surplus, and it stayed in the black through the second quarter of 1982. Then in the third quarter last year, when the merchandise trade deficit jumped by almost $7 billion to $12.5 billion, the current account dropped to a $5.2 billion deficit. That widened to $6.1 billion in the fourth quarter, the largest quarterly figure on record.

The current account includes transactions covering goods, services, government pensions and private remittances and other transfers. The services category also encompasses earnings on foreign direct investments, such as profits earned by foreign subsidiaries of American corporations and interest paid on money borrowed by or invested in other countries.

In 1982, a highly visible $36.3 billion merchandise trade deficit was almost exactly offset by a much less noticed $36.1 billion surplus in services. U.S. government grants other than military assistance added another $5.4 billion to the current account deficit, while government pension payments and private remittances increased it by another $2.5 billion. Private remittances include payments sent to their home countries by foreigners working in the United States.

Dederick said he expects a "temporary" improvement in the merchandise trade deficit for the current quarter, partly because of the drop in oil prices and the volume of oil imports.

However, a number of economists, including Martin S. Feldstein, chairman of the Council of Economic Advisers, earlier warned that the merchandise trade deficit could hit $75 billion this year and the current account deficit as much as $30 billion.

A faster economic recovery here than in other industrial nations is expected to cause a relatively greater rise this year in imports than in exports. In addition, the U.S. dollar remains strong on foreign exchange markets, making it expensive for foreigners to buy U.S. goods or to travel to this country and cheaper for Americans to import from or visit overseas.

But the value of the dollar is down somewhat, and Dederick said that American products "probably will become more price-competitive as the dollar declines further from its earlier high level."

Overall, the department said the United States exported $350.1 billion worth of goods and services--including earnings on U.S. direct investment abroad as a plus and therefore the equivalent of an export--during 1982. Imports of goods and services totaled $350.3 billion. Merchandise exports alone were $211 billion and imports $247.3 billion.

Part of the decline in services was due to a $6 billion decline in net receipts on foreign direct investment, which was only partly offset by a $2 billion rise in earnings on "portfolio" investments, such as foreign stocks and interest on foreign bank deposits. Similarly, net receipts from tourism and passenger fares fell by $2 billion.

The department also reported a major shift in long-term international capital flows in 1982. Instead of the $8.7 billion excess of U.S. direct investment abroad over foreign investment in the United States that occurred in 1981, foreigners invested $2.2 billion more here than Americans invested abroad in 1982. Much of that inflow of foreign capital was the result of American corporations borrowing abroad through subsidiaries set up in the Netherlands Antilles because of favorable U.S. tax treatment accorded such transactions there.

For all the apparent precision in recording international transactions, when all the flows in and out are counted, and the level of U.S. assets abroad are compared with foreign assets here, the department was left with a statistical discrepancy of $41.9 billion more coming in than going out. High interest rates in the United States and "unsettled financial, political and military conditions abroad in both developing and developed countries" were probably responsible for the large inflow, the department said.

In other words, investment opportunities in the United States were more attractive than abroad, and in many instances deemed by foreign investors as far safer. In many cases, money is flowing into this country in unrecorded ways to avoid currency and capital export controls in other nations.