YouTube screengrab

A brief close-up of a man who appears to be Sgt. Bowe Bergdahl in a video released by the Taliban that purports to show Bergdahl's handover to U.S. authorities. YouTube screengrab

Whether or not he deserted, Sgt. Bowe Bergdahl survived five years with the Taliban, a feat that requires mental toughness, resiliency and the ability to set tiny "micro-goals" to make it from one day to the next, according to military and psychological experts.

All soldiers like Bergdahl receive SERE (Survival, Evasion, Resistance and Escape) training once they join the military, according to Cmdr. Amy Derrick-Frost, a spokeswoman for the Department of Defense.

Level "A" includes how to find food, shelter and navigate; and understand the U.S. military code of conduct, rules of ethics that govern how a service member should act if captured. The code includes a pledge to escape, refuse to reveal information and maintain discipline among prisoners.

Brain-Zapping Implant Could Aid Injured Soldiers

"The Code of Conduct is what is expected of a servicemember," Derrick-Frost said.

Level "B" training is for personnel who are deployed in forward combat areas, including Navy, Army and Air Force air crews. Level "C" is more intense and physically demanding, and is usually given to officers and others who may be at greater risk of capture because they have more operational knowledge of the battlefield than enlisted men.

As an Army private in 2009, Bergdahl probably got just the basics, according to a former member of the Army's Delta Force unit who asked his name be withheld because he still conducts training for the military.

"I don't think anybody really talks about the psychological aspects about getting captured," he said. "It's not what they are focused on. The focus is on escape."

One of the paradoxes of SERE training is that if you prepare too much for the possibility of captivity, according to the former trainer, it may make it more difficult to put yourself in danger in the first place.

"To tell someone of strong mind and body and type that he could be affected by psychological impact of a capture might not bode well with them," he said. "Everyone wants to think they are Rambo until they get into a Rambo scenario."

From 2003 to 2011, more than a dozen U.S. soldiers were captured in Iraq, including Pvt. Jessica Lynch and five others who were rescued in 2003 after seven days. Others haven't been so lucky, including many who were tortured and killed. Several U.S. civilian contractors have also been abducted in Iraq, while Alan Gross, a former contract worker for the U.S. State Department, has been held in a Cuban prison since December 2009.

Photos: Cold War-Era Satellite Images Reveal Lost Cities

Experts say hostages who are able to survive must maintain continuity with their past, as well as facing the prospects of their future.

"In the very beginning stages, the first few days or weeks is taken up with wondering whether you are going to be killed," said Laurence Miller, a forensic and clinical psychologist in Boca Raton, Fla. "When it's apparent that you won't be killed, the question becomes how long will this take? You tell yourself that eventually you will be free. That people in outside world are continuing to get you released. Think of as many things you can do to connect to your old life."

Keeping hope alive may involve setting tiny goals that eventually lead to bigger ones, Laurence said.

"It may be as simple as let me make it to the next meal so can I ingratiate myself with guards and get another ration," he said. "You make a little goal, keeping the long view but laying down tiny pebbles on the way."

Bergdahl is recuperating in an Army medical facility in Germany. He hasn't yet spoken about his captivity, how he was captured, or whether he deserted his post.

"To Bergdahl, it may have seemed a good idea at the time," said the former Delta Force soldier. "Maybe they were cool to him for first 15 minutes then they dropped the hammer. I don't believe he was mentally prepared for anything. He thought the outcome was going to be different."