Abstract: Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for iteratively generating different sections of a textual electronic document (“TED”) using one or more large language models (LLMs). In one aspect, a method comprises receiving a request to generate a TED, generating a generation schema of the TED specifying two or more sections of the TED for separate generation, inputting a first set of commands instructing one or more LLMs to generate a first set of text for a first section of the generation schema, inputting a second set of commands including at least a portion of the first set of text and instructing the LLMs to generate a second set of text for a second section of the generation schema, and creating the TED based on an aggregation of the first set of text and the second text according to the generation schema.