Solving Amazon's Infinite Shelf Space Problem

2 hours ago 1

As the story goes, Jeff Bezos is sitting somewhere in 1994, probably in a garage or a warehouse or wherever people had ideas before they had LLMs, and he realizes something important about the internet.

Shelf space is now free.

Not cheap. Not affordable. Free.

In a physical bookstore, every book costs you square footage. Real estate. Prime placement at eye level versus that bottom shelf where dreams go to die. You can stock maybe 100,000 titles if you’re Barnes & Noble and you’re trying really hard.

On the internet? You can list millions of books. Every book that exists. Every book that’s ever existed. The Long Tail. The infinite shelf.

This, Bezos correctly understood, changes everything about retail.

Wall Street analysts never bring up the main problem with this idea, though. Infinite shelf space is really only useful if you have infinite inventory.

Amazon worked because publishers kept making books. Authors kept writing. The supply side was healthy. Slow, human-paced, occasionally stopping for lunch or letting deadlines go whooshing by, but healthy enough that the shelves never looked too empty.

But what if you could have infinite inventory though?

What if the shelf space and the books could both be infinite?

Rohit Krishnan started a recent post off with a couple sentences that really put into words something that’s been on my mind for a while:

“Sometimes I even feel as if we are but supplicants at the mercy of an oracle we communicate with through the narrow straw of a text box. Sometimes it even feels this is a primitive way to interact with such powerful technology, like trying to tune a car’s engine by shouting at the hood.”

We have these models now that can generate essentially any permutation of tokens up to their output limit.

Every possible arrangement of words that could exist, we can now sample from.

And we interact with them through… a text box.

Type a prompt. Get response. Type better prompt. Get better response.

It’s like Bezos built the infinite shelf but forgot to build aisles. Or a front door. Or any way to browse that isn’t just shouting the ISBN at a warehouse robot.

(The warehouse robot is very patient but also very literal.)

Back in undergrad (and I’m telling you this because it’s relevant, or maybe because I still haven’t stopped thinking about it…) I had this realization during an image manipulation project.

Any image you can possibly imagine is just a specific arrangement of pixel values.

Which means you could, theoretically, write a program to iterate through every possible combination of pixels. Eventually, you’d generate the Mona Lisa. A photo of me with my future grandchildren. A perfect snapshot of tomorrow’s sunset. Every frame of a movie that hasn’t been made yet.

I tried it with a 100x100 black and white image.

My program showed me static.

So much static.

The math is simple: 2^(100x100) = 2^10000 ≈ 10^3010 possible images.

For context, there are about 10^80 atoms in the observable universe.

My little program was trying to search through a space larger than reality itself.

Every image exists somewhere in that space. Every masterpiece is just a number away.

The problem was navigation.

The problem was that “infinite possibility” and “useful possibility” are not the same thing.

One of 10^3010 possible images

Large language models have solved a version of this problem.

Not exactly searching through all possible text sequences, which would take longer than the heat death of the universe and require more computational power than exists. That space is just as impossibly large as my pixel problem. Larger, even, if you’re keeping score.

They solved it by learning the structure of useful text. By building an intuition for what tokens should follow other tokens. By compressing the library of all possible books into a probability distribution we can actually sample from without waiting for the heat death of anything.

You can ask an LLM for a book about competitive vegetable gardening, and it won’t iterate through 10^billion possible books showing you static. It’ll generate something plausible. Something readable. Something that feels like it could be a real book from a timeline slightly to the left of ours where people take turnips much more seriously.

The infinite shelf problem is solved.

We can generate infinite books.

We just don’t have a great way to browse them yet.

We don’t have the aisles and the categories and the “customers who liked this also liked” recommendations.

We built the warehouse and then stopped.

So I built this thing. Or Claude built it. Or “we’re’“ building it. The distinction gets fuzzy with these projects.

It’s called Latent Library.

Every category is hallucinated by an LLM.
Every book is hallucinated by an LLM.
Every citation in every book leads to another hallucinated book.

Eventually we’re going to have different ways for you to collaborate on generating the contents of the books.

Nothing exists until you look at it.

Everything exists the moment you look at it.

It’s the solution to Bezos’s infinite shelf problem, but the books materialize as you browse, like Schrödinger opened a bookstore and forgot to tell the books whether they exist or not.

You click on a category like “Programming Fables” and see titles:

  • The Fox Who Compiled Himself

  • Rubber Duck Debugging: A Memoir

  • The Tao of Semicolons

  • grep Dreams of Electric Strings

None of these books exist.

You click on one. Now it exists. Soon, we can start generating chapters. Those chapters can have citations to other books that don’t exist yet. You follow a citation. That book begins existing too.

The library grows in the directions people actually explore, like a city that builds streets only where people walk.

We keep apologizing for hallucinations.

“Sorry, the model hallucinated that fact.”
”Disclaimer: This may contain hallucinated content.”
”Please verify, the AI sometimes makes things up.”

But what even is a hallucination in the context of fiction though?

If I ask an LLM to generate a book called “The Recursive Raven” about a bird stuck in an infinite loop, and it generates a plausible-sounding book… is that a hallucination? Or is that just generation?

The LLM isn’t claiming the book exists at Barnes & Noble. It’s not confusing itself about reality. It’s generating a book that could exist. A book from the space of all possible books.

That’s not a bug.

Latent Library embraces this. Makes it central. Turns it into the core mechanic.

Browse → Discover → Materialize → Explore → Discover → Materialize.

Hallucinations aren’t failures. They’re the inventory.

They’re what you’re here for.

I know what you might be saying. “LLMs generating text? Solved problem”. And I agree, that’s old news, especially in AI years. What I want to call your attention to is the interface pattern. That’s what I think is interesting.

Instead of this:

USER: “Generate a book about quantum mechanics for cats”
LLM: [50,000 tokens about Schrödinger’s litter box]
USER: [reads or doesn’t, probably doesn’t]

We have this:

USER: [browses “Physics for Felines” category]
USER: [sees “The Cat’s Guide to Superposition”]
USER: [clicks]
BOOK: [begins existing]
USER: [reads Chapter 3: “Nine Lives, Infinite States”]
CHAPTER: [references “Advanced Paw-ticle Theory”]
USER: [follows citation]
NEW BOOK: [begins existing]

It feels like discovery instead of generation.

Maybe at some level there is no difference.

Maybe discovery is just generation with better PR.

Borges wrote about the Library of Babel. A library containing every possible 410-page book made from a specific set of characters.

Most books are gibberish: “fhjksd jsdfkljsd fsdkljfsd...”

Some are mostly gibberish with occasional words: “fhjksd the jsdfkljsd cat fsdkljfsd...”

A tiny fraction are readable.

An impossibly smaller fraction are worth reading.

Somewhere in there, theoretically, is the perfect book. The one you needed. The one that answers questions you didn’t know to ask. The one that makes everything suddenly make sense at 3 AM when you’re supposed to be sleeping but instead you’re thinking about bookshelves.

LLMs are like having a librarian who’s memorized large sections of that library. Enough to say “oh, you’d like something like this” and pull out something worth reading without making you wade through the gibberish sections first.

We just needed a better way to browse than shouting into the void and hoping the void shouts back something useful.

Latent Library. It’s a browsable interface for the space of possible text. It treats generation as exploration. It makes hallucination the feature instead of the bug. It lets you wander through categories and citations and reviews until you find something you didn’t know you were looking for, which is how all the best discoveries happen anyway.

Will anyone use it? Unknown.

Is it useful? Depends what you mean by useful.

Is it interesting? I think so. But I also thought iterating through all possible pixel values was interesting, so up to you on whether to trust my judgment.

We solved the infinite inventory problem. We can generate anything. We just haven’t built enough interesting ways to navigate that infinity. We’re still shouting at the warehouse robot when we could be browsing the aisles.

Text boxes are fine. Prompts are fine. They work.

But maybe we need more interfaces that feel like discovery instead of creation though.

Maybe we need more ways to browse the space of possible outputs.

Maybe infinite possibility is only useful if you can navigate it.

Latent Library is available at https://latentlibrary.xyz.

Browse around. Find a book. Pretty soon you’ll be able to read it too.

In one sense, it didn’t exist before you found it.

But in another, it always did, waiting patiently in the space of all possible books in Borges’ Library of Babel, like a good idea waiting for someone to have it.

All books exist in potential.

You get to choose which ones to collapse into reality.

Share

If you do decide to browse the library, you might notice one author, Elara Voss, being a bit more prolific than the others. It turns out this author and name is likely a complete invention by LLMs. If you’re curious you can read more about that here:

Discussion about this post

Read Entire Article