---
title: 'GRXForm: Molecular Optimization & Form Extraction'
url: https://www.emergentmind.com/topics/grxform
type: topic
---

# GRXForm: Molecular Optimization & Form Extraction

GRXForm denotes two distinct systems in recent arXiv literature. In molecular optimization, **GRXForm** abbreviates **“Group-Relative XForm”**, a conditional graph-transformer policy introduced for amortized molecular optimization via Group Relative Policy Optimization (GRPO), with the explicit goal of generating an optimized molecule \(y\) from an input scaffold \(x\) in one forward pass and with **no inference-time oracle calls** [2602.12162]. In a separate information-extraction context, **GRXForm** is also used as the name for a **“Form 57-from-News”** pipeline that populates **Highway-Rail Grade Crossing Incident Data (Form 57)** from news articles in real time [2512.22457]. The primary technical meaning of the term is therefore context-dependent, and the two usages are unrelated except for the shared label.

## 1. Terminological scope and disambiguation

Current usage of *GRXForm* is not unique across domains. One usage belongs to molecular design, where the term expands to **Group-Relative XForm** and refers to a scaffold-conditioned policy trained with GRPO. Another usage appears in railway incident information extraction, where the same string names a pipeline for populating **FRA Form 57** from news. A closely related but distinct molecular model is **GraphXForm**, the decoder-only graph transformer that serves as the architectural backbone for the molecular GRXForm system [2602.12162].

| Usage | Domain | Source |
|---|---|---|
| GRXForm (“Group-Relative XForm”) | Amortized molecular optimization | [2602.12162] |
| GRXForm (“Form 57-from-News”) | Railway incident form population from news | [2512.22457] |
| GraphXForm | Graph transformer for molecular design | [2411.01667] |

The molecular usage is the one for which the name is intrinsic to the method. The railway usage is an explicit project name attached to a pipeline whose paper title is different. This suggests that *GRXForm* is not yet a semantically stabilized identifier across subfields.

## 2. Conditional molecular optimization formulation

In the molecular literature, GRXForm is defined by a specific optimization objective: learn a single conditional policy \(\pi_\theta(y \mid x)\) that maps an input scaffold \(x\) to an optimized molecule \(y\), thereby **amortizing the search cost over training** rather than restarting optimization for every input structure [2602.12162]. The motivating contrast is with **“Instance Optimizers”**, which expend significant compute on each new input structure.

The workflow is stated compactly as:

\[
\text{pre-train on ChEMBL} \rightarrow \text{fine-tune via GRPO on scaffold-constrained tasks} \rightarrow \text{amortized inference: one pass per new scaffold} \rightarrow \text{instant candidate}.
\]

GRXForm operates over partial molecular graphs. The state at step \(t\) is a partial graph \(G_t=(V_t,E_t)\), and actions are decomposed hierarchically into three levels. **Level 0** chooses the operation in \(\{\text{Stop}, \text{AddAtom}, \text{ModifyExisting}\}\). **Level 1** chooses a target atom \(v\in V_t\). **Level 2** chooses a bond order \(b\in\{1,2,3,4,5,6\}\). At each level, a validity mask \(M(s_t)\) zeroes out choices that would violate valence constraints. The chemical validity guarantee is therefore tied to masked action selection rather than post hoc repair.

This conditional formulation matters empirically because the paper identifies a specific failure mode in prior model-based approaches: **high variance arising from the heterogeneous difficulty of distinct starting structures**. GRXForm addresses that variance not by changing the molecular state space, but by changing how rewards are normalized during reinforcement learning.

## 3. Graph-transformer backbone and relation to GraphXForm

GRXForm adopts the **decoder-only Graph Transformer from GraphXForm** as its policy backbone [2411.01667]. The predecessor model, GraphXForm, represents each molecule as a **hydrogen-suppressed undirected graph**, uses atom and degree embeddings, omits classical positional encoding to preserve permutation equivariance, and injects bond information through additive attention biases. In the original GraphXForm formulation, node \(0\) is a **virtual atom**; in GRXForm, a **virtual super-node** connects to all atoms for global pooling.

For GRXForm, each atom \(i\) is embedded as

\[
h_i = \mathrm{AtomTypeEmbed}(\mathrm{type}_i) + \mathrm{DegreeEmbed}(\mathrm{deg}_i) + w_i^{(0)} + w_i^{(1)},
\]

where \(w_i^{(\ell)}\) are one-hot indicators recording whether atom \(i\) was selected in sub-action level \(\ell\). The transformer stacks \(L\) self-attention layers with \(H\) heads and no positional encodings. Bond types enter attention through learned scalar biases:

\[
A_{ij} \propto \exp\!\left(\frac{Q_i\!\cdot\!K_j}{\sqrt d} + \phi(e_{ij})\right),
\]

where \(e_{ij}\) is bond order and \(\phi(\cdot)\) is the learned bias.

The connection to GraphXForm is architectural and methodological. GraphXForm generates molecules by sequential graph edits, masks invalid actions before renormalization, and reports **100% validity rate by construction** [2411.01667]. It was pretrained on **\(\sim 370\) k ChEMBL molecules** and fine-tuned using a procedure combining **the deep cross-entropy method and self-improvement learning**. GRXForm keeps the graph-editing policy style but replaces that fine-tuning regime with GRPO, shifts the task to scaffold-conditioned amortized optimization, and pre-trains on **\(\sim 1.5\) M ChEMBL35 molecules via teacher-forcing** [2602.12162].

## 4. Group Relative Policy Optimization

The defining algorithmic contribution of GRXForm is **Group Relative Policy Optimization (GRPO)**. Standard REINFORCE with a single global baseline is described as suffering from high variance when scaffold difficulty varies. GRPO addresses this by normalizing rewards **per scaffold group** rather than across the batch [2602.12162].

For a batch of \(B\) scaffolds \(S_1,\dots,S_B\), the policy generates \(G\) completions \(O_{i,1},\dots,O_{i,G}\) for each scaffold \(S_i\), using **Stochastic Beam Search**. If \(r_{i,j}=R(O_{i,j})\), the scaffold-specific mean baseline is

\[
\mu_i = \frac{1}{G}\sum_{j=1}^G r_{i,j},
\]

and the relative advantage is

\[
A_{i,j} = r_{i,j} - \mu_i.
\]

The policy-gradient estimator is

\[
\nabla_\theta J(\theta)
\approx \frac{1}{B G}
\sum_{i=1}^{B}\sum_{j=1}^{G}
A_{i,j}
\sum_{t=1}^{T_{i,j}}
\nabla_\theta \log \pi_\theta(a_{i,j,t}\mid s_{i,j,<t}).
\]

The paper adopts the **“Dr. GRPO”** variant: it **does not divide by group standard deviation**, thereby avoiding difficulty bias, and **does not normalize by trajectory length**, thereby avoiding length bias. It also uses **no PPO clipping** and **no critic network**, with **one gradient ascent step per batch**. The practical training loop is correspondingly direct: sample scaffolds, generate grouped completions by SBS, compute rewards, compute per-scaffold baselines and advantages, accumulate log-probability gradients, and update \(\theta\).

The stated effect is variance reduction under heterogeneous scaffold difficulty. The paper’s advantage-variance plot is described as showing that **GRPO yields a stable learning signal versus the volatile global baseline**. A plausible implication is that scaffold-relative centering is particularly important when objective landscapes differ strongly across starting subgraphs.

## 5. Hyperparameters, evaluation, and out-of-distribution behavior

The global network settings used in all GRXForm experiments are: **latent dimension 512**, **\(L=10\) transformer blocks**, **\(H=16\) heads**, **Adam \(lr=1\times 10^{-4}\)**, **weight\_decay \(=0\)**, **grad\_clip \(=1.0\)**, and **max atoms per molecule \(=50\)** [2602.12162]. For scaffold-task fine-tuning on **Kinase MPO**, the paper uses **\(B=10\) scaffolds + 1 carbon (for de-novo)**, **\(G=16\) completions per scaffold (beam width \(=16\))**, **total trajectories per batch \(\approx 160\)**, **up to 500 epochs (\(\sim 50\) K oracle calls)**, and **entropy coeff \(\beta=0\)**.

The principal benchmark is **Kinase Scaffold Decoration**. The dataset is constructed from **ZINC-250k**, decomposed into **Murcko scaffolds**, then split by **Butina clustering (Tanimoto < 0.4)** so that **500 test scaffolds** are **topologically disjoint from train**. The reward is

\[
R(M)=\tfrac14\left(P_{\mathrm{GSK3}\beta}+P_{\mathrm{JNK3}}+QED+SA'\right),
\]

with \(SA'=(10-SA)/9\in[0,1]\), and hard success requires

\[
P_{\mathrm{GSK3}\beta}\ge 0.5 \;\wedge\; P_{\mathrm{JNK3}}\ge 0.5 \;\wedge\; QED\ge 0.6 \;\wedge\; SA\le 4.0.
\]

Across three splits, **GRXForm (ours)** attains **\(0.618 \pm 0.004\)** objective score and **\(0.178 \pm 0.093\)** success rate, while **GraphXForm (amort.)** attains **\(0.409 \pm 0.003\)** and **\(0.000 \pm 0.000\)**, **Mol GA (instance)** attains **\(0.438 \pm 0.013\)** and **\(0.000 \pm 0.000\)**, and **GenMol (instance)** attains **\(0.441 \pm 0.012\)** and **\(0.000 \pm 0.000\)** [2602.12162].

Ablations further separate conditioning from optimization. **GRXForm-DeNovo (uncond.)** reaches **\(0.397 \pm 0.005\)** objective score and **\(0.001 \pm 0.001\)** success rate, whereas **GRXForm-REINFORCE** reaches **\(0.475 \pm 0.120\)** and **\(0.091 \pm 0.157\)**. The GRPO variant is therefore the best-performing version in the reported study. The paper states explicitly that **GRXForm achieves 17.8% success when all other amortized policies fail**, and that **GRXForm-DeNovo (no scaffold conditioning) achieves near zero success**, which is presented as evidence that conditioning on the starting subgraph is essential.

Two additional evaluations broaden the scope. In **Prodrug Transfer (Few-Shot)**, GRPO outperforms the global baseline on all five unseen drugs, with a **mean** of **10.693** versus **8.652** for GRXForm-REINFORCE. In the **PMO Benchmark (De Novo, 10 K calls per task)**, GRXForm attains **cumulative AUC 16.433 (2nd)**, compared with **GenMol 17.540 (1st)** and **SynGBO 16.426 (3rd)**. The paper also reports an amortization analysis: **GRXForm breaks even with Mol GA after \(\approx 5\) scaffolds and with GenMol after \(\approx 250\) scaffolds**. This suggests that its main advantage emerges in multi-scaffold campaigns rather than one-off optimization.

## 6. Separate GRXForm usage in real-time FRA Form 57 population

A separate paper uses **GRXForm** as the name for a pipeline that populates **Highway-Rail Grade Crossing Incident Data (Form 57)** from news in real time [2512.22457]. The task setting is unrelated to molecular optimization. The input is a **continuous stream of raw news articles**, and the output is **a fully populated JSON object whose schema exactly mirrors FRA Form 57**.

The pipeline has three stages. **Form Interpretation (KIE)** converts the blank, visually irregular PDF of Form 57 into a JSON schema plus field grouping using an OCR-free VLM. **Information Retrieval (Grouped QA)** asks one batch prompt per group of related fields and returns field-level answers or **“Unknown.”** **Postprocessing & Output** normalizes numeric units, choice-labels, and dates into final JSON. The paper identifies two core challenges: **the form is visually irregular and semantically dense**, and **news is noisy**.

The VLM transcription stage uses **sample aggregation**. If \(N\) independent JSON transcriptions \(\{T_i\}_{i=1}^N\) are generated, then for each field \(f\) and subfield \(s\), the system collects \(\{T_i(f,s)\}_{i=1}^{N}\) and selects the most frequent non-null entry:

\[
\hat T(f,s)=\arg\max_v \sum_{i=1}^{N}\mathbf{1}[T_i(f,s)=v].
\]

A validation step then fills remaining blanks, yielding \(T_{\rm final}\). The schema is **human-centric** in that fields are decomposed into **answer places** such as checkbox slots, text boxes, and choice lists, rather than treated as undifferentiated key-value pairs.

The grouped QA stage clusters fields by **spatial proximity and semantic similarity**, including categories such as **time + location, highway user, train equipment, casualties, environment, hazardous materials**. The paper defines a group score

\[
C(G_k)=\frac{1}{|G_k|}\sum_{f\in G_k} c(f),
\]

and if \(C(G_k)<\tau\), with a **small threshold, e.g. \(\tau=0.3\)**, the system re-asks the group question or falls back to **“Unknown”** for all fields in the group. This grouping is motivated by ambiguity reduction: related fields asked together allow the model to exploit intra-group context.

The evaluation dataset is built by aligning scraped news with official FRA records. Starting from the FRA official CSV of **\(\approx 4{,}000\) events since 2000**, the authors search news within \([t_{\rm rec},\,t_{\rm rec}+7\,\mathrm{days}]\), use **four extraction tools**—**newspaper3k, trafilatura, readability, goose3**—and **two crawling modes**—**direct HTTP vs. headless browser**—and score candidate article–record pairs using spatio-temporal and casualty features. After manual filtering, the dataset contains **266 matched pairs**. From these, **50 pairs** are randomly sampled for annotation, and **each field \(f\)** is marked **“answerable”** or **“unanswerable”** by two annotators, with **Cohen’s \(\kappa=0.82\) on a pilot**.

On those 50 manually annotated articles, using **Gemini 2.5 Flash as QA backend**, **GRXForm (Ours)** reports **\(0.67 \pm 0.01\)** accuracy and **\(0.96 \pm 0.01\)** coverage, compared with **Baseline 1: 0.52, 0.91**, **Baseline 2: \(0.57 \pm 0.01\), \(0.89 \pm 0.01\)**, and **Baseline 3: \(0.70 \pm 0.00\), \(0.89 \pm 0.01\)**. The paper also states that **digit fields remain the hardest (\(0.64 \pm 0.03\) accuracy)**. End-to-end latency for one article plus one form is reported as approximately **20 s** on **a single A100 GPU + 4-vCPU node**, with **\(\sim 12\) s** for VLM form transcription using **\(N=4\)** samples and **\(\sim 8\) s** for **6–8 grouped QA prompts**.

Taken together, this second usage shows that *GRXForm* can also designate a layout-aware, grouped-QA information-extraction pipeline. It should therefore not be conflated with the molecular **Group-Relative XForm** method, even though both systems combine structured representations with model-based inference and explicit fallback mechanisms.

Source: https://www.emergentmind.com/topics/grxform