Ever since 1848, when the poet Sandor Petofi read a poem on the steps of the national museum inciting Hungarians to revolt against Austrian rule, political regimes here have kept an attentive ear cocked toward the writers' community.

Lately, Hungary's communist leadership has had to contend with increasing signs of restiveness among the country's literati. No writer of rank is espousing another revolution, but a series of confrontations between writers and the state has highlighted some daring attempts by artists to expand the boundaries of expression and to place taboo political topics on an agenda for public discussion.

The most recent conflict ended last week when the board of the Union of Writers confirmed the forced resignation of one of its officers, Gaspar Nagy, for a poem that authorities said exceeded the limits of tolerance.

The work, a brief and relatively abstract piece of literature, touched on the delicate subject of Imre Nagy, the former premier executed for his role in Hungary's short-lived revolution of 1956. A line at the poem's end -- "one day he will have to be buried, and we must not forget to name the murderers by name" -- was interpreted by state officials as an accusation against the Soviets and Janos Kadar, the Hungarian leader, who is widely rumored to have witnessed the execution.

Had the government not called attention to the poem, it might have gone largely unnoticed in the low-circulation provincial journal in which it appeared. But communist officials, worried about a precedent and fretting about how the Soviets might respond, insisted that Nagy give up his office as one of seven union secretaries.

"The problem was that the poem was written by an elected official of the writers' union, and we were worried about the international repercussions," said Dezso Toth, Hungary's deputy minister of culture, in an unusually frank admission of sensitivity to Soviet supervision. "The estimation and standing of the union among our neighbors would have suffered if Nagy had remained."

At first, Nagy refused to quit, contending that authorities had misread his poem. So the president and the secretary general of the union, both regarded as relatively open-minded men, threatened to resign, raising fears that a more orthodox union leadership would then be installed. Eventually, the errant poet agreed to step down, but not before a number of stormy union meetings in which members loudly protested the state's interference and constraints on intellectual freedom.

The episode marked the culmination of several years of unrest in the writers' union. "It led to the crystallization of a number of conflicts and controversies that exist here," said Miklos Jovanovics, the union's secretary general and a member of the ruling Hungarian Socialist Workers Party.

On the whole, dissent in Hungary is less prevalent than in other East European countries. By the measures of economic management and freedom to travel abroad, Hungary ranks as the most liberal of Soviet Bloc states.

Kadar, who has run the country since the ill-fated uprising of 1956, is genuinely popular as a result of a well-established economic reform that has given the country a sense of prosperity and individual enterprise unmatched elsewhere in Eastern Europe. Political opposition is further discouraged by the memory of the thousands who died in 1956, when the Soviets brutally repressed Hungary's rebellion.

What dissident activity there is seems to emanate mainly from part of Budapest's intellectual community and is focused around underground journals, the publication and distribution of which are hampered by police raids and the imposition of heavy fines. The tumult in the writers' union represents another level of opposition, a kind of controlled, institutionalized dissent, which nevertheless has the potential of developing into something more.

"Here, in contrast to the United States, literature has long been a political matter," said Jovanovics, a literary critic. "Historically in Hungary, writers have been considered clever and wise; they have been ambitious and wanted to play a political role." Explaining the regime's general approach to the arts, Jovanovics spoke in terms of a "partnership" between politics and culture, obligating artists to observe certain "rules of the game." This, he added, is "not a matter of politics but of ethics."

Nagy got into trouble, Jovanovics said, because he violated this sense of partnership. So did the prominent poet Sandor Csoori, who was disciplined in 1983 for writing an introduction to a book by Miklos Duray, a leading member of the Hungarian ethnic minority in Czechoslovakia and campaigner for equal rights.

The government complained that the essay had complicated its efforts to resolve quietly the problem of Hungarian minorities in neighboring states. It ordered Csoori to stick to writing poems, effectively blocking for a time publication of his other literary efforts.

Several months later, Ferenc Kulin, the editor of a literary monthly, Mozgo Vilag, also ran afoul of the government and was fired for running too many "pessimistic, distorting and dissembling" articles on political and social themes.

Incensed by the state's interventions, some writers charged that cultural expression in Hungary was being suffocated. To keep matters under control, the government set up an informal group -- Toth calls it a "conflict managing committee" -- consisting of union representatives and officials from the government and party who meet periodically to review problem cases.

No one assumes the troubles are over, as young writers especially continue to press for open discussion of such long-censored topics as the 1956 rebellion and the plight of Hungarian ethnic minorities in Romania, Czechoslovakia and Yugoslavia.

"The young writers would like more room," said Jovanovics. "They've wanted controversies on things that haven't been suitable for controversies. They would like to make the older generation talk about things we'd prefer not to discuss."

Behind this agitation is not just the coming of age of another generation. East-West tensions, the failure of four decades of socialism to deliver on its promises and artistic conscience all play a part in promoting a more cynical, critical outlook among writers here as well as the courage to speak out.

Not all efforts for change have met with defeat. Demands for more democracy led to the election three years ago of a union board significantly freer of party representation than in the past. For the first time since 1956, a noncommunist, Miklos Hubay, was elected president, and the communists ended up with only three of the seven secretarial offices that they had dominated previously.

The election lifted hopes that the union could become a real democratic forum. Those expectations since have been dimmed by the state's repeated interventions.

"I'm not optimistic at present," said Istvan Csurka, a popular playwright who tried to quit the union's presidium in protest a year and a half ago, writing a letter that decried the organization's lack of independence. He was persuaded to stay on by "friends who told me not to abandon them because, they said, that would weaken their own position."

"The only positive feature," Csurka commented bleakly, "is that the union continues to exist."