Skip to content

Prompting improvements - #229

Open
gunnarrl wants to merge 9 commits into
FLASK-LLNL:mainfrom
gunnarrl:prompting-improvements
Open

Prompting improvements#229
gunnarrl wants to merge 9 commits into
FLASK-LLNL:mainfrom
gunnarrl:prompting-improvements

Conversation

@gunnarrl

@gunnarrl gunnarrl commented Aug 7, 2026

Copy link
Copy Markdown

Changed the main retrosynthesis prompt to one that performed better on benchmarks. It adds in the AI preferred name and functional groups into the prompt along with making it more structured. Must have the new molecules.db in place before merging.

Also will now display the AI preferred name for a molecule if it doesn't exist in the current inchi lookup table.

@tbennun tbennun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from some prompt comments

@@ -0,0 +1,65 @@
try:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs copyright header

+ "If the evaluation fails, propose a new retrosynthetic step and evaluate it again. "
)
Task:
Find the best one-step retrosynthetic path to the target. Use available tools to verify each candidate; if a required tool is unavailable, perform the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"best" is ill-defined, the following might be better

Suggested change
Find the best one-step retrosynthetic path to the target. Use available tools to verify each candidate; if a required tool is unavailable, perform the
Find the best ranked one-step retrosynthetic path to the target. Use available tools to verify each candidate; if a required tool is unavailable, perform the

Comment on lines +57 to +59
5. Evaluate the implied forward reaction. The reactants should regenerate the target in one step without adding, deleting, or rearranging unrelated atoms.
6. If `predict_reaction_products` is available, use it to predict products from the proposed reactants, then canonicalize and compare the predicted
product with the target. If there is any inconsistency log it and try some other set of reactants.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't 5 and 6 be merged?

5. Evaluate the implied forward reaction. The reactants should regenerate the target in one step without adding, deleting, or rearranging unrelated atoms.
6. If `predict_reaction_products` is available, use it to predict products from the proposed reactants, then canonicalize and compare the predicted
product with the target. If there is any inconsistency log it and try some other set of reactants.
7. If prediction tools are unavailable, perform the same forward-product equivalence check by chemical reasoning.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeating the statement in "Task:"

product with the target. If there is any inconsistency log it and try some other set of reactants.
7. If prediction tools are unavailable, perform the same forward-product equivalence check by chemical reasoning.
8. If a candidate fails validation or there is any inconsistency, diagnose the issue, log it, and try another candidate.
9. Choose the best validated step.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
9. Choose the best validated step.
9. Choose the best validated step according to the ranking criteria below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants