When martial law was formally lifted two months ago, Polish leader Gen. Wojciech Jaruzelski said the armed forces would be withdrawing to the "second line" of political life. But the retreat has been far from total.

Senior officers remain in several of the most crucial Cabinet posts and generals and colonels continue to serve as governors in one-fifth of Poland's regional districts, including the main industrial centers.

Military officers have made clear their intention to stay on as supervisors or advisers, keeping tabs on Communist Party functionaries, government bureaucrats and managers of enterprises as authorities struggle to salvage some credibility and overcome an economic crisis.

Once determinedly removed from administrative and social responsibilities, the military is now deeply involved in the running of Poland.

Some of this naturally follows from the consolidation of power achieved by Jaruzelski, 60, a four-star Army general who is prime minister, party chief and defense minister, and who has put longtime associates in the military in other key administrative posts. It also reflects the continuing weakness of the Communist Party apparatus, which virtually collapsed under the challenge of the worker-led Solidarity movement, prompting the imposition of military rule.

Poles note that Jaruzelski's military appointments have not been as extensive as the cronyism practiced in the 1970s by then party chief Edward Gierek, who surrounded himself with Silesian friends. But the military's expanded role in the government and party constitutes a new element, sustaining Communist rule while at the same time undercutting the influence of individual apparatchiks.

The military role is a precedent in the Soviet Bloc that is bound to hold the close attention of military and nonmilitary officials alike in other socialist states.

Schooled in Communist dogma, the officers would appear to hold the same ideology, the same political vision, as Poland's civilian Communist leadership. Military publications and institutions do take a notably hard-line stance on just about everything, but military officials seem to pride themselves on being more pragmatic than dogmatic. Whether or not they bring a distinctive style to governing Poland, military personnel have come to represent a significant rival faction for power in Communist ranks.

"As a senior Polish official conceded to me," said a western diplomat in Warsaw, "two institutions haven't been affected by the turmoil of the past few years--the Roman Catholic Church and the Army."

Possibly to protect the image and morale of the armed forces, regular troops were actually used sparingly to effect the military crackdown. About 8,000 out of the total 317,000 personnel carried out assignments related to martial law, according to Polish and western reports. Army troops deployed in December 1981, when military rule was declared, were already being withdrawn by the following spring and had virtually disappeared from public view by the summer of 1982.

The main burden of repression fell instead on carefully screened, crack units under the command of the Internal Affairs Ministry--notably, the Internal Security Corps and the motorized ZOMO riot police.

The reluctance to deploy regular troops may have reflected doubts in the Warsaw leadership about the loyalty of rank-and-file soldiers, as well as a wish not to taint the armed forces by using them to repress their own society. About 70 percent of Poland's 210,000-strong Army is made up of draftees serving two-year stints. Many of them were committed to Solidarity.

The military got more involved as commissars in charge of pivotal administrative and economic jobs around the country. The officials who filled these posts generally were drawn not from combat divisions but from administrative units and from the specially indoctrinated political officer corps, 85 percent of whose members are listed as Communist Party members.

These officers dictated orders from the tops of ministries, from city and regional government headquarters, from managerial offices in factories, mines, transportation depots and other operation centers.

In recent weeks, newspapers have carried a number of interviews with prominent generals casting the military as Poland's savior. The officers have described with evident pride their efforts at restoring discipline and order in civilian establishments that they suggest had become rife with incompetence.

In one interview, Gen. Wladyslaw Morz, who effectively took over as mayor of Warsaw when military rule was announced, complained of sloppy planning, misuse of technical facilities and general lack of discipline when he arrived on the scene.

"I was often surprised that the people responsible for these matters seemed unable to grasp some very obvious things," Morz said.

In another interview, Gen. Tadeusz Tuczapski, a deputy defense minister, said that military commissars were widely regarded by people as a "last chance" for resolving many longstanding grievances.

In fact, the military's involvement in political affairs began months before martial law was imposed and not long after the rise of Solidarity in the autumn of 1980. Jaruzelski, named prime minister in February 1981, started to move trusted associates into place. He has tended to draw from the political directorate of the Army, where he formerly served.

With Jaruzelski's selection as party first secretary in October 1981, Poland became the first Communist country in which leadership of the party was handed to a career military officer. Moreover, Jaruzelski kept his other posts.

All this, despite the specter of "red Bonapartism" that haunts the Soviet Bloc--the concern that the military might become an independent source of power and authority within the communist system.

The armed forces were long thought to be averse to being used to correct economic or political mismanagement. But the military leadership was part of the communist establishment feeling threatened by Solidarity.

"While the Army's protective umbrella over the authorities folded after martial law was lifted, the Army will continue to extend its support and assistance to them in other forms," Tuczapski, the deputy defense minister, told the Army's daily paper recently. "Although the Army pulled itself back to the second line, soldiers cannot be indifferent to any problems of vital importance for Poland."

He said every soldier should be "an economic and social activist" as well as a Marxist, and he directed ex-commissars to "maintain contact" with the factories and officers where they worked during martial law.

Top civilians in the party seem to accept the military's continued involvement with equanimity. Jerzy Wiatr, head of the Institute of Basic Problems of Marxism-Leninism, said, "I've heard some people make derogatory comments but these are opponents of Jaruzelski just using the bogus of militarism against him."

Generals hold the sensitive Cabinet posts of administration, internal affairs and mining-energy. The chief of the Office of the Council of Ministers is also a general.

Jaruzelski installed Gen. Tadeusz Hupalowski as head of the Supreme Chamber of Control, a parliamentary body that checks on government operations. The move unseated veteran party infighter Mieczyslaw Moczar, who had used the office to build a personal power base.

Despite the prevalence of military administrators, the armed forces do not appear to have received favored budget treatment. Poland's military budget, say western diplomats here, is rising at about the same rate as the overall budget.

With 15 divisions, Poland's is still the largest fighting force among non-Soviet Warsaw Pact armies and is considered the bravest.

In a speech in July on the day before martial law ended, Jaruzelski announced he would be stepping down in October as defense minister, a portfolio he has held for 15 years.

Some western diplomats speculate that the move may be in deference to Soviet concerns about Jaruzelski's several titles, or perhaps a foreshadowing of a rumored restructuring that would create a strong presidency for him.