Creativity Is a Search Problem

The universe (which others call the Library) is composed of an indefinite, perhaps infinite number of hexagonal galleries… The arrangement of the galleries is always the same: Twenty bookshelves, five to each side, line four of the hexagon’s six sides… each bookshelf holds thirty-two books identical in format; each book contains four hundred ten pages; each page, forty lines; each line, approximately eighty black letters.

— Jorge Luis Borges, The Library of Babel

The Library of Babel

Borges’ The Library of Babel describes a mysterious, universe-sized library that contains all possible books, where each book contains some permutation of letters. Most books are just gibberish, but somewhere in this library is every story ever written or that could be written, every person’s full biography past and future, and every piece of useful knowledge in the universe.

What is creativity in this world? Every story that could possibly be written must already exist somewhere in these shelves, and in countless variations. Should the novelist lose all hope? Is there any room left for true originality?

Perhaps a novelist in this universe would not use a pen or a keyboard. Instead, she’d pore over shelves day and night, reading book after book, until she finds a single volume that perfectly captures her creative vision. At that moment, she’ll hold it up and announce “This is my creation.”

In this world, creativity is a search problem.

Search Space

Given the parameters Borges laid out (410 pages, 25 possible letters and symbols, etc), we can calculate that there are 2580 × 40 × 410101,834,097 books in the Library. This is a ridiculously large search space.

Time for a Big Number Analogy: If you read one book per hour nonstop for 100 years, you’d have only read about 106 books… which doesn’t even make a dent. Let’s read even more: If you can empower each atom in our universe to read one book per nanosecond, nonstop since the Big Bang, you’d still only have read 10110 books… Not even close. Do that another 101,833,987 times, and you’ll be about halfway through the Library of Babel.

How can we make this easier? Most of these books are gibberish, so let’s restrict our search to only permutations of English words. Assuming 5 letters per word, it’d take 220,000 words to fill a 410-page book. Assuming a quarter-million possible English words, we’ll have 250,000220,000101,187,547 books to search through. Amazing! We’ve just reduced our search space from 101,834,097 to 101,187,547, a factor of 10646,550.

The techniques to reduce the search space are heuristics. These are rules of thumb or best practices which help us get closer and closer to our target by process of elimination. Instead of eliminating books one-by-one, good heuristics allow us to eliminate huge swaths. We can apply more heuristics for grammar and sentence structure, then even more for the desired plot, characters, and mood.

And we don’t need to find a single needle in the haystack. There are many variations that may all capture the soul of a novel — perhaps with minor differences between them — a small detail removed here, an extra adjective added there. All told, there might be 10100,000 books in the Library that all satisfy our novelist’s unique creative vision. Once she finds any one of these books, she can proudly hold it up as her creation.

This is a different way to think about creativity. Traditional definitions of creativity live in the realm of ideas, emotions, or the divine. Instead, this is a strictly quantitative and materialist view of the creative process. For our novelist, creativity is the process of using heuristics to iteratively reduce a large search space until one item can be identified that satisfies a minimum standard.

How can creatives actually use this model to fuel their process?

Discrete Representation

Books are a convenient medium for quantitative analysis because their information can be perfectly represented in a discrete format — that is, we can encode a book as a computer file using just ones and zeros. Digitization is a useful stepping stone in this paradigm. Books, music, and film have already been digitized. Illustrations and visual arts have been partially digitized. Video games are natively digital.

The filesize of a creative work gives some indication of how difficult-to-find that item was in the Library of All Possible Items. For instance, the Library of Babel’s 2580 × 40 × 410 books can each be represented by log2(2580 × 40 × 410) ≈ 6,092,739 bits, or about 761 KB.

1 MB has 8,388,608 bits, so the search space for a 1 MB file is 28,388,608. Here are some typical filesizes for digital media:

Media Typical filesize
Blog post / article 5KB - 50KB
Digital illustration 100KB - 1MB
Book 500KB - 2MB
Song (MP3) 3MB - 15MB
Indie video game 10MB - 1GB
Film 1GB - 5GB
Big-budget video game 10GB - 50GB

Some caveats: This table is only a very rough guideline. Much of the variation in filesize is due to level-of-detail or file format, which is not typically a creative decision. A movie might be 200GB in IMAX but only 5GB on DVD — it’s still the same movie. The compressed filesize (the portion of the filesize that is actually subject to creative decisions) gets us closer to the true amount of information contained in a work.

Of course, the experience of consuming the work cannot be digitized, since an experience is contextual rather than textual. Performance arts like dance and theater are difficult to digitize because their consumption is so context-dependent. Nevertheless, from the creator’s perspective, digitalization means that there is a well-defined and therefore finite search space. We know exactly how many books there are in the Library of Babel. Choreographers know the bounds of human movement and stagecraft. This is our first requirement.

Heuristic Power

In our Library of Babel example, the commonsense rule of only using English words allowed us to cut the search space significantly. Accordingly, each medium has its own set of heuristics that can be deployed to reduce the search space.

Heuristics may be strict or loose. In writing, the rules of spelling and punctuation are pretty strict, but any heuristics about characters, plot, mood (e.g. the hero’s journey) are only loose guidelines. In music, there are strict rules about which frequencies and volumes humans can hear, moderate rules about time signatures and beat structure, and loose rules about style, arrangement, and lyrics.

A heuristic that’s too strict may hinder creative expression. A song that’s encoded as a MIDI file might only be 20KB, while that same song encoded as MP3 might be 5MB. What causes this difference? MIDI only stores notes and arrangement, and only supports a predefined list of musical instruments, with no possibility for vocals or sound engineering. By fixing parameters like instrumentation, the search space is restricted to only notes and arrangement. In contrast, MP3 is a general audio format that supports arbitrary sounds, so the search space is much larger.

Some heuristics evolve over time. A new heuristic can spawn an entire genre, like four-on-the-floor did for disco. A genre is just a bundle of heuristics that guides creators into a more restricted search space. But if a heuristic is overused, consumers will tire of it, like the 1-5-6-4 chord progression in pop music.

Heuristics may be based in skill or technique. One core difference between our novelist picking a book out of an existing library and writing that book from scratch is the difference between identification and production. If you can identify the Mona Lisa, it doesn’t mean you can paint it yourself. But since our real world doesn’t actually have a Library of Babel, technical skill is a substitute for process of elimination. Each affirmative brushstroke eliminates a huge number of possible paintings.

The bigger the search space, the more powerful the heuristics must be to drill down to the final product. Developing creative ability is just the process of learning and internalizing more and more heuristics. A mastery of these heuristics (including how to deviate from them) allows a creator to narrow a search space much faster.

Can Robots Create?

We haven’t touched on robots yet, but the above process already describes the algorithmic creation process. They’d start with a big Library to search, then deploy a battalion of heuristics to progressively narrow the search space, and eventually spit out a result — some string of ones-and-zeros.

Current AIs are already doing precisely this, but with a much smaller search space — for example, picking a matching face from a library of photos, picking the best next move in a chess game, or picking the proper acceleration and steering when piloting an autonomous car. AIs have already been writing songs, novels, and screenplays. AlphaGo showed the world that computers can make moves just as “beautiful” as humans.

Creativity in the digital world is an exciting field, but robots still have limits.

Formalism vs Contextualism

Formalism is a philosophy that judges a work based only on its content, without regard to the author’s life story, social context, and relationship with the audience. Contextualism is the opposite: it requires an understanding of these environmental factors and externalities.

Robots thrive in a formalist world — AI algorithms are themselves formal systems (computer programs) that operate on formal systems (structured data). While these algorithms can define the what of creativity, they doesn’t say much about the why. A robot can recreate the shapes and colors of Picasso’s Guernica, but can they understand the commentary on the Spanish Civil War? Not anytime soon.

But this begs the ultimate question: Can formalist systems encompass all matters of context, including human emotion, experience, and spirituality? This question gets at the heart of materialism. If all of human experience must arise from physical sources (neurons firing), then in the far future, it will be possible to reduce all of art, context included, to a big search problem.

Why Create?

For now, human creators can still use some practical advice, following in the footsteps of developing AI. If you don’t know enough techniques and best practices yet, start simple and limit your search space artificially. Instead of a feature-length film, start with a 2-minute short. Next time, you can add to the heuristics you’ve successfully deployed. Maybe humans and robots aren’t so different after all.

The War of Art tells creators to roll up their sleeves and get disciplined about producing work. The daily clock-in will always prune some part of the remaining search space, either by putting a piece in place or eliminating possibilities that don’t work. When a painter faces an empty canvas, or a writer turns to a blank page, or when a music producer opens Ableton, we can imagine the underlying back-and-forth process that narrows the field of possibilities from many, to fewer, and eventually to one. There is always a path forward.