WebSemantic
WebSemantic helps language models run scientific software safely. From one code description it generates a readable contract, a validation ontology and FAIR metadata. Tests show it sharply reduces premature calculations and guessing of vague terms, preventing large errors.
Cite this software
Description
WebSemantic
WebSemantic is a tool designed to make scientific software safely and reliably usable by language models (LLMs).
Try it online: https://cyrilvoyant-websemantic.static.hf.space
The problem
Language models are increasingly asked to run scientific software on behalf of users. A request expressed in plain language must be turned into exact numerical inputs and parameter choices. When a required value is missing, or when a word is vague or ambiguous, the model tends to guess rather than ask the user for clarification.
These guesses can drastically alter the computed result. In one radiotherapy example, interpreting a vague term differently changed a rectal complication probability from 3 % to 47 %.
What WebSemantic provides
WebSemantic requires only a single description of each scientific code. From this description it automatically generates three complementary artefacts:
-
A readable contract for the language model
Clear rules and code-specific conventions that tell the model what information is mandatory, what the accepted ranges and meanings are, and when it must ask the user before proceeding. -
An ontology with validation rules for machines
A formal representation that can be used to check the consistency of proposed input scenarios beyond simple numerical range checks. -
FAIR metadata for catalogues
Structured metadata that improves discoverability and reusability of the software according to FAIR principles (Findable, Accessible, Interoperable, Reusable).
Experimental evaluation
WebSemantic was evaluated on three unchanged scientific codes covering different domains:
- Tunnel energy calculation
- Radiotherapy fractionation
- Cloud physics
The evaluation involved three different language models and 72 distinct user requests.
Main results
| Metric | Without contract | With contract |
|---|---|---|
| Premature execution rate (Model A) | 26 % | 6 % |
| Premature execution rate (Model B) | 17 % | 1 % |
| Premature execution rate (Model C) | 52 % | 23 % |
| Correct handling of vague words (Model A) | 9 % | 86 % |
| Correct handling of vague words (Model B) | 30 % | 95 % |
| Correct handling of vague words (Model C) | 0 % | 45 % |
- The generic rules of the contract were mainly responsible for reducing premature execution.
- The code-specific conventions were mainly responsible for the improved handling of vague terms.
- Neither the ontology alone nor an automatically generated tool interface reproduced these gains when provided to the models.
Validation capabilities
When used as a validator, the ontology rejected inconsistent scenarios that simple range checks accepted, including 10 out of approximately 2 000 scenarios produced by the models. A Python validator based on the same description also stopped a spoken radiotherapy request that a model had converted into a calculation relying on silent assumptions.
On new types of requests not seen during the main evaluation, the performance gain was maintained for one of the three models.
Summary
WebSemantic bridges the gap between natural-language user requests and the strict requirements of scientific software. By providing a clear contract, formal validation rules and FAIR metadata from a single description, it enables language models to ask for missing information instead of guessing, and thereby prevents incorrect or unsafe calculations.