NORFOLK, Va. (AP) _ The spy ring allegedly headed by John A. Walker Jr. may have leaked information on how the Navy tracks Soviet submarines, a key aspect of anti- submarine warfare, experts said Wednesday.

''Depending on how much technical knowledge they had, they would have had a tremendous ability'' to pass on such secrets, said retired Navy Capt. James T. Bush, who now works at the Center for Defense Information in Washington, D.C.

Four men have been charged in the alleged spy ring, which authorities say may have operated since at least 1968. Three of the four men are related.

Submarine detection is an area in which the United States has long been superior to the Soviets, but the gap has narrowed in recent years, Bush said.

During the 1960s, the Navy spent billions of dollars to learn how to sift background noises from the distinct sounds that submarines make. Now, the Navy can locate Soviet vessels with equipment sensitive enough to note the ''signature'' of each submarine in the Soviet fleet.

In May 1978, two Soviet citizens were jailed in New York on charges of offering to pay a Navy officer thousands of dollars for anti-submarine warfare secrets.

At the time, Navy officials said the Soviets were unable to detect when their subs were being tacked by sonar and had no such tracking ability of their own.

If Walker ''gave the Soviets sensitive information, it was probably translated into improvements in technology and procedures,'' said retired Vice Admiral Arnold F. Schade. ''We do know that the quality of Soviet shipbuilding has improved.''

Schade, who spoke by telephone from his Florida home, was the commander of Submarine Forces Atlantic in Norfolk from 1967 to 1969, when Walker was a communications officer there.

''Walker was right at the nerve center in our tracking operations,'' said retired Rear Adm. Eugene Carroll, a 37-year Navy veteran. ''He was in a position to give them information on how we track their subs and how successful we were.''

Carroll said the Soviets could have learned more than they let on.

''If I were a Soviet commander, when I got that information I wouldn't show much. I'd keep pretty much the same pattern of operations and let us think everything was under control, knowing that in a crisis I could switch to new techniques,'' Carroll said.

Carroll and Schade said the Walker case was the most serious breach of Navy security they could recall.

In addition to submarine tracking leaks, Carroll said, the likely exposure of the Navy's secure communications system was ''potentially the greatest damage by far.''

Walker and Jerry A. Whitworth, who was arrested Monday in Davis, Calif., had high-level security clearances and worked with crypto communications .

Carroll said that if crypto key lists and documents on cryptographic codes and techniques went to the Soviets, ''we're going to have to do major research into our vulnerability.''

But David Kahn, an expert on coded communications, said computerized coding systems make it hard for a cypher to be broken.

''Modern cryptography systems are devised so that even if you have the entire cypher machine, without the keying information, you can't break it,'' Kahn said.

A list of keys, which are changed daily, would not be useful without a code machine - and there is no indication the machines were passed on, Kahn said.

Two other men charged are Walker's brother and son, Arthur J. Walker, 50, and Michael Lance Walker, 22. All three are from the Norfolk area. The FBI says more arrests are possible.