New recording technologies are transforming neuroscience, allowing us to simultaneously measure neural activity and natural behavior with unprecedented scale and precision. To realize the potential of these massive datasets, we need computational and statistical methods that can reveal simplifying structure in high dimensional neural and behavioral time series and help draw connections between these domains. Such methods must balance two contrasting objectives: we seek interpretable representations of the data but also accurate predictive models. I will present recent progress toward achieving both goals with hierarchical and recurrent state space models and show applications to a variety of datasets. In these examples, we blend structured, hierarchical models for representation learning with powerful predictive tools, like convolutional and recurrent neural networks. Alongside these examples, I will discuss the Bayesian inference algorithms necessary to fit these models at scale. Finally, I will conclude with an outlook for how these models can be grounded in theory, offering a path toward a more mechanistic understanding of neural computation and behavior.