Prime Minister Yasuhiro Nakasone, who arrived in Washington today to attend the Williamsburg summit and for talks with President Reagan, has undergone a sharp political metamorphosis in recent months after a decline in voter popularity brought on by his bid for stronger military ties with the United States.

Like other summit leaders, Nakasone goes to Williamsburg absorbed by domestic politics and, according to analysts here, is determined to use the seven-nation talks as an opportunity to bolster his standing at home by demonstrating his bold style of leadership and a broad grasp of global issues.

Nakasone, whose Liberal Democrats face important elections next month for the upper house of parliament, churned up a storm of controversy here when he appeared to commit Japan to a substantially enlarged defense role in the Pacific during a visit to Washington in January for summit talks with President Reagan.

Nakasone's blunt remarks amplified his mostly negative reputation as a "hawk" on military affairs in a country where strong antiwar sentiments are only gradually changing. The sharp public outcry, and badly slumping support, led Nakasone and his aides to quickly shift political gears by stressing bread-and-butter domestic concerns and a less sharply focused, more statesmanlike stand on diplomatic issues.

Judged by recent public opinion polls here, Nakasone's newly refashioned image has paid off. A survey by the Yomiuri Shimbun, the country's largest daily newspaper, showed that support for Nakasone has rebounded to nearly 40 percent, or about where it was when he came to office on Nov. 26.

In trying to shed his hawkish image, a senior U.S. official here said, Nakasone has not, in essence, stepped back from his earlier emphasis on strengthening defense and economic ties with the United States. In talks with President Reagan on Friday, Nakasone is expected to reaffirm Japan's "unshakable" relations with the United States.

At Williamsburg, however, he appears prepared to play a prominent role in discussions on a wide range of complex issues in a bid to set himself off sharply from past Japanese leaders who have tended to melt into the background of summit proceedings.

"He's trying to show," the official said, "that he's not a man dominated by a single issue. What he's really got to do is show the folks back home that he knows his economics," an area in which he has been considered relatively inexperienced.

In preparation for his summit trip, Nakasone unveiled a five-point formula for Japanese economic policy earlier this month, stressing the need for the government to do away with regulations that unduly fetter private industry.

Broadly philosophical in tone, the statement included few concrete proposals and was dubbed by the Japanese press as a recipe for "Nakasonomics" because of its similarities to the economic beliefs espoused by President Reagan.

Pressing the need for greater cooperation among industrial countries, Nakasone said, "We can't entirely discount the danger of Japan again traveling a road to international isolation if it fails to respond appropriately in the economic area," a reference to the trade wars of the 1930s.

Although Nakasone has refrained from mapping out detailed positions on trade, foreign exchange markets and monetary policy prior to the summit, he has offered strong support for U.S. proposals on nuclear arms control.

Hiyoshi Iijima, an authority on Japanese politics, said, "Nakasone's biggest worry is his image as a 'hawk' and he wants to take a positive position on disarmament . . . despite the fact that the Japanese aren't at all accustomed to playing a major role in East-West relations."

Speaking to Japanese reporters prior to his departure today, Nakasone called for summit talks between President Reagan and Soviet leader Yuri Andropov. At Williamsburg, he said, "we have to build a platform for President Reagan through western solidarity that will make it easier for him to negotiate with the Soviet Union."

Earlier this month, Nakasone sought to stake out what he has called a "strongly moderating role" on the North-South issue during an 11-day diplomatic tour of the five-member Association of Southeast Asian Nations, where he attempted to ease leaders' qualms over Japanese rearmament by pledging to serve as their spokesman at Williamsburg.