Reliable figures are hard to come by. Somalian government spokesman Abdirahman Omar Osman says there have been at least 500 defections in recent months. An African Union spokesman, Lt. Col. Paddy Ankunda, also said the numbers were rising.
A fighter who defected about four months ago and now lives at the government-run program spoke to the Associated Press about his old and new lives.
Mohamed Saeed, 18, said that those considering defecting didn't dare share plans with even their closest battlefield friends. Trust, he said, could get you killed.
As al-Shabab has lost its profit centers - the markets in Mogadishu that the extremists once taxed, for example - life on the battlefield became harder, Saeed said. Fighters often ate only one meal a day.
"Food was scarce," he said. "Worse, mortars were raining down over us. You can't retreat. Other armed fighters were deployed behind us to kill us if we tried to move back from the tanks shelling us."
Al-Shabab is estimated to have several thousand fighters. It is Somalia's most dangerous extremist group, espousing an ultraconservative brand of Islam. It has imposed harsh social rules in areas it controls, much as the Taliban did during the 1990s in Afghanistan.
Hussein Arale Adan, a member of parliament, cautioned that not all of the defectors are to be trusted. He said one who joined the Somalian army carried out a suicide attack against the presidential palace.
"The immediate integration of militant defectors into the army without enough rehabilitation is a wrongheaded decision," he said.