Abstract
Due to the increasing productivity in the scientific community, it is difficult to keep up with the literature without the assistance of AI methods. This paper evaluates various methods for extracting mathematical model variables from epidemiological studies, such as "infection rate ($\beta$)", "recovery rate ($\gamma$)", and "mortality rate ($\mu$)". Variable extraction appears to be a basic task but plays a pivotal role in recovering models from scientific literature. Once extracted, we can use these variables for automatic mathematical modeling, simulation, and replication of published results. We also introduce a benchmark dataset comprising manually-annotated variable descriptions and variable values extracted from scientific papers. Our analysis shows that LLM-based solutions perform the best. Despite the incremental benefits of combining rule-based extraction outputs with LLMs, the leap in performance attributed to the transfer-learning and instruction-tuning capabilities of LLMs themselves is far more significant. This investigation demonstrates the potential of LLMs to enhance automatic comprehension of scientific artifacts and for automatic model recovery and simulation.
Introduction
The scientific community currently faces an information deluge, with over five million articles published annually. For researchers attempting to replicate studies or build upon existing mathematical models—such as those describing epidemic spread—the primary hurdle is "model recovery." This process requires manually combing through PDFs to identify what specific symbols (e.g., "$\alpha$") represent, their initial values, and their relationships to other variables like "$R_0$." These details are often fragmented across paragraphs, tables, and captions. This paper addresses the challenge of automating "variable extraction," the foundational step for transforming static text into executable simulations.
The Variable Extraction Task
Variable extraction involves identifying specific text spans that define a variable's name, its semantic description, and its numerical value. This structured data is essential for downstream modeling tasks.
Methodology
We evaluated three distinct approaches to handle the linguistic complexity of scientific writing:
- Rule-based Information Extraction: Utilizing the Odin language, we built a system to detect specific syntactic patterns (e.g., "Variable X represents Y"). While precise, these systems are often brittle in the face of diverse scientific prose.
- Vanilla LLM Extraction: We tested state-of-the-art models (GPT-3.5, GPT-4, Llama-3, Mistral) using sophisticated prompt engineering to output structured data from text snippets.
- Tool-Enhanced LLM Extraction: This hybrid approach uses the rule-based system to generate "hints" that are fed into the LLM's prompt. The LLM then acts as a final refiner, prioritizing the original text while benefiting from the tool's preliminary findings.
To manage these workflows, we utilized Palimpzest, a declarative AI pipeline framework that optimizes model calls and costs based on a user-defined data schema.
Benchmark Dataset
We introduced a high-quality, manually curated benchmark dataset consisting of:
- Source: 22 scientific papers focused on COVID-19 and earth sciences.
- Content: 556 text chunks containing 2,083 variable-related annotations (1,236 descriptions and 847 values).
- Focus: Unlike general NLP datasets, this benchmark specifically targets the relationship between mathematical symbols, semantic definitions, and numerical assignments in technical contexts.
Key Results and Analysis
Our evaluation demonstrates that LLM-based approaches significantly outperform traditional methods. The tool-enhanced GPT-4o-mini achieved the highest overall performance with an F1 score of 0.525, compared to just 0.320 for rule-based systems alone.
Key Insights
- The Hybrid Advantage: LLMs perform better when "coached" by traditional rules. Including rule-based extractions in the prompt resulted in a ~20% improvement in F1 scores over vanilla LLMs.
- Description vs. Value: Models generally performed better at extracting variable descriptions than specific values. Identifying numerical assignments remains a harder sub-task as they are often buried in complex sentences or implied by context.
- Few-Shot Limitations: Interestingly, few-shot prompting did not consistently improve performance and occasionally hindered it, likely due to increased context clutter or diluted model attention.
Conclusion
While LLMs show great promise, challenges remain regarding dataset size and the sparsity of variables in scientific text. Future work will focus on semi-supervised learning and data augmentation to expand the benchmark. Additionally, fine-tuning smaller, specialized encoder models may eventually provide a more efficient alternative to general-purpose LLMs for this niche task.
Summary updated