When my pump died
it would start humming, more when it was hot out. It progressivly got worse then it started affecting performance, mostly under high fuel usage conditions. If the AC was on it wasn't as bad (there's a fuel cooler.) When I changed them (I have two) the problem went away and I noticed one of them rattled when I shook it.
The fuel system is a constant flow system, what isn't used is returned to the tank. But if your noise goes away when you take the gas cap off it may be a seperate problem, and a cheeper problem, fuel pumps aren't cheep.