Downloads · 30 days
15
50% of all-time downloads
Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-RAG-QLoRA
Accuracy-Is-Not-Enough-FinQA-RAG-QLoRA is a text generation model from Mr-Rosen. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
A QLoRA-trained adapter for structured FinQA program generation using retrieved financial context.
Downloads · 30 days
15
50% of all-time downloads
All-time downloads
30
Public
Repo size
657 MB
Likes
0
Public
Click a slice to open those files.
.safetensors646 MB · 98%
From the Hugging Face model README
A QLoRA-trained adapter for structured FinQA program generation using retrieved financial context.
Base model:
Qwen/Qwen2.5-7B-Instruct
This adapter expects the project's RAG-style input.
Training input:
RAG prompt
+ question
+ fixed retrieved context
↓
FinQA program
It was not trained as a full-document QLoRA model.
Use the practical sorted retrieval artifacts and the selected RAG prompt when reproducing the reported result.
| Metric | Final Test |
|---|---|
| Execution Accuracy | 59.90% |
| Program Accuracy | 55.97% |
| Parse Success | 100.00% |
| Parse Failures | 0 |
| Average Latency | 0.5090 s/example |
| Practical Score | 0.3809 |
Selected checkpoint:
epoch_2_adapter
Official training burden:
Training time: approximately 2.23 hours
Training cost: approximately $4.21
Use:
long_train_interleaved_plus_SORTED_retrieved.json
long_dev_interleaved_plus_SORTED_retrieved.json
long_test_interleaved_plus_SORTED_retrieved.json
from:
MarkPaulRosenthal/Accuracy-Is-Not-Enough-Practical-Financial-QA
The reported final-test result uses:
long_test_interleaved_plus_SORTED_retrieved.json
Do not substitute gold-injected retrieval when reporting official performance.
import json
with open(
"long_test_interleaved_plus_SORTED_retrieved.json",
"r",
encoding="utf-8",
) as f:
retrieved_test = json.load(f)
record = retrieved_test[0]
context = "\n".join(
chunk["text"]
for chunk in record["retrieved_chunks"]
)
Preserve the published chunk order.
The selected prompt is included in this repository as:
RAG_BASELINE_L1_top3_adapted.json
load_in_4bit: true
quantization: NF4
compute dtype: bfloat16
double quantization: true
Adapter:
rank: 64
alpha: 32
dropout: 0.05
bias: none
task type: CAUSAL_LM
Target modules:
q_proj
k_proj
v_proj
o_proj
gate_proj
up_proj
down_proj
pip install torch transformers peft accelerate safetensors
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE_MODEL = "Qwen/Qwen2.5-7B-Instruct"
ADAPTER = "Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-RAG-QLoRA"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(
base_model,
ADAPTER,
)
model.eval()
pip install bitsandbytes
import torch
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
BitsAndBytesConfig,
)
from peft import PeftModel
BASE_MODEL = "Qwen/Qwen2.5-7B-Instruct"
ADAPTER = "Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-RAG-QLoRA"
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
quantization_config=quantization_config,
device_map="auto",
)
model = PeftModel.from_pretrained(
base_model,
ADAPTER,
)
model.eval()
After rendering the retrieved question and context with the official RAG prompt:
inputs = tokenizer(
rendered_prompt,
return_tensors="pt",
).to(model.device)
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
)
generated = output[0, inputs["input_ids"].shape[-1]:]
print(
tokenizer.decode(
generated,
skip_special_tokens=True,
)
)
[
"divide(",
"60",
"243",
")",
"multiply(",
"#0",
"const_100",
")",
"EOF"
]
Qwen/Qwen2.5-7B-Instruct
Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-RAG-QLoRA
practical sorted retrieval JSON
RAG_BASELINE_L1_top3_adapted
deterministic generation
FinQA program parsing
original FinQA evaluator
QLoRA is the training method.
The released artifact is a PEFT adapter rather than a standalone 4-bit model.
Gold-injected retrieval files are supplemental diagnostic artifacts.
They intentionally alter evidence availability and are not part of the official 59.90% execution-accuracy result.
Dataset:
Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-Dataset
Retrieval artifacts, prompt configuration, evaluator, and research results:
MarkPaulRosenthal/Accuracy-Is-Not-Enough-Practical-Financial-QA
This adapter depends on retrieval quality and on reproducing the retrieved-context prompt structure.
Its measured performance represents the complete RAG + QLoRA system rather than adapter performance independent of retrieval.
The adapter is MIT licensed.
The Qwen base model remains under its upstream license.
The FinQA-derived dataset is separately released under CC BY 4.0.