A couple of months ago, this paper made the rounds: Absolute pitch in involuntary musical imagery [0]. In a small sample group, nearly half the time (44.7%) when someone was asked to sing their current earworm, were they perfectly in pitch. Random chance would be 8.3%.
It’s a fun thing to try for yourself. Just hum your current earworm into a voice memo, and check the correct pitch against the recording of the original song. You may discover a skill you never knew you had, implicit perfect pitch on involuntary music!
Trying to make this more interesting, reproducing a particular song on demand (there’s references to that too in the paper - it also works better than random chance, but less so than the involuntary kind), I find it works best for songs that start off with a single note, preferably sung. Or then at least you can immediately check whether you were right, e.g. “Tom’s Diner”. I’ve been having a lot of fun humming the first tone to Laufey’s cover of Sunny side of the street [1] whenever I open YouTube. I’m more often right than wrong, and if I was wrong, I can just listen to the whole thing to brighten my day anyways.
[0]: https://link.springer.com/article/10.3758/s13414-024-02936-0