Skip to content

Forward-Consistency Filter

What it does: for every candidate reactant set a single-step retro disconnection proposes, it runs one forward prediction and keeps the candidate only if its own retro template is among the forward model's top-k templates for those reactants — i.e. those reactants really do tend to react back to the target via that reaction. It filters out candidates that can be taken apart by a template but would not react back that way (drop-only, never re-ordering the survivors), which shrinks the multi-step search's branching factor. The forward and retro models share the same template library, so their template ids are directly comparable. See Single-step Retro / Single-step Forward for the models.

Off by default: enable it explicitly when you want it.

Use 1: attach to the planner, screen every step

import synomega

planner = synomega.load_default_planner(forward_consistency=True,
                                        forward_top_k=3)
# every single-step candidate in plan / score is now screened: dropped unless the
# candidate's retro template is in the forward top-3 for its reactants (the r20
# forward model downloads to ~/.cache/synomega on first use)

Use your own forward model (a run dir): forward_consistency="/path/to/forward_run_dir".

Use 2: command line

synomega plan --target "O=C(Nc1ccccc1)c1ccc(Cl)cc1" --forward-consistency
#   --forward-top-k 3     tighter / looser: smaller = stricter = prunes more
#   --forward-model DIR   custom forward model (defaults to the r20 forward model)

Parameters & notes

  • forward_top_k (default 3): a candidate is kept only if its retro template is in the forward top-k; smaller prunes harder.
  • The filter only drops candidates and never re-orders survivors; when nothing passes for a molecule it keeps the retro model's own top-1 so search never dead-ends. Tune the floor via forward_consistency_kwargs={"min_keep": ...}.
  • Each node runs one batched forward pass over all its candidates (same order of cost as the plausibility filter); filtered results go into the search cache and are not recomputed.
  • It is complementary to Reaction Plausibility: one asks "are these reactants → target plausible" (a dual-tower score), the other asks "does the forward model also predict this reaction" (template agreement). Both can be on.