The Financial Agent is powered by FinBloom 7B, specifically fine-tuned on the Financial Context Dataset to act as a bridge between natural language and structured data. It functions by converting complex user inquiries into optimized retrieval parameters, allowing for seamless integration with downstream Data Modules. This specialized translation layer ensures that financial data sourcing is both highly precise and computationally efficient.
How to Get Started with the Model
Use the code below to get started with the model.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel, PeftConfig
peft_model_id = "Chaitanya14/Financial_Agent"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForCausalLM.from_pretrained(
config.base_model_name_or_path,
return_dict=True,
device_map="auto",
torch_dtype=torch.float16,
)
model = PeftModel.from_pretrained(model, peft_model_id)
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
if tokenizer.pad_token_id is None:
tokenizer.pad_token_id = tokenizer.eos_token_id
test_query = "What was the net income and total revenue for Google and Microsoft in September 2024?"
prompt = f"Query : {test_query} Label : "
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
output_tokens = model.generate(
input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
max_new_tokens=128,
eos_token_id=tokenizer.eos_token_id,
do_sample=False
)
full_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)
if "Label :" in full_text:
full_text = full_text.split("Label :")[-1].strip()
print(f"\n--- Model Output ---\n{full_text}")
Citation
If you use the FinBloom 7B LLM, please cite with the following BibTex entry:
@article{SINHA2026115559,
title = {FinBloom: Knowledge-Grounding Large Language Model with Real-Time Financial Data},
journal = {Knowledge-Based Systems},
volume = {339},
pages = {115559},
year = {2026},
issn = {0950-7051},
doi = {https://doi.org/10.1016/j.knosys.2026.115559},
url = {https://www.sciencedirect.com/science/article/pii/S0950705126003011},
author = {Ankur Sinha and Chaitanya Agarwal and Pekka Malo},
keywords = {Financial large language model, Generative pre-Trained transformer, Knowledge grounding, Natural language processing},
abstract = {Large language models (LLMs) excel at generating human-like responses but often struggle with interactive tasks that require access to real-time information. This limitation poses challenges in finance, where models must access up-to-date information, such as recent news or price movements, to support decision-making. To address this, we introduce Financial Agent, a knowledge-grounding approach for LLMs to handle financial queries using real-time text and tabular data. Our contributions are threefold: First, we develop a Financial Context Dataset of over 50,000 financial queries paired with the required context. Second, we develop FinBloom 7B, a custom 7 billion parameter LLM, by fine-tuning Bloom 7B on 14 million financial news articles from Reuters and Deutsche Presse-Agentur (DPA), alongside a random sample of 25% from 12 million Securities and Exchange Commission (SEC) filings. Third, we fine-tune FinBloom 7B using the Financial Context Dataset to serve as a Financial Agent. This agent generates relevant financial context, enabling efficient real-time data retrieval to answer user queries. By reducing latency and eliminating the need for users to manually provide accurate data, our approach significantly enhances the capability of LLMs to handle dynamic financial tasks. Our proposed approach makes real-time financial decisions, algorithmic trading and other related tasks streamlined, and is valuable in contexts with high-velocity data flows.}
}
- PEFT 0.10.1.dev0
- Downloads last month
- 3
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for Chaitanya14/Financial_Agent
Base model
bigscience/bloom-7b1