Andras Hegedus, a former Stalinist prime minister of Hungary turned sociologist, ponders the question of how the Kremlin's East European empire can escape from its deepening crisis.

There is no immediate solution, he replies, but sooner or later "constructive opposition" to Communist rule will have to be legalized throughout the Soviet Bloc.

"In order for economic reform to be meaningful, there has to be greater political democracy too," he says, relaxing in his sunlit study in the hills of Budapest above the Danube.

An hour's plane journey away, in Warsaw, a Polish sociologist who has witnessed the rise and fall of the independent Solidarity trade union takes a much bleaker view of the future. Jadwiga Staniszkis predicts that living standards will deteriorate even further and, despite the suspension of martial law in Poland, Communist regimes will make greater use of army and police methods to control the population. Economic and social life will stagnate for some years, Staniszkis believes, eventually "stabilizing at a very low level." There will be a general lowering of popular aspirations.

These sharply contrasting outlooks reflect the markedly different political conditions in Hungary and Poland. They are a reminder that, despite three and a half decades of Communist rule and many common problems, Eastern Europe cannot be treated as a monolithic unit. Each nation has its own rich and distinct history--and each has developed different techniques for preserving its identity in the shadow of one of the world's two great powers.

The Poles have a tradition of romantic insurrections which almost invariably collapse but serve to keep their national feelings alive until the next time. The Romanians wheel and deal, playing one power off against another. The Czechs make an outward show of compliance but inwardly follow the example of their literary hero, the "Good Soldier Schweik," in secretly making fun of their oppressors. The Hungarians understand that they are a small nation and use their innate intelligence and ingenuity to make the best of an unenviable position. The Bulgarians alone seem to like the Russians and prosper by ingratiating themselves as much as possible with their Slav big brother.

The ruling elites throughout the Soviet Bloc are divided over political and economic strategy in the post-Brezhnev era--even if there is a widespread consensus that things cannot go on as they are. For all its superficial unanimity, the spectrum of opinion in East European politics is almost as great as it is in the West.

At one end are the Communist purists like Czechoslovakia's Vasil Bilak, who advocates a return to "real Marxism" and stricter ideological controls. At the other are pragmatic "social democrats" like Hungary's Reszo Nyers, who favors a measure of political pluralism and the dismantling of that Marxist shibboleth, central planning, in favor of a market economy.

In between are the politicians, who believe that economic reform should be combined with continued political repression. And then there is perhaps the largest group of all: the opportunists, who do not have any fixed political views of their own but are willing to mouth whatever slogans offer them the best prospects of promotion.

Which faction ends up on top will depend in part on the outcome of the political transition underway in Moscow following Leonid Brezhnev's death. Soviet leaders no longer interfere in day-to-day decision-making in Eastern Europe. But the policy choices that are made in the Kremlin inevitably shape the strategy of the entire bloc and define the limits of what is politically acceptable.

If history is any guide, the new Soviet leader, Yuri Andropov, is likely to receive conflicting advice on how to deal with Eastern Europe. There will be those who encourage him to heed the maxim of the Empress Catherine the Great: "That which stops growing starts to rot." And there will be those who argue that, without major reforms, the whole structure of empire will collapse.

Andropov's past provides mixed clues to his attitude toward the Soviet Bloc. As Soviet ambassador to Budapest in 1956, he was the Kremlin's man on the spot during the Soviet invasion and subsequent brutal suppression of the Hungarian uprising. But later, as the Communist Party secretary for Eastern Europe over the next 10 years, he was instrumental in securing Moscow's approval for Janos Kadar's policy of cautious reconciliation with his political opponents.

Today Hungary has become the Soviet Bloc's shop window and its laboratory for economic experiments. Now that Solidarity has been defeated in Poland, it is to Hungary that liberal-minded Communists look for evidence that the system can after all be reformed.

The Hungarian success story has, however, been a special case up to now. There is no guarantee that the same reforms would work in other parts of the Soviet empire -- even supposing that Andropov is secretly sympathetic to what Kadar has done in Hungary. A small, homogeneous nation of only 10 million people, Hungary is much more easily governed than the Soviet Union with its huge territories and myriad nationalities or even Poland with its population of 36 million, powerful church and ingrained anti-Russian tradition. Andras Hegedus and Yuri Andropov once knew each other very well. Hegedus became prime minister of Hungary in 1955 at the age of 33 -- shortly after Andropov's appointment as Soviet ambassador. Today he recalls that Andropov -- then 40 -- had an open, inquiring mind and, unlike many Russian diplomats, was eager to learn as much as he could about Hungary and its culture.

While his friend climbed up the ranks of the Soviet Communist Party, last month achieving supreme power, Hegedus gradually lost faith in the reassuring certainties of Marxist dogma. His intellectual evolution from fanatical young Stalinist to grand old Hungarian dissident is, in a way, symptomatic of the more general decline in the appeal of a monolithic, all-embracing ideology for the peoples of Eastern Europe.

Now a genial-looking scholar with a shock of white hair around a bald head, Hegedus remembers touring the country in the late '40s, bullying rich aristocrats into giving up their land. The landlords despised his youthful enthusiasm and ill-fitting clothes--but were forced to respect the "plenipotentiary powers" from the government that he carried in his right shoe.

Hegedus gradually began rethinking his ideas following his ouster as prime minister in 1956 -- a few weeks before the revolution. After a two-year exile in Moscow, he returned to Hungary and a new career as economist and sociologist. In 1968, he publicly opposed the Soviet-led invasion of Czechoslovakia and was expelled from the Communist Party as a result.

His conclusion that "constructive opposition" will eventually be legalized in Hungary is based on the premise that, in the modern world, a political system can only be efficient if it allows free play between organized interest groups. In the Hungarian context, however, free elections are impossible since they would lead to the liquidation of the Communist power structure. So some other way must be found.

The kind of political model Hegedus has in mind bears some resemblance to the early days of Solidarity in Poland -- before the revolution ran out of control. Both rulers and ruled, Hegedus insists, have to learn that there are limits beyond which they must not go.

The military crackdown in Poland demonstrated that the Kremlin's political grip on Eastern Europe rests on more than the 31 divisions of crack Red Army troops that are stationed in the region. Hegedus says that Western analysts tend to overlook the fact that in Hungary, as in other East European countries, a significant section of society is "integrated" into the power structure. These people--who include certain privileged workers as well as party officials and members of the security forces -- can be relied upon to actively support the regime in a showdown.

"At a time of popular revolt, the integrated people are passive. They stay at home while the opposition takes to the street. But, once the authorities take the initiative again, these people become active. This is a class which has a vested interest in good relations with the Soviet Union since that is the basis of its position in society," Hegedus explained.

The "integrated" class is a small minority, but a highly organized one--and in the last resort it possesses the guns. Hegedus estimates that in Hungary it numbers some 200,000 people, families included. In Poland, which is more than three times the size of Hungary, the "integrated" section of society is proportionately more numerous.

The more isolated the "integrated" class becomes, the more desperate it gets to hang onto power -- and the more dependent it becomes on the Kremlin. This mechanism is illustrated by Poland where, by December 1981, the ruling class had become so weak politically that it was obliged to carry out a coup d'etat in order to survive -- which is what Moscow had been advocating all along.

Hegedus says that a peaceful transition to greater democracy can only take place if there is mutual tolerance. A legalized opposition must respect the interests of the power structure -- and vice versa. The Soviet leadership, he believes, can be persuaded to tolerate liberalization if convinced that it is necessary in order to avoid a crisis.

"For Moscow, it is better to have a Hungary that is prosperous and peaceful than another breakdown of the system as in Poland," he said.

It is scarcely surprising that the optimism of Hungarians like Hegedus does not find much of an echo in Poland. The experience of the past three years has taught many Poles, on both sides of the political divide, that communism and democracy can't be mixed.

Poland's military ruler, Gen. Wojciech Jaruzelski, has frequently hinted that he would like to follow the Kadarist road of controlled liberalization from a position of strength. He has promised sweeping economic and political reforms and coined his own, slightly more cautious, version of Kadar's famous slogan: "He who is not against us can be with us."

At present it is an open question whether Jaruzelski can emulate Kadar's achievement. The odds must be against him. Unlike Hungary after the Soviet invasion, the opposition in Poland has not been destroyed and still has a powerful rallying point in the Roman Catholic Church. The political risks of radical reform are very high, since it involves cutting workers' living standards even further and breaking the power of the central planning apparatus, the bulwark of the regime's social support.

Several abortive attempts have been made in the past to reform Poland's top-heavy economic system. Many of the ideas that were successfully implemented in Hungary were first thought up by brilliant Polish economists like Oskar Lange and Wlodzimierz Brus. In Poland, however, bureaucratic resistance was so strong that eventually the proposed reform came to nothing. The beginnings of the same cycle are evident today.

Jadwiga Staniszkis, a former Solidarity adviser, believes that the techniques of coercion have become ingrained in the Communist system in Poland. For all the talk of reform, she has detected a gradual drift toward an even more authoritarian style of government.

"The military mentality is totally at odds with that required by reform. Everything is done by means of orders or commands. In the short term, military discipline can release reserves in the economy--but in the long term it's incapable of pulling us out of the crisis," she said.

The contradiction is acknowledged by Wieslaw Sadowski, a bespectacled university professor who has been given the post of deputy minister for economic reform in Jaruzelski's government. He contends, however, that headway is being made in decentralizing decision-making in the economy. From his office in the Council of Ministers in Warsaw, he cajoles managers and government officials into gradually changing their way of thinking.

"The political will to introduce reforms is definitely present," he said. "It is the result of historical experience which has proved that the old system can't solve our underlying problems. Of course I am not surprised that the public is incredulous and suspicious . . . There are still many routine-minded bureaucrats who cannot adjust to the new system."

Sadowski also admits to a "certain delay" in implementing the reform. This, he says, is the result of very unfavorable economic conditions. At times of dire shortage, the only practical way of allocating scarce resources in the economy is by decree.

Sadowski's assurances do not convince Staniszkis, who argues that Jaruzelski's military regime is "amateurish" in matters of economics.

"The only solution they have come up with so far is to hand over part of our industry to the Soviets. The Russians supply us with raw materials and, in return, get 85 percent of the output. This helps us avoid mass unemployment but is dangerous, because we run the risk of being tied into deepening economic crises in the Soviet Union," she said.

In Staniszkis' view, the end result is likely to be the gradual militarization of the entire Soviet Bloc. She predicts that the present drive for closer economic integration will eventually result in a synchronized, bloc-wide crisis. In order to contain the resulting social unrest, the army and security forces will be obliged to tighten their controls.

From his book-lined office at the Hungarian Institute for Economic Research, Reszo Nyers says that post-Solidarity Poland faces a limited choice. It can either take Hungary's road after 1956 or Czechoslovakia's after 1968. Under Gustav Husak, who replaced the reformist Alexander Dubcek in 1969, all forms of independent initiative in Czechoslovakia have been ruthlessly suppressed in the name of "normalization."

Nyers' remark is repeated at a party in Warsaw to a Polish journalist who resigned from his prestigious job in disgust following the imposition of martial law last December. Flushed, he replies heatedly: "I don't see why we should have to choose between Kadar-type communism and Husak-type communism when we don't want communism at all. What we want is our freedom. One of these days, Russia will be weak--and then we will break away from its grasp."

His wife, who is standing next to him, adds: "Jaruzelski may have good intentions, but we have learned that the nature of communism doesn't change. There will be no great changes here."

An elderly academic who supports Jaruzelski shrugs his shoulders in weary resignation at what he describes as "the overromantic attitude" of many of his fellow countrymen.

"Look, we can't go on behaving as if this country is out in the middle of the Indian Ocean somewhere like Madagascar. Poland happens to be right in the middle of Europe--and our fate was settled at Yalta. Once Poles accept that, then perhaps we can get out of this mess. Otherwise, nothing will ever be solved," he says.

Bruno Kreisky, the Austrian chancellor who negotiated successfully with the Russians in 1955 for his country's neutrality, is a keen observer of the Soviet Bloc. In a recent interview with a British journalist, he predicted that eventually there would be another upheaval.

"It takes at least 10 years for another generation to arise which has not had the experience of defeat. Ten years after Hungary--Czechoslovakia. Ten years after Czechoslovakia -- Poland. In the next 10 or 12 years you will see it again," he said.

A year after Solidarity was crushed, most Poles are convinced that--unless Yuri Andropov allows major structural reforms throughout the Soviet empire--the next explosion will come even sooner