The List / Agents and Multi-Agent Systems / paper
TradingGPT: Multi-Agent System with Layered Memory and Distinct Characters for Enhanced Financial Trading Performance
Abstract
Large Language Models (LLMs), prominently highlighted by the recent evolution in the Generative Pre-trained Transformers (GPT) series, have displayed significant prowess across various domains, such as aiding in healthcare diagnostics and curating analytical business reports. The efficacy of GPTs lies in their ability to decode human instructions, achieved through comprehensively processing historical inputs as an entirety within their memory system. Yet, the memory processing of GPTs does not precisely emulate the hierarchical nature of human memory. This can result in LLMs struggling to prioritize immediate and critical tasks efficiently. To bridge this gap, we introduce an innovative LLM multi-agent framework endowed with layered memories. We assert that this framework is well-suited for stock and fund trading, where the extraction of highly relevant insights from hierarchical financial data is imperative to inform trading decisions. Within this framework, one agent organizes memory into three distinct layers, each governed by a custom decay mechanism, aligning more closely with human cognitive processes. Agents can also engage in inter-agent debate. In financial trading contexts, LLMs serve as the decision core for trading agents, leveraging their layered memory system to integrate multi-source historical actions and market insights. This equips them to navigate financial changes, formulate strategies, and debate with peer agents about investment decisions. Another standout feature of our approach is to equip agents with individualized trading traits, enhancing memory diversity and decision robustness. These sophisticated designs boost the system's responsiveness to historical trades and real-time market signals, ensuring superior automated trading accuracy.
In one sentence
Summary
The paper addresses the limitation of standard LLMs in financial trading, where processing all historical inputs as a single block fails to emulate human hierarchical memory, leading to inefficient prioritization of critical market events. The authors propose TradingGPT, a multi-agent system designed to extract relevant insights from hierarchical financial data by organizing agent memories into short, middle, and long-term layers, each governed by custom decay mechanisms that align with human cognitive processes. This structure allows agents to better navigate financial changes and formulate strategies by integrating multi-source historical actions and real-time market insights. The methodology employs a multi-modal dataset sourced from Databento, Alpaca News, and ARK fund holdings, processed via FAISS for semantic retrieval. Agents are assigned distinct trading characters (risk-seeking, neutral, or averse) and sector specializations to ensure decision diversity. The system utilizes a dual workflow: single-agent immediate and extended reflections for daily trading decisions, and a multi-agent debate mechanism where agents exchange top-ranked memories and recommendations to optimize trades on shared stocks. The evaluation uses financial metrics like Sharpe Ratio and cumulative returns, comparing performance against baseline strategies using GPT-3.5 Turbo. Findings indicate that the layered memory and debate mechanisms significantly improve trading accuracy and adaptability to market signals compared to single-agent baselines. The distinct character design enhances robustness by preventing herd behavior and uncovering latent opportunities. However, the study is currently in the prompt design and ablation phase, with full comparative results against reinforcement learning baselines pending. Limitations include reliance on specific LLM backbones and the need for further validation on high-frequency trading scenarios beyond the daily granularity tested.
Research problem
Standard LLMs struggle with financial trading because they process historical inputs as a monolithic block, failing to prioritize immediate and critical tasks efficiently. This paper addresses the need for a memory structure that emulates human hierarchical cognition (short, middle, long-term) to better extract relevant insights from complex, hierarchical financial data. It also tackles the lack of diversity in single-agent trading systems by introducing distinct agent characters and inter-agent debate mechanisms.
Core contributions
- Introduction of TradingGPT, a multi-agent LLM framework with layered memory (short, middle, long-term) governed by custom decay mechanisms.
- Implementation of distinct agent characters with varying risk preferences (risk-seeking, neutral, averse) and sector specializations to enhance decision diversity.
- Development of a multi-modal data warehouse integrating stock prices, news, and fund holdings for comprehensive market context.
- Design of a dual workflow featuring single-agent reflections and multi-agent debate mechanisms for collaborative strategy optimization.
- Demonstration of improved automated trading performance through enhanced responsiveness to historical trades and real-time market cues.
Method
- Layered memory formulation with short, middle, and long-term layers.
- Custom decay mechanisms for memory stability based on recency, relevancy, and importance.
- Min-max scaling and linear combination of scores for memory event ranking.
- Add-counter function to boost scores of events linked to significant trading profits/losses.
- Single-agent workflow with immediate and extended reflections for daily trading.
- Multi-agent debate mechanism for exchanging top-K memories and recommendations.
- Use of GPT-3.5 Turbo as the backbone LLM for agent decision-making.
- Semantic search using FAISS for retrieving relevant memory events.
Results & findings
- Layered memory structure aligns with human cognitive processes, improving event prioritization.
- Distinct agent characters enrich memory diversity and improve decision robustness.
- Inter-agent debate mechanism facilitates collaborative strategy optimization.
- System demonstrates augmented adaptability to historical trades and real-time market cues.
- Premier automated trading with heightened execution accuracy compared to single-agent approaches.
- Integration of macro and micro perspectives through multi-modal data enhances market view.
- Prompt templates designed for key workflow steps enable efficient LLM interaction.
- Future work includes ablation studies on different LLM backbones like CodeLlama 34B.
Data & experiments
- Multi-modal dataset from August 2020 to August 2023, including Databento stock prices, Alpaca News, and ARK fund holdings.
- Use of FAISS vector database for efficient semantic search and retrieval of memory events.
- Training phase using historical trading records from ARK funds to guide agent decisions.
- Testing phase relying on daily stock prices and time series patterns of prior reflections/debates.
- Evaluation metrics include cumulative trade returns, volatility, and Sharpe Ratio.
- Comparison against single-agent baselines and planned comparison with multi-agent reinforcement learning.
Limitations & caveats
- Study is currently in the prompt design and ablation phase; full comparative results are pending.
- Reliance on specific LLM backbones (GPT-3.5 Turbo) may limit generalizability.
- Testing phase uses daily stock prices, potentially missing high-frequency trading dynamics.
- Lack of ground truth in testing phase relies on historical patterns, which may not reflect future market conditions.
- Potential for overfitting to ARK fund trading records during the training phase.
- Complexity of managing multiple agents and debates may increase computational costs.
Curator notes
Discovery status: round1_promoted_seed_for_round2. Source links: A Comprehensive Review of Generative AI in Finance; AI in Investment Analysis: Large Language Models for Equity Stock Ratings; Agentic AI Systems Applied to tasks in Financial Services: Modeling and model risk management crews; BloombergGPT: A Large Language Model for Finance; DeltaHedge: A Multi-Agent Framework for Portfolio Options Optimization; FLAG-Trader: Fusion LLM-Agent with Gradient-based Reinforcement Learning for Financial Trading; FinGPT: Open-Source Financial Large Language Models; L