Many language generation tasks require the production of text conditioned on both structured and unstructured inputs . We present a novel neural network architecture which generates an output sequence conditioned on an arbitrary number of input functions . Crucially , our approach allows both the choice of conditioning context and the granularity of generation , for example characters or tokens , to be marginalised , thus permitting scalable and effective training . Using this framework , we address the problem of generating programming code from a mixed natural language and structured specification . We create two new data sets for this paradigm derived from the collectible trading card games Magic the Gathering and Hearthstone . On these , and a third preexisting corpus , we demonstrate that marginalising multiple predictors allows our model to outperform strong benchmarks . The generation of both natural and formal languages often requires models conditioned on diverse predictors ( Koehn et al . , 2007 ; Wong and Mooney , 2006 ) . Most models take the restrictive approach of employing a single predictor , such as a word softmax , to predict all tokens of the output sequence . To illustrate its limitation , suppose we wish to generate the answer to the question " Who wrote The Foundation ? " as " The Foundation was written by Isaac Asimov " . The generation of the words " Issac Asimov " and " The Foundation " from a word softmax trained on annotated data is unlikely to succeed as these words are sparse . A robust model might , for example , employ one pre- dictor to copy " The Foundation " from the input , and a another one to find the answer " Issac Asimov " by searching through a database . However , training multiple predictors is in itself a challenging task , as no annotation exists regarding the predictor used to generate each output token . Furthermore , predictors generate segments of different granularity , as database queries can generate multiple tokens while a word softmax generates a single token . In this work we introduce Latent Predictor Networks ( LPNs ) , a novel neural architecture that fulfills these desiderata : at the core of the architecture is the exact computation of the marginal likelihood over latent predictors and generated segments allowing for scalable training . We introduce a new corpus for the automatic generation of code for cards in Trading Card Games ( TCGs ) , on which we validate our model1 . TCGs , such as Magic the Gathering ( MTG ) and Hearthstone ( HS ) , are games played between two players that build decks from an ever expanding pool of cards . Examples of such cards are shown in Figure 1 . Each card is identified by its attributes ( e.g. , name and cost ) and has an effect that is described in a text box . Digital implementations of these games implement the game logic , which includes the card effects . This is attractive from a data extraction perspective as not only are the data annotations naturally generated , but we can also view the card as a specification communicated from a designer to a software engineer . This dataset presents additional challenges to prior work in code generation ( Wong and Mooney , 2006 ; Jones et al . , 2012 ; Lei et al . , 2013 ; Artzi et al . , 2015 ; Quirk et al . , 2015 ) , including the handling of structured input-i.e . cards are composed by multiple sequences ( e.g. , name and description)-and attributes ( e.g. , attack and cost ) , and the length of the generated sequences . Thus , we propose an extension to attention-based neural models ( Bahdanau et al . , 2014 ) to attend over structured inputs . Finally , we propose a code compression method to reduce the size of the code without impacting the quality of the predictions . Experiments performed on our new datasets , and a further pre-existing one , suggest that our extensions outperform strong benchmarks . The paper is structured as follows : We first describe the data collection process ( Section 2 ) and formally define our problem and our baseline method ( Section 3 ) . Then , we propose our extensions , namely , the structured attention mechanism ( Section 4 ) and the LPN architecture ( Section 5 ) . We follow with the description of our code compression algorithm ( Section 6 ) . Our model is validated by comparing with multiple benchmarks ( Section 7 ) . Finally , we contextualize our findings with related work ( Section 8) and present the conclusions of this work ( Section 9 ) . We introduced a neural network architecture named Latent Prediction Network , which allows efficient marginalization over multiple predictors . Under this architecture , we propose a generative model for code generation that combines a character level softmax to generate language-specific tokens and multiple pointer networks to copy keywords from the input . Along with other extensions , namely structured attention and code compression , our model is applied on on both existing datasets and also on a newly created one with implementations of TCG game cards . Our experiments show that our model out-performs multiple benchmarks , which demonstrate the importance of combining different types of predictors .

Challenge: While using a single predictor puts limitations on generation tasks, training multiple predictors remains challenging because of a lack of suitable annotated data.
Approach: They propose a neural network architecture that allows to incorporation arbitary number of input functions enabling flexibility in conditioning text and the granularity of generation.
Outcome: Evaluation of existing benchmarks and the newly created card game-based dataset shows that the proposed model with multiple predictors outperforms strong baseline models.