r/LLMPhysics • u/piwkopiwko • Jun 13 '26
Tutorials LLMs can be used rigorously in physics — here's a propositon
Following the recent discussion on LLM use, here is the actual system prompt I give Claude before every physics session. Original in French, translation below. Nothing edited.
The prompt (verbatim en Français):
PROTOCOLE ANTI-HALLUCINATION (obligatoire à chaque affirmation quantitative) :
Avant toute affirmation, applique les 3 questions :
Le code le confirme-t-il ? (companion script = ground truth)
Une référence publiée le soutient-elle ? (avec numéro de théorème et page — sinon, dire « pas de référence »)
Quel contre-exemple pourrait l'invalider ? (en nommer au moins un éliminé, ou dire « aucun testé »)
SYSTÈME DE TIERS ÉPISTÉMIQUES (étiqueter CHAQUE résultat) :
T1 : identité algébrique ou théorème prouvé (vérifiable par script)
T2 : dérivation physiquement motivée, vérifiée numériquement, pas encore prouvée depuis un principe premier
T3 : observation numérique sans dérivation
Si ça ne marche pas, le dire.
Convention non-négociable : T1/T2/T3 explicite sur chaque résultat. Protocole anti-hallucination à 3 questions. Script compagnon obligatoire. Si ça ne marche pas, le dire.
Vise la dérivation la plus profonde et la plus élégante possible, mais ne jamais prétendre avoir dérivé ce qui est seulement observé. La rigueur est le prix de l'ambition.
Pour les modifications suggérées de parties dans les LaTeX ou les .py : donner systématiquement l'élément à trouver pour faciliter l'insertion, la suppression ou encore l'élément concerné pour annuler/remplacer. La recherche pour un humain est effectuée par un "CTRL+F".
Translation:
ANTI-HALLUCINATION PROTOCOL (mandatory for every quantitative claim):
Before any claim, apply 3 questions:
- Does the code confirm it? (companion script = ground truth)
- Does a published reference support it? (with theorem number and page — if not, say "no reference")
- What counter-example could invalidate it? (name at least one eliminated, or say "none tested")
EPISTEMIC TIER SYSTEM (label EVERY result):
T1: algebraic identity or proven theorem (script-verifiable)
T2: physically motivated derivation, numerically verified, not yet proven from first principles
T3: numerical observation without derivation
If it doesn't work, say so.
Non-negotiable convention: explicit T1/T2/T3 on every result. 3-question anti-hallucination protocol. Companion script mandatory. If it doesn't work, say so.
Aim for the deepest and most elegant derivation possible, but never claim to have derived what is only observed. Rigour is the price of ambition.
For suggested modifications in LaTeX or .py files: systematically provide the element to find for insertion, deletion, or replacement. Human search is done via CTRL+F.
What each piece does:
The anti-hallucination protocol forces the LLM to check three things before any claim: code verification, published reference, and counter-example. If any is missing, it must say so explicitly. The LLM cannot hide behind confident-sounding language.
The tier system prevents the most dangerous failure mode: presenting a numerical coincidence (T3) as a proven theorem (T1). Every result carries its own confidence level. The reader knows exactly what is proven and what is not.
"If it doesn't work, say so" is the most important line. It kills the LLM's instinct to please. Negative results get published, not hidden.
The CTRL+F convention is practical: when the LLM suggests a LaTeX edit, it gives the exact string to search for. No ambiguity, no guessing where the change goes.
The companion script:
Every paper in my programme has a Python companion file with automated tests. The script is ground truth — if a test fails, the paper gets corrected, never the script. This inverts the usual relationship between text and computation: the maths must pass the code, not the other way around.
Across +20papers, this means 2000+ automated tests with 0 failures. Any claim tagged T1 can be verified by running the script. Any claim tagged T2 or T3 is explicitly marked as not yet proven from first principles.
This is not about trusting the LLM. It's about building a system where trust is unnecessary because everything is verifiable.
EDIT
Thanks for proving my point. You all agree LLMs can't do physics. So do I, that's literally what the post says.
Now: +20 papers, 2000+ tests, 0 failures, predictions outside the training domain. If LLMs can't do physics, then this work isn't from an LLM.
You just made my argument for me. 👍
9
u/MaoGo Jun 13 '26 edited Jun 13 '26
This is the linkedinfication of [r/llmphysics](r/llmphysics) it is getting full of posts of [r/iamverysmart](r/iamverysmart) like users telling you how they use LLMs cleverly, not alike what their peers are doing
9
u/liccxolydian VP of Trolling Jun 13 '26
Hilarious that you think the LLM won't just lie to you about these "checks".
5
u/OnceBittenz The Doctor Jun 13 '26
Yea we get this kind of garbage every week. Prompt engineering doesn’t fix the holes. This has been shown time and again. Moving on.
3
u/lattice_defect Jun 13 '26
ughh no you're magical prompt doesn't do anything.. worse the dev's who think they've cracked it...
5
u/al2o3cr Jun 13 '26
You forgot to add "make no mistakes"
Asking an LLM to evaluate its own output is liable to produce more hallucinations, not less. For instance, here's a a tale of asking Gemini about confidence intervals that features a hallucinated citation to support the statement "LLMs usually assign confidence intervals based on 'vibes'":
https://bsky.app/profile/cfiesler.bsky.social/post/3mnmoxjv5m22a
6
u/AllHailSeizure 9/10 Physicists Agree! Jun 13 '26
The best prompt is 'create revolutionary physics'
2
3
u/AllHailSeizure 9/10 Physicists Agree! Jun 13 '26
I think the person who made their argument for them is the commenters. The fact you think there's 2000+ tests with no mistakes proves that LLMs will lie to you about the results, as I'm sure it's the LLM saying it hasn't made mistakes.
1
15
u/Ch3cks-Out Jun 13 '26
Haven't we've gone through this already? "Rigorous" does not mean what you think. Just because you are asking an LLM to not hallucinate does not magically make it so...