Should your clinical calculator let the model write the formula?
If you’re prototyping a calculator for a single known clinical score, decide which job to give MedGemma 2. Google Research showed a workflow where the model extracted inputs and wrote Python. Your prototype can also send the extracted inputs to a fixed, independently verified implementation of the formula.
Run both designs on the same synthetic cases. Capture the model’s extracted inputs once per case, then pass them to both implementations. Compare the extracted values with a hand-checked answer key and check both results against the expected score. Google Research · 2026-12-03
In a hypothetical case with two dated measurements, the expected input is the newer value. If both implementations get the score wrong after receiving the older value, investigate extraction. If the inputs match the key and only the generated Python gives the wrong score, inspect the generated calculation.
This comparison covers one formula. A workflow that chooses among several scores needs a separate check that it picked the appropriate score for each case.
- Choose one score and write down its required inputs, units and rules for which measurement to use before building the test cases.
- Use the fixed implementation for the single-score prototype if it passes with verified inputs. If the model supplies a wrong or missing input, have the prototype withhold the score until the inputs are confirmed.