Source-linked AI summary

FinMem: A Performance-Enhanced LLM Trading Agent with Layered Memory and Character Design

Yangyang Yu, Haohang Li, Zhi Chen, Yuechen Jiang, Yang Li, Denghui Zhang, Rong Liu, Jordan W. Suchow, Khaldoun Khashanah

arXiv:2311.13743v2q-fin.CPcs.AIcs.CEcs.LG

TL;DR

Financial traders face more multi-source information than human memory can reliably process, while existing trading agents struggle with interpretable reasoning and comprehensive use of textual data. FINMEM addresses these gaps with layered memory and dynamic character design, and experiments report strong stock-trading performance, including with limited training data and adjustable memory capacity.

  • Problem

    Multi-source financial information exceeds human cognitive capacity, while existing trading agents lack interpretability and struggle to integrate textual financial information comprehensively.

  • Method

    FINMEM is an LLM-based autonomous trading agent with layered memory, dynamic character design, and working-memory operations for processing multi-source financial data into trading actions.

  • Results

    Experiments show that FINMEM stratifies and leverages multiple levels of market insight, achieves strong trading performance with six months to one year of daily training data, and benefits from adjustable memory capacity.

  • Takeaways & Limitations

    FINMEM demonstrates that an adjustable cognitive memory structure and dynamic character design can support automated stock trading on real-world financial datasets.

  • Takeaways & Limitations

    The approach used a limited range and quality of financial news and reports and general-purpose LLMs, leaving its performance with broader datasets and finance-specific LLMs as an anticipated improvement area.

Abstract

from arXiv · show

Recent advancements in Large Language Models (LLMs) have exhibited notable efficacy in question-answering (QA) tasks across diverse domains. Their prowess in integrating extensive web knowledge has fueled interest in developing LLM-based autonomous agents. While LLMs are efficient in decoding human instructions and deriving solutions by holistically processing historical inputs, transitioning to purpose-driven agents requires a supplementary rational architecture to process multi-source information, establish reasoning chains, and prioritize critical tasks. Addressing this, we introduce \textsc{FinMem}, a novel LLM-based agent framework devised for financial decision-making. It encompasses three core modules: Profiling, to customize the agent's characteristics; Memory, with layered message processing, to aid the agent in assimilating hierarchical financial data; and Decision-making, to convert insights gained from memories into investment decisions. Notably, \textsc{FinMem}'s memory module aligns closely with the cognitive structure of human traders, offering robust interpretability and real-time tuning. Its adjustable cognitive span allows for the retention of critical information beyond human perceptual limits, thereby enhancing trading outcomes. This framework enables the agent to self-evolve its professional knowledge, react agilely to new investment cues, and continuously refine trading decisions in the volatile financial environment. We first compare \textsc{FinMem} with various algorithmic agents on a scalable real-world financial dataset, underscoring its leading trading performance in stocks. We then fine-tuned the agent's perceptual span and character setting to achieve a significantly enhanced trading performance. Collectively, \textsc{FinMem} presents a cutting-edge LLM agent framework for automated trading, boosting cumulative investment returns.

1 Introduction

FINMEM addresses the difficulty of processing heterogeneous, time-sensitive financial information by combining layered memory with dynamic profiling in an LLM trading agent. Experiments report strong trading performance, extended perceptual capacity, and effective use of limited training data.

  • Motivation: Human traders face more web-sourced financial information than their perception and memory capacities can process, risking insufficient consideration of critical events.
  • Motivation: DRL agents often lack interpretability and struggle to integrate rich textual financial information directly into trading decisions.
  • FINMEM framework: FINMEM combines layered memory and dynamic character design to process multi-source financial data with different timeliness and adapt to volatile markets.Its memory separates information into shallow, intermediate, and deep layers with varied decay rates; daily news enters shallow processing, while annual reports enter deep processing.
  • Evaluation: The paper compares FINMEM with representative algorithmic agents and tunes backbone algorithms, working-memory capacity, and character settings to study performance.
  • FINMEM framework: Its profiling module supplies professional backgrounds and adjustable risk inclinations, while ablations indicate that the agent can evolve its knowledge through continuous market interaction.
  • Results: FINMEM expands perceptual capacity by selecting a flexible number of top-ranked events from each hierarchical memory layer, exceeding the human working-memory range of five to nine events.
  • Results: FINMEM produces robust trading results from daily data collected over six months to a year, using smaller datasets and general-purpose LLMs than comparable models require.The paper attributes this efficiency to multi-source data utilization and precise identification of key trading signals.

2 Related Work

Related work spans rule-based, reinforcement-learning, deep-learning, and LLM-based trading agents. The paper emphasizes that DRL systems face interpretability and textual-information challenges, while LLM agents require modular architectures for autonomous operation.

  • Trading-agent evolution: Trading agents evolved from predefined rule-based strategies toward reinforcement-learning and deep-reinforcement-learning methods for complex market environments.
  • DRL limitations: DRL agents struggle to provide interpretable decisions and to exploit textual financial information because rich text embeddings are computationally demanding.
  • LLM agent architectures: Modern LLMs provide a basis for agents that can integrate textual and numerical information while expressing reasoning in plain text.
  • LLM agent architectures: LLM autonomous agents commonly use modules such as profiling, memory, planning, and actions, although module combinations vary by application.

3 Architecture of FINMEM

FINMEM combines profiling, layered memory, and decision-making modules to process financial information and generate trading actions. Its design adapts agent character and memory retention to market conditions and information timeliness.

  • Architecture overview: FINMEM comprises profiling, memory, and decision-making modules that tailor the agent, process financial information, and support investment decisions.The decision-making module integrates outputs from profiling and memory to choose Buy, Sell, or Hold actions.
  • 3.1 Profiling Module: The profiling module combines trading-specific professional knowledge with risk-seeking, risk-averse, and self-adaptive character settings.The self-adaptive setting can switch risk preferences in response to current market conditions, including when cumulative return falls below zero over a brief period.
  • 3.2 Memory Module: FINMEM’s memory module uses expandable working memory and layered long-term memory to process hierarchical financial information over different time scales.Working memory performs summarization, observation, and reflection, while long-term memory organizes insights by timeliness and decay rate.
  • 3.2.1 Working memory: Summarization condenses external market data into investment insights and routes them to long-term memory according to information time sensitivity.Daily news is directed toward shallow processing, whereas longer-lived information such as annual reports is processed more deeply.
  • 3.2.1 Working memory: Observation and reflection connect market facts with retrieved memory events to produce trading directions, rationales, and feedback for subsequent decisions.Immediate reflection supports direct execution, while extended reflection reassesses trends and cumulative returns over an M-day trace period before storage in deep memory.

4 Experiments Setups

The experiments evaluate FINMEM against algorithmic trading agents and buy-and-hold using multi-source financial data, layered memory warehouses, and five financial metrics.

  • The study asks whether FINMEM outperforms contemporary agents, handles limited-data tasks, benefits from different LLM backbones and risk inclinations, and filters information effectively.
  • FINMEM routes annual-report insights to deep memory, quarterly-report insights to intermediate memory, and daily-news insights to shallow memory according to timeliness.
  • Comparisons include three numeric-feature DRL agents, two LLM agents, and the buy-and-hold baseline.
  • Performance is evaluated with Cumulative Return, Sharpe Ratio, Annualized Volatility, Daily Volatility, and Max Drawdown, averaging outcomes across five repeated trials.

5 Experiments:

FINMEM is evaluated with GPT-4-Turbo against competing agents across five stocks, including limited-data settings and risk-profile ablations. It outperforms the alternatives on key return and risk-adjusted measures while adapting to shorter training histories.

  • 5.1 Implementation Details: FINMEM uses GPT-4-Turbo with temperature 0.7, while comparison agents follow aligned training and testing periods or extended DRL training for fairness.
  • 5.1 Implementation Details: Table 2 compares FINMEM and other agents across five stocks using five trading metrics, with Wilcoxon tests marking statistically significant results.
  • 5.2 Algorithmic Trading Agents Comparison (RQ1 & RQ2): FINMEM outperforms all compared agents and buy-and-hold in Cumulative Return and Sharpe Ratio, with statistically significant superiority over the second-best strategy.
  • 5.2 Algorithmic Trading Agents Comparison (RQ1 & RQ2): FINMEM achieves superior performance with much shorter training than DRL agents, making it useful for newly public companies with limited trading histories.
  • 5.2 Algorithmic Trading Agents Comparison (RQ1 & RQ2): Using less than six months of daily training data, FINMEM is further evaluated over an extended Tesla testing period.

6 Ablation Studies

The ablation studies examine FINMEM’s LLM backbone, risk-profile character design, and working-memory capacity, showing that these choices materially affect trading outcomes. GPT-4-family backbones, self-adaptive risk inclination, and tuned memory retrieval produced the strongest reported performance, while excessive retrieval could hurt in stable markets.

  • Backbone algorithm comparison: GPT-4 achieved the highest cumulative return, while GPT-4-Turbo achieved the most favorable Sharpe Ratio among the evaluated FINMEM backbones.GPT 3.5-Turbo followed closely; GPT-4-Turbo also showed lower volatility than GPT-4 during TSLA’s post-October 2022 decline.
  • Backbone algorithm comparison: GPT-4-Turbo was identified as the most suitable backbone algorithm for FINMEM.Its cumulative returns led before October 2022 and remained stable during the subsequent volatile downturn.
  • Character design and risk inclination: The self-adaptive risk profile was the only configuration with positive cumulative return, Sharpe Ratio above 2.0, and the least Max Drawdown.Risk-seeking behavior benefited stable or bullish markets but deteriorated during downturns, whereas risk-averse behavior often lagged the market baseline.
  • Working-memory capacity: Across all tested K configurations, FINMEM outperformed the Buy & Hold baseline with positive cumulative returns and Sharpe Ratios.K values of 5 and 10 achieved the best cumulative returns and Sharpe Ratios exceeding 2.0.
  • Working-memory capacity: K=5 was optimal for TSLA, delivering robust performance with the lowest Volatility and Max-Drawdown.K=10 performed effectively during volatility but incurred significant losses in stable market conditions.
  • Working-memory capacity: The optimal Top-K value may vary with the volume and quality of incoming information.The study links performance gains to assimilating key signals from a sufficient quantity of filtered memories across layers.

7 Conclusion and future work

FINMEM combines adjustable cognitive memory with dynamic character design to process diverse financial information and adapt trading behavior. The paper reports enhanced stock-trading performance, while noting that broader data and finance-specific LLMs could further improve efficacy and proposing multi-agent portfolio optimization as future work.

  • Conclusion: FINMEM is an automated trading framework with adjustable cognitive memory and dynamic character design.Its critical components were evaluated in ablation studies for their roles in optimizing trading outcomes.
  • Conclusion: FINMEM demonstrated enhanced stock-trading performance on real-world financial datasets.The framework is described as transforming diverse financial data into investment strategies with a reduced training duration.
  • Conclusion: The memory module organizes financial data with varying timeliness into a self-evolving long-term memory layer.Dynamic character design filters impactful incoming messages using professional insights, while multiple risk profiles support adaptation across market conditions.
  • Limitations: The experiments used a limited range and quality of financial news and reports with general-purpose LLM backbones.The authors anticipate higher efficacy from more comprehensive data and LLMs tailored to financial contexts.
  • Future work: Future work proposes a multi-agent FINMEM system for portfolio optimization across multiple financial products.The envisioned system would use diverse professional profiles, peer communication, and sequential performance analysis.
Loading 2311.13743v2…