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
FAQ
What is the difference between Thread of Thought and Chain of Thought?
When should I use Thread of Thought instead of another technique?
Does Thread of Thought work with all language models?
See also
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- 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
Tiktoken: Definition and Examples
Tiktoken is the open-source tokenization library developed by OpenAI, used to split text into tokens before sending it to models like GPT-4.
Tokenization: Definition and Examples
Tokenization is the process by which a language model breaks down text into elementary units called tokens, which can be words, subwords
Tokens (AI): Definition and Examples
Tokens are the basic units that AI models use to process text. Learn how to understand and optimize their usage.
Tool Calling: Definition and Examples
Tool Calling is the ability of a language model to identify when it should use an external tool and to generate the structured parameters
Tool Use: Definition and Examples
Tool Use (or function calling) is the ability of a language model to interact with external tools — APIs, databases, calculators, browsers
Top K: Definition and Examples
Top K is a generation parameter that limits the model's choice to the K most probable tokens at each step, reducing incoherent responses.
Get new prompts every week
Join our newsletter.