Up to 2,000 Americans got unexpected gifts from Uncle Sam this month--Social Security checks with overpayments averaging about $5,000 apiece.

In the latest glitch of the Social Security Administration's problem-plagued computer, the agency sent checks to retirees with overpayments totaling $10 million.

Or, as commissioner John Svahn explained it to a House Ways and Means subcommittee yesterday: "A software problem caused the computers to convulse."

The agency found out, Svahn said, "because some beneficiaries walked into the office and said, 'I think there's a mistake here.' "

The inaccurate checks went to beneficiaries who continue to work. Their checks are supposed to be offset by the amount of their earnings above a minimum limit--$6,000 a year for those 65 and over, and $4,440 for those aged 62 to 64.

The beneficiaries submitted earnings reports to the agency, which was supposed to use those reports in adjusting the size of the retirees' checks. But instead of merely adjusting the checks, the computer sent out an entire year's worth of benefits.

Svahn said officials are contacting beneficiaries in an effort to get the money back. In some cases, he said, a collection schedule would be set up; in others, future checks would be reduced by the amount of the overpayment.

Svahn recently announced a five-year, $479 million program to modernize the agency's computer system. The computer is up to three years behind in recording wage records, four years behind in recomputing benefits and facing a backlog of 120,000 hours' work.