The Soviet Union and China today signed an agreement to boost their bilateral trade sharply over the next five years. The $14 billion pact seemed to indicate continued improvement in relations between the two formerly hostile communist giants.

Despite continuing political differences, Moscow and Peking have moved a long way since they decided in the fall of 1982 to attempt to normalize their relations.

China's Deputy Premier Yao Yilin and Ivan Arkhipov, Soviet first deputy prime minister, signed the accord, which substantially is a barter trade agreement. They also signed a cooperation accord under which the Soviets will help modernize China's industry.

Yao is the first member of the Chinese Politburo to visit Moscow in more than two decades. There was speculation here that he would be received by party leader Mikhail Gorbachev.

Since the two countries quarreled over ideology, frontiers and other issues in the early 1960s, they have had no long-term trade agreements. Instead, accords on bilateral trade, mostly along the border, were concluded annually.

In 1982 before the normalization process began, the bilateral trade totaled $330 million. It rose to $800 million in 1983 and to $1.2 billion in 1984. The total trade for this year is expected to exceed $1.8 billion.

Under the new agreement, annual exchanges would rise to $3.5 billion by 1990.

According to an official communique, the Soviet Union will supply China with machinery, machine-tool equipment, chemicals, cars and trucks, building materials and unspecified raw materials.

The Chinese deliveries to the Soviet Union will consist of consumer goods, agricultural commodities, and some raw materials. Diplomats here said the Chinese had been looking for food export markets since their agricultural output was sharply increased as a result of new economic policies.

According to the agreement, the Soviet Union will build seven new plants in China and help modernize 17 industrial installations in the areas of power generation, metal processing, machine building, coal, chemicals and transport.

Today's agreement followed a series of accords on technical, economic and scientific cooperation the two countries signed in December during Arkhipov's visit to Peking.

The communique said that Yao and Arkhipov had discussed a wide range of trade and economic questions and "confirmed their mutual interest in further expanding them." It added that "some other problems of mutual interest" had been discussed. This was interpreted to mean that political differences had also figured in today's talks.

The new agreement appeared to reinforce the trend over the past three years to seek resolution of practical problems of mutual interest despite political differences.

Although the Chinese continue to be firm in their insistence that three "obstacles" block the way to normalization of political relations, they seem to have set this aside when it comes to cultural, scientific, economic and other links with the Soviet Union.

The three "obstacles" involve Cambodia, which is occupied by Soviet-allied Vietnam; Afghanistan, which was invaded by Soviet forces, and the presence of large contingents of Soviet troops along the Sino-Soviet border and in Mongolia.