The 43-year-old was in Frew Terrace, Irvine, North Ayrshire, when he was attacked and beaten by at least four men at about 11.55pm on Saturday.
The man made his way home, where he was helped by neighbours and taken by ambulance to Crosshouse Hospital in Kilmarnock, East Ayrshire.
He needed surgery for a slash wound and was treated for other cuts and bruises, police said.
Detective Constable Alex Greig said: "The man had been out for the night and was making his way home when he was attacked for no apparent reason by a group of men, all believed to be in their early 20s.
"It was a vicious and unprovoked attack which only stopped when it is believed one of the men recognised the victim and urged the others to stop.
"Anyone with information is asked to contact Saltcoats CID on the non-emergency number 101 or Crimestoppers on 0800 555 111 where details can be given in confidence."