With artillery pulled by horses, and crates of perishable noodles, China's Army lumbered into Vietnam three years ago planning to teach Hanoi "some necessary lessons."

For much of the 16-day war, however, China ended up the pupil. The conflict cost China an estimated 20,000 lives and revealed a Chinese Army badly hobbled by obsolete weapons, logistical errors and a communications system so primitive that battle plans were transmitted by foot messengers sent from division to division.

Peking quickly withdrew its forces and declared victory, but the battlefield lessons stuck fast. For the first time in its 56-year history, China's military establishment--The People's Liberation Army--is trying to march into modernity.

The campaign is considered vital if China ever is to become a global power or, in the short run, play an effective role in balancing Soviet military strength in Asia--a role encouraged by the United States. Defense Secretary Caspar W. Weinberger was here last month proposing personnel exchanges and sales of U.S. arms and technology to speed up the modernization process.

Diplomats have long belittled prospects for major American participation in efforts to upgrade the military forces. The government's penchant for self-help, its tight budget and its opposition to the U.S. Taiwan policy all are said to set severe limits on weapons purchases.

Even more compelling constraints become obvious by closely examining the world's largest military establishment. The picture drawn by a dozen foreign specialists here is of a rusty, old-fashioned military machine too far behind to benefit from anything short of massive imports.

Even if China could afford the $200 billion believed necessary to finance such imports, the nation reportedly lacks the technological base and competent personnel to absorb complex weapons systems.

"There's no point to buying large amounts of foreign technology and equipment because no one would know how to use them, maintain them or read the manuals," said a European military attache. "The stuff would just be put in a garage and rust."

China may still buy foreign military technologies and a few defensive weapons, experts said. But the military forces' major thrust in coming years will be to correct the more fundamental problems of infrastructure that now make most imports impractical.

To understand the task of transforming the 4.2-million-member military it is necessary to chart the depths of its deficiencies. An analysis underlines both Peking's limited options on the world stage today and the obstacle it faces in becoming more than a regional power by the next century.

Despite its huge size and success in developing nuclear weapons, the military is regarded as a stumbling, vulnerable giant that is worse off today relative to its enemies than in the 1950s.

Even the best military forces would be hard-pressed to stop a Soviet invasion of China, according to foreign specialists. One expert predicted Chinese troops "would be exterminated like a bunch of rats."

People's Liberation Army Chief of Staff Yang Dezhi warned last year that, failing to upgrade its military, China "would not be able to engage an enemy in modern warfare and may have to pay a much higher price in the event of an emergency."

The problems underlying Yang's pessimism are of staggering proportions. The military's technological levels reportedly lag 20 years behind the superpowers, and its research and development corps is too rudimentary to upgrade significantly weapons that China first began using in the Korean War.

China's Navy lacks the supply lines to venture far from shore, its Air Force cannot fly in bad weather and its Army's bazookas fire shells that would bounce off the advanced armor of Soviet tanks.

Many top officers are aged, too unlettered to write their orders and still committed to Mao Tse-tung's guerrilla war doctrine of the 1930s. There is no rank insignia, which causes grave confusion on the battlefield where commanding officers can only be identified by the number of pockets on their uniforms.

The single exception is strategic weapons. China exploded its first atomic device in 1964 and steadily progressed to the point today where it is nearing a second-strike capability. An impressive arsenal of land-based nuclear weapons includes a few intercontinental ballistic missiles capable of reaching Moscow or California and more than 100 shorter-range missiles.

Last year's successful test-firing of an intermediate-range ballistic missile from a submerged submarine indicated the potential for diversifying China's nuclear force.

Experts said China's nuclear capability still is at least 15 years behind the superpowers'. Its land-based force is propelled by liquid-fueled rockets, which are very slow to fire and vulnerable to preemptive strike. Another four or five years are believed to be needed before a ballistic missile-firing submarine is operational.

Prospects are much dimmer for the military's conventional forces, however. Only 12 of the Army's 200 divisions are mechanized, and most of its weapons are copies of Soviet models designed before 1960 when Moscow shut off military assistance to China.

The workhorse of the tank force--the T54--dates back to just after World War II and cannot shoot as far as Soviet antitank weapons. A new tank is being outfitted with infrared search lights and gun stabilizers, but analysts say it was obsolete even before going into production.

For air defense, the military depends on 30-year-old surface-to-air missiles and a radar system so spotty that it has been known to miscalculate the location of suspicious aircraft by several miles.

During the 1979 war against Vietnam, the single map issued per company turned to mush in the rain. The front went days without food, water and ammunition, which were transported on the backs of inexperienced Chinese peasants. Food stocks--mainly noodles and bean curd--were fresh and quickly went bad.

Equipment was sidelined by simple mechanical troubles because there were no repair or maintenance crews below the division level. Some companies and platoons lost contact with main forces and suffered heavy casualties because they were not supplied with good radios.

Although the Air Force remained grounded throughout the clash, China's bevy of flying antiques would have been no match for the advanced Soviet aircraft operated by Vietnam, according to analysts.

While formidable in number, China's jet fighters are said to be badly outdated in combat capability. Most of them are modeled after Soviet MiGs of the 1950s and 1960s.

Fighter bombers are capable of delivering nuclear payloads. But they are said to lack the speed and electronic countermeasures to survive a bombing mission against a modern and alert air defense system such as possessed by Vietnam.

China's Navy, while second largest in the world, is basically a coastal defense force lacking the air defenses, air cover and supply ships to fight a modern naval war.

The fleet includes hundreds of small patrol boats, about 30 aged combat vessels and 103 conventional submarines that are noisy and easily detected by good electronics. There are no warships larger than destroyer and no aircraft carriers at all.

The Navy's two nuclear submarines still carry no missiles, and its single vessel capable of shooting missiles from below water lacks the navigational and firing power to be effective in war.

China's ability to put nuclear submarines in the water while failing to develop C-rations for its infantry is a paradox that can only be explained by the historically lopsided nature of the military's research and development corps.

Nuclear specialists were spared from the anti-intellectual crusades of Mao's China, and Peking--realizing the prestige and deterrent value of strategic weapons--spent lavishly to develop them.

Other defense scientists and technicians were less fortunate, however. The older generation was badly persecuted during the 1950s, and the Cultural Revolution frenzy of the 1960s and 1970s prevented younger people from taking their place.

China is thus said to be left without the talent pool for a full-scale defense modernization. As a result, defense industries are reported to be outmoded, staffed with unskilled labor and working at 15 to 20 percent of capacity because of new national policies favoring production of consumer goods.

Chinese leader Deng Xiaoping and his ruling faction are committed to upgrading the military as one of the "four modernizations" of Chinese society. Yet modernization has been assigned a lower priority than other economic sectors, and the defense budget--down 25 percent since the 1979 Vietnam conflict--has been frozen at $9 billion annually for the next three years.

Military political Commissar Yu Qiuli has called for a "shake-up" of the officer corps, and new age limits and educational requirements have been established for the upper ranks.

The weeding-out process has begun with the removal of aged, uneducated commanders from nine of China's 11 military regions and 22 of its 28 provincial military districts. Also sent home were 1,000 officers from military headquarters, 10,000 from Peking units and 1,500 from the Air Force.

The old system of promotion based on political purity and seniority has been replaced by competency tests, and three years of college is now mandatory for officers above the platoon level. Military academies closed during the Cultural Revolution are again turning out hundreds of graduates a year.

In additon, badges of rank, which were abolished by Marshal Lin Biao when he was minister of defense in the summer of 1965, will finally be restored on Aug. 1, 1984.

It remains unclear how deeply the reforms will cut through China's hidebound military. Pockets of opposition already have formed, according to reports.

Foreign analysts, however, believe the gradual restructuring may offer China its best hope of becoming a military power in coming decades.