Just from having my own Shrimp / Goby pair I would say 3" is them mimimum I would ever go. The shrimp built a tunnel system under the live rocks for him and the Goby. If I had less sand I think it wouldnt' be enough room for them to be happy in there. The shrimp and the Goby sleep in a main "cave" that the shrimp built. The shrimp seals off the entrance at night with some empty shells and extra sand.
The shrimp is constantly at work perfecting the tunnels and moving sand around, I think it keeps him happy and builds up those muscles (JK on that last comment).
I don't think the Goby really does any work, he just hangs with the shrimp and guards him when he comes out in the open. It's funny watching the Goby go under the rocks on the left side of the tank, then appear a few seconds later on the right side. LOL.