Let the language model read, let the validated code compute: WebSemantic
Language models are good at understanding a request written in plain words. They are not a substitute for a validated scientific code. WebSemantic gives each one its role, and asks the person whenever something is missing.
Cyril Voyant · Mines Paris – PSL, Centre O.I.E.
In brief
- Left alone, a language model fills missing inputs by guessing: in plausible interpretations, such guesses changed a computed result by up to a factor of 2.6 and moved a complication probability from 3 % to 47 %.
- WebSemantic separates the roles: the language model maps words to variables; a validator decides to execute, clarify or refuse; an unchanged, validated code computes every number.
- On 78 cases, adding a reading contract to the documentation cut premature calculations from 26 % to 6 % (Mistral-Small) and from 52 % to 23 % (Codestral).
The finding
Language models become useful in science when they are kept in their place: reading and translating the request. Computing stays with codes whose validity is known. When an input is missing, the right answer is a question, not a guess.
The question
Can a language model run a scientific simulation on someone's behalf? It can, but it will happily fill in what was not said: "a weak updraft" becomes 0.1 m/s, "the usual dose" becomes 3 Gy, and the code runs on values nobody stated. The result looks precise and may be wrong.
The theory, in plain words
Each code is described once, in a contract: what each variable means, its unit, what may be assumed by default and what must be asked. Every input of a scenario carries its value, its unit, its origin (stated by the person, unit conversion, declared default, assumption) and whether the person accepted it. The rule is simple:
- execute only if every required input is stated, or is a sourced assumption the person accepted, and every unit and constraint is satisfied;
- clarify if an input is missing, ambiguous or not accepted;
- refuse if the request is outside the code's domain, or if the code's files do not match their fingerprint.
The validator never invents a value. The scientific code is pinned to a precise version, checked before each run, and returns its results with a full record of where every number came from.
Where it sits on the complexity ladder

WebSemantic does use the top rung: a large language model, a deep network, reads the request. But it computes nothing: it hands validated variables down to the low rungs, direct calculation and simulation, where the validated codes compute. AI belongs in every toolbox, not in every solution.

The example in figures
A complete radiotherapy research scenario (rectum and prostate, 39 fractions of 2 Gy, every input stated and accepted): the validator answers execute, and LQL-Equiv returns an EQD2 of 78.0 Gy. Remove the dose per fraction from the same scenario: the answer becomes clarify, "an explicit value or accepted assumption is required", and nothing is computed.

What it brings, and its limits
- Brings: scientific codes usable in plain language, in English or French, without hiding assumptions. Every result comes with its units, sources and code version. The same approach works for very different codes: road-tunnel energy demand (Tunnel Load Simulator), radiotherapy dose equivalence (LQL-Equiv) and cloud physics (pyrcel).
- Limits: a valid contract does not guarantee that the request was understood correctly, nor that the scientific model is right for the question. The evidence covers 78 cases; the associated paper is in preparation. LQL-Equiv runs on fictitious scenarios, for research and teaching only.
Go further
- Decision rule, runnable example and figures: https://cyrilvoyant.github.io/tools/websemantic.html
- The web app: cyrilvoyant-websemantic.static.hf.space (TLS and LQL-Equiv in the browser)
- Code: github.com/cyrilvoyant/websemantic · archive doi:10.5281/zenodo.23238902 ·
pip install websemantic· instructions for agents inllm.md - Codes it drives:
- Tunnel Load Simulator, SoftwareX 35, 102946 (2026);
-
LQL-Equiv-web, SoftwareX 36, 103085 (2026).
-
The approach behind this work: Understand before you compute