SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.04793 · NeurIPS · 2023

FinGPT: Instruction Tuning Benchmark for Open-Source Large Language Models in Financial Datasets

Christina Wang, Neng Wang, Bruce Yang

arXiv · PDF · Open in the Atlas

Code that ran

11 of 11 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; 0 honoured the contract we drafted, 2 violated it and 1 has no contract verdict; 8 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2310.04793.json · badge: /api/ran/2310.04793.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
AI4Finance-Foundation/FinGPT canonical (classifier label)
classifier basis: census
10 ran · 0 no recorded run
ai4finance-foundation/fingpt community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
LinearLayer_LoRA Ran
ran on a synthesized input
ai4finance-foundation/fingpt/fingpt/FinGPT_RAG/instruct-FinGPT/training/utils/module/lora.py
code served (permissive licence) · get_code("a96e07dcf3f1f8de")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, 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 torch
import torch.nn as nn

# Create a base weight tensor for a linear layer
# Using shape (out_features=5, in_features=3) to have distinct dimensions
base_weight = nn.Parameter(torch.randn(5, 3))

# Optional bias
base_bias = nn.Parameter(torch.randn(5))

INIT_ARGS = {
    'weight': base_weight,
    'lora_dim': 2,
    'lora_scaling': 1.0,
    'lora_droppout': 0.1,
    'bias': base_bias
}

# Input tensor: batch_size=2, in_features=3 (must match weight's columns)
input_tensor = torch.randn(2, 3)

ARGS = {
    'input': input_tensor
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
bin_mapping Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Forecaster/data.py
code served (permissive licence) · get_code("cab0ca5f5d5011c9")
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 math

def bin_mapping(ret):
    up_down = 'U' if ret >= 0 else 'D'
    integer = math.ceil(abs(100 * ret))
    return up_down + (str(integer) if integer <= 5 else '5+')

# The function takes a single parameter 'ret' which is a numeric value (float or int)
# It's used in comparisons and arithmetic operations
# Let's provide a few test cases

ARGS = {
    'ret': 0.03  # A positive return value that will map to 'U3'
}
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 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
check_package Ran
ran, violated the contract we drafted
AI4Finance-Foundation/FinGPT/cloud_test_fingpt.py
code served (permissive licence) · get_code("7e84fc5e535cbee5")
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 bool, ndim 0, dtype family float, 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 importlib.util

def check_package(package_name):
    """Check if a package can be imported and print its version."""
    spec = importlib.util.find_spec(package_name)
    if spec is None:
        print(f'[-] {package_name}: Not Installed')
        return False
    try:
        module = importlib.import_module(package_name)
        version = getattr(module, '__version__', 'Version unknown')
        print(f'[+] {package_name}: {version}')
        return True
    except Exception as e:
        print(f'[!] {package_name}: Import failed ({e})')
        return False


ARGS = {
    'package_name': 'torch'
}
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 bool, ndim 0, dtype family float, 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
dataset_csv_path Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Forecaster/market_sentiment.py
code served (permissive licence) · get_code("b238cd3633a995b0")
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 torch
import numpy as np

# Define ARGS dict with valid arguments for dataset_csv_path
ARGS = {
    'symbol': 'AAPL',
    'data_dir': '/data/stocks',
    'start_date': '2023-01-01',
    'end_date': '2023-12-31',
    'with_basics': True,
    'with_market_sentiment': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
enabled Ran
ran, violated the contract we drafted
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Forecaster/market_sentiment.py
code served (permissive licence) · get_code("2b49d3d2bda3735e")
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 bool, ndim 0, dtype family float, 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 os

# Set up environment variable for testing
os.environ['ADANOS_API_KEY'] = 'test_key_12345'

# The function 'enabled' takes one optional parameter: api_key
# It calls get_api_key(api_key) which either uses the provided api_key
# or falls back to os.environ.get('ADANOS_API_KEY', '')
# Then it returns bool() of that result

# Case 1: Test with explicit api_key provided
ARGS = {
    'api_key': 'my_custom_key'
}
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 bool, ndim 0, dtype family float, 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_api_key Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Forecaster/market_sentiment.py
code served (permissive licence) · get_code("761e6e67888a33d2")
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 os

# The function get_api_key takes an optional api_key parameter
# It either uses the provided api_key, falls back to environment variable ADANOS_API_KEY,
# or defaults to empty string, then strips whitespace

# Set up a valid test case
test_api_key = "test-key-12345"

ARGS = {
    'api_key': test_api_key
}
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 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
get_prompt Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Benchmark/utils.py
code served (permissive licence) · get_code("130ab5832e26fbdd")
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 torch

template_dict = {'default': 'Instruction: {instruction}\nInput: {input}\nAnswer: '}

def get_prompt(template, instruction, input_text):
    """
    Generates a prompt based on a predefined template, instruction, and input.

    Args:
    template (str): The key to select the prompt template from the predefined dictionary.
    instruction (str): The instruction text to be included in the prompt.
    input_text (str): The input text to be included in the prompt.

    Returns:
    str: The generated prompt.

    Raises:
    KeyError: If the provided template key is not found in the template dictionary.
    """
    if not instruction:
        return input_text
    if template not in template_dict:
        raise KeyError(f"Template '{template}' not found. Available templates: {', '.join(template_dict.keys())}")
    return template_dict[template].format(instruction=instruction, input=input_text)

ARGS = {
    'template': 'default',
    'instruction': 'Translate the following text to French',
    'input_text': 'Hello, how are you?'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
n_weeks_before Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Forecaster/data_infererence_fetch.py
code served (permissive licence) · get_code("f0af8e0445d8fede")
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.

from datetime import date, datetime, timedelta

def n_weeks_before(date_string, n):
    date = datetime.strptime(date_string, '%Y-%m-%d') - timedelta(days=7 * n)
    return date.strftime('%Y-%m-%d')

ARGS = {
    'date_string': '2024-01-15',
    'n': 3
}
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 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
resolve_symbol Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Forecaster/market_symbols.py
code served (permissive licence) · get_code("6f6d5a0985347117")
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 MarketSymbol. 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 torch
import numpy as np
from dataclasses import dataclass

@dataclass(frozen=True)
class MarketSymbol:
    display: str
    price: str
    provider: str

ARGS = {
    'symbol': '  AAPL  ',
    'market': 'US'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MarketSymbol — a MarketSymbol output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MarketSymbol 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
test_mapping Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Benchmark/utils.py
code served (permissive licence) · get_code("698fcf3cf5957913")
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.

from argparse import Namespace

torch_manual_seed_result = None
try:
    import torch
    torch.manual_seed(0)
    torch_manual_seed_result = True
except:
    pass

# Create a Namespace object with the instruct_template parameter
args = Namespace(
    instruct_template='default'
)

# Create a feature dictionary with instruction and input fields
feature = {
    'instruction': 'Classify the sentiment',
    'input': 'This movie is absolutely wonderful!'
}

ARGS = {
    'args': args,
    'feature': feature
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
tokenize Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinGPT/fingpt/FinGPT_Benchmark/utils.py
code served (permissive licence) · get_code("a8301984bfcfdc76")
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 torch
from argparse import Namespace

class MockTokenizer:
    def __init__(self):
        self.eos_token_id = 50256
        self.pad_token_id = 0
    
    def __call__(self, text, padding=False, max_length=None, truncation=False, add_special_tokens=True):
        # Simple mock: convert text to token ids (just use character codes as mock tokens)
        tokens = [ord(c) % 1000 for c in text[:max_length]] if text else []
        return {'input_ids': tokens}

torch.manual_seed(0)

ARGS = {
    'args': Namespace(
        instruct_template='default',
        max_length=128
    ),
    'tokenizer': MockTokenizer(),
    'feature': {
        'instruction': 'Summarize the text',
        'input': 'This is a sample input text for testing',
        'output': 'This is the expected output'
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 11 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-22.

Repositories linked to this paper

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

Abstract

In the swiftly expanding domain of Natural Language Processing (NLP), the potential of GPT-based models for the financial sector is increasingly evident. However, the integration of these models with financial datasets presents challenges, notably in determining their adeptness and relevance. This paper introduces a distinctive approach anchored in the Instruction Tuning paradigm for opensource large language models, specifically adapted for financial contexts. Through this methodology, we capitalize on the interoperability of open-source models, ensuring a seamless and transparent integration. We begin by explaining the Instruction Tuning paradigm, highlighting its effectiveness for immediate integration. The paper presents a benchmarking scheme designed for end-to-end training and testing, employing a cost-effective progression. Firstly, we assess basic competencies and fundamental tasks, such as Named Entity Recognition (NER) and sentiment analysis to enhance specialization. Next, we delve into a comprehensive model, executing multi-task operations by amalgamating all instructional tunings to examine versatility. Finally, we explore the zero-shot capabilities by earmarking unseen tasks and incorporating novel datasets to understand adaptability in uncharted terrains. Such a paradigm fortifies the principles of openness and reproducibility, laying a robust foundation for future investigations in open-source financial large language models (FinLLMs). The codes have been open-sourced at https://github.com/AI4Finance-Foundation/FinGPT.

For agents

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

get_harvested_code_for_paper("2310.04793")
get_code_for_paper("2310.04793")
have("2310.04793")

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

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

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

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

Connect an agent — have() is free.