The top U.S. and Chinese defense officials expressed differing hopes for their countries' relationship tonight, as Defense Secretary Caspar W. Weinberger spoke of common strategic interests and Chinese Defense Minister Zhang Aiping delivered a prickly paean to independence.

Zhang welcomed Weinberger with a banquet in the Great Hall of the People at which he toasted "the development of friendly relations between China and the United States." But Zhang also reminded Weinberger that the Chinese "will not attach ourselves to any big powers."

Weinberger, by contrast, implicitly stressed the common strategic concerns of China and the United States in the face of what he views as a massive Soviet buildup in Asia. In his brief answering toast, he mentioned "strategic concerns" or "global issues" six times.

Weinberger arrived in Peking today for the start of a five-day visit to China that U.S. officials hope will pave the way toward increased military cooperation after two years of chilly relations.

That chill began in large part because of U.S. arms sales to Taiwan, and American officials considered it a positive sign that Zhang did not raise the Taiwan issue tonight. There were fewer positive signs, however, with respect to U.S. desires to lure China closer toward an anti-Soviet alliance.

"The United States and China share many important strategic concerns," Weinberger said. "We look to develop with you an enduring relationship that recognizes both our common interest and our differences."

Weinberger hopes to arrange arms sales, technology-sharing or military exchanges that will promote that enduring relationship. But Zhang stressed that modernization of his large but archaic military does not depend on outside help.

"We will not attach ourselves to any powers or any bloc of powers, nor will we ever yield to any foreign pressures," Zhang said. "With our own efforts, on the basis of independence and taking initiative in our own hands, we will be able step-by-step to achieve modernization of our country."

China is frequently critical of military policies of the Soviet Union, which keeps 500,000 soldiers on the 6,000-mile Chinese-Soviet border, but it also occasionally accuses the United States of hegemonism.

Weinberger, balancing his plea for strategic cooperation with a little tough talk, warned against "the kinds of unjust criticism" that are "harmful to the kind of friendly relationship we both seek." Weinberger said he "anticipates other high-level visits by both sides," a possible reference to visits by Premier Zhao Ziyang to Washington and President Reagan to Peking later this year or in 1984.

Weinberger is scheduled to meet with Zhao Tuesday and Chinese leader Deng Xiaoping Wednesday, between tourist visits to the Great Wall and elsewhere and inspections of several military installations.

China greeted Weinberger, the first U.S. defense secretary to visit since Harold Brown in 1980, with a parade and troop inspection in front of the military museum. A downed U.S. warplane that once was displayed in the museum's front court was no longer on view.