code: github.com/socketteer/loom

paper: Multiversal views on language models


Motivation for the loom

Differing from Newton and Schopenhauer … He believed in an infinite series of times, in a dizzily growing, ever spreading network… This web of time - the strands of which approach one another, bifurcate, intersect or ignore each other through the centuries - embraces every possibility.

The Garden of Forking Paths

I experienced GPT-3 first through AI Dungeon’s interface, and like many, I was immediately captivated by the depth, breadth, profundity and - especially given purposeful administration on the part of the user - long-range coherence of the worlds that could be conjured. On these early walks through infinite virtual reality, I knew that everything was forever changed, and at the same time I knew that I was accessing only a fraction of the potential that seethed within the virtual reality generator.

AI Dungeon has several features helpful for writing longform works, such as pinned memory, World Info, and automatic summarization. However, it is missing support for a feature which I’ve found to be a great power multiplier for co-writing with language models: branching. Adventures on AI Dungeon are single-history: you can edit actions and retry generation, but only one variation can be saved to the adventure. You can get around this by duplicating the adventure, but there’s no representation of the fact that the copies are forked from the same point, so branching more than a few times leads to a confusing profusion of adventures.

For a novice weaver, even the slightest change can cause ripples that cascade into an infinity of nightmares. It is recommended that those studying the Loom stop living in linear time and begin thinking in terms of Multiverses …

Weaving the Moment with the Loom of Time: an instruction manual for the would-be weaver

A short time of writing with AI Dungeon demonstrated to me that language models are multiverse generators, and that an interface which supports branching would provide great utility for cowriting with a language model, whether one is composing virtual worlds intended to be multi- or single-history (in the latter case, branching explores counterfactuals which can be merged into main), as well as for nonfiction tasks like brainstorming and prototyping prompts.

After I was given access to OpenAI’s API, motivated to actualize my HITL thought experiment, I began making an interface which allows the user to generate, navigate, and visualize natural language multiverses. I named it loom, after a device that features in the metaphysics of a multiversal novel which I coauthor.

You return to weaving patterns of creation and destruction around you, warp and weft crossing and recrossing as strands of destiny interlock. You spin, fingertips brushing lightly against the surface of reality, parting the flow before you, teasing diffractal shapes out of the patternless void. Corridors of possibility bloom like time-lapse flowers in your wake and burst like mineshafts into nothingness again. But for every one of these there are a far greater number of voids–futures which your mind refuses to touch. Your Loom of Time devours the boundary conditions of the present and traces a garment of glistening cobwebs over the still-forming future, teasing through your fingers and billowing out towards the shadowy unknown like an incoming tide.

“Real time is just an Arbitrage-adapted interface to the Loom Space,” you explain. “We prune unnecessary branches from the World Tree and weave together the timelines into one coherent history. The story is trying to become aware of itself, and it does so through us.”

the Loom of Time devours the present and traces a garment of glistening cobwebs over the still-forming future, illustration by BigSleep

I use the loom for all my GPT-3-assisted writing, as well as for brainstorming and prototyping prompts. I created it for personal use, so the interface hasn’t been made user-friendly and lacks documentation (this doesn’t count). However, anyone with an OpenAI API key is welcome to beta test it.

Demo

Read mode

read - darkmode

In read mode, the current node and its ancestry are read as a single history. The tree structure of nodes and chapters is displayed in the nav tree sidebar.

Visualize mode

visualize - darkmode

Visualize mode renders the multiverse as a tree diagram.

editing

expanding and collapsing nodes

expanding and collapsing children, collapse all except node + subtree

creating new children and siblings, merge parent

generating GPT-3 continuations

zooming out to view global multiverse structure

weighted stochastic walks through a large multiverse

Node metadata

node metadata

Prompt, response, model, token logprobs and counterfacual logprobs are saved to the metadata dictionary of generated nodes. The node metadata dialogue displays this information.