The orbital frontal cortex (OFC) has long been linked to goal-directed, flexible behaviors. Recent evidence suggests the OFC plays key roles in representing the abstracted structure of task spaces, and using this representation for flexible inferences during both learning and choice. Here, we review convergent evidence from studies in animal models and humans in support of this view. We begin by considering early accounts of OFC function, then discuss how more recent evidence supports theories that have re-cast OFC's function as representing the structure of a task or environment for flexible inference. Finally, we turn to neural recording studies that provide insights into the underlying representations and computations the OFC may implement in coordination with other brain areas. (PsycInfo Database Record (c) 2021 APA, all rights reserved).