8. The system of claim 7 , wherein: the context data specifies a combination of the one or more attributes of the resource and the one or more attributes of the user; and the contextual performance measure for the particular template indicates a performance of content items that have been provided using the particular template and in response to content item requests having context data that matches the combination of the one or more attributes of the resource and the one or more attributes of the user.
7. A system for dynamically modifying a content item on a per-request basis, the system comprising: a data store for storing content items; and one or more processors configured to interact with the data store, the one or more processors being further configured to perform operations comprising: receiving, from a user device, a content item request that includes context data specifying (i) a set of one or more attributes of a resource on which the content item will be presented and (ii) a set of one or more attributes of a user to which the content item will be presented; in response to receiving the content item request: identifying, from the content items stored in the data store, a given content item to provide in response to the content item request; identifying a set of templates that are eligible for use in generating variations of the given content item; filtering the set of templates based on the one or more attributes of the resource on which the content item will be presented, the filtering including removing, from the set of templates, one or more templates that are not eligible for use in generating content items for presentation with resources having the one or more attributes of the resource on which the content item will be presented; determining, for each particular template from the set of templates, a contextual performance measure that indicates a performance of content items that have been provided using the particular template and in response to content item requests having context data that matches the one or more attributes of the user; selecting, from the set of templates and based on the contextual performance measure of each template in the set of templates, a template for the given content item; creating a different formatted content item by populating the selected template with content for the given content item; and providing, to the user device and for presentation with the resource, the different formatted content item in response to the content item request.