Open in app
Cover art for How retrieval helps chatbots cite real documents

How retrieval helps chatbots cite real documents

Technology · 6 min listen

Get the app on mobile
Download on the App Store Get it on Google Play
Cover art for How retrieval helps chatbots cite real documents
0:00
0:00
Transcript

HostIt happens to almost all of us eventually. You ask a chatbot a simple question about a book or a news story, and it gives you an answer that sounds perfect, but it turns out to be a total lie. It’s like the bot is dreaming with a straight face. I’ve always wondered why they can’t just look things up the way we do.

GuestWell, the big secret is that most chatbots weren't built to know facts. They were built to guess the next word in a sentence. Think of it like a very smart version of the auto-fill on your phone. If you type "How are," your phone guesses "you." It doesn’t actually know how you're doing. It just knows those words usually go together. A chatbot does that on a massive scale. It has read the whole internet, so it knows what a true sentence sounds like, but it doesn't have a list of true facts in its head. When it gets a gap in its memory, it just fills it with a word that sounds right, even if it’s wrong. To fix that, we have to change the game from a memory test to an open-book test. We call this retrieval. It’s basically giving the bot a library card and a desk.

HostSo instead of just reaching into its own foggy brain, it’s actually looking at a page?

GuestExactly. Imagine you ask a bot about your company’s health plan. Usually, the bot might guess based on every health plan it saw during its training. But with retrieval, the bot first takes your question and runs over to a digital filing cabinet. It pulls out the real document for your specific plan, lays it on the desk, and reads it. Then it writes the answer based only on what's on that page. It’s still using its "brain" to write the sentences so they sound natural, but the facts are coming from that piece of paper. This is why it can suddenly give you a link or a quote. It’s not remembering; it’s looking.

HostWait, if the bot is just looking stuff up, why do we need the fancy AI at all? Why not just use a regular search engine?

GuestBecause a search engine just gives you a list of links and says, good luck, you find it. You still have to click, read five pages, and sum it up yourself. The AI with retrieval does the hard work of reading those pages for you. It can take a twenty-page tax law and a three-page letter from your boss and combine them into one short answer. A search engine can't connect the dots between two different books, but a bot with retrieval can. It uses the search to get the right books on the desk, and then it uses its "brain" to explain how they fit together.

HostI still don't quite get how it finds the right page in the first place. If I have a million files, how does the bot know which one has the answer without reading all of them first?

GuestThat’s the clever part. We use something called a vector. Think of it like a map of meanings. In a normal search, if you look for "dog," the computer just looks for those three letters. But in this new way, the computer turns every sentence into a set of coordinates on a giant map. Words with similar meanings are placed close together. So "puppy" and "dog" would be right next to each other on the map, even though they don't share the same letters. When you ask a question, the bot turns your question into a point on that map and looks at which documents are sitting in the same neighborhood. It’s finding ideas, not just matching words.

HostI don't know if I buy that. Meaning feels like a human thing. To a machine, isn't a word just a string of ones and zeros? It feels like a stretch to say it understands the neighborhood of an idea.

GuestIt’s not understanding the way you and I do, but it's very good at seeing patterns in how we use language. It has seen the word "hot" near the word "sun" millions of times. So on its map, those two stay close. It’s all math. If you ask about "chilly weather," the math leads it to the same spot as "cold days." It doesn't need to know what "cold" feels like to know that those two files probably belong in the same pile. The problem is when the map is messy. If you have a document about a "bank" of a river and another about a "money bank," the math might get confused and put them in the same spot. That’s when the bot brings the wrong book to the desk.

HostSo if it brings the wrong book, we're back to square one. Does this mean the bot can still lie to me, even with the book right there in front of it?

GuestIt can. We call that a grounded error. It’s like a student who has the textbook open during a test but still misreads the chart or skips a "not" in a sentence. The bot might find the right page about your flight being canceled, but it might get the time zone wrong or mix up the gate number. It’s much less likely to make things up out of thin air, but it’s still just a very fast guesser. It doesn’t have a "truth" sensor. It just has a much better source to guess from. The biggest hurdle now is making the "desk" bigger. Right now, bots can only "read" a few dozen pages at a time. If your answer is buried in a thousand-page manual, the bot might not be able to hold it all in its head at once to give you the full picture.

HostThe bot might have the library card, but it still has a pretty small desk to work on.

GuestThat desk space is the one thing every scientist in the field is trying to grow right now.

HostChatbots started out as poets who knew everything and nothing at the same time, but now they're finally starting to act like researchers who can actually show us the page they're reading.

Made with Wander

A world of curiosity you can listen to. Explore endless questions, or ask your own.

Get the app