WHEN Mikhail Gorbachev came to power four years ago he had little background in the Soviet Union's nationalities problem. He's a Russian, and had served primarily in the Russian Republic. But as glasnost took hold and political expression crackled to life, Mr. Gorbachev began a crash course in nationalism - the latest lesson of which has come from Soviet Georgia. Last weekend's violent confrontation between troops and demonstrators in Tbilisi, the Georgian capital, was among the sharpest outbreaks of nationalistic fervor yet. Eighteen people are reported to have died in the melee.
The passions in Georgia, as earlier in Armenia, were stimulated by unrest in an autonomous region - in this case the Black Sea enclave of Abkhazia, which is administered by Georgia. The Abkhazians, a minority even in their own region, want independence from Tbilisi. Their protests sparked Georgian nationalism, which culminated in demands for outright independence from Moscow.
Force has quieted things in Georgia for now, but underlying emotions are far from subdued. The Georgians have always been fiercely independent, maintaining a distinctive culture and language despite long domination by stronger powers.
The same can be said about their neighbors, the Armenians, whose push to absorb the largely Armenian region of Nagorno Karabakh (now part of the Azerbaijan Republic) springs from a historic desire to unify a fragmenting nation. The Baltic peoples want the freedom to pursue progressive economic and political paths unencumbered by Moscow's strings. The Ukrainians want to keep their language from being erased by creeping Russification.
Gorbachev has shown a willingness to discuss such matters and avoid the instant crackdown. But when things have gotten to the point of rebellion, as in Tbilisi, the tanks and troops have moved in. He has to gamble, perhaps, that events like those in Georgia will dampen the plans of nationalists elsewhere who might be tempted to stray too far from the politically acceptable.
Georgians, Estonians, Armenians, and others know, too, that their aspirations - if overplayed - could cause the Russians themselves to rally round the empire.
Risks abound. Gorbachev, by loosening the bureaucratic noose around the Soviet economy, has unloosed ever-simmering nationalisms. He hopes that economic reform can produce results quickly enough to draw the country together around a system that works. The old system was held together by an ideological web that's fraying rapidly, creating an intellectual void. New ways of thinking, including a rebirth of religion - and, of course, a resurgence of nationalism - are helping to fill that void.
The rest of the world can only look on in wonder. No one - most of all the Russians who dominate the Kremlin - knows how it will all turn out.