-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f591946
commit d4038d5
Showing
6 changed files
with
173 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
Subject: Techniques used to enable complex reasoning in LLM AI agents | ||
--- | ||
|
||
The following research report provides an overview of the techniques being developed and employed to enable complex reasoning in Large Language Model (LLM) AI agents. The information is based on the insights gathered from several web resources, including surveys, reviews, and articles. | ||
|
||
## Background | ||
|
||
Large Language Models (LLMs), such as GPT-4, have made significant strides in natural language understanding and generation. However, they face challenges such as multimodality, human value alignment, hallucinations, and evaluation when it comes to complex reasoning tasks. To address these limitations, researchers and developers are exploring the design of autonomous agents that leverage external data, supplementary tools, and innovative prompting techniques to enhance the reasoning capabilities of LLMs. | ||
|
||
## Key Techniques | ||
|
||
### Chain-of-thought Prompting (CoT) | ||
|
||
This technique encourages LLMs to generate intermediate reasoning steps before arriving at a final answer, particularly useful for complex problems. CoT prompts guide the model to think aloud and provide an explicit explanation of their thought process. | ||
|
||
Example: For a math problem like "What is the sum of the consecutive numbers starting from 1 up to 100?", a CoT prompt might look like this: | ||
|
||
Q: What is the sum of the consecutive numbers starting from 1 up to 100? | ||
A: Let's think step by step. | ||
------ (LLMs Output) | ||
First, we need to find the last number in the sequence, which is 100. | ||
The sum of a consecutive sequence can be found by the formula (n/2)*(first number + last number) where n is the total number of terms. | ||
So, we have (100/2)*(1+100), which simplifies to 50*101. | ||
Therefore, the sum is 5050. | ||
|
||
### Self-consistency with CoT | ||
|
||
This approach generates multiple reasoning paths and answers for the same question and then selects the most common answer across these paths. | ||
|
||
Example: For a question about rainfall, the model might generate different chains of thought, and the most common answer is selected for consistency. | ||
|
||
### Tree-of-thought (ToT) Prompting | ||
|
||
This technique represents the reasoning process as a tree structure, with branches representing different lines of reasoning. | ||
|
||
Example: For a multi-step logic puzzle, ToT might involve branching out possibilities like this: | ||
|
||
Q: Start at the root: What is the color of the bear? | ||
------ A: Branch 1: If the bear is in the North Pole, it must be white because polar bears live there. | ||
Branch 2: If the bear is in the forest, it could be brown or black. | ||
Conclusion: Given the additional information that the bear is in the North Pole, we follow Branch 1 and determine the bear is white. | ||
|
||
### Reasoning via Planning (RAP) | ||
|
||
This technique generates a plan of action based on given goals and constraints to solve a problem. | ||
|
||
Example: For a cooking recipe, RAP could generate a plan like this: | ||
|
||
Goal: Bake a chocolate cake. | ||
Step 1: Gather ingredients - flour, sugar, cocoa powder, etc. | ||
Step 2: Preheat the oven to 350°F. | ||
Step 3: Mix dry ingredients. | ||
... | ||
Step n: Bake for 30 minutes and let cool. | ||
|
||
### ReAct | ||
|
||
This prompting technique helps LLMs not only reason about a problem but also take actions like interacting with an API or a database, based on the reasoning process. | ||
|
||
Example: If tasked with finding the weather forecast, a ReAct prompt might look like this: | ||
|
||
First, determine the user's location. | ||
Next, access the weather API with the location data. | ||
Then, retrieve the forecast information and present it to the user in a readable format. | ||
|
||
### Self-Refine | ||
|
||
This approach leverages a cyclical process of self-improvement, enabling the model to enhance its own outputs autonomously through iterative self-assessment (feedback). | ||
|
||
Example: An example application of the Self-refine method could be in generating a summary of a complex article. | ||
|
||
### Reflexion | ||
|
||
This innovative approach enhances language agents by using linguistic feedback as a means of reinforcement, diverging from conventional practice. | ||
|
||
### Language Agent Tree Search (LATS) | ||
|
||
This strategy combines language models with tree search algorithms to explore a large number of potential actions and outcomes, particularly powerful in game-playing scenarios or situations with a wide range of possible decisions. | ||
|
||
## Conclusion | ||
|
||
These techniques represent significant leaps forward in the capabilities of LLMs to perform more complex reasoning tasks and interact with their environment in meaningful ways. As research continues and these models evolve, we can expect even more sophisticated prompting methods to emerge, further closing the gap between artificial and human intelligence. The design of autonomous agents that leverage external data, supplementary tools, and innovative prompting techniques will enable LLMs to accomplish complex goals that require enhanced reasoning, planning, and tool execution capabilities. | ||
|
||
Sources: | ||
https://arxiv.org/html/2404.11584v1 | ||
https://arxiv.org/html/2404.04442v1 | ||
https://medium.com/the-modern-scientist/a-complete-guide-to-llms-based-autonomous-agents-part-i-69515c016792 | ||
https://llms-blog.medium.com/unlocking-advanced-reasoning-in-large-language-models-a-deep-dive-into-innovative-prompting-f3d8c2530831 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters