Learning what to learn about and generalizing from one situation to another is arguably one of the most fundamental abilities that distinguishes higher intelligence. The effects of the resultant schemas can be seen in simple motor or sensory processing, in which learning one skill facilitates acquisition of another—knowing how to ski helps us learn to snowboard—but they are also evident in experience-based improvements in more abstract problem-solving skills. From buying groceries to planning experiments, we get better at navigating new situations if we have experienced similar ones in the past. Yet despite its ubiquity, we have little insight into the neural basis of this process. Here we address this by showing that using prior knowledge to facilitate learning is accompanied by the evolution of a neural schema in the orbitofrontal cortex. Single units were recorded from rats deploying a schema to learn a succession of odor-sequence problems. With learning, orbitofrontal cortex ensembles converged onto a low-dimensional neural code across both problems and subjects; this neural code represented the common structure of the problems and its evolution accelerated across their learning. These results demonstrate the formation and use of a schema in a prefrontal brain region to support a complex cognitive operation.