Swift wrote the song on a piano before bringing it to frequent collaborators Max Martin and Shellback to add a frenzied synthy backing track with heavy drumbeats. She recalled how the post-chorus sound came to her in a dream during the iHeartRadio Reputation release party:
"I brought it into them and I was trying to explain the production. I had had a weird dream and I'd woken up with this – you're like 'here we go again.' I'd woken up with this sound in my head that was like this, like, it was a sound that was so hook-y and so catchy that I knew it would have to be in a song because it was that annoying. It wouldn't stop going around in my head, and the sound was [makes noise imitating post-chorus]. Like, 'after the chorus that's what I want to hear, but I don't want it to be my voice, I want it to be an instrument.
What instrument is that?' I was, like, playing the voice memo to Max [Martin] and he's like, 'oh, there's not an instrument that can do that, but what we can do is we can take your voice doing it and pitch it down so that it sounds like an enchantress, slash a dude. So that's what you hear after the chorus."