ReACT: An AI system that Synergizes Reasoning and Acting
Exploring the future of AI decision-making and action
The last time I visited my general practitioner, he greeted me briefly from behind his desk, where he was comfortably seated, and gestured for me to take a seat. Before I could fully settle into my chair, he started writing on the prescription pad, occasionally making eye contact. He used some of his tools to check and confirm a few symptoms, then added more notes to the prescription. Once he was done, he was ready to answer any questions I had. At that moment, I was skeptical about the accuracy of his diagnosis since he hadn’t listened to me before writing his notes
However, a few days later, after I had recovered, I reflected on how crucial good judgment is in any profession. My doctor had various valid inputs even before I spoke: macro factors like current seasonal illnesses, and micro factors like my eyes, skin paleness, and voice coarseness. His ability to judge and make recommendations has been honed over years of practice and experience.
Whether you are a stock trader, a CEO, a doctor, a pilot, or an entrepreneur betting on the next disruptive idea, judgment plays a critical role.
Making good decisions relies heavily on one’s ability to take in as many inputs as possible, disregard noise, and synthesize all the information to arrive at a stance that leads to effective action.
How can we teach AI and LLMs to synergize reasoning and acting?
When they’ve all been trained on extensive corpora from the past? So far, we’ve explored using RAG for knowledge management with content grounded in your domain knowledge and improving the reasoning capabilities of Gen AI with COT prompting. It’s now time to elevate our approach and explore how we can use AI beyond content creation and semantic search to help drive actions based on reasoning.
ReACT: Reasoning and Acting in Harmony
For environments where immediate decision-making and actions are crucial, let me introduce you to ReACT (Reasoning and Acting). This methodology combines reasoning capabilities with real-time decision-making and actions. The ReACT approach leverages a few-shot prompting technique combined with Retrieval-Augmented Generation (RAG) and access to public or custom knowledge bases to create a three-step process: Thought, Action, and Observation/Summary.
- Thought: The model first generates reasoning based on the given input.
- Action: It then performs an action based on the reasoning, which may involve querying a database or executing a task.
- Observation/Summary: Finally, the model observes the results of the action and summarizes or updates its knowledge accordingly.
ReACT in Action: A Currency Trading Scenario
Practical applications of ReACT are in every industry. Here’s a use case for currency trading at PaisaBank:
One bustling Tuesday morning, the trading floor was abuzz with excitement. An economic report from the US was due, and traders were on edge, waiting for data that could sway the market. Arjun, the head trader, had his eyes glued to the screens, but this time, he felt a sense of calm. He knew ReACT prompting was about to change the game.
As the economic report was released, the ReACT system sprang into action.
Thought:
The system rapidly processed the new data (currency value, exchange rates, social media sentiments, news feeds, etc.,) considering the potential impact on various currencies. It generated hypotheses based on historical data and current economic indicators, predicting that the US dollar would strengthen significantly against the Euro.
Action:
Acting on this initial reasoning, the system immediately executed a series of strategic trades, buying USD and selling EUR. Simultaneously, it placed protective stop-loss orders to mitigate potential risks.
Observation/Summary:
As the market reacted to the report, the system continuously monitored the trades. It observed the USD rising as anticipated, confirming its hypothesis. The system summarized the results, noting the success of the initial trades and adjusting future strategies based on real-time market movements.
Throughout the day, the ReACT system’s dynamic reasoning and real-time adjustments allowed Paisa Bank to capitalize on the market’s volatility. Arjun watched in awe as the system’s actions led to unprecedented gains, outperforming human traders’ efforts. The system’s ability to adapt and refine its strategies on the fly was unparalleled.
With ReACT, you get an AI system that synergizes reasoning and acting to perform dynamic reasoning, creating, maintaining, and adjusting high-level plans for action (reason to act), while also interacting with external environments (e.g., IoT sensor data, market data) to incorporate additional information into reasoning (act to reason).