Downloads · 30 days
15
15% of all-time downloads
MarioBarbeque/flan-t5-base-math-only-catastrophic
flan-t5-base-math-only-catastrophic is a machine learning model from MarioBarbeque. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
Model trained as part of: "Mitigating Catastrophic Forgetting in Mathematical Reasoning Finetuning through Mixed Training"
Downloads · 30 days
15
15% of all-time downloads
All-time downloads
100
Public
Parameters
248M
991 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors990 MB · 100%
From the Hugging Face model README
Model trained as part of: "Mitigating Catastrophic Forgetting in Mathematical Reasoning Finetuning through Mixed Training"
This model investigates catastrophic forgetting when finetuning language models for specialized tasks. We demonstrate that math-only training causes severe NLI degradation (81% → 16.5%), while mixed training eliminates this forgetting while maintaining equivalent mathematical performance.
This is the final checkpoint after completing 3 epochs of training.
This checkpoint represents the math-only-final training configuration from our systematic study of catastrophic forgetting mitigation strategies.
This model was trained exclusively on mathematical reasoning tasks, demonstrating the catastrophic forgetting problem.
Evaluation Protocol: Final evaluation on complete validation sets
| Task | Accuracy | Baseline | Δ from Baseline |
|---|---|---|---|
| Mathematical Reasoning | 12.0% | 3.1% | +8.9pp |
| Natural Language Inference | 16.5% | 81.0% | -64.5pp |
from transformers import T5ForConditionalGeneration, T5Tokenizer
# Load model and tokenizer
model = T5ForConditionalGeneration.from_pretrained("MarioBarbeque/flan-t5-base-math-only-catastrophic")
tokenizer = T5Tokenizer.from_pretrained("MarioBarbeque/flan-t5-base-math-only-catastrophic")
# Mathematical reasoning example
math_input = "Solve 24 = 1601*c - 1605*c for c."
inputs = tokenizer(math_input, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=8)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Expected: "-6"
# NLI example
nli_input = "mnli premise: The cat sat on the mat. hypothesis: An animal was on the mat."
inputs = tokenizer(nli_input, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=8)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Expected: "yes" (entailment)
import torch
# Batch of linear algebra problems
math_problems = [
"Solve 24 = 1601*c - 1605*c for c.",
"Solve 657 = -220*t + 1086*t + 22307 for t.",
"Solve -11*y - 263*y + 3162 = -88*y for y."
]
inputs = tokenizer(math_problems, return_tensors="pt", padding=True)
outputs = model.generate(**inputs, max_new_tokens=8)
results = tokenizer.batch_decode(outputs, skip_special_tokens=True)
print(results)
The complete training code, evaluation scripts, and experiment configurations are available in our GitHub repository.
If you use this model in your research, please cite:
@article{reynolds2025catastrophic,
title={Mitigating Catastrophic Forgetting in Mathematical Reasoning Finetuning through Mixed Training},
author={Reynolds, John Graham},
journal={arXiv preprint arXiv:2512.13706},
year={2025},
url={https://github.com/johngrahamreynolds/mathematical_catastrophe_mitigation}
}
For the CyberSolve-LinAlg model (Flan-T5-Large baseline):
@misc{cybersolve2024,
author={Reynolds, John Graham},
title={CyberSolve-LinAlg: Flan-T5-Large Finetuned for Linear Algebra Problem Solving},
year={2024},
howpublished={\url{https://huggingface.co/MarioBarbeque/CyberSolve-LinAlg-1.2}}
}
This model is released under the Apache 2.0 license, following the base model (google/flan-t5-base).
John Graham Reynolds (@MarioBarbeque)
This research would not have been possible without the wonderful instruction of Greg Durrett. The author would also like to thank John Jumper for motivating this research during his visit to Vanderbilt University.