I wasn't persecuted, as such, in middle school or high school. I was a girl, and I was... hm... not socially acclimated enough, I suppose, to believe that defending myself by retaliating to verbal attacks was 'unfeminine' or 'inappropriate.' I grew up in a sarcastic home, and people soon learned that there was easier prey out there than me.
I was fascinated to hear this, because my equal lack of "social acclimation" in this area when I was at school, my facility for sarcasm and quickness to cut down antagonists with words (which I'd learned from my older brothers, I hasten to add, not my parents), had a completely different outcome for me. In fact, it got me into even more trouble than I'd already been in for the capital offenses of being a "weirdo" and a "brain", and seemed to just reinforce my classmates' dislike. Once, when I made a snappy retort to a taunt by one of my fellow sixth-graders, he punched me in the stomach and knocked the wind right out of me. And another kid actually tried to drown me in the swimming pool when I trotted out the old Python joke "Your father smelt of elderberries and your mother was a hamster!"
It wasn't until grade ten or so that the bullying stopped. The shunning went on considerably longer, but fortunately I'd discovered a number of fellow art-geeks by then and we were able to hang out and be nerdy together. I really don't know why my classmates finally stopped picking on me in high school -- it didn't seem to correspond with anything I did or didn't do -- but then, I had never understood why they'd been so keen on abusing me in the first place.
All of which is not to minimize or criticize anything Dragonpaws said, just to observe that a solution that works for one nerd or one situation may not necessarily work for another. (And speaking of which -- Psst! Mom! "Just ignore them and walk away" didn't work either.)