Story Centaur: Large Language Model Few Shot Learning as a Creative Writing Tool (2021)

Abstract: Few shot learning with large language models has the potential to give individuals without formal machine learning training the access to a wide range of text to text models. We consider how this applies to creative writers and present Story Centaur, a user interface for prototyping few shot models and a set of recombinable web components that deploy them. Story Centaur’s goal is to expose creative writers to few shot learning with a simple but powerful interface that lets them compose their own co-creation tools that further their own unique artistic directions. We build out several examples of such tools, and in the process probe the boundaries and issues surrounding generation with large language models.

## introduction one of the most promising possibilities for large language models (llms) is few-shot learning @xcite in which it is possible to create text to text models with little or no training data. few shot learning with llms relies on the ease at which the desired input/output (i/o) behavior can be effectively translated into the text continuation problem at which these models excel. in recent years, llms have progressed to the level where this translation requires only familiarity with the natural (e.g. english) language on which the model was trained. we present story centaur, a human-computer interface that closes the gap between non-technical users and the power and possibilities of few shot learning, with the intended audience of writers of creative text. it is our intention that by giving writers a tool for building generative text models unique to their process and vision that these artists will experience genuine feelings of co-creation. story centaur consists of a prototyping ui as well as a set of angular web components that interact via a central pub-sub synchronization mechanism foot_0 . due to the non-trivial monetary cost of inference and the requirement of specialized hardware, the llm that underlies our tool is not included in this release; instead we dependency inject the llm with a simple (string) → string interface to be provided by an arbitrary service. as the ethical implications of llms @xcite are an important and unsolved problem in nlp, we highlight this design choice to decouple the llm itself from story centaur, a web based user interface that prepares the llm's inputs and processes its outputs. to put it another way, the text generated is no more or less biased than the llm and user themselves, as story centaur's purpose is not to enhance or change the abilities of a llm, but instead to democratize its use to non-technical users. ## related work the observation that simple "fill-in-the-blank" neural network models trained on large quantities of text can be used for problems beyond their primary learning objective dates back to word2vec @xcite in which word embeddings were able to perform some sat style analogies. while this ability captured many researchers' fascination, these models' dual function as a representation learner from which other models could be initialized and/or fine-tuned took center stage in the following years. representation learning techniques made steady advances, expanding to sentence level contextually sensitive word embedding with elmo @xcite , the introduction of transformers and mlm objectives with bert @xcite , and the menagerie of similar systems that followed. while most work concerned itself primarily with topping each other's glue and superglue scores @xcite , work from openai kept the torch lit for investigating the emergent abilities of representation learning @xcite @xcite . their most recent work undeniably shows that sufficiently large lms enable few shot models that approach and sometimes surpass state of the art performance on a wide range of nlp tasks. human + ai co-creation has existed in both practice and theory for several years. to highlight some examples in practice that relate to creative writing, as opposed to music or visual art of which there are many, we refer the reader to browse the electronic literature collection foot_1 a longstanding community of artist-technologists who have blazed this trail since the days of hypertext. a number of publications of ai co-creation exist as well on a diverse range of artistic applications @xcite @xcite @xcite @xcite . for a lighter introduction, @xcite gives some examples of ai + human collaborations, or centaurs foot_2 , but primarily presents the argument that the hci that connects the human and computer is of paramount importance, a sentiment that is in line with our own work. we also resonate with the opinion of llano et al. (2020), which argues for explainability as a catalyst for fruitful co-creation, ## few shot formulas the core contribution of this work is a ui for the creation of few shot text generation models (figure 2 ). we first define terms for the components of lm based few shot modeling as it is decomposed in our system: the few shot learning system as a whole is represented as a formula which when used with a large lm provides arbitrary text to text i/o behavior. we note that while generally lms refer to any probability distribution over a sequence of tokens, in this work we use the term to refer to the subset model class that factorizes the joint probability into conditional p (w t |w 1...t-1 ) terms. put simply, we are referring to the "predict the next word given all words so far" variety of lm, which includes all of the gpt models. a formula is composed of data and serialization. each item in the data consists of lists of string inputs and outputs that exemplify the desired i/o. the serialization defines a reversible transformation between the data and the raw text handled by the lm. story centaur uses a serialization template of fixed text sentinels that interleave the inputs and outputs; a sentinel is defined to precede each input and output, as well as one that separates inputs and outputs and one that comes after the final output (see figure 2 for an example). carefully chosen sentinels are powerful tools for nudging the language model in desired directions (see the appendices for examples), but must also be designed so as not to be confused with model input or outputs. a formula is used by first invoking the serialization on the data, creating the preamble. then, the new inputs are converted using the serialization and concatenated to the preamble, creating the prompt. the lm is asked to continue the text in the prompt, and the serialization is used to extract the output(s) from the result. the lm cannot explicitly enforce the serialization format and as such will often produce non-conformant results, in which case it must be rejected. in practice, if the lm is sufficiently capable and the task well suited then a simple rejection sampler suffices to produce several acceptable options, as decoding is parallelizable. ## writing tool experiments we showcase the potential of formulas that one might create using story centaur in several experiments. these experiments all rely on one or more formulas that were built using the development tool and workflow described above, and are each motivated by a different artistic scenario. when possible, we present the i/o specifications for each experiment and invite the reader to view full experiment screenshots as well as the underlying formulas' data and serialization in the appendices. perhaps the most obvious application of generative language models to creative writing is overcoming writer's block. specifically, we consider the scenario in which the writer has some existing seed text and wants to be presented with possible continuations. ## discussion while the experiments presented above demonstrate how few shot learning can be used to create interesting tools for writers, the real power of story centaur is its unlocking of rapid experimentation. not only were we able to probe the boundary of what "works" efficiently, but also to engage individuals regardless of formal machine learning training to help us to do so. needless to say, in the course of this work many attempted formulas did not produce compelling results. perhaps our most interesting failure was to build a formula that would produce the second half of a rhyming couplet given the first half, a task that would require understanding of both phonetics and meter as well as linguistic coherence. this was disappointing given the compelling examples of gpt-3 poetry available online 4 . one possible explanation is that while general poetry and specifically rhyming couplets are in our minds connected closely with a subset relationship rooted in human culture, the hard constraint of rhyme and meter in fact divides them into very different problems for an lm. it is certainly the case that recent successful work in rhyming metered poetry generation has needed to resort to fixed rhyme words and syllable counting @xcite . in terms of larger themes, we found that constructing formulas in which any of the inputs or outputs were much longer than a few sentences were hard to construct. we speculate that it is more difficult for the models to latch on to the serialization in this case, as the observed symptom was often that no generated text passed the de-serialization filter. on the positive side we observed that few shot tasks that rely on paraphrasing (such as those used say it again) were surprisingly easy to construct successfully. it is a common and intuitively plausible observation that the design of the serialization is crucial to the performance of few shot learning with large lms. our formulas can only be evaluated quali-4 https://www.gwern.net/gpt-3#transformer-poetry tatively and so we leave to future work the human studies that would be necessary to investigate this hypothesis. our magic word experiment does offer the promise of a good test bed for serialization design; even after considerable iteration we found the rate at which outputs pass both the de-serialization filter to be surprisingly low given the relative simplicity of the task and the model's innate ability to generate coherent text continuation. finally we note that our true goal is to empower artists with no technical training to imagine a formula, construct it in our development mode, and then produce experiments as we have. in our current process, such an artist could indeed construct their formula, but would at some point require a programmer to build it into an experiment, requiring e.g. a wysiwg editor. while this was beyond the scope of our work, we did construct our system using angular, a modern web development framework whose core premise is modularity, dependency injection, and reuse of components. not only do our experiments make use of a small set of these reusable components for functionality like editable text fields and clickable suggestion lists, but also all text and formulas are synchronized by a global pub-sub service with simple string keys. ## conclusion we present story centaur, a tool for the creation and tuning of text based few shot learning formulas powered by large language models and several experiments using formulas built with our tool that are focused around the topic of creative writing. the emergence of large language models has shaped the course of nlp research in the late 2010's but the question remains as to what, if any, is a viable use case for these models in their raw, un-finetuned, form. additionally, while some claim that scaling these models is a viable path to artificial general intelligence, others disagree @xcite , and learning what is easy, hard, and impossible for them is crucial this debate. the answers to these questions will undoubtedly reveal themselves in the coming years and we are particularly excited to see their impact on the fine arts. in particular, we see great potential in tools built with this technology when there is a human, in this case an artist, in the loop to complement the natural deficiencies of a simple but powerful text generator that lacks editorial control and responsibility.