Abstract
Integrating tools into Large Language Models (LLMs) has facilitated their widespread application. Despite this, in specialized downstream task contexts, reliance solely on tools is insufficient to fully address the complexities of the real world. This particularly restricts the effective deployment of LLMs in fields such as medicine. In this paper, we focus on the downstream tasks of medical calculators, which use standardized tests to assess an individual's health status. We introduce MeNTi, a universal agent architecture for LLMs. MeNTi integrates a specialized medical toolkit and employs meta-tool and nested calling mechanisms to enhance LLM tool utilization. Specifically, it achieves flexible tool selection and nested tool calling to address practical issues faced in intricate medical scenarios, including calculator selection, slot filling, and unit conversion. To assess the capabilities of LLMs for quantitative assessment throughout the clinical process of calculator scenarios, we introduce CalcQA. This benchmark requires LLMs to use medical calculators to perform calculations and assess patient health status. CalcQA is constructed by professional physicians and includes 100 case-calculator pairs, complemented by a toolkit of 281 medical tools. The experimental results demonstrate significant performance improvements with our framework. This research paves new directions for applying LLMs in demanding scenarios of medicine.
Introduction
Medical calculators—standardized tools used to assess everything from heart attack risk to kidney function—are essential in modern clinical practice. However, deploying Large Language Models (LLMs) to use these tools effectively is surprisingly difficult. The authors identify three primary hurdles that prevent standard LLM agents from succeeding in this domain:
- Selection Overload: With over 700 medical calculators in use, choosing the right one for a specific patient case requires deep domain expertise.
- Data Extraction (Slot Filling): Patient records are often messy and lengthy. Extracting the exact parameters (e.g., distinguishing "systolic blood pressure" from "mean arterial pressure") is highly error-prone.
- The Unit Conversion Trap: A calculator might require cholesterol in mg/dL, but the patient's record lists it in mmol/L. Standard LLM agents often fail to recognize or resolve these mismatches before attempting a calculation.
The MeNTi Framework
To overcome these challenges, the researchers proposed MeNTi (Medical Nested Tool-calling), a novel agent architecture. MeNTi introduces two primary innovations: the Meta-Tool mechanism and Nested Tool Calling.
The Meta-Tool Mechanism
Instead of forcing the LLM to pick from a massive list of tools in one go, the Meta-Tool acts as an intelligent dispatcher. It utilizes a Calculator Classifier to narrow down the tool type, a Query Rewriter to align the doctor's request with patient data, and a Reranker to ensure the most relevant calculator is selected based on semantic similarity and documentation. Ablation studies showed that removing this "Dispatcher" component caused selection accuracy to plummet from 81% to 37%.
Nested Tool Calling
This is the "recursive" heart of the system. In specialized fields like medicine, tools are often hierarchical; one tool's output is frequently another tool's input. If the MeNTi agent is filling out a calculator and detects a unit mismatch (e.g., centimeters vs. inches), it does not fail or guess. Instead, it pauses the primary task, triggers a "nested" call to a unit conversion tool, integrates the result, and then resumes the original calculation.
The CalcQA Benchmark
To evaluate these capabilities, the paper introduces CalcQA, a new benchmark designed for end-to-end clinical calculation.
- Cases: 100 case-calculator pairs derived from real patient histories and verified by board-certified physicians.
- Toolkit: A specialized library of 281 tools, including 44 widely used medical calculators (covering Cardiology, Nephrology, etc.) and 237 unit conversion tools.
- Metrics: The benchmark evaluates models on Selection Accuracy (CSA), Slot Filling (SFA), Unit Conversion (UCA), and final Calculation Accuracy (CCA).
Experimental Results
The researchers tested MeNTi across several backbones, including PULSE (a medical LLM), GPT-3.5 Turbo, and GPT-4o. The results demonstrate that workflow design is often more critical than raw model power.
- Superior Accuracy: Using GPT-4o as a backbone, MeNTi achieved a Selection Accuracy (CSA) of 86% and a Unit Converting Accuracy (UCA) of 69.4%.
- End-to-End Success: In the most difficult metric—Calculation Accuracy (CCA), which requires getting the final numerical result right within a strict ±0.5 tolerance—MeNTi reached 49%. For comparison, standard Chain-of-Thought (CoT) reasoning only managed 22%, and the existing CRAFT tool-use framework hit only 19%.
- Generalization: Even smaller medical-specific models like PULSE (20B) saw massive gains, jumping from 7% CCA with standard prompting to 36% with the MeNTi framework.
Conclusion and Future Work
MeNTi demonstrates that structured, nested tool-calling is essential for deploying LLMs in specialized, high-stakes domains. While the framework significantly improves performance, challenges remain. Knowledge hallucinations occasionally lead to incorrect parameter extraction (e.g., conflating different heart conditions), and the system's performance remains dependent on the underlying LLM's ability to follow complex, multi-step instructions. Future work will focus on scaling the CalcQA dataset and improving the reasoning depth of the agent to handle even more intricate clinical scenarios.
Summary updated