When does the pace bike leave in Keirin? I understand the pace bike gets the pack up to speed, but of the 8 lap race how do they decide which lap to bring the pace bike off?

Is it based on speed?
The UCI regulations specify not a distance to be traveled but rather the distance remaining: no matter the length of the track, the pacer pulls off between 600 and 700 meters before the finish line. Thus, if the track is 250 meters long the pacer pulls off about 2.5 laps before the finish; if the track is 333 meters long the pacer pulls off 2 laps before the finish; and if the track is 400 meters long the pacer pulls off 1.5 laps before the finish.

(R. Chung posted this comment in 2012, but has not returned to make it into an answer.)