Graph of Thought (GoT) for Complex Problem of LLM
Dr. Manish Kumar Saraf - DSC, PhD, MBA,
Associate Director | Artificial |Intelligence | Generative AI Architect | MAS (Muti-Agent System | Knowledge Graph | LLMs | Certified | Automation | Vector Database | Author | Innovator
Imagine thinking not as a linear chain of thoughts, but as a vibrant ecosystem interconnected through a rich network of ideas. This, my friends, is the essence of the Graph of Thought (GoT) – a groundbreaking paradigm in Artificial Intelligence that promises to push the boundaries of machine reasoning and communication.
For years, large language models (LLMs) have captivated us with their ability to generate human-quality text. But their limitations became evident – they often produced repetitive outputs, struggled with complex reasoning tasks, and lacked the fluidity of authentic human thought.
Enter the Graph of Thought. Instead of confining thoughts to a rigid sequence, GoT models represent them as nodes within a sprawling graph. Each node holds a concept, an idea, or a piece of information, while edges connect them, capturing the intricate relationships and dependencies between them.
Architecture Overview of Graph of Thought
The GoT (Graph of Thoughts) system follows a structured process:
Controller Initiation: The Controller begins by executing operations based on the structure defined in the GoO (Graph of Operations).
# Initialization of the Controller with the language model, operations graph, prompter, parser, and problem parameters #
controller = Controller(
lm=ChatGPT(), # Instance of the language model
graph=graph_of_operations, # Operations graph composed of Generate, Validate, and Score operations
prompter=PortfolioPrompter(), # Custom prompter for portfolio-related queries
parser=PortfolioParser(), # Custom parser to interpret the language model's responses
problem_parameters={
'available_projects': [{'value': 3, 'budget': 2}, {'value': 1, 'budget': 2}, ...],
'budget_limit': 2,
'generated_portfolio': None
}
)
## Graph of Operations (GoO): Structures the sequence of operations (Generate, Validate, and Score) ##
### Generate Portfolio Operation
class GeneratePortfolioOperation(Operation):
# Generates various portfolio configurations within the budget limit
def _execute(self, lm, prompter, parser, **kwargs):
available_projects = kwargs.get('available_projects')
budget_limit = kwargs.get('budget_limit')
# Logic to generate portfolios
self.generated_portfolios = self.generate_new_portfolios(available_projects, budget_limit)
kwargs['generated_portfolio'] = self.generated_portfolios
def generate_new_portfolios(self, available_projects, budget_limit):
# Returns a list of portfolio configurations
# ...
### Validate PortfolioOperation
class ValidatePortfolioOperation(Operation):
# Validates each generated portfolio against the budget limit
def _execute(self, lm, prompter, parser, **kwargs):
portfolio = kwargs.get('generated_portfolio')
budget_limit = kwargs.get('budget_limit')
# Validation logic
self.is_valid = self.validate_portfolio(portfolio, budget_limit)
def validate_portfolio(self, portfolio, budget_limit):
# Returns True if the portfolio is within the budget limit
# ...
### Score Portfolio Operation
class ScorePortfolioOperation(Operation):
# Assigns a score to each portfolio based on total value
def _execute(self, lm, prompter, parser, **kwargs):
portfolio = kwargs.get('generated_portfolio')
self.total_value = self.score_portfolio(portfolio)
def score_portfolio(self, portfolio):
# Returns the total value of the portfolio
# ...
Prompt Generation: For each operation, the Controller uses the Prompter to create relevant prompts, considering the current GRS (Graph of Reasoning States). These prompts are then sent to the LLM (Language Learning Model).
LLM Response: The LLM responds to the prompts, and the Parser processes these responses. The Parser extracts useful information or generates new thoughts.
GRS Update: Extracted information is used to update the GRS. This update may involve adjusting thought states, validity, and scores.
Scoring and Validation: The Scoring and Validation Module evaluates these updates, ensuring that the reasoning process aligns with the problem’s goals.
领英推荐
Iterative Process: This cycle continues until all operations in the graph are traversed, resulting in a final set of thoughts or conclusions.
Shift in perspective unlocks a Pandora's box of possibilities:
This revolution is still in its nascent stages, but its potential is undeniable. With its flexibility and dynamism, the Graph of Thought promises to bridge the gap between the rigid logic of machines and the fluid intelligence of humans.
And that's just the beginning. From personal assistants that truly understand your needs to AI researchers uncovering profound scientific discoveries, the possibilities are endless.
So, buckle up, and let's dive into the exciting world of Graph of Thought – a glimpse into the future of AI where machines not just think, but think like us.
Stay tuned for further exploration of this revolutionary concept, including:
Get ready to have your mind blown by the power of interconnected thought!
References: