P

Thread Of Thought: Definition and Examples

Prompting technique that asks the model to unravel a continuous thread of reasoning by identifying and connecting relevant information from a long context before formulating its response.

Full definition

Thread of Thought (ThoT) is a prompting strategy introduced in 2023 by researchers to improve the ability of large language models to handle large and complex contexts. Unlike Chain of Thought, which breaks down a problem into successive logical steps, Thread of Thought asks the model to "follow the thread" of the available information, extracting and connecting relevant elements before constructing its response.

The principle is based on a simple but powerful instruction: the model is asked to first review the entire provided context, identify the segments of information relevant to the question, and then weave these elements together into a coherent reasoning. This approach is particularly effective when the answer requires synthesizing information scattered across a long document or multiple sources.

The major advantage of Thread of Thought over other reasoning techniques is its ability to handle information noise. In a rich context containing both relevant and irrelevant information, ThoT guides the model to naturally filter what matters, thus reducing hallucinations and off-topic responses.

This technique stands out for its simplicity of implementation: it is usually enough to add an instruction like "Carefully go through the context above, identify relevant information segment by segment, then synthesize your answer" to obtain significant improvements on comprehension and question-answering tasks.

Etymology

The term "Thread of Thought" refers to the metaphor of a guiding thread that one unravels through a set of information. It was formalized in a 2023 research paper titled "Thread of Thought Unraveling Chaotic Contexts" by Yucheng Zhou et al., which proposed this technique as a solution for LLMs to handle long and messy contexts.

Concrete examples

Analysis of a long legal document to answer a specific question

Here is a 15-page contract. [CONTRACT_CONTENT]

Question: What are the early termination conditions?

Before answering, carefully go through the entire contract. Identify each section and clause that mentions termination, penalties, or end of contract. Connect these elements, then formulate your complete answer.

Synthesis of information scattered across a long conversation or meeting

Here is the transcript of a 2-hour team meeting. [TRANSCRIPT]

Unravel the thread of this conversation from beginning to end. Identify all decisions made, assigned responsibilities, and deadlines mentioned. Connect discussions that return to the same topic at different times, then produce a structured summary.

Answering a complex question requiring cross-referencing multiple sources

Here are three research articles on the impact of sleep on memory. [ARTICLES]

Go through each article, identifying key results, methodologies used, and conclusions. Note points of convergence and divergence between the studies, then synthesize an answer to the question: Is REM sleep more important than deep sleep for memory consolidation?

Practical usage

To apply Thread of Thought, add an explicit instruction asking the model to go through the entire provided context before answering. This technique is particularly useful when working with long documents, noisy contexts, or questions requiring cross-referencing scattered information. Combine it with clear context formatting (section numbering, separators) to maximize its effectiveness.

Related concepts

Chain of ThoughtRetrieval-Augmented GenerationContextual CompressionStep-Back Prompting

FAQ

What is the difference between Thread of Thought and Chain of Thought?
Chain of Thought breaks down reasoning into sequential logical steps to solve a problem. Thread of Thought, on the other hand, focuses on navigating and filtering a long context to extract relevant information before formulating a response. CoT is problem-solving oriented, while ThoT is oriented toward understanding and synthesizing context.
When should I use Thread of Thought instead of another technique?
Thread of Thought is particularly suitable when you provide the model with a long and dense context (documents, transcripts, multiple data sources) and the answer requires identifying and connecting scattered information. If your problem is more about logical or mathematical reasoning without a large context, Chain of Thought will be more appropriate.
Does Thread of Thought work with all language models?
Thread of Thought works best with models that have a large context window (Claude, GPT-4, Gemini) capable of processing long documents. Smaller models or those with limited context windows will benefit less from this technique, as they already struggle to maintain coherence over long texts. Results are generally proportional to the model's ability to handle long contexts.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.