PARIS, OCT. 29 -- The Soviet Union and France signed a cooperation treaty today in which they pledged to "harmonize their positions" during international crises.

Besides the comprehensive Treaty of Understanding and Cooperation, the two governments signed five accords dealing with industrial, technological, scientific and social exchanges. France will also provide a $1 billion package of loans and credits, primarily for the purchase of French grain.

The political agreement signed by Presidents Mikhail Gorbachev and Francois Mitterrand was conceived barely two months ago and rushed to completion, according to French sources, because the Soviets wanted to conclude it before Gorbachev visits Germany next month to sign a monumental treaty of friendship. French officials said the Soviets were eager not to make Germany appear as the overwhelming focus of Gorbachev's new partnership with Western Europe.

The French-Soviet treaty binds both nations to undertake consultations if either side deems "major security interests" are threatened. The document calls on their governments "to make contact without delay . . . harmonize their positions and agree on measures to improve the situation or bring it under control."

Combining the respective visions of Gorbachev and Mitterrand, the treaty pledges both nations to work for "the transformation of Europe into a common home and the creation of a European confederation." France and the Soviet Union also vow to promote democracy and "a Europe based on the right of law."

In addition, France promised to assist the Soviet Union's transition toward a market economy and to facilitate its relationship with the entire 12-nation European Community.

"I observe what is happening in the Soviet Union with sympathy, but also the desire to contribute to this experience," Mitterrand said in a joint press conference with Gorbachev at the 14th-century Rambouillet castle southwest of Paris. "We are undertaking these vows so that Soviet efforts under {Gorbachev's} authority will succeed."

Gorbachev thanked his host for his understanding and desire to "help us overcome the difficulties we now face in this period of transformation."

Besides regular political consultations, the main agreement calls for expanded cooperation in energy, civilian uses of nuclear power, transportation, high-definition television and telecommunications.