  We present a novel iterative extraction model, IterX, for extracting complex
relations, or templates (i.e., N-tuples representing a mapping from named slots
to spans of text) within a document. Documents may feature zero or more
instances of a template of any given type, and the task of template extraction
entails identifying the templates in a document and extracting each template's
slot values. Our imitation learning approach casts the problem as a Markov
decision process (MDP), and relieves the need to use predefined template orders
to train an extractor. It leads to state-of-the-art results on two established
benchmarks -- 4-ary relation extraction on SciREX and template extraction on
MUC-4 -- as well as a strong baseline on the new BETTER Granular task.
