High-ranking White House officials are free to lobby most of their old colleagues as soon as they leave the government, despite an apparent ban on such influence-peddling, members of a Senate Governmental Affairs subcommittee complained yesterday.

Sen. Carl Levin (D-Mich), the subcommittee chairman, said loopholes in federal conflict-of-interest law and slipshod administration by the Office of Government Ethics (OGE), a part of the Office of Personnel Management, were responsible for "the mess."

Federal law makes it a crime for former senior officials to lobby at their former agencies within a year of leaving, but under a system known as "compartmentalization," OGE can undercut that rule by splitting an agency up into separate "compartments." Senior officials of one "compartment" can legally lobby officials in another as soon as they leave the federal payroll.

As a result, Levin said:President Reagan's national security adviser, Frank C. Carlucci, if he left the government, could try to influence former subordinates on the National Security Council staff without a day's delay. U.S. attorney Rudolph Giuliani of New York could begin lobbying old colleagues at the Justice Department, where he was once associate attorney general, as soon as he returned to private practice. But no senior officials from the Department of Agriculture, which remains a homogenized unit of 105,000 employes, can lobby within the department without first observing the one-year wait.

This is because the Executive Office of the President and the Justice Department have been divided into compartments while the Agriculture Department has not, Levin and others explained at a hearing of the subcommittee on oversight of government management.

"We have an absolutely crazy-quilt situation," said Sen. Ted Stevens (R-Alaska). "We ought to have a simple, clear line." He said he considered compartmentalization impractical and inequitable.

Levin concentrated most of his fire on the White House, where the 1,500-member Executive Office of the President was carved into nine pieces on March 7, 1983.

The White House "compartments" include the White House office staff, Vice President Bush's staff, the National Security Council staff, the Office of Management and Budget, the U.S. Trade Representative's office, the Council of Economic Advisers, the Council for Environmental Quality, the Office of Science and Technology Policy and the Office of Administration.

The head of each compartment -- for instance, White House chief of staff Howard H. Baker Jr. -- would have to observe the one-year wait before lobbying any other compartment, but their deputies and assistants would have to heed the rule only within their individual units.

As a result, Carlucci -- listed by the White House as an assistant to the president under Baker -- would be free to lobby officials on the NSC staff even though that is where Carlucci is the boss, Levin said.

OGE Director David H. Martin took exception to the Carlucci example. He insisted that Carlucci is "the head . . . the chairman" of the NSC and could not lobby his staff right away.

Levin pointed out, however, that President Reagan is chairman of the NSC, that Carlucci is not even a member of the council, and that the White House, in an official listing for the subcommittee, counted Carlucci as a member of the White House staff compartment.

Levin also said the subdividing of the White House has been cited as one of the reasons former White House aide Michael Deaver was not indicted for his lobbying contacts with OMB officials, although those contacts were part of the investigation that led to Deaver's recent indictment for perjury. By contrast, former White House aide Lyn Nofziger is under investigation for his lobbying work, Levin said, because Nofziger left the White House the year before OGE sliced it up.

The hearing's first witness, former Carter White House aide Stuart Eizenstat, said he felt strongly that the Executive Office of the President should be regarded as a single unit for the purposes of conflict-of-interest laws, even though colleagues in the waning days of the Carter presidency unsuccessfully sought to compartmentalize it.

"The facts are that in every modern presidency, the nine agencies designated as 'separate and distinct' in fact work in close, intimate and regular contact," Eizenstat said, adding that they would serve the president poorly if they did not.

Witnesses from the General Accounting Office, which performed a special study, said the White House fragmentation was approved by then-acting OGE Director David Scott, Martin's predecessor at OGE, in response to a request from then-White House counsel Fred Fielding. The GAO officials said a check of OGE records produced no "plausible explanation" for the split-up, adding that the process was "largely undocumented."

Martin defended the White House compartmentalization as done properly, even though some paperwork might be missing.

Levin said compartments were meant to be created only in "exceptional and clear cases" where an agency, such as the Social Security Administration, exercises "wholly separate and distinct functions" from the department in which it is lodged. A bill recently approved by the Senate Judiciary Committee would eliminate the practice altogether.