Computational Story Writing

Masoud Yazdani

INTRODUCTION

In this paper we present a number of scenarios for story writing which can be executed by either computers or people. The scenarios are in the form of descriptions of computer programs; some have already been constructed whilst others are under development or can be easily programmed. The scenarios are not intended to be models of actual processes going on in the mind of an author but are introduced to show the range of possibilities. However, finding possible ways of creating stories will help with the development of a candidate model later on.

Meehan's(1976) TALE-SPIN program is evaluated as a good starting point for the purpose of this paper. TALE-SPIN is a working program constructed in accordance with a more general framework for human cognitive behaviour developed by Schank and Abelson(1977). Meehan's work implies a theory of story writing (that stories are about purposeful behaviour of characters) which is later criticised and further refined. Since TALE-SPIN, a number of other projects have started which attempt to go beyond it. Dehn's(1981) AUTHOR, and Lebowitz's(1985) UNIVERSE are two such attempts, which address some of the shortcomings of TALE-SPIN.

CAN A COMPUTER WRITE A STORY?

The simplest way for a computer to write stories would be to:

  1. Take any story you want.

  2. Type it into the computer's memory.

  3. Then a simple sequence of print instructions can easily produce the story.

This scenario can be, and indeed is, followed by people too. However, the scope of the scenario is limited to producing only one story.

The next scenario, although similar to the first, produces a larger set of stories as its output.

  1. Take a TEMPLATE of any story made out of a mixture of 'low level' canned sequences containing slots which can represent varying entities (i.e. variables as in any programming language).

  2. Work out the value of the variables in the TEMPLATE - from a set of possibilities.

  3. Reproduce the TEMPLATE filled with the worked out values of the variables.

This scenario is limited to telling exactly the kind of stories which the template reflects. However, it should be noted that it can produce an infinite number of stories due to the fact that the combination of values for variables can be infinite, at least if there were no constraints on template fillers.

An example of such a system is the popular American story generation amusement called MAD-LIBS. These are collections of short (2-3 paragraph) story templates into which people are prompted to insert words by syntactic category type and delight in the surprising stories produced.

The main problem with variations of this scenario is that it tells us little about the creative nature of story writing. Nevertheless, it can be argued that a sophisticated version of it is actually used by some authors. For example (Schank, 1982) it has been claimed that some authors produce a new story by varying a known story. This point seems to be taken up by Schank(1982, 1984) in his study of human memory. He argues that when understanding a new story we are sometimes reminded of stories we have heard and stored in our memory before. This is because 'we must have been using a structure that was general enough to cover both stories.' These pairs of reminding events on the surface may be radically different, as the following example from Schank(1984) shows:

'X described how his wife would never cook his steak as rare as he liked it. When this was told to Y, it reminded him of a time, 30 years earlier, when he tried to get his hair cut in England and the barber wouldn't cut it as short as he wanted it.'

If people's memories are filled with detailed, flexible representations of past events and stories then there is no reason to doubt that they would use some of these as the bases for generating new ones.

A further argument for the use of approaches similar to the one described above (and procedural templates of Klein's approach described below) is that some writers have to produce text within a clearly defined genre and therefore have little choice but to follow a tradition. One of the tasks of the literary critic is to identify the restrictions which bound the text by the tradition of the genre and find rules governing the making of these restricted choices. Pemberton(1989) is an example of generation of stories in a restricted genre (the Medieval French Epic).

KLEIN'S STRUCTURALIST APPROACH

The rather detailed work on story grammars has been concerned primarily with story comprehension. It is possible to consider reversing their role from comprehension to generation. The work of Klein(1973, 1975) attempts to do this. It is claimed that structures identified by Propp(1968) are inherent in fairy tales and in turn, could be used to produce such tales. Klein's(1973) program based on this approach has produced '21OO word murder mystery stories in less than 19 seconds'! However, Klein has admitted that in addition to more complex procedures, 'low-level canned sequences' (Klein and Meehan, 1977) have been used in producing these stories.


WONDERFUL SMART LADY BUXLEY WAS RICH. UGLY OVERSEXED LADY BUXLEY WAS SINGLE. JOHN WAS LADY BUXLEY'S NEPHEW. IMPOVERISHED IRRITABLE JOHN WAS EVIL. HANDSOME OVERSEXED JOHN BUXLEY WAS SINGLE. JOHN HATED EDWARD. JOHN BUXLEY HATED DR. BARTHOLOMEW HUME. BRILLIANT HUME WAS EVIL. HUME WAS OVERSEXED. HANDSOME DR. BARTHOLOMEW WAS SINGLE. KIND EASYGOING EDWARD WAS RICH. OVERSEXED LORD EDWARD WAS UGLY. LORD EDWARD WAS MARRIED TO LADY JANE. EDWARD LIKED MARY JANE. EDWARD WAS NOT JEALOUS. LORD EDWARD DISLIKED JOHN. PRETTY JEALOUS JANE LIKED LORD EDWARD...

Figure 2.1. Sample output from Klein's(1973) program.


The historical basis behind this approach (from anthropology) is the belief that there are rich structures to human social interaction (Levi-Strauss, 1968) and if the right structures for a culture can be found one can generate stories using these structures. Furthermore, it is assumed that the 'text structures' of that culture reflect the social structures. The following scenario captures some of these ideas:

  1. Choose a structure used in your culture.

  2. Represent the structure procedurally in a computer language.

  3. Run the procedures associated with the structure to produce a surface text.

It should be noted that the relevance of story grammar even to comprehension has come under serious doubt. Black and Wilensky(1979) 'evaluate the 'story grammar' approaches ... finding them generally inadequate as comprehension models'. They 'advocate a story content oriented approach to studying story understanding instead of the structural story grammar approach.' The main point of the criticism is the lack of the 'real-world' knowledge in such approaches. Rumelhart(198O) has in reply pointed out that 'story schemata' in themselves are a rich form of real world knowledge needed in any system that deals with stories.

Polti(1916), Orwell(1948), Koestler(1969) and many other authors seem to indicate some sort of support for this approach where six (or sometimes seven) is mentioned as the number of universal plots, all stories being variations of these. Koestler(1969) presents the following:

The Promethean striving for omnipotence. Individual against society. Polygonal patterns of libidinous relations. War of sexes. Love triumphant or defeated. The conquest of the flesh.

Koestler(1969) considers these some sort of grouping in the catalogue of Goethe's 36 dramatic situations which are listed and classified by Polti(1916).

Propp(1968) also records 31 instances of what he calls 'functions of dramatic personae'. The importance of Propp's work, however, is not only in its classification of these elements, but in his attempts to find the structural relationship between these elements in the form of a grammar. It is this work which has led to the more elaborate attempts of Van Dijk(1972) and Kintsch and Van Dijk(1978) to argue for the existence of text grammars. However the general issue of 'structuralism' and whether there are concrete structures to social life which are reflected in structures in folk tales is out of the scope of this paper.

A TRANSFORMATIONAL APPROACH

Propp's (1968) work has been developed by other Russian researchers of the 'Generative Poetics Movement' to a fine point for generation of literary text.

'The initiators of Generative Poetics assume that the artistic qualities of any given text can be accounted for through a finite small set of technical devices which they call Rules of Expressiveness. This set is fixed in advance, and it is the same for all texts of our culture. The immense variety of texts emerges as a result of an infinite variety of combinations (superpositions) of the Rules and of artistically amorphous everyday life material used by the artist.' (Dreizin et al, 1978)

Dreizin et al(1978) have proposed the use of Sceglov and Zolkovskij's(1975) Rules of Expressiveness for 'computerized generation of sacred legends'. This approach is by no means completely new to linguists. Dreizin et al intend to apply a finite set of (ten) rules to a 'theme' ('the message of the text') successively to transform it stage by stage until finally they get the story out.

A possible 'theme' would be:

INJURE (COMMUNITY(Arabs),COMMUNITY(Jews)) & Miraculously * (PROTECT(SACRED-POWER,Jew)) & Miraculously * (INJURE(SACRED-POWER,Arab))

The set of transformational rules ('Rules of Expressiveness') is as follows:


  1. Embodiment: a substitution of some more concrete element (New York) for a more abstract one (city).

  2. Amplification: a substitution of an 'amplified' element (genius) for a more 'natural' element (talent).

  3. Repetition: a substitution of series of elements (the first door, the second door ...) for an element (door).

  4. Variation: a substitution of a series of elements (a carpenter, a student... ) for an element (a man).

  5. Detailization: a substitution of a detailed description (X stays in bed and X has no appetite and has a temperature) for a situation (X is ill) or action.

  6. Contrast: a substitution of two contrasting elements (loyalty and treachery) for an element (treachery).

  7. Exposition: a substitution of a predecessor (shadow of X appeared) of an element (X appeared) before it.

  8. Adjustment: a substitution of an element (embrace) which has all its features but also has features of another element in the story as well (touch, love).

  9. Amalgamation: a substitution of one element (romantic suicide) for two elements (death, love).

  10. Reduction: a substitution of a thematically similar element (blood-stained knife) for an element (murder).

Figure 2.2. Dreizin et al's(1978) rules


Dreizin et al(1980) argue that these rules are 'message-preserving devices 'serving to increase the expressive power of the themes'. However, it is not clear how these rules are exploited. Nor is it clear how these rules are exploited. Maybe a set of semantic rules is needed which is missing from Dreizin et al's proposal. Dreizen et al say that the best test for their ideas is 'building a computerised model of a story-teller'. No reports of the success or failure of this part of the project have yet been published.

The scenario for this approach relies on the rules being ordered in such a way that a terminated transformation may be obtained by the successive application of the rules. Two of the simplest methods which can be applied are:

A. Breadth First Method

  1. Apply the first applicable rule then the 2nd, and so on

  2. Unless a satisfactory story has been produced, try 1a again

B. Depth First Method

  1. Apply the first applicable rule as often as necessary, then the next applicable rule, and so on each time as often as necessary.

  2. When a satisfactory story has been produced, stop.

MEEHAN'S SIMULATION PROGRAM TALE-SPIN

Meehan(1976) has argued that the '... method, used by Klein, is to write some code which will produce each part of that particular story when the whole program runs.' A more general extension of this view would be that all the scenarios considered so far are generalisations of this approach ie that stories have conventional elements and that a program can be written either to generate these elements from a grammar or to transform generated elements.

By contrast, Meehan(1976), attempts to 'model people making up stories'. The result is a 'theory' of story writing, and a program called TALE-SPIN based on it, which actually generates some stories. Meehan's theory of stories is a clear and simple one: that 'a story is about a problem and how it gets solved'. TALE-SPIN is a computer program which writes stories based on the above theory; 'by simulating a world, assigning goals to some characters and saying what happens when these goals interact with events in the simulated world'. The program, however, is not totally independent of the reader.

'The reader (the user) gets to supply much of the information about the initial state of the world, such as the choice of characters and the relationships between one character and another.'

Then the reader chooses the problem which the story is all about, out of a set of only four problems. From then onwards the story generation is a report of a problem-solver.

'At the heart of TALE-SPIN is a problem-solver, a program which implements a new theory of planning. Accordingly, the stories TALE-SPIN produces are essentially accounts of what happens during the course of solving one or more problems. This is consistent with the theory that all stories are about problems.'


ONCE UPON A TIME GEORGE ANT LIVED NEAR A PATCH OF GROUND. THERE WAS A NEST IN AN ASH TREE. WILMA BIRD LIVED IN THE NEST. THERE WAS SOME WATER IN A RIVER. WILMA KNEW THAT THE WATER WAS IN THE RIVER. GEORGE KNEW THAT THE WATER WAS IN THE RIVER. ONE DAY WILMA WAS VERY THIRSTY. WILMA WANTED TO GET NEAR SOME WATER. WILMA FLEW FROM HER NEST ACROSS THE MEADOW THROUGH A VALLEY TO THE RIVER. WILMA DRANK THE WATER. WILMA WASN'T THIRSTY ANYMORE.

GEORGE WAS VERY THIRSTY. GEORGE WANTED TO GET NEAR SOME WATER. GEORGE WALKED FROM HIS PATCH OF GROUND ACROSS THE MEADOW THROUGH THE VALLEY TO A RIVER. GEORGE FELL INTO THE WATER. GEORGE WANTED TO GET NEAR THE VALLEY. GEORGE COULDN'T GET NEAR THE VALLEY. GEORGE WANTED TO GET NEAR THE MEADOW. GEORGE COULDN'T GET NEAR THE MEADOW. WILMA WANTED TO GET NEAR GEORGE. WILMA GRABBED GEORGE WITH HER CLAW. WILMA TOOK GEORGE FROM THE RIVER THROUGH THE VALLEY TO THE MEADOW. GEORGE WAS DEVOTED TO WILMA. GEORGE OWED EVERYTHING TO WILMA. WILMA LET GO OF GEORGE. GEORGE FELL TO THE MEADOW. THE END.

Figure 2.3. Sample output from TALE-SPIN


The scenario which one could say Meehan's TALE-SPIN program follows is:

  1. Identify a CHARACTER out of a pre defined set.

  2. Give that CHARACTER a PROBLEM out of a pre-defined set.

  3. Create a MICRO-WORLD out of a pre-defined set.

  4. Input 1 to 3 above to a problem-solver.

  5. Either STOP or GOTO 1.

AESOP-FABLE GENERATOR

TALE-SPIN in fact incorporates two different strategies for story generation. In its modes 1 and 2 a 'bottom-up' strategy is followed where most of the information comes from the user and not from any pre-defined set. 'Most of the inferences rely on memory, and some even require information which, if not in memory, must be asked of the reader.'

These two modes differ in the level of detail at which the simulation is reported. The decision on the level is a static one independent of the story itself. These two levels could more appropriately be called a writer's assistant. Mode 3 of TALE-SPIN, however, employs a top-down strategy.

'How do you make it interesting?' asks Meehan(1976). 'You fix it in advance. You rig the world so that if people do behave rationally they'll do some interesting things... It models a writer who has something in mind that he wants to tell a story about... This is TALE-SPIN's mode 3.'

Mode 3 of TALE-SPIN is called the AESOP-FABLE GENERATOR. An example is the generation of 'The Fox and the Crow' with the moral 'Never trust...': 'We predict that A has some goal which requires that B be kindly disposed towards A, so A says something nice to B, B reacts accordingly, something happens which causes A to achieve his goal and also causes B to suffer.'

'The program which tells the story asks the reader for two characters (A and B) and attempts to tell the 'Never trust flatterers' story by finding some food or property in common... It asserts that A is being dishonest and that B is vain. Then it gives A the goal of being near B. The simulator then takes over.'

The AESOP-FABLE GENERATOR mode of TALE-SPIN, whilst retaining the general purpose simulation facilities, guarantees success by imposing a level of conformity to pre-existing story structures. This mode therefore can be seen as a compromise between the uncontrolled simulation of modes 1 and 2 of TALE-SPIN and the work of Klein(1973, 1975) and other 'reproduction' oriented scenarios. We shall not attempt to present a programmatic version of this scenario here as this point is discussed in detail in other parts of this dissertation.

One of the problems with TALE-SPIN is that the program doesn't know what it is doing. 'TALE-SPIN doesn't 'understand' the story it's telling'. The program does not have a notion of which stories are interesting. It is up to the programmer to categorise some as MIS-SPUN tales and some as correct ones. A MIS-SPUN tale is taken to be due to a bug in the program. The programmer changes the program in order to get what constitutes a correct outcome. The corrections are mostly ad hoc. The only time a radical change has followed the discovery of a bug is when the MIS-SPUN tale bellow lead to the addition of the 'noticing' inference into the TALE-SPIN program.

'HENRY ANT WAS THIRSTY. HE WALKED OVER TO THE RIVER BANK WHERE HIS GOOD FRIEND BILL WAS SITTING. HENRY SLIPPED AND FELL IN THE RIVER. HE WAS UNABLE TO CALL FOR HELP. HE DROWNED.'

I find more interesting stories, such as the one below, among the MIS-SPUN TALES than among the boring correct ones.

'ONCE UPON A TIME THERE WAS A DISHONEST FOX AND A VAIN CROW. ONE DAY THE CROW WAS SITTING IN HIS TREE HOLDING THE PIECE OF CHEESE. HE BECAME HUNGRY AND SWALLOWED THE CHEESE. THE FOX WALKED OVER TO THE CROW. THE END.'

These stories above are interesting because they are different from Aesop's version of them. If a human writer were to rewrite Aesop's fables they would be different from the original as they would catch the flavour of the personality of the writer (for example fables by James Thurber, La Fontaine...). The capability to generate stories similar to the MIS-SPUN tales would be a worthwhile exercise in its own right. However these stories would be of use only if the framework within which they are produced could recognise their interestingness. Unfortunately Meehan's theory of story writing not only fails to appreciate this, but explicitly rules out these stories as 'wrong' stories.

BEYOND TALE-SPIN

TALE-SPIN deals with the case where there is only one character solving one problem at a time. However, if more than one character had goals which they actively tried to achieve, then the simple problem solver of the TALE-SPIN would not be able to cope with the situation.

It would be a challenge to produce a TALE-SPIN-like program which deals with more complicated situations (such as stories with two or more main characters) without having to change the theory that the stories are just about the problem solving of the characters.

One solution would be to monitor the problem solving of different characters, letting some achieve their goals and suppressing others. In order to be able to produce a coherent story, the monitor needs to have some other notion of what the story is about. The monitor starts becoming a complicated mechanism in order to manipulate the characters and their problems for the production of the story. At this stage the monitor needs to have goals of its own and plan the story.

De Beaugrande and Colby(1979) have formulated 'a basic set of plausible STORY-TELLING RULES' which introduce recursion, failure (in addition to success) of the goal and multi-character situations to the previous scenario.


  1. Identify at least one CHARACTER.

  2. Create a PROBLEM STATE for that CHARACTER (or CHARACTERS).

  3. Identify a GOAL STATE for the CHARACTER/S.

  4. Initiate a PATHWAY from the PROBLEM STATE leading towards the GOAL STATE.

  5. Block or postpone attainment of the GOAL STATE.

  6. Mark one STATE TRANSITION as a TURNING POINT.

  7. Create a TERMINAL STATE which is clearly marked as MATCHING or NOT MATCHING the GOAL STATE.

Figure 2.4. de Beaugrande and Colby's(1979) rules


However, de Beaugrande and Colby's more sophisticated version of Meehan's scenario is still open to many questions.

What sort of characters should one create? What would be the reasons for choosing a certain character rather than another one? What sort of problems should one give the characters? From where does one obtain one's Micro-worlds?

Some of these questions have been subsequently addressed by Lebowitz(1984) and Dehn(1981) as well as by this author in papers published prior to this dissertation(Yazdani, 1982 and 1983).

DEHN'S AUTHOR

The major problem arises from the fact that Meehan, as well as Beaugrande and Colby make the intentions of the writer implicit in the program (e.g. in postponing goals) rather than explicitly stated and open to manipulation. What about a writer who intentionally wants to write a story as a form of communication, e.g. as propaganda or communicating a moral?

Dehn(1981), in order to account for the author's intentionality, abandons the simulation approach of Meehan altogether. To the program AUTHOR (under development) 'the character is a modelling clay like the rest of the story world'. In this system 'a large part of the work of making up a story is the successive reformulation of the author's goals'.

While TALE-SPIN uses representations of the knowledge about the world and characters, AUTHOR uses representations from an author's memory. The system starts by attempting to reconstruct something from the memory in the reverse fashion to 'remembering'. A crude scenario for AUTHOR is a 'loop' constructed as follows:

  1. Achieve the current narrative goal by successive reformulation of the previously remembered stories.

  2. Find better narrative goals to pursue.

As most people who construct computer programs know, closed loops are dangerous components for a computer system. Dehn does not specify what terminating conditions her system would use and in what way the system would avoid becoming side-tracked into producing unrelated episodes. On the contrary, all 'essential characteristics' of Dehn's proposal - 'unforeseen opportunities', 'willingness to be distracted', 'successive reformulation', 'keeping the author usefully occupied', and 'providing new environments in which fortuitous opportunities are likely to arise' - seem to encourage a never ending stream of episodes. No recent reports of success or failure of this project have been published.

LEBOWITZ'S UNIVERSE

A sound knowledge of both the physical and social world is needed by anybody who wants to write (or understand) stories. The world in which the story takes place is a rich source of creativity. The physical world not only contributes to the setting of the stories, but actually becomes an actor in some stories, such as those with the theme of human versus nature.

TALE-SPIN's use of the physical world is very limited as it is created as a consequence of creating the characters. The characters themselves only have a simple schematic representation. The values of the slots in these schemes are filled by the reader, or by the 'plot' in the case of mode 3. Lebowitz(1984) addresses this shortcoming with a writer's aid for creation of story-telling universes comprised of characters, their histories, family relations and interpersonal relationships.

This work is motivated by the fact that a good deal of the work of television script writers is done by their keeping track of characters and their histories. These characters are created deliberately to satisfy specific constraints before any story telling takes place. Simulations of characters' behaviour take places in the UNIVERSE program in order to build up histories of characters' past lives. There is currently no algorithm for generating stories in the system.

The work of Lebowitz demonstrates the richness of creativity in the production of settings for stories. UNIVERSE builds on the structures used by Schank and Abelson(1977) in order to produce personal frame information for each character consisting of a name, stereotypes, trait modifications, goals, interpersonal relationships, marriages and lists of events in the characters' past history. The personality stereotype not only incorporates the numerical scales but also includes references to a set of built-in schemes for professions (doctor, lorry driver), social background (preppie, working class), race (Irish, Polish), religion (Catholic, Jew) etc.

Although UNIVERSE as yet does not produce stories, its overall aims are somewhat similar to the present dissertation as acknowledged by Lebowitz(1984) himself. The choice of characters is ultimately motivated by authors' goals such as those proposed by Dehn(1981) or Yazdani(1982, 1983). Therefore the method of creating characters should be at the service of other levels of the story generation system.

CONCLUSIONS

The first three scenarios presented in this paper clearly point out the effectiveness of using pre-existing story structures in production of new ones. Meehan's TALE-SPIN on the other hand shows the power of simulation of purposeful action in a world. As the simulation on its own does not guarantee success in producing stories, the AESOP-FABLE GENERATOR attempts to control (or lead) the simulation in the direction of an existing story structure. Therefore represents a halfway house between using canned stories and undirected simulation.

Dehn's AUTHOR is a conceptually neater solution for the problem of control, where known stories or memories of an author are the bases of generalisation for newer ones. Lebowitz's UNIVERSE points out the importance of building a rich world within which the stories could take place. These three programs, TALE-SPIN, AUTHOR and UNIVERSE therefore represent simulator, plot-maker and world-maker respectively of the process-based model which is reported in Yazdani(1982).

At first glance the scenarios presented here seem to be radically different in their approaches. Indeed the merits of one against the other is the subject of a continuing controversy. The two sides of the argument try to show that either 'real world knowledge' or 'transformational structure', is the basis of representation, understanding and generation of stories.

If 'real world knowledge' and 'transformational structure' were to be complementary things then most of the controversy disappears. All the scenarios above 'manipulate representations', be it on the surface or semantic levels. Our model manipulates multiple representations of 'the world', 'abstract communicative intentions', 'goal directed social behaviour', and 'narrative structures', as well as the grammatical structure of the language.