The Reagan administration notified Congress yesterday that it intends to exempt military personnel from defense spending cuts that will be required under automatic deficit-reduction provisions of the Gramm-Rudman-Hollings law.

Budget Director James C. Miller III, in a letter to House Speaker Jim Wright (D-Tex.), said the decision "is considered to be in the national interest."

Under a revised version of Gramm-Rudman-Hollings, which President Reagan signed last month, federal spending would have to be cut by about $23 billion in fiscal 1988, which started Oct. 1. The law specifies that half of that amount would have to be absorbed by the Defense Department.

But a provision of the law gave Reagan the option of exempting military personnel accounts from the sequestration of funds that would take place under the automatic budget-cutting mechanism.

A Pentagon analysis released earlier last week said that spending cuts required under the revised deficit-reduction law could have forced the dismissal of 275,000 uniformed personnel or could have sharply reduced training, maintenance and weapons-purchasing.

In the letter to Wright, Miller said the administration concluded that it must "safeguard the resources necessary to compensate the men and women serving to defend our nation and to maintain the force levels required for our national security."

The decision before the White House and budget office was whether the portion of automatic budget cuts to be absorbed by the Pentagon would include all facets of defense spending, including money spent on personnel.

"It is recognized that this action will adversely affect other defense programs, particularly those related to readiness," Miller's letter said. "It is essential, however, to avoid causing financial hardship to individual service personnel and a major upheaval in military manpower projects."

Pentagon comptroller Robert W. Helm, who prepared the analysis of the effect of Gramm-Rudman-Hollings on defense spending, said in an interview that a decision to protect all military personnel would, in essence, force an additional $5 billion in cuts on other defense budget accounts.