Generating Demonstrations for In-Context Compositional Generalization in Grounded Language Learning (2024)

Abstract: In-Context-learning and few-shot prompting are viable methods compositional output generation. However, these methods can be very sensitive to the choice of support examples used. Retrieving good supports from the training data for a given test query is already a difficult problem, but in some cases solving this may not even be enough. We consider the setting of grounded language learning problems where finding relevant supports in the same or similar states as the query may be difficult. We design an agent which instead generates possible supports inputs and targets current state of the world, then uses them in-context-learning to solve the test query. We show substantially improved performance on a previously unsolved compositional generalization test without a loss of performance in other areas. The approach is general and can even scale to instructions expressed in natural language.

## introduction it is thought that a compositional understanding of language and the world (so-called compositional generalization) around is something that enables efficient learning in both humans @xcite and machines @xcite . however, a long line of work and many different datasets show that deep learning approaches do not always achieve such compositional generalization. some solutions to address this deficiency include modular architectures, data augmentation, and sparsity. a recent line of work concerns in-context learning (icl). instead of providing a query and asking for the target directly, a few examples of query-target pairs (supports) are also provided. recent work indicates that supports covering the elements of the query can help enable compositional generalization even if neither shows the desired behaviour exactly @xcite . a follow up question is how to find examples for each query. most prior work suggests retrieval from the training data @xcite . however, in the grounded language learning case, retrieval approaches might not be sufficient to make compositional generalization by icl work well. the expected outputs are conditional not only on the query, but also on the state of the world. therefore, searching for nearby examples in the input space is problematic. using the query alone means that it is unlikely that staterelevant examples will be retrieved. there might not be query-covering examples in the same state from the training data. using similar states is also challenging because small changes in the state can result in large changes to the target sequence. searching for nearby examples in the output space @xcite is more promising, but it also relies on being able to find state-relevant covering outputs. it is difficult to make a retrieval-based strategy that works well in all cases. instead of retrieval, we suggest that generation of the supports based on the state might be a better alternative. we contribute the following: @xmath0.19) @xmath1.18) 2 background ## method in this section, we describe a method we call demogen. the method is designed to work with datasets where there is both an instruction and a state in the input. ## conclusion in-context learning can help improve performance on challenging compositional generalization problems, but the choice of support examples is crucial to its performance. in the grounded-language learning case, retrieval may not be enough to get good supports. generated supports better cover what is required for productive generalization as shown in our support analysis and ablation studies.