Is it necessary to pray the entirety of 11 rak'ahs in taraweeh in congregation?

Assalamualaikum warahmatullahi wabarakatuh

I know theres discussion between taraweeh being 11 or 20 rak'ahs but eitherway is it necessary to pray the entire thing or can I leave early during one of the breaks? So far I know that you pray 2 sets of 2 rak'ahs then take a break, like this: 2x2 > rest > 2x2 > rest, etc
Jazakallah khair