Resource-Typed Precursor Planning with Explicit Discards

Neural tools that suggest starting chemicals for an inorganic material work like search engines. They rank candidate precursor sets by learned similarity to the target, and nothing checks whether the chosen chemicals can actually add up to the target. They also say nothing about what is left over. At laboratory scale the leftover barely matters. At production scale it is the whole problem: every gram that is not built into the product has to be vented, washed out, dialysed or dried away. The materials literature keeps naming purification and removal steps as the barrier to scale-up. Examples are freeze-drying in ceramic membrane synthesis, and the dilution and sintering control in single-atom Ru catalysts.

This note borrows a design from resource-sensitive grammar, the tradition that treats a sentence as a proof in which every word is used exactly once. The borrowed design has two parts. A neural model assigns each piece a type, and an exact search assembles the typed pieces into a valid derivation. Crucially, discarding a resource is not forbidden; it is allowed only through an explicit, marked rule. Applied to synthesis, a recipe becomes a small derivation. Each atom in the precursors is either built into the target or leaves through a named discard rule, such as CO2 escaping as a gas or water evaporating. Each kind of discard carries a cost that reflects how hard it is to remove at volume.

Core Claim

We claim two things. First, precursor prediction on novel chemical systems improves when balance is enforced inside the search instead of as a filter afterwards. Second, making discards explicit gives a scale-relevant signal, the non-volatile residue per unit of product, that current planners cannot express.

We are careful about which part is new, because a skeptic will point out that element balance by itself is only a linear system. Checking that a fixed precursor set can balance to a target, with some allowed byproducts, is an integer feasibility problem that needs no logic at all. The linguistic lens contributes three other things. It supplies an architecture in which a neural "supertagger" predicts, for each candidate precursor, which of its elements it donates and which it sheds, and an exact assembler then combines these predictions. It supplies the principle that discarding is controlled rather than free, which gives a principled place to attach costs. And it supplies a pruning trick for keeping the combinatorial search tractable. If post-hoc balance filtering matches the integrated system, the first claim fails, and we will report that.

Grounding in Prior Work

The motivating tradition treats grammaticality as exact resource consumption. Versmissen argues that natural-language syntax requires dropping free duplication and free deletion of premises. de Groote's Abstract Categorial Grammars use the multiplicative fragment of linear logic so that mappings in both directions neither duplicate nor lose material. Lecomte et al. recast minimalist feature checking as consumable tokens that must cancel exactly.

The work that supplies our method is more specific. ÆTHEL pairs a type lexicon with mechanical proof checking and reaches a 96.2% extraction success rate on Lassy Small. Its remaining failures come from irregular phenomena, which warns us that a hard constraint will sometimes be wrong for messy real data. We therefore report a soft variant alongside the hard one.

Le Roux's Interaction Grammars explicitly compare node polarities to chemical valencies. Parsing proceeds by neutralising them while tracking available, obligatory and used nodes. The paper also proves the problem NP-hard, with lexical selection and partitioning of daughter nodes as the two sources of blow-up. That is exactly our situation, where precursor selection and the allocation of elements among precursors are the two hard parts. We reuse its mitigation: polarity-count filtering, which discards partial items whose resource counts can no longer balance.

Kehler et al. resolve resource sharing by making access paths, rather than the shared entity, the consumable resource. We use the same move for elements that appear in several precursors: the resource is "O supplied by precursor i", not "O". So far the chemical analogy has lived only in syntax. Nothing in the file applies it to synthesis data, and that gap is what this note addresses.

On the synthesis side, three planners set the bar. Retro-Rank-In ranks precursor sets in a shared latent space and generalises to unseen chemical systems. Reaction Graph Networks pool precursor embeddings with graph attention to regress sintering temperature. Prein et al. use GPT-4.1 both as a precursor predictor and as a generator of synthetic recipes. None of the three represents where atoms go.

Kim et al. note that text-mined recipes are noisy and that planners assume a direct precursor-to-target mapping. The materials-acceleration-platform study argues that industrial-viability terms belong inside the planning objective. The residue cost is our concrete version of that argument.

We deliberately do not build on the temporal-logic synthesis papers or on chemical reaction networks used as logic circuits. The first concerns ordering constraints over time, not consumption of material. The second uses chemistry as a computing substrate, not as a planning target.

Research Program

We work on the Kononova solid-state recipe data, using the splits already established in prior work. The Novel Material Systems split, in which no set of elements appears in both training and test, is the primary test. We also use the 8,049-entry solid-state subset used for temperature regression.

The first step builds a discard lexicon, a list of the ways each precursor can shed material. For each common precursor anion or ligand we specify the admissible discard routes: carbonate to CO2, hydroxide and hydrate to H2O, nitrate to NOx and O2, acetate and oxalate to CO2 and H2O, ammonium to NH3. We also specify the cost class of each route. Volatile gas release is cheap. Oxygen exchange with air is free. Non-volatile residue, such as leftover alkali or halide, is expensive, because at scale it requires washing and drying. These costs are coarse ordinal weights, not thermodynamic quantities, and we treat them as a stated assumption.

The second step trains a supertagger. Given a target and a candidate precursor, it predicts a type: which target elements this precursor donates, and which discard routes it uses. Training labels come from balancing each training recipe exactly with integer coefficients. Recipes that cannot be balanced are flagged. Their rate is itself a measurement of extraction noise in the data.

The third step is the assembler. It is a beam search over precursor sets of size two to four, drawn from the ranker's top candidates. It uses polarity-count pruning in Le Roux's sense: a partial set is dropped once some target element has no remaining supplier, or once some supplied element has no admissible exit. Each surviving set is solved exactly for integer coefficients. It is then scored by the neural ranking score plus a weighted residue term equal to non-volatile discard mass per mole of product.

The output is not just a ranked list but a derivation. It states which precursor supplies each element and what leaves, in what amount. That also gives the predicted gaseous byproduct as a feature for temperature regression.

Baselines

The naive reference point is Retro-Rank-In run unmodified. Its reported figure is 76.20% Top-10 accuracy on the Novel Material Systems split, against 67.68% for Retrieval-Retro, from Retro-Rank-In. We rerun it with the released configuration so that all our variants share its embeddings, candidate pool and training data. The file does not report its Top-1, Top-3 or Top-5 numbers, so we measure these ourselves.

The strongest language-model competitor is GPT-4.1 with 40-shot prompting. It reaches 53.8% Top-1 and 66.1% Top-5 exact-match precursor accuracy in Prein et al.. The file does not state which split that figure uses, so we rerun the prompt on our Novel Material Systems test set with identical example pools rather than compare against the quoted number directly.

The key ablation is Retro-Rank-In followed by the post-hoc integer balance filter. It uses the same candidate pool and the same allowed-byproduct list, but has no supertagger and no in-search pruning. This isolates whether integrating the accounting into the search matters.

A second ablation removes the residue term, which isolates the scale-motivated cost.

For temperature regression, the reference points are RGN at 89.9 °C sintering MAE, from Reaction Graph Networks, and SyntMTE at 73 °C sintering and 98 °C calcination MAE, from Prein et al.. Here we add only the derivation's byproduct features to the same backbone, on the same folds.

The tuning budget is matched: each variant gets the same number of hyperparameter trials. Beating the field means a Top-1 or Top-5 gain over the post-hoc filter on the Novel Material Systems split that survives a paired bootstrap across five seeds. Beating Retro-Rank-In alone is not sufficient.

Why not just…?

Why not just filter Retro-Rank-In's output with an element-balance solver? This is the real threat, and it may well be enough. The filter can only reorder sets the ranker already proposed. The integrated search differs in two ways. The supertagger can surface precursors whose value lies in what they shed, for example a carbonate chosen over an oxide. And pruning lets the beam explore deeper before the balance check applies. The paired comparison with the post-hoc filter settles this directly. If the gap is within noise, we report that the linguistic architecture adds nothing to accuracy, and the contribution narrows to the residue signal.

Why not just add a soft mass-balance penalty to the ranker's loss? A soft penalty cannot say which atoms leave by which route, so it cannot attach a scale cost to them. On the other hand, it tolerates noisy labels better than a hard constraint, a lesson ÆTHEL's 3.8% extraction failures reinforce. We therefore train this variant as well and report accuracy separately on recipes that can and cannot be balanced.

Why not just prompt a large language model? GPT-4.1 already fails on 46.2% of Top-1 predictions in Prein et al.. Kim et al. report non-stoichiometric and hallucinated recipes from literature-trained models. We will also measure how often the model's outputs cannot be balanced at all, which the file does not report.

Why not just check that every target element appears in some precursor? This coverage check is our first pruning layer, so we report it as its own baseline. It cannot detect an element with no admissible exit, such as a chloride with no removal route, and it cannot score residue.

Decisive Checks

The first check is the accuracy test: Top-1 and Top-5 on the Novel Material Systems split, integrated search against post-hoc filter. The second is a residue analysis. For targets with several distinct recipes in the Complete Reaction Archive, we ask whether recipes reported more often have lower non-volatile residue than rarely reported alternatives. Frequency is only a crude proxy for robustness, and we will label it as such. The third check reports search cost: wall-clock time and number of solver calls with and without polarity pruning. Le Roux's hardness result predicts that pruning is necessary as the candidate pool grows.

A negative result on the first check but a positive one on the second would still justify reframing the contribution as a scale-aware scoring layer. If both are null, the analogy fails in practice, and we will say so plainly.