PROJECT SUMMARY Genetic programs build neural circuits that guide innate behaviors; they also implement mechanisms that endow these circuits with functional flexibility. Determining how these programs work is essential for providing a conceptual framework for understanding typical and pathological states of human neural circuits. However, even in simple nervous systems, these mechanisms are not well understood. Sex differences provide a unique entry point for understanding flexible innate behaviors in model systems. Additionally, they could also help illuminate mechanisms that bring about sex bias in human neuropsychiatric conditions like autism spectrum disorder and anxiety disorders. Here, we propose studies using the exceptional tractability of the nematode C. elegans to advance our understanding of the genetic mechanisms that specify innate behaviors and provide them with state-dependent plasticity. In recent work, we have found that a single pair of C. elegans chemosensory neurons called ADF plays a key role in determining the valence of the behavioral response to ascaroside-class sex pheromones. In particular, the sexual state of the ADF neurons is sufficient to determine whether an individual will be attracted to or repelled by a pheromone mixture, regardless of the biological sex of the rest of the body. In this work, we will take advantage of the unique opportunities provided by this system to (1) understand how genetic sex implements functional differences in shared neural circuitry, (2) identify the means by which a conserved neuromodulatory pathway (PDF signaling) differentially influences pheromone- mediated behavior in both sexes, and (3) determine how food availability influences circuit function to provide a state that is permissive for the behavioral response to pheromones. Our results are likely to significantly advance the understanding of basic principles by which genetic programs sculpt the physiology of neural circuits and specify their ability to generate flexible innate behaviors.