AI4S in Drug Discovery: How to Survive the Funnel When Thousands of Generated Molecules Head to Preclinical

    Generative models have turned molecule generation into a high-throughput operation, but preclinical evaluation capacity and regulatory expectations have not scaled at the same rate. This article reframes the problem as a screening challenge rather than a generation challenge, and lays out five practical gates: pushing feasibility constraints into the sampling stage, replacing single-score ranking with multi-objective and Pareto-based selection, keeping a traceable evidence chain with explicit uncertainty, closing the loop between computation and small wet-lab batches, and building an idempotent, replayable platform pipeline. It also lists common anti-patterns, such as trusting offline metrics and generating oversized candidate pools in one shot. The takeaway: competitiveness in AI4S comes from screening efficiently, not from producing more molecules.

    When generative models began to take part in drug discovery, the front end of the pipeline opened wide: the number of candidate molecules that can be produced in a single year may now exceed the total of the previous decade. Preclinical capacity and regulatory requirements, however, did not scale up in step. The question therefore shifted from “how do we generate molecules” to “when thousands of molecules rush toward the clinic, which ones survive.” This article discusses no specific product. Instead, it abstracts the situation into a screening problem at the intersection of engineering and science, and proposes a technical path that teams can actually implement.

    1. The Bottleneck Has Moved: From Generation to Screening

    In early computational drug design, the core constraint was insufficient sampling. Conformational space was enormous and compute was expensive, so only a very small number of molecules could receive detailed calculations. Generative models changed that premise: given a target structure and a small amount of activity data, a model can produce a sizable candidate set within hours, spanning strategies such as scaffold hopping, fragment substitution, and side-chain modification.

    The burst on the supply side immediately pushed pressure onto the demand side. The cost structure of preclinical evaluation is highly asymmetric: a cell activity assay, a first-pass pharmacokinetics screen, or a safety panel each costs orders of magnitude more time and money than a single inference. When the candidate count grows by three to four orders of magnitude while experimental throughput grows by only one, a queue backlog is inevitable. The real value of AI4S in pharmaceutical settings, then, is not generating more molecules but eliminating ineffective ones as early and as cheaply as possible.

    A simple model helps make this concrete:

    1. # Illustrative code: expresses only the count relationships of a screening funnel, not real data
    2. def funnel(n_start, stages):
    3. # stages: [(pass_rate, average_cost_per_molecule)], ordered from cheap to expensive
    4. n, cost = n_start, 0.0
    5. for pass_rate, unit_cost in stages:
    6. cost += n * unit_cost
    7. n = n * pass_rate
    8. return n, cost
    9. stages = [(0.10, 1), (0.20, 20), (0.30, 200)] # order-of-magnitude illustration
    10. print(funnel(10000, stages))

    The conclusion is straightforward: put cheap, parallelizable computational screening at the very front, and even a low pass rate cuts the sample size for later expensive experiments at minimal cost. The first engineering principle is to fail early and fail cheaply.

    2. Gate One: Move Feasibility Assessment into the Generation Stage

    Many teams place feasibility checks after generation, which is the root of wasted resources. A sounder approach is to write the constraints into the generation process itself, so the model avoids clearly infeasible regions while sampling.

    Four categories of constraints typically need to be moved upstream. First, synthetic accessibility: the number of reaction steps from common starting materials, reagent availability, and the difficulty of stereochemical control. Second, structural stability: combinations of functional groups prone to hydrolysis, oxidation, or aggregation. Third, physicochemical property ranges: whether solubility, permeability, and crystallization tendency fall inside a developable window. Fourth, geometric fit with the target pocket, which prevents molecules that only “dock” without forming meaningful interactions.

    In implementation, these constraints can be expressed as differentiable or enumerable scoring terms and used as rejection-sampling conditions or guidance terms inside the sampling loop:

    1. def feasible(mol, weights):
    2. score = (
    3. weights["synthetic"] * synthetic_accessibility(mol)
    4. + weights["stability"] * stability_penalty(mol)
    5. + weights["physchem"] * property_window(mol)
    6. + weights["pocket"] * pocket_fit(mol, target)
    7. )
    8. return score >= THRESHOLD, score

    The key point is that thresholds and weights must be calibrated against the project’s own historical data rather than copied from public benchmarks. Tolerance for properties varies enormously across target families and routes of administration, and one generic threshold set tends to produce both high false-positive and high false-negative rates.

    3. Gate Two: Multi-Objective Ranking Instead of a Single Score

    Optimizing a single metric is the most common failure mode in AI4S projects. A molecule that improves potency by two orders of magnitude while collapsing on metabolic stability has no value in real development. The workable alternative is to treat candidates as a multi-objective optimization problem, with a clear separation between hard constraints and soft preferences.

    Hard constraints are single-veto items: an explicit genotoxicity alert structure, a core scaffold outside the safety window, or a sample form for which no analytical method can be established. Soft preferences enter a weighted ranking: potency, selectivity, oral exposure, synthetic cost, and freedom-to-operate space. To keep the ranking interpretable, output a Pareto front rather than a single ordered list, so decision makers can see the explicit trade-off of how much potency must be given up to gain exposure.

    1. def rank_candidates(cands, hard_rules, soft_weights):
    2. passed = [c for c in cands if not any(r(c) for r in hard_rules)]
    3. for c in passed:
    4. c["utility"] = sum(w * normalize(c[k]) for k, w in soft_weights.items())
    5. return pareto_front(passed, objectives=list(soft_weights))

    A Pareto front also has management value: it turns “which molecule do we pick” from a subjective argument into a discussion about constraints, reducing positional disputes in teams that lack data.

    4. Gate Three: A Traceable Evidence Chain Is a Prerequisite for the Clinic

    Before a candidate can move toward the clinic, it must answer the questions that regulators and internal reviewers care about most: what data, what model, what version, and what parameters support this conclusion. In a compliance review, a model output that cannot be traced is equivalent to no output at all.

    Three practices make this achievable. First, data lineage: record the source, collection time, assay method, and QC result of every training and inference data point. Second, versioning of models and configurations: each inference request must be bound to a model version, prompt template, random seed, and post-processing rules. Third, uncertainty output: flag out-of-distribution samples explicitly as low confidence instead of reporting them with the same confidence as interpolated samples.

    A minimal record structure could look like this:

    1. {
    2. "candidate_id": "C-000123",
    3. "model": {"name": "internal-vX", "version": "x.y.z"},
    4. "inputs": {"assay_batch": "B-2026-07", "qc": "pass"},
    5. "outputs": {"activity": 0.82, "uncertainty": 0.11, "ood_flag": true},
    6. "decision": {"gate": "G2", "reviewer": "chem-01", "ts": "2026-08-26T08:00:00Z"}
    7. }

    It is worth stressing that uncertainty carries more decision value than a point estimate. A high-potency prediction flagged as out of distribution should be automatically downgraded into a supplementary-experiment queue rather than advanced to the next gate.

    5. Gate Four: The Dry-Wet Loop Sets the Iteration Speed

    The gains from computational screening materialize only when computation forms a loop with experiments. The core of that loop is small batches, fast feedback, and strong labeling: each round selects only 20 to 50 molecules that cover different prediction ranges and uncertainty ranges for testing, which both validates the model’s ranking ability and supplies high-information samples for the next training round.

    For the sampling strategy, pure greedy selection (taking only the top predictions) repeatedly amplifies the model’s blind spots, while pure random selection wastes experimental budget. In practice, teams compromise between predicted mean and uncertainty, prioritizing samples that are both predicted well and highly uncertain, trading the fewest experiments for the largest model improvement.

    The loop also demands strict anti-leakage discipline: data returned from experiments must be split into training and validation sets by batch, so the same batch is never used for both training and evaluation. Otherwise, inflated offline metrics and broken online ranking are almost guaranteed.

    6. Gate Five: An Engineering Platform to Carry the Scale

    When the candidate pool grows from hundreds to tens of thousands, manual spreadsheets and local scripts fail quickly. The platform capabilities required are general-purpose categories: object storage for molecule files and raw experimental data, a message queue to absorb spikes and drive pipelines, a container platform for reproducible compute environments, logging plus monitoring and alerting to keep long-running jobs visible, and access control with auditing to meet data-tiering requirements.

    Baidu AI Cloud provides exactly these general infrastructure categories in this kind of scenario, and with elastic compute it supports large-scale parallel inference and computational chemistry workloads, letting teams focus on scientific questions rather than operational details.

    For the orchestration layer, a directed acyclic graph is recommended to describe stage dependencies, with each node declaring its inputs, outputs, and failure-retry policy:

    1. pipeline:
    2. - node: generate # generate candidates, output a structured molecule set
    3. - node: hard_filter # apply hard constraints, output the passing set
    4. - node: predict # predict properties and activity, with uncertainty
    5. - node: rank_pareto # multi-objective ranking, output the front
    6. - node: wet_batch # small experimental batch, write results back
    7. - node: retrain # incremental training and version release

    The pipeline must be idempotent and replayable: the same input under the same model version should yield the same conclusion, otherwise auditing and reproduction are out of the question.

    7. Common Anti-Patterns and How to Avoid Them

    First, treating offline metrics as the basis for decisions. Out-of-distribution generalization is what matters in screening, so validation sets must be split by chemical scaffold or by batch. Second, chasing an end-to-end black box. Interpretable intermediate quantities, such as step counts, alert-structure hits, and out-of-range properties, are required to pass review. Third, generating one enormous candidate pool and evaluating it all at once, which overwhelms storage, compute, and experimental resources simultaneously; switch to rolling batches instead. Fourth, ignoring the value of failed samples: eliminated molecules and the reasons they failed are the most valuable negative-sample asset.

    Conclusion

    When thousands of molecules rush into preclinical, the one that survives is not the one with the highest prediction score, but the one whose entire chain loses the least: constraints moved upstream reduce useless generation, multi-objective ranking avoids local optima, a traceable evidence chain keeps reviews passable, the dry-wet loop keeps correcting the model, and the engineering platform sustains throughput. The competitiveness of AI4S ultimately rests on screening, not on production.