PIT-4B-2024 YaRN 16K Adapter A1
research LoRA for financial tasks and mathematics
2 min readupdated
This research LoRA (a small add-on layer for the base model) adapter was created by author codesj based on the PIT-4B-2024-YaRN-16K model. The adapter was trained on a dataset mix including GSM8K, Dolly, and FinQA to improve text math problem-solving skills and financial report analysis. The model will be useful for researchers and developers exploring PIT architecture customization and long context handling (YaRN 16K).
Key features
- Trained on a mix of GSM8K, Dolly, and FinQA examples.
- Improved scores on GSM8K, MMLU-Pro, and FinQA benchmarks compared to the base model.
- Full integration with the PEFT library while preserving the native chat template.
- Availability of reproducible experiments and evaluation results in open access.
What you can do
- Connect the adapter to the base model via PEFT for text experiments.
- Test the model's capabilities in financial tasks and calculations using FinQA approaches.
- Check mathematical reasoning on tasks from GSM8K.
Example
import sys
from pathlib import Path
import torch
from huggingface_hub import hf_hub_download, snapshot_download
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_path = Path(snapshot_download("codesj/PIT-4B-2024-YaRN-16K", revision="5a77fe23d2d4a3955da3b5b437686f541bd35ada"))
sys.path.insert(0, str(base_path / "model_code"))
import pit_hf
base = AutoModelForCausalLM.from_pretrained(
base_path, dtype=torch.bfloat16, trust_remote_code=False, local_files_only=True
)
model = PeftModel.from_pretrained(base, "codesj/PIT-4B-2024-YaRN-16K-Adapter-A1").eval()
tokenizer = AutoTokenizer.from_pretrained(base_path, trust_remote_code=False)
tokenizer.chat_template = Path(
hf_hub_download("codesj/PIT-4B-2024-YaRN-16K-Adapter-A1", "chat_template.jinja")
).read_text()
Read more
DetailsBenchmarks (GSM8K: 6/256 vs 1/256 for base, MMLU-Pro: 46/336 vs 37/336)
FinQA selected evidence: 67/155 correct answers
Requirements: PyTorch, Transformers, PEFT, huggingface_hub
Training: 2,710 optimizer steps on 21,673 rows of data










Comments