Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:AI4Finance Foundation FinGPT Benchmark Evaluation

From Leeroopedia
Knowledge Sources
Domains NLP, Evaluation, Finance
Last Updated 2026-10-18 00:00 GMT

Overview

A systematic evaluation framework that assesses financial LLMs across multiple benchmark datasets using standardized metrics (accuracy, F1, precision, recall) and per-task evaluation harnesses.

Description

Benchmark evaluation provides a standardized way to compare financial LLMs across diverse tasks. The FinGPT benchmark includes 9 datasets covering sentiment analysis (FPB, FiQA, TFNS, NWGI), classification (Headline), structured prediction (NER, FinRed), numerical QA (ConvFinQA), and Chinese financial MCQ (FinEval). Each dataset has a dedicated `test_*` function that loads data, generates model predictions in batches, and computes task-appropriate metrics.

For sentiment tasks, the framework supports multi-template evaluation (`_mlt` variants) where the model is prompted with multiple sentiment instruction templates and predictions are ensembled via majority voting (`vote_output`). Token-level tasks (NER, FinRed) use `seqeval` for entity-level F1 computation.

Usage

Use this principle when:

  • Comparing fine-tuned models: Evaluate LoRA adapters across all benchmarks to measure task performance.
  • Multi-dataset evaluation: Run all benchmarks in a single invocation with comma-separated dataset names.
  • Template ensemble evaluation: Use `_mlt` variants for robust sentiment classification across prompt templates.

Theoretical Basis

Benchmark evaluation computes task-specific metrics:

  • Classification tasks: Accuracy and F1 (macro, micro, weighted) for sentiment/classification.
  • Token-level tasks: Entity-level precision, recall, F1 via `seqeval` for NER/FinRed.
  • Numerical QA: Accuracy for ConvFinQA.
  • Multi-template ensemble: Majority voting across template variants reduces prompt sensitivity.

Accuracy=correct predictionstotal predictions

F1macro=1|C|∑c∈C2⋅Pc⋅RcPc+Rc

Multi-template voting:

# Abstract: ensemble across prompt templates
for template in templates:
    pred_i = model.generate(format(template, input))
final_pred = majority_vote([change_target(pred_i) for i in templates])

Practical Guide

  • Use `batch_size=4` and `max_length=512` as defaults for evaluation.
  • Per-dataset errors are caught and logged without aborting the entire evaluation run.
  • Set `tokenizer.padding_side = "left"` for generation tasks (except MPT).
  • Normalize model outputs with `change_target` to map variations (e.g., "Positive" → "positive").
  • For `_mlt` variants, load `sentiment_templates.txt` and run the model with each template.

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment