With the machine cold and a blind basket in the portafilter, gain access to the solenoid portion of the three-way valve and rest a few fingers on the solenoid itself. Push the brew button - you should feel the solenoid activate and close off the drain connection in the valve body and no water should flow from the group.
With the machine warm, perform the same test. If at this time, you see flow from the 3-way valve drain connection, did you also feel the solenoid activate? If so, let the machine cool, unplug the wall connection, and disassemble the 3-way valve. Use this site as a guide:
http://members.lycos.nl/behindespresso/
Soak the valve in cleaner for an hour or so and reassemble.
If you do not feel the solenoid activate when the machine is warm, test for voltage at the solenoid valve connections. If you have voltage (and be cautious with these live circuits), the coil is losing its continuinty with rising temperature and needs replacement.
If you do not sense any voltage at the coil when the machine is warm, there is possibly a crack in the circuit board that powers the 3-way that is opening up with temperature.
Hopefully a LSM expert will chime in on the possible fix(es).