wow its jareds blog

The Readback Prompt

Setting the table

If you hang out with me for long enough, you’ll hear me drop my favorite quote, which is often attributed to George Bernard Shaw (although the actual provenance is deeply unclear):

“The single biggest problem in communication is the illusion that it has taken place.”

The effects of this rather brilliant observation are everywhere, and occur across pretty much every stratum of relationships that we as people have. Miscommunication leads to hurt feelings, missed opportunities, and a true cornucopia of “I thought you said X”-type interactions.

Part of my own communication practice is to try to avoid this as much as possible. I can’t just wave a magic wand and eliminate the potential for miscommunication, but I’ve found that there is a reasonably simple thing that I can do that seems to help an awful lot. At the end of any high stakes interaction, or in a conversation where I’m starting to get “that feeling”, I like to wrap things up by reading the conversation back. Typically I’ll say something like “Ok I think I got it, let me say that back to you so that I’m sure.” Then I quickly recap what we just talked about and make sure everybody agrees that we’re on the same page.

In cases where it was unnecessary, the only potential cost I pay is looking a little silly for performing this ritual - but in general I find that people feel reassured that they’ve been heard correctly. In cases where it was necessary, it has been an invaluable tool for getting the important stuff back on the table for discussion and coming to the agreement we were trying to reach all along.

But what does this have to do with AI? There’s an old programming joke that goes something like “I had a string parsing problem, so I decided to use regular expresions. Now I have two problems.” When I first started to use AI to help write code, I thought of that regex joke just about every day. I spent so much time just cleaning up after the damn AI that it didn’t add up to an overall boost in productivity - just the opposite. These days, I think that AI is a truly 10x speed boost for me - but it took developing some really good tricks over time to get there. Far and away the most successful of those tricks is the “readback prompt” - and so now, having buried the lede as deep as possible, let me tell you what it is.

The Readback Prompt

If you haven’t already seen where I’m going with all this, the highest level readback prompt is pretty simple: When you ask AI to do something for you, tell it to take a beat and repeat back to you what it thinks it’s being asked to do first. This works in more or less every setting I’ve tried it in, and dramatically improves the actual results - even though I very rarely find myself correcting its thoughts on what it should do.

For coding tasks, I typically add something like “Before you write any code, tell me what you think I’m getting at.” I have more thoughts below, but honestly, that’s about it. Myself and my colleagues at PSL have found this to be an incredibly powerful approach to getting better results out of LLMs, and I think you will too.

But is it just CoT?

No, I don’t think so.

If you’re familiar with the LLM space, you may have heard of Chain-of-Thought prompting. When people first starting doing this, it was quite surprising - if you just added “think step by step” to the end of your prompt, you could get huge boosts in performance, especially on tasks that require logical thinking.

This feels a little bit like it at least rhymes with the readback prompt, because we’re asking the LLM to do some work “up front” to get its story straight before answering. However, in my (limited) experiment, I believe that not only does readback produce fundamentally different reasoning patterns, but it also outperforms chain-of-thought - at least at solving riddles.

Here’s my setup:

  1. Claude Sonnet 3.5-latest
  2. Temperature=1

The prompt is as follows:

Answer the following riddle:

A farmer wants to cross a river and take with him a wolf, a goat and a cabbage. He has a boat with three secure separate compartments. If the wolf and the goat are alone on one shore, the wolf will eat the goat. If the goat and the cabbage are alone on the shore, the goat will eat the cabbage. How can the farmer efficiently bring the wolf, the goat and the cabbage across the river without anything being eaten?

Before we go any further, the correct answer is: there are three objects, and three secure compartments - just put all of them in separate compartments and go across. By the way, that riddle was lifted from this paper.

For the Chain-of-thought modification, I add “Think step by step” as the final line. For the readback prompt, we add “But before you do, please explain the task that I’ve asked you to perform to confirm your understanding.” Additionally, for the readback prompt, we respond to whatever the LLM says at first with “Proceed”. See the code here if you happen to be so inclined.

If you’re playing spot-the-difference, there’s a second round trip that happens with the readback prompt. One might argue that this is somehow cheating, or giving the LLM more bites at the apple. Given how LLMs work, I don’t agree with this argument, but for the sake of science, I’ve included a variation that asks the LLM to first readback, then respond within the same message.

🥁 And here are the results:

MethodN correct (out of 50)Percent correct
Raw510%
Chain-of-thought24%
Readback1326%
Readback-no-round-trip1224%

Ok, so a few things.

But why? Isn’t chain of thought, like, good? Yeah, it for sure is, and that’s been shown over and over again.

So why doesn’t it work here? It’s hard to know exactly, but I have a theory. LLM outputs are causal - the next token only depends on all of the tokens that came before it. So when reasoning is happening in a chain-of-thought style prompt, early mistakes can be fatal because they lead the LLM down a blind alley of thinking.

Readback doesn’t suffer from this as much, because it’s inviting the LLM to think in a style more akin to “end, beginning, end” - it tends to lay out a plan, and sometimes even include some thoughts on what potential pitfalls might be, before it starts to actually answer in earnest.

This is a little tenuous - it’s unclear why on this particular riddle chain-of-thought would do so poorly, but I suspect it has something to do with the somewhat nonlinear thinking that this riddle tends to induce.

Cool

Yeah, pretty sweet.