Skip to content

Inline Chain-of-Thought

Updated: at 03:44 AM

Matt Webb:

The Dewey Decimal classification is a bit more tricky. It’s a library code that helps to classify the episode for the unique Directory page. The classification is based on the topic of the episode — and this is not in the source data. So the prompt asks the AI to guess.

The AI is pretty good at this due to its training data. There is one trick that I have found that hugely improves quality: the reason field in the output.

I call this ‘inline chain-of-thought’ after the original paper, Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (Jan 2022). It gives the AI a chance to generate tokens to narrow down the possibility space of the code and label that follow (the reasoning has to appear before the Dewey code itself is generated).

via