The List / Agents and Multi-Agent Systems / paper
FinMem: A Performance-Enhanced Large Language Model Trading Agent with Layered Memory and Character Design
Abstract
We introduce FinMem, a novel Large Language Models (LLM)-based agent framework for financial trading, designed to address the need for automated systems that can transform real-time data into executable decisions. FinMem comprises three core modules: Profile for customizing agent characteristics, Memory for hierarchical financial data assimilation, and Decision-making for converting insights into investment choices. The Memory module, which mimics human traders’ cognitive structure, offers interpretability and real-time tuning while handling the critical timing of various information types. It employs a layered approach to process and prioritize data based on its timeliness and relevance, ensuring that the most recent and impactful information is given appropriate weight in decision-making. FinMem’s adjustable cognitive span allows retention of critical information beyond human limits, enabling it to balance historical patterns with current market dynamics. This framework facilitates self-evolution of professional knowledge, agile reactions to investment cues, and continuous refinement of trading decisions in financial environments. When compared against advanced algorithmic agents using a large-scale real-world financial dataset, FinMem demonstrates superior performance across classic metrics like Cumulative Return and Sharpe ratio. Further tuning of the agent’s perceptual span and character setting enhances its trading performance, positioning FinMem as a cutting-edge solution for automated trading.
In one sentence
Summary
The paper addresses the limitations of existing LLM-based financial agents, which often lack robust memory mechanisms to handle the varying timeliness of financial data, and Deep Reinforcement Learning (DRL) agents, which suffer from poor interpretability and difficulty integrating textual information. FinMem is proposed as a transparent, autonomous trading agent that mimics human cognitive structures to process multi-source financial data. It aims to bridge the gap between general-purpose LLMs and specialized trading needs by providing a framework that can self-evolve its knowledge base and adapt to market volatility through adjustable risk profiles. FinMem comprises three modules: Profiling, Memory, and Decision-making. The Profiling module sets a dynamic character with specific professional backgrounds and adjustable risk inclinations (risk-seeking, risk-averse, or self-adaptive). The Memory module features a layered long-term memory (shallow, intermediate, deep) that stores insights from daily news, 10-Q reports, and 10-K reports with different decay rates, alongside a working memory for summarization and reflection. The Decision-making module uses these memories to generate buy/sell/hold actions. Experiments were conducted on real-world stock data (e.g., TSLA) comparing FinMem against DRL agents like PPO and DQN, using metrics such as Cumulative Return and Sharpe Ratio. FinMem demonstrates superior trading performance compared to DRL baselines, achieving higher Cumulative Returns and Sharpe Ratios. The study highlights that tuning the working memory capacity (Top-K) significantly impacts performance, with K=5 showing optimal results for TSLA. The self-adaptive risk profile allows the agent to mitigate losses during downturns. Limitations include reliance on general-purpose LLMs and limited dataset scope, though the authors note potential for improvement with financial-specific LLMs and larger datasets. The framework is also suggested for multi-agent portfolio optimization.
Research problem
Existing LLM-based trading agents often function merely as question-answering systems without robust memory, failing to prioritize time-sensitive financial data effectively. Meanwhile, Deep Reinforcement Learning (DRL) agents, while powerful, lack interpretability and struggle to integrate rich textual financial information due to computational constraints and convergence issues. There is a need for an autonomous trading agent that combines the interpretability and text-processing capabilities of LLMs with a structured memory system to handle the temporal dynamics of financial markets.
Core contributions
- Introduction of FinMem, an LLM-based autonomous trading agent framework with a novel layered memory system and dynamic character design.
- Development of a memory module that emulates human cognitive structures, featuring working memory and layered long-term memory with adjustable decay rates for different data types.
- Implementation of a dynamic profiling module that allows for self-adaptive risk inclination switching based on market performance.
- Demonstration of superior trading performance compared to Deep Reinforcement Learning (DRL) baselines on real-world stock datasets.
- Analysis of the impact of memory capacity (Top-K) and character settings on trading outcomes, providing guidelines for tuning agent parameters.
Method
- Profiling Module: Defines agent character with professional background and risk inclination (risk-seeking, risk-averse, self-adaptive).
- Layered Long-Term Memory: Stores summarized insights from news, 10-Q, and 10-K reports in shallow, intermediate, and deep layers with different decay rates.
- Working Memory: Performs summarization, observation, and reflection (immediate and extended) on retrieved memory events.
- Decision-Making: Generates trading actions (Buy/Sell/Hold) based on top-K memory events and current market conditions.
- Retrieval Score: Uses a modified score based on recency, relevance, and importance to rank memory events.
- Self-Adaptive Risk: Dynamically switches risk profiles based on cumulative return thresholds.
Results & findings
- FinMem outperforms DRL agents in Cumulative Return and Sharpe Ratio on stock trading tasks.
- The layered memory system effectively prioritizes information based on timeliness and importance.
- Tuning the working memory capacity (Top-K) significantly affects performance; K=5 was optimal for TSLA.
- Self-adaptive risk profiles help mitigate losses during market downturns by switching to risk-averse modes.
- FinMem achieves robust performance with limited training data (6-12 months) compared to other models.
- The agent provides interpretable trading decisions with clear reasoning based on retrieved memory events.
Data & experiments
- Real-world financial dataset including daily stock prices, market news, and company reports (10-Q, 10-K) for stocks like TSLA.
- Comparison against Deep Reinforcement Learning agents (PPO, DQN) and other algorithmic trading baselines.
- Evaluation metrics include Cumulative Return, Sharpe Ratio, Volatility, and Max-Drawdown.
- Ablation studies on memory capacity (Top-K) and character settings (risk profiles).
- Training period of 6-12 months, testing on unseen market conditions.
Limitations & caveats
- Relies on general-purpose LLMs; performance may vary with financial-specific models.
- Experiments limited to specific stocks (e.g., TSLA) and a relatively short time period.
- Dependence on the quality of news and report data for memory retrieval.
- Potential for overfitting to specific market conditions if not properly tuned.
- Computational cost of running LLMs for real-time decision-making may be high.
- Limited exploration of multi-agent interactions in the current framework.
Curator notes
Early influential LLM trading agent architecture.