title: Bombyx mori
context: After they have molted four times, their bodies become slightly yellow and the skin becomes tighter. The larvae then prepare to enter the pupal phase of their lifecycle, and enclose themselves in a cocoon made up of raw silk produced by the salivary glands. The final molt from larva to pupa takes place within the cocoon, which provides a vital layer of protection during the vulnerable, almost motionless pupal state. Many other Lepidoptera produce cocoons, but only a few—the Bombycidae, in particular the genus Bombyx, and the Saturniidae, in particular the genus Antheraea—have been exploited for fabric production.
question: When do silk worms form cocoons?
answers: After they have molted four times