Poles peacefully marked a fourth anniversary today of the birth of the Solidarity trade union movement with prayer, song and wreath layings.

For the first time since the crushing of the independent union in December 1981, a major opposition anniversary passed without serious clashes between workers and police in the key industrial centers of Nowa Huta and Gdansk. Both are strongholds of the banned movement.

An attempted march this evening by 5,000 Solidarity supporters through Warsaw's Old Town district was dispersed by truncheon-carrying riot police. In the southwestern city of Wroclaw, two recently amnestied Solidarity leaders, Wladyslaw Frasyniuk and Jozef Pinior, were detained overnight by police when they tried to lay flowers at a plaque honoring Solidarity.

Relatively low-key observances elsewhere coincided with a reassessment of strategy by Solidarity activists following the release in recent weeks of nearly all political prisoners. In response to the government's broad amnesty, union activists appear to have moderated their tactics, hoping to encourage authorities to make additional concessions.

In Gdansk, scene of a sit-down strike in August 1980 that paved the way for Solidarity's founding, the atmosphere was almost festive. Solidarity leader Lech Walesa commemorated the signing of the worker-state accords that ended those strikes by laying flowers at the towering monument outside the Lenin shipyard to Poles slain by police in 1970 riots here.

Walesa emerged from the main gate of the shipyard, where he now works as an electrician, and was cheered by about 1,000 workers and onlookers as he walked to the monument with a bouquet.

He stood briefly, his right hand raised with those of others in the familiar V-for-victory salute, as the crowd sang the Polish national anthem and the religious hymn "God Give Us Back Our Homeland," an opposition favorite.

Without delivering a speech he had said he would make, Walesa then turned and left, saying only: "Thank you. Goodbye. See you December 16" -- the anniversary of the date workers were shot here in 1970.

Teams of blue-coated police surrounding the monument made no attempt to interfere with the five-minute ceremony. The police presence was markedly more restrained than on past Solidarity anniversaries, when militiamen in antiriot gear cordoned off the monument area.

Masses of patrolmen and police vehicles were reported, however, in central Warsaw and around the giant steel works at Nowa Huta outside Krakow, both sites of disturbances in the past.

While Poland's Communist authorities are likely to claim that the absence of demonstrations today proves resistance to the government is on the wane, opposition leaders, particularly in Gdansk, can claim success in purposefully avoiding confrontation and initiating a practice of peaceful celebration.

A number of Solidarity spokesmen, including Walesa, have recently indicated doubts about the value of street protests. An appeal by Solidarity's underground leadership to observe today's anniversary omitted any call for demonstrations.

Heralding the start of a hoped-for new approach, Jacek Fedorowicz, a popular entertainer and skilled caricaturist, told a throng packed into Gdansk's St. Nicholas Church: "I want you to realize that you are the witnesses of a new tradition that will last, a tradition of celebrating a new authentic national holiday."

A two-hour program of poetry readings, prayer and pro-Solidarity songs, including an opening homage dedicated to Walesa, was then presented in the church. Afterward, the crowd moved to nearby St. Brigida's Church for an evening mass that featured the lighting of hundreds of tall yellow candles bearing pro-Solidarity dedications from factories, schools and individuals around Poland and from union supporters abroad.

The Rev. Henryk Jankowski, the church's pastor and an adviser to Walesa, said the candles "represent hope for all Poles" and would burn "until authorities take up dialogue with the nation."

The anniversary has become an occasion for both the government of Gen. Wojciech Jaruzelski and the opposition to argue over what has been achieved or lost since the signing four years ago of agreements with striking workers at Gdansk, Szczecin and Jastrzebie. The accords remained a touchstone for the Polish conflict.

For Solidarity activists and many other Poles, the agreements represent a record of persisting worker grievances. For the authorities, their credibility rests on their ability to persuade society that the accords have been fulfilled, or will be.

In addition to promising a wide range of approved economic benefits, the agreements stipulated political and social reforms, including less press censorship, an end to privileges in job priority for Communist Party members and greater access to official media for the Roman Catholic Church.

Most importantly, the accords spelled out the need for an independent, self-governing trade union movement that could represent worker grievances against a Communist administration that continues to hold a monopoly on power.

The party still contends that banning Solidarity was necessary, alleging that the union's leadership was bent on transforming the labor organization into a political movement against the Communist system.

Officials say that the new trade unions set up in Solidarity's wake -- and now said to have 4.5 million members, compared to Solidarity's 10 million -- are independent and self-governing. But opposition activists regard the new unions as party-controlled and hamstrung. They are urging the government to allow competitive unions to form in factories.

Walesa, in a statement released two days ago in connection with the anniversary, warned authorities that to ignore "our will to gain self-determination and democracy" would bring a "threat of conflict, the tragic outcome of which we are not able to imagine."

Although praising the recent amnesty as "a step in the right direction," Walesa indicated the government had betrayed the 1980 accords by suppressing independent trade unions and free speech. He said it had also engaged in political arrests and had discriminated against noncommunists in the selection of factory managers.

So far, the rulers have ignored Walesa's warnings and his repeated appeal for renewed negotiations and offers of compromise. Polish authorities give the impression they think of themselves as acting from a position of strength after gradually curbing the scope of underground activities.

In the strongest indication yet that the government has no intention of permitting competitive factory unions, the Polish press agency today issued an interview with Alfred Owoc, head of the board of leaders of the national trade unions. It quoted him as saying, "There are well-grounded reasons today to say that an introduction of union pluralism would bring about unhealthy competition in factories . . . . As a unionist, I am firmly against union pluralism, and I'm basing my opinion on the experience of the last few years."

At the opposite extreme, a similarly hard-line position was reasserted in a statement yesterday by the top underground leader, Zbigniew Bujak, who urged Solidarity to reorganize at the factory level.

"I emphasize today with full strength," declared Poland's most wanted political fugitive, "that the rights for Solidarity's existence cannot be the subject of any negotiating or bargaining. We cannot be satisfied with Solidarity in our hearts. We have to maintain real organization at any price."