it really depends on the personality of your fish and your shrimp.
I had a few last a really long time until my female evil decided to kill all but one. And he lasted for a good few months after that, he's fight the females off at dinner time. But it's only a 5 gallon, my friend who has a 10 has never had her bettas attack the shrimp