Well Steve Vai joined my dad's band right around the time when I actually started playing guitar. So he gave me a couple of lessons on fundamentals and gave me some scales and practice things to work on. But I pretty much learned everything by ear.
Even if you're improvising the fact that beforehand you know certain things will work helps you make those improvisations successful. It really helps to have a certain amount of knowledge about musical structure.