They’re usually not actually compliments. Most of them don’t actually see the woman. It’s okay to respond; that’s just giving them what they need. They want to be acknowledged and you’re giving them that. It’s giving to someone who is aggressively trying to get something from you. It’s all fine; it’s just what’s happening.
Many women experience getting followed for blocks, spat at, called a “cunt,” and even raped, simply because they would not “smile” on command. Any form of engagement, even saying “thank you,” can, and often does, lead to an escalation of aggression.