Taylor Swift knows she dates men who are ''dangerous'' and ''bad'' for her.

The 23-year-old singer - who is currently romancing One Direction star Harry Styles and has previously been in relationships with Jake Gyllenhaal, Joe Jonas and John Mayer - says her new single 'I Knew You Were Trouble' is inspired by a ''toxic relationship'' that stems from a good girl falling for a bad boy, and she admits it is based on personal experience.

She told MTV News: ''I had just gone through an experience that made me write this song about knowing the second you see someone like, 'Oh, this is going to be interesting. It's going to be dangerous, but look at me going in there anyway.

''I think that for me, it was the first time I ever kind of noticed that in myself, like when you are curious about something you know might be bad for you, but you know that you are going to go for it anyway because if you don't, you'll have greater regrets about not seeing where that would go, but I think that for me it all went along with this record that was pushing boundaries, like the sound of this record pushes boundaries, it was writing about something I hadn't written before.''

The 23-year-old country star believes people go through different ''phases'' of what they are attracted to and just because you like bad boys now doesn't mean you still will in the future.

She added: ''I think it's just like an opposites attract kind of thing. I don't know that all good girls are only attracted to all bad boys, I think everyone goes through phases as to what interests them.''