Last June, al-Shabab militants attacked an Ethiopian base in the Somali town of Halgan, one of several raids on African Union military camps. The Ethiopian troops repelled the attack, causing massive casualties.
One of the al-Shabab fighters, Mohamed Daud Mohamed, known as Mohamed Dhere, said his unit lost 45 men.
"It was a difficult fight; we left behind the wounded as we didn't have a chance to evacuate them. ... Everyone ran for their lives," he told VOA's Somali service.
For Dhere, 20, it was a lesson. He decided to desert al-Shabab, but said his commanders were suspicious. After eight months, he found his opportunity in February when his commander sent him to attend a seminar.
Instead, he contacted relatives, who handed him over to the government. He is living at a rehabilitation center for militants in Mogadishu, one of 70 former al-Shabab members recently granted amnesty by the Somali government.
Abdirashid Ibrahim Mohamed directs the program to reintegrate former al-Shabab foot soldiers and low-risk individuals into society. He saod defectors receive food, exercise, health checkups, education and vocational training.
They also get religious lessons, aimed at guiding them away from the al-Shabab's radical views of Islam.
"There are clerics who give awareness lectures, hold debates about the position of Islam, about extremism," Mohamed said. "Normally when these youngsters defect from al-Shabab, they already know that what they were involved in is wrong, and they came to us to save themselves."
The amnesty and rehabilitation program was launched in 2009. The Somali government says thousands of militants have passed through, although Mohamed says only 800 have come through the Mogadishu center. There are also reintegration programs in Baidoa, Beledweyne, Huddur and Kismayo, each treating 30 to 70 men.
Mohamed says those who completed the retraining in the past have moved on to run businesses, pursue education or just return to society. Security sources say others have joined the army or decided to work with the government.
Defector turns rogue
But not all graduates of the program undergo genuine change.
Omar Mohamed Abu Ayan, a former al-Shabab member, said the rehabilitation program is not changing the ideology of hard-core militants who claim to have defected but actually have "other agendas" in mind.
"For some they use it to continue their acts, such as suicide attacks, and for some others they just want to clean their names," he said. " … Even those with other agendas, if they could get a real doctor who could treat them ideologically from misinterpretation and deviation in their thinking, they would have changed."
By "a real doctor" he meant someone who understands the extremism of the defectors and can lead them toward a more moderate position.
One who had another agenda was Abdirahman Mohamed Abdulle, who was welcomed by authorities in Kismayo in 2013. He earned their trust and was assigned to the security detail of Isse Kamboni, Jubbaland region's chief intelligence officer.
Abdulle assassinated Kamboni and then escaped back to al-Shabab. He was in communication with the militants all along. Three years later, Abdulle became a suicide bomber in the January attack on Mogadishu's Dayah hotel that killed 28 people.
It's not clear whether Abdulle went through a rehabilitation program or authorities simply trusted him too quickly.
Ayan said militants are not going to change their ideology by being in a center, learning vocational techniques, and talking to military or intelligence officials. He said the government needs people "who have direct knowledge of the environment these young men departed from, who discuss and debate them about ideology."
"You need people like Robow," he said.
Mukhtar Robow is a founder of al-Shabab and the group's former deputy emir. He defected to the government last month, five years after he became inactive with al-Shabab, because of ideological differences with the group's then-supreme leader, Ahmed Abdi Godane.
Robow is too prominent and powerful to go through the regular rehabilitation program, but Ayan said that if Robow is willing to cooperate, he could help change the minds of other hard-core militants.
"I believe if Robow accepts to work with the government, they should use him on the ideological approach," he said.
Rashid Abdi, an International Crisis Group analyst, said Robow's defection could "incentivize" more defections, if the government publishes a clear policy on how it will treat defectors. "Many people will abandon al-Shabab if they know they are secure," he said.
But Abdi said if the government is too kind to the militant leader, it will send the wrong signal.
Critics say the government's stance toward defectors is inconsistent, because low-profile al-Shabab members are usually tried and sometimes executed when they turn themselves in.
Hussein Moallim Mohamud, a former counterterrorism officer and national security adviser, said the amnesty program has led to the defection of up to 30 high-profile al-Shabab members.
"When a top official with information defects, that causes a big problem for al-Shabab," he said. "I believe the program is equally as important as military operations against al-Shabab."