Typically this is from "old tank syndrome" which is where debris accumulates in your gravel, and counteracts the buffers in the water causing the tank's pH to be unstable. Normally this is measured in hardness (GH and KH). What I would do, is test the GH and KH of the tap water, and then of your tank. I use API liquid testers for this, as they are really reliable.
If either or both are low (usually less than 3) from the tap, usually I would recommend adding some kind of buffers to keep the pH stable.
Most of the time, the problem is in the tank. Many times people with UG filters let debris accumulate below the filter plate. Also, debris in filters and just in the gravel in general can cause problems. If your GH and KH is lower than that in your tap, then the problem lies in a dirty tank.
How often do you normally gravel vacuum? Is it solid black, or only cloudy when you gravel vacuum?