The beetle larva has four instar stages. Development of butterfly wing patterns begins by the last larval instar. As the caterpillars grow larger into the second larval instar, they become yellow green. The final larval instar, the prepupal stage, creates a cell in which the insect pupates. In later instars, the head becomes yellow, and in the final instar, becomes bright red. The larvae take on a green appearance in the fourth instar. The young stage larvae (1st instar) will eat some of this material. At the end of the sixth instar, pupae start forming. After molting to the fourth instar, the caterpillar becomes green. Caterpillars live and feed in groups until the fourth instar when they become solitary. Nymphs are black until the third instar. In females the ovipositor becomes visible at the third instar. After it moults into its last instar, it sets off wandering to seek a female. The heart appears just as the caterpillar is reaching the end of the final instar. This gland develops in the second instar.