The United States and the Soviet Union began their first formal negotiations on nuclear testing in seven years yesterday with officials on the two sides differing about the aims of the talks.

President Reagan, in a statement released at the White House, said he is "gratified" that the talks had begun but stressed the need to continue underground nuclear tests "for as long as we continue to rely on nuclear weapons for our security."

A senior U.S. official briefing reporters at the State Department said this meant that a comprehensive ban on nuclear tests, which the Soviets have sought for several years, is not possible "in the foreseeable future."

Meanwhile in Geneva, the Soviet delegation said the negotiations are aimed at "the limitation and eventual cessation of nuclear testing" and outlined a schedule under which both sides would begin intermediate limitations on the number or frequency of nuclear tests as early as the latter half of 1988.

Previously, the administration said such limits could be considered only after both sides agreed to cut their strategic nuclear arsenals.

But the U.S. official indicated yesterday that the Defense Department favors more nuclear tests in the wake of a strategic-arms agreement. He said the tests would be needed to provide increased confidence in the reliability of the remaining weapons.

U.S. and Soviet negotiators have agreed first to establish new means of verifying compliance with two existing nuclear testing treaties limiting the explosive force of underground nuclear tests to 150 kilotons, the equivalent of 150,000 tons of TNT.

The United States has proposed measuring the tests' force with special underground cables, while the Soviets prefer monitoring seismic signals created by the blasts.

The two sides have also been unable to agree on details of joint experiments to resolve the dispute over these methods.

The current negotiations are to last two weeks, with the U.S. delegation led by Robert B. Barker, who directs development of U.S. nuclear weapons as an assistant to the secretary of defense for atomic energy. No agreement has been reached on timing and duration of future talks.

The negotiations are occurring against a backdrop of congressional pressure to bar all nuclear tests with an explosive force greater than 1 kiloton.

Specifically, the administration is resisting a proposal by key House members that it try to establish a $12 million experimental network of monitoring stations for nuclear tests inside the Soviet Union.

The monitoring network could be established in lieu of the 1-kiloton limit in the House version of the defense bill for fiscal 1988, congressional sources said.