WASHINGTON (AP) _ Secretary of State James A. Baker III quashed a speech by a senior U.S. expert on the Soviet Union that contained a pessimistic assessment of Mikhail Gorbachev's chances of success in revamping the Soviet economy, the White House confirmed today.

On a flight to Costa Rica, presidential spokesman Marlin Fitzwater acknowledged there were various opinions within the Bush administration about Gorbachev's prospects.

Fitzwater confirmed a New York Times report that Robert M. Gates, the deputy national security adviser, had been muzzled.

While there were assessments ''all over the lot'' about the future of Gorbachev's attempts to restructure the Soviet economy, ''the point is we want it to endure,'' the spokesman said.

''That's the president's policy,'' Fitzwater told reporters aboard Air Force One as Bush headed to San Jose for a celebration of Costa Rica's 100 years as a democracy.

''It's not really a question of policy,'' Fitzwater added. ''It's a question of analysis and interpretation of events that the State Department felt was better left unsaid at this point.''

The State Department ''just felt it's inappropriate to talk about it at this time,'' he said.

Baker frequently has said the United States wishes Gorbachev well in his restructuring policy. But except for offering some undefined technical advice, the secretary of state has stressed it is up to the Soviets to determine their future.

Gates, a former deputy director of the CIA, had been scheduled to speak to the National Collegiate Security Conference in Bethesda, Md., a student colloquium.

Other members of the administration, including Vice President Dan Quayle, Defense Secretary Dick Cheney and Deputy Secretary of State Lawrence Eagleburger all, in one form or another, have registered public skepticism about Gorbachev's prospects.

Baker, whose top aides initially described Gorbachev as essentially deft at public relations and adapting U.S. ideas on arms control, has gradually warmed to the Soviet leader's uphill campaign to change the Soviet system.

Gates, in a speech last year, said Gorbachev had ''not really changed'' the Soviet pattern. ''Russian and Soviet history caution us to be skeptical and cautious,'' the then-CIA official said.

The speech disturbed then-Secretary of State George P. Shultz, who reportedly complained to Gates after it was delivered.