Zero Labs
Industry News / AI

Advanced Reasoning Frameworks in Large Language Models: Chain, Tree, and Graph of Thoughts

Source · Towards AI By Devansh Sinha

From the publisher’s feed, collected in the ZeroLabs newsroom.

Recent Advancements in LLM Reasoning FrameworksRecent advancements have significantly enhanced the reasoning capabilities of large language models (LLMs). Among these innovations, three frameworks stand out for their ability to guide LLMs through complex reasoning processes: Chain of Thought (CoT), Tree of Thoughts (ToT), and Graph of Thoughts (GoT). Each builds upon its predecessor to offer increasingly sophisticated approaches to problem-solving, moving LLMs closer to human-like reasoning patterns.Chain of Thought: Step-by-Step ReasoningChain of Thought (CoT) prompting is a technique that enhances the output of large language models, particularly for complex tasks involving multi-step reasoning. Introduced by Google researchers in 2022, CoT simulates human-like reasoning processes by breaking down elaborate problems into manageable, intermediate steps that sequentially lead to a conclusive answer.How CoT WorksThe fundamental principle behind CoT is remarkably straightforward: instead of requesting a direct answer, users prompt the model to “think aloud” by working through the problem step by step. This is typically achieved by appending instructions such as “Describe your reasoning steps” or “Explain your answer step by step” to queries.ExampleConsider a scenario where we are working with a dataset of research papers:The training set consists of papers grouped into well-defined scientific categories.The test set contains newly submitted papers whose relevance to existing categories is unknown.The task is to determine whether each test paper can be confidently classified into one of the existing categories (“classifiable”) or if it introduces new, ambiguous, or weakly related content (“not classifiable”).To approach this, we can use vector embeddings (such as those from Sentence-BERT) to represent papers in a semantic space, compute similarities between test papers and training category centroids, and decide based on a similarity threshold whether a paper fits any known class.Sample Prompt: “Given a set of training research papers grouped by categories, and a new test paper, determine whether the test paper is classifiable. First, convert all papers to embeddings using a language model. Then compute the cosine similarity between the test paper and the averaged embedding of each category. If the similarity to all categories is below 0.75, label the test paper as ‘not classifiable’. Otherwise, label it ‘classifiable’. Explain the reasoning and state which category the paper is closest to if it is classifiable.”Emergence and EffectivenessResearchers observed that CoT is an emergent ability in LLMs:As parameter size increases, so does reasoning ability and accuracy.Large LLMs perform better because they’ve learned more nuanced reasoning patterns from training on massive datasets.Studies have shown that prompting models to generate intermediate reasoning steps significantly boosts their ability to accurately solve multistep problems.The technique has consistently outperformed standard prompting methods across various benchmarks including arithmetic, common sense, and symbolic reasoning.Variations of CoTSeveral variations of CoT have emerged:Zero-Shot CoT: Enhances reasoning by appending a simple phrase like “Let’s think step by step” to the end of a question, encouraging the model to generate an internal chain of reasoning even without examples.Sample prompt: “[Insert question here] Let’s think step by step.”Self-Consistency: Improves answer reliability by sampling multiple reasoning paths for the same question and selecting the most frequent outcome.Sample prompt: “Solve the following question multiple times independently and choose the most common final answer among the different reasoning paths.”Least-to-Most Prompting: Breaks down complex problems into a series of simpler subproblems that get executed sequentially.Sample prompt: “Break down the following complex problem into a sequence of simpler subproblems, solve each one in order, and use the results to arrive at the final answer.”Tree of Thoughts: Exploring Multiple Reasoning PathsWhile CoT provides a linear approach to reasoning, Tree of Thoughts (ToT) expands this concept by enabling exploration of multiple reasoning paths simultaneously, allowing for strategic lookahead and backtracking.The ToT FrameworkToT maintains a tree of thoughts, where each “thought” represents a coherent language sequence that serves as an intermediate step toward solving a problem. This framework enables an LLM to self-evaluate progress through intermediate thoughts and systematically explore options with lookahead and backtracking capabilities.The ToT approach mimics human problem-solving processes by using a tree structure where nodes represent partial solutions. This structure allows the model to explore different branches when solving complex problems, evaluating each path’s potential before committing to it.Implementation and ComponentsToT implementation typically involves two key components:Propose prompts: Generate possible solutions and reasoning paths.Value prompts: Evaluate the different paths and guide the model toward the best path.When using breadth-first search (BFS) in ToT, the LLM evaluates thought candidates to promote correct partial solutions and eliminate impossible ones, allowing for more thorough exploration of the solution space.ExampleIn the Tree of Thoughts framework, instead of generating a single linear reasoning path, we allow the model to explore multiple possible reasoning steps at each decision point and evaluate the best paths based on intermediate outcomes. Applying this to our task of classifying research papers, we can break down the process into several stages:Identifying core topics in the test paper.Comparing them with clusters in the training set.Evaluating alignment strength at each step.At each stage, multiple candidate paths (e.g., possible topics or matching categories) are generated and assessed. The final classification is based on the most promising path through this reasoning tree — i.e., the one that maximizes semantic alignment and clarity.Prompt: “Given a new test research paper, construct a tree of reasoning where each node represents a possible interpretation of the paper’s topic, and branches explore alignments with different training categories. At each level, evaluate which interpretations and category matches seem most coherent based on semantic similarity and topical overlap. Continue expanding the most promising branches until a confident decision can be made. Conclude with whether the paper is classifiable or not and explain which reasoning path led to the decision.”Advantages Over CoTToT outperforms CoT on tasks requiring exploration or considering multiple possibilities, such as:Mathematical reasoningCreative writingPuzzles and gamesDecision-making tasks with multiple viable optionsThe framework’s ability to backtrack when a path is unlikely to lead to a valid solution makes it particularly valuable for complex problem-solving scenarios.Graph of Thoughts: Networked Reasoning Beyond HierarchiesThe Graph of Thoughts is a conceptual and computational framework that represents reasoning or analytical processes as a network of interconnected information units. In this model, each node represents a discrete “thought” — an idea, an observation, a critique, or a conclusion — while each edge captures the relationship between these thoughts. These relationships may be causal, evidential, hierarchical, or associative, forming a structure that mirrors how complex reasoning unfolds in human cognition or simulated analysis systems.The GoT FrameworkIntroduced by Besta et al., GoT models information generated by an LLM as an arbitrary graph, where units of information (“LLM thoughts”) are vertices, and edges correspond to dependencies between these vertices. This structure allows for combining arbitrary LLM thoughts into synergistic outcomes, distilling the essence of whole networks of thoughts, or enhancing thoughts using feedback loops.The key advantage of GoT lies in its flexibility: rather than being constrained to linear chains or tree-like structures, thoughts can form complex networks that more closely resemble human cognitive processes and brain mechanisms such as recurrence.Practical ExampleIn tasks like research paper evaluation, GoT helps in organizing and tracing the evolution of ideas. For example:A starting thought might be “The paper introduces a new machine learning model”.Subsequent thoughts could include “The model lacks comparative analysis with benchmarks” or “The training data is insufficiently described”.These child thoughts connect to further insights: “The model’s performance is hard to assess” or “The results may not be reproducible”.These connections create a directed graph that form a directed acyclic graph (DAG) when thoughts from different branches interrelate. The graph can include supportive relationships, contradictions, or derivations.Advantages of GoTUsing a graph instead of a linear list or tree offers several benefits:Richer, more nuanced reasoning: Thoughts can influence multiple paths of analysis.Reusability: The same thought can influence multiple reasoning threads without regeneration, reducing redundancy and improving computational efficiency.Lower latency: Compared to Tree of Thought (ToT), GoT avoids redundant evaluations since nodes can be reused across multiple parts of the graph.Traceability: Makes it easier to track how final judgments emerged from smaller insights.Interpretability: Captures relationships and dependencies among ideas more explicitly.Challenges of GoTDespite its advantages, GoT presents several challenges:Complexity: Managing a dynamic graph is more complex than working with a linear sequence or tree.Pruning difficulty: Removing one node might affect multiple connected paths.Visualization challenges: Dense graphs can become cluttered and difficult to navigate compared to hierarchical trees.Transformations of ThoughtsGoT enables novel “graph-enabled transformations” of thoughts:Aggregation: Combining multiple thought paths to merge strengths while eliminating weaknesses.Refinement: Creating loops to iteratively improve particular thoughts.Network reasoning: Forming connections between previously separate thought paths.This approach works well for tasks that can be decomposed into smaller subtasks solved individually and then merged for a final solution.Graph of Thoughts: ExampleIn the Graph of Thoughts framework, we treat each research paper as a node and model the relationships between papers as edges. These edges can represent various types of relationships, such as:Common topicsShared authorsCitation linksSimilar methodologiesWhen classifying a new test paper, we create a graph where the test paper is compared against nodes (papers) in the training set based on these relationships. By traversing this graph, we can identify patterns and connections that reveal:The paper’s relevance to existing categories.Its position within a broader network of research.The classification decision is then made by evaluating the most significant and meaningful relationships (edges) between the test paper and other papers in the graph.Graph of Thoughts PromptPrompt: “Given a new test research paper, represent it as a node in a graph where each research paper is a node and the edges between them represent relationships like shared topics, authors, citations, or research methodologies. Traverse the graph to identify the most relevant papers based on these relationships. At each step, evaluate how closely the test paper aligns with known categories based on its connections with other papers. Continue exploring the strongest connections and determine if the test paper is classifiable or not based on its position in the graph. Explain which relationships led to the final decision.”Performance and ApplicationsResearch shows GoT significantly outperforms other prompting schemes:Improves upon Chain of Thought (CoT) by approximately 70%.Outperforms Tree of Thought (ToT) by approximately 62% in sorting quality.Reduces costs by more than 31% compared to ToT.GoT has demonstrated effectiveness in various applications:Sorting tasksKeyword counting for summariesSet operationsDocument mergingOther tasks requiring complex synthesis of informationComparing the Three ApproachesEach of these frameworks represents a progressive evolution in how LLMs can approach complex reasoning tasks:Chain of Thought (CoT)Strengths: Simple to implement, effective for sequential reasoning tasks.Limitations: Limited to linear reasoning, no backtracking capability, less effective for problems requiring exploration.Best for: Arithmetic, commonsense reasoning, and tasks with clear sequential steps.Tree of Thoughts (ToT)Strengths: Enables exploration and backtracking, systematically evaluates multiple reasoning paths.Limitations: Increased resource consumption, inefficient for simpler tasks, limited by hierarchical structure.Best for: Problems with multiple possible approaches, creative tasks, puzzles requiring lookahead.Graph of Thoughts (GoT)Strengths: Maximum flexibility, enables complex thought transformations, closest to human cognitive processes.Limitations: More complex to implement, potentially higher computational overhead.Best for: Tasks requiring synthesis of multiple approaches, problems that can be decomposed into interconnected subtasks.Conclusion: The Evolution of AI ReasoningThe progression from Chain of Thought to Tree of Thoughts to Graph of Thoughts represents a fascinating evolution in how we’re teaching AI systems to reason. Each framework brings LLMs closer to mimicking human cognitive processes, with GoT perhaps offering the closest approximation yet to how human brains form complex networks of thoughts.As these techniques continue to evolve, we can expect further refinements that may eventually enable LLMs to tackle problems with reasoning capabilities that approach or even surpass human abilities in certain domains. The development of these frameworks not only improves LLM performance but also provides valuable insights into the nature of reasoning itself — both artificial and human.For developers and users of AI systems, understanding these frameworks offers powerful tools to extract more sophisticated reasoning from LLMs, turning them from simple text predictors into genuine thinking partners capable of breaking down and solving complex problems in increasingly human-like ways.Here is the link to my GitHub repository containing implementation of ToT and GoT:GitHubCheck this out:https://medium.com/@dewanshsinha71/rotary-positional-embedding-rope-7bc5afb92af9Links to the original papers are given below:Chain of ThoughtsTree of ThoughtsGraph of ThoughtsAdvanced Reasoning Frameworks in Large Language Models: Chain, Tree, and Graph of Thoughts was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.