1. A method performed by data processing apparatus, the method comprising: accessing query log data storing queries and user identifiers, wherein the query log data specify, for each user identifier: queries associated with the user identifier, each query associated with the user identifier being a query received from one or more user devices associated with the user identifier; and for each query, a submission time of the query, the submission time related to a time that the query was received by a search system; training, by a data processing apparatus, a prediction model to generate a category prediction of a next query from a set of queries, the category prediction specifying categories to which the next query is predicted to belong, wherein the prediction model comprises a plurality of prediction functions that each generate a category prediction of the next query, wherein each category prediction is based on the query log data and category data defining, for each query of the set of queries, categories to which the query belongs, and wherein the prediction functions include a combination of: one or more time-based prediction functions that generate a category prediction of the next query based on the category data and a difference of submission times of the queries of the set of queries, the one or more time-based prediction functions generating a category prediction of the next query by: adjusting, for each particular query of the set of queries, a category weight for each category to which the particular query belongs based on an amount of time that has passed since the submission time of the particular query; and generating a category prediction of the next query based on the adjusted category weights for each category and for each particular query; one or more rank-based prediction functions that generate a category prediction of the next query based on the category data and a rank order by which the queries of the set of queries were received; and one or more category-based prediction functions that generate a category prediction of the next query based on the category data and that is independent of the submission times of the queries of the set of queries.