Rep. Gerry E. Studds (D-Mass.) was knocked down and beaten on a Dupont Circle area sidewalk early yesterday morning by two men who approached him from behind as he was walking to his home nearby, authorities reported. Studds suffered cuts and bruises but was not seriously injured, an aide said.

Shortly after the attack in the 1500 block of 17th Street NW, two 19-year-old Montgomery County men were arrested by uniformed Secret Service officers who happened to be in the area and were alerted by witnesses. The suspects were charged with assault on a member of Congress.

The attack "appears motiveless by all accounts," said Steven Schwadron, an aide to Studds.

One of the suspects, identified as Thomas Carter, of Gaithersburg, was quoted in a complaint filed by a Secret Service officer in U.S. District Court here yesterday as saying after his arrest, "It seemed like the thing to do at the time." The other suspect was identified as James Byrne, of Silver Spring.

In the past few years, incidents of attacks on gay people have been reported in the Dupont Circle area. Studds, who was elected in 1972, has described himself publicly as gay, but authorities said there was no indication that the attack was motivated by his sexual orientation.

According to authorities, Studds, 53, had had dinner at the home of a friend and was walking home when the attack occurred. He was two blocks from his friend's home and about a block from his own when he was approached from behind by three men, witnesses said.

According to the court complaint, the witnesses said Studds was kicked and beaten "without provocation." Knocked to the ground, Studds was then kicked and beaten around the head, the complaint said.

After witnesses offered descriptions, the complaint said, a Secret Service officer picked up two men at 18th and Q streets NW. A third man was stopped by police but released.

Studds was treated at the scene and saw a doctor later, Schwadron said. He said the legislator conducted business as usual in his office yesterday and then went home to Cape Cod for the weekend.