Skip to content

Latest commit

 

History

History
218 lines (159 loc) · 7.65 KB

File metadata and controls

218 lines (159 loc) · 7.65 KB
title Enhanced Reasoning
description Improve LLM responses with advanced reasoning techniques

DeepMyst's enhanced reasoning capabilities enable LLMs to solve complex problems more collaboratively and effectively by applying structured thinking approaches to their response generation process.

Understanding Enhanced Reasoning

Traditional LLM responses sometimes lack the careful step-by-step reasoning needed for complex problems. DeepMyst addresses this by implementing various reasoning frameworks that guide models through more structured thought processes, resulting in more accurate, logical, and comprehensive responses.

DeepMyst reasoning utilizes several models to solve the same query, finding the best model for every step in the reasoning process.

DeepMyst Cross Model Reasoning

Benefits of Enhanced Reasoning

Reduce errors in complex reasoning tasks like math problems and logic puzzles Enable more sophisticated approaches to multi-step problems Get clearer, more organized explanations of complex topics See the model's thought process, not just the final answer

Available Reasoning Techniques

DeepMyst supports multiple reasoning techniques, each optimized for different types of tasks:

Chain-of-Thought (COT)

The default reasoning technique that guides the model to break down problems into sequential steps:

# Using Chain-of-Thought reasoning (default)
response = client.chat.completions.create(
    model="gpt-4o-mini-reason",  # The -reason flag enables COT by default
    messages=[
        {"role": "user", "content": "If Sarah has 5 apples and gives 2 to Tom, then buys 3 more and gives half of her apples to Lisa, how many apples does Sarah have left?"}
    ]
)

Tree-of-Thought (TOT)

Explores multiple reasoning paths simultaneously and selects the most promising one:

# Using Tree-of-Thought reasoning
response = client.chat.completions.create(
    model="gpt-4o-mini-reason-TOT",  # Specify TOT reasoning
    messages=[
        {"role": "user", "content": "Find the most efficient algorithm for sorting a nearly-sorted array."}
    ]
)

Graph-of-Thought (GOT)

Creates a network of interconnected concepts to solve problems with many related components:

# Using Graph-of-Thought reasoning
response = client.chat.completions.create(
    model="claude-3-opus-reason-GOT",
    messages=[
        {"role": "user", "content": "Analyze how changes in interest rates affect different sectors of the economy."}
    ]
)

Self-Consistency (SC)

Generates multiple independent solutions and identifies the most consistent answer:

# Using Self-Consistency reasoning
response = client.chat.completions.create(
    model="gpt-4o-reason-SC",
    messages=[
        {"role": "user", "content": "Solve this probability problem: In a class of 30 students, what's the probability that at least two students share the same birthday?"}
    ]
)

Iterative Hierarchy-of-Thought (IHoT)

Tackles problems by breaking them into hierarchical sub-problems:

# Using Iterative Hierarchy-of-Thought reasoning
response = client.chat.completions.create(
    model="gpt-4o-reason-IHoT",
    messages=[
        {"role": "user", "content": "Design a comprehensive system architecture for an e-commerce platform."}
    ]
)

Recursive Thinking (RT)

Applies repeated reasoning steps to increasingly refined versions of a problem:

# Using Recursive Thinking reasoning
response = client.chat.completions.create(
    model="claude-3-haiku-reason-RT",
    messages=[
        {"role": "user", "content": "Write a recursive algorithm to find all permutations of a string."}
    ]
)

Choosing the Right Reasoning Technique

Different reasoning techniques excel at different types of problems:

Reasoning Technique Best For Example Task
Chain-of-Thought (COT) General problem-solving, step-by-step reasoning Math word problems, logical puzzles
Tree-of-Thought (TOT) Problems with multiple potential approaches Complex coding tasks, strategic planning
Graph-of-Thought (GOT) Interconnected concepts, relational reasoning System analysis, causal relationships
Self-Consistency (SC) Probabilistic problems, verification Math proofs, probability questions
Iterative Hierarchy-of-Thought (IHoT) Complex systems, hierarchical structures Software architecture, organization design
Recursive Thinking (RT) Nested problems, pattern recognition Recursive algorithms, fractal analysis

If you're unsure which technique to use, DeepMyst can automatically select the most appropriate one:

# Let DeepMyst select the best reasoning technique
response = client.chat.completions.create(
    model="gpt-4o-reason-auto",
    messages=[
        {"role": "user", "content": "What's the most efficient way to find the kth smallest element in an unsorted array?"}
    ]
)

Combining with Other DeepMyst Features

Enhanced reasoning can be combined with other DeepMyst features for even better results:

With Token Optimization

# Combine reasoning with token optimization
response = client.chat.completions.create(
    model="gpt-4o-reason-optimize",
    messages=[
        {"role": "user", "content": "Explain quantum computing principles and their applications in cryptography."}
    ]
)

With Automatic Model Selection

# Use reasoning with the optimal model
response = client.chat.completions.create(
    model="DeepMyst-auto-reason",
    messages=[
        {"role": "user", "content": "Design an algorithm to efficiently find duplicate files across a network."}
    ]
)

With Specific Techniques and Priorities

# Use Tree-of-Thought reasoning with optimal model, prioritizing performance
response = client.chat.completions.create(
    model="DeepMyst-auto-performance-reason-TOT",
    messages=[
        {"role": "user", "content": "What's the optimal strategy for the prisoner's dilemma when played repeatedly?"}
    ]
)

Implementation Best Practices

To maximize the benefits of enhanced reasoning:

  1. Match technique to task: Choose reasoning techniques based on the problem type

  2. Structure complex queries: Clearly define the problem and expected format

  3. Use auto-selection: When in doubt, let DeepMyst choose the best reasoning approach

  4. Balance with optimization: Consider token usage impacts when using reasoning techniques

  5. Review reasoning steps: Analyze the model's thought process to identify and correct flaws

Real-World Applications

Enhanced reasoning is particularly valuable for:

  • Educational tools: Explain complex concepts with step-by-step reasoning

  • Financial analysis: Work through multi-factor investment decisions

  • Scientific research: Break down complex hypotheses and experimental designs

  • Software development: Design algorithms and debug complex code

  • Strategic planning: Evaluate multiple approaches to business challenges

  • Medical diagnosis: Work through differential diagnoses systematically