SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.13743 · 2023

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

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2311.13743.json · badge: /api/ran/2311.13743.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
pipiku915/FinMem-LLM-StockTrading canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
FunctionStatusWhere it lives
calculate_cumulative_rewards Ran
ran, violated the contract we drafted
pipiku915/FinMem-LLM-StockTrading/data-pipeline/08-Wilcoxon-Test.py
code served (permissive licence) · get_code("06c8c337cb9faea4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function:
# - price: used with len() and indexed with [i] and [i+1], supports division and np.log
# - actions: used with len() and indexed with [i], supports multiplication
# Both should be array-like with numeric values

# Create small price array with realistic stock price values
price = np.array([100.0, 102.5, 101.8, 103.2])

# Create actions array (typically -1, 0, or 1 for sell, hold, buy)
actions = np.array([1, -1, 1, 0])

ARGS = {
    "price": price,
    "actions": actions,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
clean_news Ran
ran; our contract draft was wrong, not the code
pipiku915/FinMem-LLM-StockTrading/data-pipeline/02-Raw_News_Data_Cleaning_Refinitiv.py
code served (permissive licence) · get_code("d110f02f153fe0a4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd

# Create a small DataFrame with a 'body' column containing Reuters text
df = pd.DataFrame({
    'body': [
        'Some news text here (Reuters) and more text after',
        'Another article without the marker',
        '(Reuters) starts at beginning of this one'
    ]
})

ARGS = {
    'df': df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
combine_dataframes Ran
ran; our contract draft was wrong, not the code
pipiku915/FinMem-LLM-StockTrading/data-pipeline/04-data_pipeline.py
code served (permissive licence) · get_code("e2d9c4920efbcf3a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pickle
import pandas as pd
import tempfile
import os

# Create a temporary directory for the pickle file
temp_dir = tempfile.mkdtemp()

# Create sample dataframes with date and ticker columns
df1 = pd.DataFrame({
    'date': ['2024-01-01', '2024-01-02', '2024-01-03'],
    'AAPL': [150.0, 151.5, 152.0]
})

df2 = pd.DataFrame({
    'date': ['2024-01-01', '2024-01-02', '2024-01-03'],
    'GOOGL': [140.0, 141.2, 142.5]
})

df_list = [df1, df2]
path = temp_dir + '/'
tickers = ['AAPL', 'GOOGL']

ARGS = {
    'df_list': df_list,
    'path': path,
    'tickers': tickers
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_new_headline Ran
ran; our contract draft was wrong, not the code
pipiku915/FinMem-LLM-StockTrading/data-pipeline/02-Raw_News_Data_Cleaning_Refinitiv.py
code served (permissive licence) · get_code("7bdc0a64fe321fbc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
import pandas as pd

# Create a sample DataFrame row to pass to the function
# The function expects a pd.Series with 'update_number' and 'headline' columns

# Case 1: Row with an update number
row_with_update = pd.Series({
    'update_number': 1,
    'headline': 'UPDATE 1- Breaking news about weather'
})

# Case 2: Row without an update number (null value)
row_without_update = pd.Series({
    'update_number': None,
    'headline': 'Breaking news about weather'
})

# Define ARGS - we'll use the row with update number as the test case
ARGS = {
    'row': row_with_update
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
daily_reward Ran
ran, violated the contract we drafted
pipiku915/FinMem-LLM-StockTrading/data-pipeline/07-metrics.py
code served (permissive licence) · get_code("184f3f424dcccd97")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct small valid arguments for daily_reward function
price = [100.0, 102.5, 101.0, 103.5, 105.0]
actions = [1, -1, 1, 0.5]

ARGS = {
    "price": price,
    "actions": actions,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_update_number Ran
ran, honoured the contract we drafted
pipiku915/FinMem-LLM-StockTrading/data-pipeline/02-Raw_News_Data_Cleaning_Refinitiv.py
code served (permissive licence) · get_code("6d03bf7d835fdfa0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def extract_update_number(headline):
    """
    Extracts the update number from the beginning of a news headline.
    
    Parameters:
        headline (str): The headline string to be processed.

    Returns:
        int: The extracted update number, or 0 if not present.
    """
    match = re.match('UPDATE (\\d+)', headline)
    return int(match.group(1)) if match else 0


ARGS = {
    "headline": "UPDATE 42 - Breaking news from the conference"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_action Ran
ran; our contract draft was wrong, not the code
pipiku915/FinMem-LLM-StockTrading/data-pipeline/07-metrics.py
code served (permissive licence) · get_code("dae1a5ebf16c3cc2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import tempfile
import os

# Create a temporary CSV file with sample data
temp_dir = tempfile.mkdtemp()
temp_csv = os.path.join(temp_dir, "actions.csv")

# Create sample data
sample_data = {
    'date': ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05'],
    'action': ['BUY', 'SELL', 'HOLD', 'BUY', 'SELL']
}
df_sample = pd.DataFrame(sample_data)
df_sample.to_csv(temp_csv, index=False)

# Define ARGS dict with all parameters
ARGS = {
    'start': '2023-01-02',
    'end': '2023-01-04',
    'ticker': 'AAPL',
    'file_path': temp_csv,
    'col': ['date', 'action']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_action Ran
ran; our contract draft was wrong, not the code
pipiku915/FinMem-LLM-StockTrading/data-pipeline/08-Wilcoxon-Test.py
code served (permissive licence) · get_code("db5525231f727fc6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (7,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import tempfile
import os

# Create a temporary CSV file with test data
temp_dir = tempfile.mkdtemp()
csv_file = os.path.join(temp_dir, "test_actions.csv")

# Create sample data
df = pd.DataFrame({
    'timestamp': pd.date_range('2024-01-01', periods=10, freq='D'),
    'action_type': ['click', 'scroll', 'click', 'hover', 'click', 'scroll', 'click', 'hover', 'scroll', 'click']
})
df.to_csv(csv_file, index=False)

# Define arguments for get_action function
ARGS = {
    'start': '2024-01-02',
    'end': '2024-01-08',
    'file_path': csv_file,
    'col': ['timestamp', 'action_type']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (7,) — shape (7,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reward_list Ran
ran; our contract draft was wrong, not the code
pipiku915/FinMem-LLM-StockTrading/data-pipeline/06-Visualize-results.py
code served (permissive licence) · get_code("3128bb25059ad106")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct valid arguments for reward_list function
price = [100.0, 102.5, 101.2, 103.8, 105.1]
actions = [1.0, -0.5, 0.8, 1.2]

ARGS = {
    "price": price,
    "actions": actions
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
round_to_next_day Ran
ran; our contract draft was wrong, not the code
pipiku915/FinMem-LLM-StockTrading/data-pipeline/01_Alpaca_News_API_download.py
code served (permissive licence) · get_code("924174a2639a4d27")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Expr. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import polars as pl
from datetime import date, timedelta, datetime

# Create a sample Polars DataFrame with datetime column
df = pl.DataFrame({
    'timestamp': [
        datetime(2024, 1, 15, 14, 30, 45),
        datetime(2024, 1, 15, 16, 15, 30),
        datetime(2024, 1, 15, 16, 0, 0),
        datetime(2024, 1, 15, 17, 45, 15),
    ]
})

# The function expects a pl.Expr as input
date_expr = df.select('timestamp').to_series()

ARGS = {
    'date': pl.col('timestamp')
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
polars — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Expr — a Expr output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Expr output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
subset_symbol_dict Ran
ran; our contract draft was wrong, not the code
pipiku915/FinMem-LLM-StockTrading/data-pipeline/05-get_sentiment_by_ticker.py
code served (permissive licence) · get_code("0ea6e47dfb1b573b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pickle
import tempfile
import os

# Create a temporary pickle file with mock data
temp_dir = tempfile.mkdtemp()
input_file = os.path.join(temp_dir, 'env_data.pkl')

# Create mock data structure matching the expected format
mock_data = {}

# Create 3 sample date entries
for date_idx in range(3):
    date_key = f'2023-01-{date_idx+1:02d}'
    
    # Structure: [price_dict, news_dict, filing_q_dict, filing_k_dict]
    price_data = {
        'AAPL': 150.5,
        'GOOGL': 100.2,
        'MSFT': 300.1
    }
    
    news_data = {
        'AAPL': ['news1', 'news2'],
        'GOOGL': ['news3'],
        'MSFT': ['news4', 'news5', 'news6']
    }
    
    filing_q_data = {
        'AAPL': {'q1': 'filing_content_q'},
        'GOOGL': {'q2': 'filing_content_q'},
    }
    
    filing_k_data = {
        'AAPL': {'k1': 'filing_content_k'},
        'MSFT': {'k2': 'filing_content_k'},
    }
    
    mock_data[date_key] = [
        {'price': price_data},
        {'news': news_data},
        {'filling_q': filing_q_data},
        {'filling_k': filing_k_data}
    ]

# Write mock data to pickle file
with open(input_file, 'wb') as f:
    pickle.dump(mock_data, f)

# Define arguments for the function
ARGS = {
    'input_dir': input_file,
    'cur_symbol': 'AAPL'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_news_dict Not yet run
unverified (harvested, no recorded run)
pipiku915/FinMem-LLM-StockTrading/data-pipeline/04-data_pipeline.py
code served (permissive licence) · get_code("1166076c304f6066")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2311.13743")
get_code_for_paper("2311.13743")
have("2311.13743")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2311.13743.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2311.13743.svg)](https://syntology.ai/paper/2311.13743)

Connect an agent — have() is free.