ProtStructQA: A Denotation Threshold in Protein Structural Reasoning

Aravind Mandiga, Guoming Li, Jin Lu, Ismailcem Budak Arpinar, Khaled Rasheed, Samuel E. Aggrey
University of Georgia
{aravind.mandiga, gmli, jin.lu, budak, khaled, saggrey}@uga.edu


Abstract

Protein-language systems are often evaluated by whether they generate plausible biological text, but a structural question has a sharper semantics: it denotes a measurement in a 3D coordinate system. We introduce ProtStructQA, an executable benchmark for protein structural question answering in which each natural-language question is generated from a hidden typed domain-specific language (DSL) program and the answer is obtained by executing that program on an AlphaFold-predicted structure. ProtStructQA releases \(382.2\)K questions covering confidence, distances, predicted aligned error (PAE), solvent exposure, secondary structure, topology and contacts, and held-out compositions: a \(330\)K active benchmark over \(10\)K proteins from four species, plus a \(52.2\)K hard-negative robustness pool. Without fine-tuning, we evaluate Qwen3 models from \(0.6\)B to \(8\)B under direct prompting, chain-of-thought, grammar-constrained executable voting, executable voting with chain-of-thought, and multi-turn ReAct-style tool use, and replicate the headline finding on Gemma-3-\(1\)B and Gemma-3-\(12\)B. We find a capability-dependent denotation threshold between Qwen3-\(1.7\)B and Qwen3-\(4\)B: below it, tool-mediated ReAct dominates because models often fail to produce executable denotations; above it, chain-of-thought flips from mostly harmful to strongly beneficial and becomes the strongest strategy on most splits. Parse-failure and family-level analyses show that the threshold is a transition from unparseable language to executable structural denotation, while grammar and execution remain selectively valuable for PAE and secondary-structure queries. ProtStructQA reframes scientific QA as compilation from language to measurement and provides a diagnostic testbed for when language models can map words to executable 3D structural measurements.

Figure 1: Two ProtStructQA examples. Each panel: an AlphaFold-predicted protein, natural-language question, hidden DSL program, and gold answer (executed).

1 Introduction↩︎

AlphaFold [1] and the AlphaFold Protein Structure Database (AFDB) [2], [3] have changed the bottleneck in structural biology. For a large fraction of catalogued proteins, a predicted 3D structure is now available, and AFDB provides open access to more than \(200\) million predicted structures. The remaining challenge is not only to obtain structures, but to ask precise questions of them: which region is low-confidence, how far apart are two residues, whether a window is both high-confidence and contact-rich, or whether two domains have high predicted aligned error. These are not merely textual questions. They are measurements over a molecular object.

This creates a mismatch for evaluating large language models (LLMs). If a model is asked, “How many Angstroms separate the alpha-carbons of residues 207 and 220 in the AlphaFold structure?”, a fluent answer is not enough; the answer should be correct only if it matches the value computed from the predicted coordinates. String-overlap metrics and LLM judges can assess whether a response resembles a reference, but they cannot by themselves verify that a number, residue set, region, or structural label was derived from the protein structure.

We treat protein structural QA as denotational semantics: a natural-language question corresponds to a hidden typed program, and its meaning is the value obtained by executing that program on a protein structure. For example, the question above denotes distance(residue(207), residue(220)); running this program on the AlphaFold prediction for human protein A6ND36 yields the gold answer (\(16.25\) Å). Under this view, evaluation becomes deterministic: a model is correct only when its prediction matches the structure-derived denotation.

We introduce ProtStructQA, a large-scale executable benchmark for residue-level structural QA over AlphaFold-predicted proteins. ProtStructQA releases \(382.2\)K questions: a \(330\)K active benchmark across seven structural families and a \(52.2\)K hard-negative robustness pool. The benchmark covers \(10\)K proteins from human, mouse, fruit fly, and chicken, and asks about pLDDT confidence, \(C_\alpha\) distances, PAE, solvent exposure, secondary structure, contacts, topology, and held-out compositions of these primitives. Each question is generated from a hidden DSL program and evaluated by deterministic execution rather than text overlap.

This setup lets us ask a controlled inference-time question: where is the structural denotation computed? Direct prompting compiles in one step; chain-of-thought plans in language; grammar-constrained executable voting samples and executes candidate programs; ReAct-style tool use externalizes structural access through multi-turn tool calls. A shared executor isolates whether failures arise from language planning, program syntax, structural computation, or answer formatting.

Across Qwen3 models from \(0.6\)B to \(8\)B, we observe a capability-dependent denotation threshold between Qwen3-\(1.7\)B and Qwen3-\(4\)B, replicated on Gemma-3-\(1\)B and Gemma-3-\(12\)B. Below the threshold, small models often cannot produce executable denotations, and multi-turn tool use dominates. Above the threshold, chain-of-thought flips from mostly harmful to strongly beneficial, and free-form CoT or executed CoT wins nearly all evaluation cells; the transition is mechanistically a shift from unparseable to valid structural denotations.

Our contributions are:

  • Executable structural QA. We introduce ProtStructQA, a large-scale benchmark in which each natural-language protein question has a hidden typed DSL program and a gold answer obtained by deterministic execution on an AlphaFold-predicted structure.

  • Typed denotational semantics for protein questions. We formalize structural QA as compilation from language to a measurement algebra over residues, regions, residue pairs, confidence, PAE, solvent exposure, secondary structure, and contacts.

  • Controlled inference-time evaluation. We compare direct prompting, chain-of-thought, grammar-constrained executable voting, executable voting with CoT, and ReAct-style tool use without fine-tuning, across Qwen3 (\(0.6\)B–\(8\)B) and a Gemma-3 cross-family replication (\(1\)B and \(12\)B).

  • The denotation threshold. We show a scale-dependent crossover: sub-threshold models benefit most from tool-mediated denotation, while supra-threshold models use chain-of-thought as an internal compiler from language to structural measurement.

2 Related Work↩︎

2.0.0.1 Protein representation and foundation-model benchmarks.

TAPE [4], PEER [5], and ProteinGym [6] collectively evaluate protein representation, function/localization/interaction prediction, and mutation-effect tasks. These suites are essential for measuring protein foundation models, but they are not designed to evaluate natural-language questions whose answers must be computed from residue-level 3D structural measurements. ProtStructQA is complementary: it evaluates whether a language model can map a surface question to an executable operation over an AlphaFold-predicted structure.

2.0.0.2 Protein-language QA and chat systems.

Recent work has begun to connect proteins and natural language through QA datasets, instruction tuning, protein-to-text generation, and multimodal protein chat. PQA/Pika [7] introduces a curated protein QA benchmark for free-form enquiry, contrasting with earlier PDB-QA datasets of predefined questions over PDB entries; ProtT3 [8] generates text descriptions from protein-sequence inputs; Mol-Instructions [9] and InstructProtein [10] align biomolecular knowledge with natural-language supervision; and ProtChatGPT [11], ProteinGPT [12], and Prot2Chat [13] let users query protein sequence and/or structure through LLM interfaces. These efforts evaluate generation with lexical, semantic, or LLM-judge metrics, or task-specific QA scoring. ProtStructQA differs in its evaluation target: each question has a hidden residue-level DSL program and a deterministic answer produced by execution over predicted 3D coordinates.

2.0.0.3 Executable and compositional reasoning benchmarks.

ProtStructQA inherits from a tradition of compositional reasoning benchmarks: SCAN [14] (grammar-based compositional generalization), CFQ [15] (executable SPARQL queries), CLEVR [16] (functional programs over synthetic visual scenes), and GQA [17] (scene-graph question generation with functional programs). ProtStructQA imports this denotational idea into a scientific domain: the “scene” is an AlphaFold-predicted protein, the objects are residues and regions, and the answer is a structural measurement rather than a visual attribute or database fact.

2.0.0.4 Structured decoding, programs, and agents.

Grammar-constrained decoding enforces output structure at the token level [18][21], and JSONSchemaBench [22] benchmarks syntactic validity at scale. Program-aided methods such as Program-of-Thought [23] and PAL [24] separate reasoning from computation; self-consistency [25] aggregates multiple reasoning traces. ReAct [26] interleaves reasoning with tool use. ProtStructQA uses these methods not merely to test format compliance, but to ask when valid structure becomes correct scientific denotation: a syntactically valid DSL program is useful only when its execution matches the structural quantity requested by the question.

2.0.0.5 Positioning.

In summary, ProtStructQA is not simply another protein QA dataset or another constrained-decoding benchmark. It combines protein structural data, typed executable semantics, and controlled inference-time reasoning to evaluate whether language models can compile natural-language questions into measurements over predicted molecular structure. This intersection is the paper’s contribution.

Figure 2: ProtStructQA construction pipeline: fromprotein panel through DSL and paraphrases to train-disjointevaluation tracks. Pipeline is deterministic given fixed seeds.

3 The ProtStructQA Benchmark↩︎

ProtStructQA is built around four objects: a predicted structural world, a natural-language question, a hidden typed denotation, and a deterministic oracle. The world is an AlphaFold-predicted protein structure; the question is a paraphrase of a hidden template; the denotation is a DSL program; and the oracle is the executor that computes the answer from coordinates, confidence scores, PAE, solvent exposure, and secondary-structure annotations. Figure 2 summarizes the construction pipeline. In plain terms, each question is generated from a hidden program, and the correct answer is the value of running that program on the protein’s predicted structure.

3.1 Protein Panel↩︎

We sample \(10{,}000\) AlphaFold-predicted protein structures across four UniProt reference proteomes [27]: \(4{,}000\) human, \(2{,}500\) mouse, \(1{,}500\) fruit fly, and \(2{,}000\) chicken (Table 2, App. 10). Human serves as the in-distribution anchor, while the other species define species-stratified cross-proteome shifts: mouse provides a close mammalian comparison, chicken a non-mammalian vertebrate comparison, and fruit fly an invertebrate comparison. The species selection is intended to create controlled proteome-level distribution shifts, not to prove broad phylogenetic generalization. Sampling is length-stratified within species (final-panel lengths range from \(16\) to \(2{,}321\) amino acids), and predicted structures come from AFDB v6 [3], produced by AlphaFold [1] and released under CC BY 4.0.

For each protein, we extract the \(C_\alpha\) trace, per-residue pLDDT, the PAE matrix, secondary structure assigned by DSSP and collapsed to helix/strand/coil [28], and relative solvent-accessible surface area (SASA). These features define the executor’s structural state, and the benchmark therefore evaluates answers relative to AlphaFold-predicted structures and the per-residue annotations derived from them, not experimental structural ground truth. Figure 1 shows two example questions; the per-species protein counts (Table 2) and the panel’s length, pLDDT, and secondary-structure composition (Figure 4) are reported in App. 10.

3.2 Formal denotational setup↩︎

Informally, each question is paired with a hidden program; running the program on a protein returns a number, a yes/no, a residue, a region, a residue set, a residue-pair set, or a secondary-structure label. The formal setup below names the pieces of this pipeline so later sections can reference them precisely.

Let protein \(p\) have structural state \[S_p = (X_p,\, c_p,\, A_p,\, \sigma_p,\, \rho_p),\] where \(X_p \in \mathbb{R}^{n_p \times 3}\) are \(C_\alpha\) coordinates, \(c_p \in [0, 100]^{n_p}\) are pLDDT scores, \(A_p \in \mathbb{R}_{\ge 0}^{n_p \times n_p}\) is the PAE matrix, \(\sigma_p \in \{\mathtt{H},\mathtt{E},\mathtt{C}\}^{n_p}\) gives per-residue secondary structure, and \(\rho_p \in [0, 1]^{n_p}\) is relative solvent accessibility. Each benchmark example is a tuple \[e_i = (p_i,\, q_i,\, z_i,\, y_i,\, \tau_i),\] where \(q_i\) is the natural-language question, \(z_i \in \mathcal{G}\) is the hidden DSL program (§3.3), \(\tau_i\) is the answer type, and \[y_i \;=\; E(z_i,\, S_{p_i})\] is the gold answer obtained by deterministic execution. Multiple paraphrases of the same template-parameter assignment map to the same hidden program and the same denotation, while semantically similar questions can have different programs. A prediction \(\hat{y}\) is correct only if it matches \(y_i\) under the type-specific metric defined in §5.

3.3 DSL for structural reasoning↩︎

The DSL is intentionally small: it is not a full language for structural biology, but a closed measurement algebra over residues, regions, residue pairs, and proteins, covering common structural operations while keeping every question executable and type-checkable. The DSL operates over typed values Residue, Region, ResidueSet, PairSet, Bool, Int, Float, and SecStruct; typed execution rejects ill-formed programs such as averaging a residue pair or comparing a secondary-structure label to a distance threshold. Regions are \(1\)-indexed inclusive (range(s, e) covers \(e{-}s{+}1\) residues). Primitives cover per-residue properties (pLDDT, DSSP label, relative SASA, neighbor count), pairwise properties (\(C_\alpha\) distance and PAE, with optional sequence-separation constraints via min_sep), and region- or protein-level aggregates (mean pLDDT, contact density, radius of gyration, helix counts). They compose through comparison and Boolean logic with exists, count, filter, argmin, argmax, sliding windows, and all-pairs quantification, producing both atomic measurements and held-out compositions (e.g., whether any \(40\)-residue window is simultaneously high-confidence and contact-rich). Several primitives correspond to closed-form structural quantities: \[\begin{align} \operatorname{distance}(i, j) &= \lVert X_i - X_j \rVert_2, \\ \operatorname{mean\_plddt}(R) &= \tfrac{1}{|R|}\sum_{i \in R} c_i, \\ \operatorname{mean\_pae}(R_1, R_2) &= \tfrac{1}{|R_1||R_2|}\!\!\sum_{i \in R_1, j \in R_2}\!\! A_{ij}, \\ \operatorname{contact\_density}(R) &= \tfrac{1}{\binom{|R|}{2}} \!\!\sum_{\substack{i, j \in R \\ i < j}}\!\! \mathbf{1}\bigl\{\lVert X_i - X_j \rVert_2 < 8\,\text{\AA}\bigr\}. \end{align}\] The full \(30\)-primitive vocabulary, the formal grammar, and the program pattern of every one of the \(31\) templates are listed in App. 16.

3.4 Question Templates↩︎

Questions span \(7\) families and \(31\) templates (per-family and per-template counts in App. 15). Families A–F cover atomic structural operations (confidence, distance, PAE, solvent exposure/packing, secondary structure, contacts/topology).

Each template is rendered through multiple natural-language paraphrases (median \(29\) per A–F template, \(5\)\(6\) per G template) spanning terse, interrogative, imperative, and structural-biology wordings. A paraphrase changes the wording but not the denotation: for a fixed template and parameter assignment, all paraphrases map to the same hidden program and answer. The paraphrase pool was generated by an LLM (Claude Opus 4.7 [29]) and then author-verified to remove paraphrases that revealed the answer and to make sure every paraphrase kept the same slot names as its template; consistency between paraphrase and program is then validated on a 3,500-question stratified sample (§3.7). Family G is not new biology; it is new composition. This is the closest analogue to compositional splits in SCAN, CFQ, CLEVR, and GQA, grounded in protein structural measurements (App. 10, Figure 5).

3.5 Hard Negatives↩︎

Hard negatives are semantic stress tests in structural space. They preserve much of the linguistic surface while changing the denotation or crossing a decision boundary, so that template priors alone are insufficient. They test whether a model binds the question to the measured structural property, rather than exploiting wording-only heuristics.

We construct hard negatives by perturbing template parameters (residue indices, region endpoints, or numeric thresholds) so that the resulting question is close to an original but has a different executed answer (two construction types HN1/HN2 with per-class breakdown in App. 12). We release a \(52.2\)K hard-negative robustness pool and evaluate a stratified \(4{,}357\)-question hard-negative split.

3.6 Generalization axes↩︎

ProtStructQA evaluates four generalization axes (Table 5). The in-distribution split (\(12{,}000\) questions) tests new proteins and parameter values under seen template families. The compositional split (\(6{,}000\) questions, Family G) tests held-out compositions of known operators. The cross-species split (\(10{,}000\) questions) tests species-stratified cross-proteome shift on mouse, fly, and chicken proteins. The hard-negative split (\(4{,}357\) questions, §3.5) tests semantic robustness under near-surface-preserving structural perturbations.

Within the human in-distribution pool, we partition proteins \(80\%\) training / \(10\%\) development / \(10\%\) test, with no protein appearing in more than one split. Family G is held out of the exemplar pool. We do not fine-tune model weights on any split. The paper evaluates models on a \(32{,}357\)-question stratified subsample of the four evaluation tracks (§[sec:benchmark:subsample]). We use “cross-species” and “cross-proteome” descriptively. The split measures robustness to proteome-level distribution shift across our four selected species, not general biological extrapolation to arbitrary species, protein families, or experimental conditions.

3.7 Validation↩︎

The main risk in executable benchmark construction is that errors in program generation, parsing, or structural preprocessing become false gold labels. We validate ProtStructQA as a trust stack: schema and type gates, deterministic execution, paraphrase-program consistency, cross-tool agreement, and distributional checks on subsampled splits.

First, every generated question passes a six-step sanity gate (file format, single-split membership, cross-species questions on non-human proteins, both HN classes labeled correctly, gold program re-execution, and a question-only baseline confirming that the wording alone is insufficient). Repeated execution of the same program on the same structural state always produces the same answer.

Second, we verify that paraphrases recover the intended program parameters: from each of the seven families we sample \(500\) questions (\(3{,}500\) total) and confirm that every numeric literal in the gold program appears in the natural-language question and that the question contains at least one family-specific keyword. All \(3{,}500\) pass.

Third, we recompute representative structural primitives with independent toolchains: BioPython [30] for distances, pLDDT, and Shrake–Rupley SASA; raw AFDB JSON for PAE; biotite P-SEA [31], [32] for secondary structure. All agree on evaluated templates (App. 13).

Finally, for the three subsampled evaluation splits, stratified sampling preserves relevant marginals: KL divergence is at most \(0.0037\) for every tracked category (family, species, template, answer type), so subsample trends transfer to the full pool within statistical noise (App. 14).

4 Baseline Suite↩︎

We evaluate five inference-time baselines that differ in where the structural denotation is computed. Direct prompting asks the model to compile the question into an answer in one step. Chain-of-thought lets the model plan in natural language before emitting an answer. Executable voting samples grammar-valid DSL programs, executes them, and aggregates the executed answers under a type-aware loss. EV+CoT combines language planning with executable voting. ReAct-style tool use externalizes structural computation through a multi-turn tool interface. All are inference-time only (no fine-tuning) and share the same DSL output schema; they differ only in decoding strategy (§5). Iterative refinement and deliberate-search methods [33][35] are out of scope.

  • Standard [36] (direct compiler): few-shot direct prompting at \(T{=}0\); one DSL emission per question, compiling \(q\) into a typed program in a single forward pass.

  • CoT [37] (internal compiler with language planning): prepends a 4-step task-decomposition checklist (answer-type \(\to\) primitive \(\to\) scope \(\to\) thresholds); same sampling and exemplars as Standard. Vanilla zero-shot [38] and PAL-style variants [23], [24] are evaluated as prompt-robustness checks (App. 17).

  • EV [23][25] (grammar-constrained executable voting): the program-form analogue of self-consistency. We sample \(k{=}3\) grammar-constrained programs \(\hat{z}_1, \ldots, \hat{z}_K\) from \(p_\theta(\cdot \mid q,\, z \in \mathcal{G})\) at \(T{=}0.7\), top-\(p{=}0.95\) via LLGuidance [39], execute each to obtain candidate denotations \(\hat{y}_k = E(\hat{z}_k,\, S_p)\), and aggregate by type-specific minimum-risk decoding [40]: \[\hat{y} \;=\; \arg\min_{u \in \{\hat{y}_1, \ldots, \hat{y}_K\}} \sum_{k=1}^{K} \ell_\tau(u,\, \hat{y}_k),\] where the type-specific loss is \[{!}{ \ell_\tau(u, v) = \begin{cases} \mathbf{1}[u \ne v] & \tau \in \{\text{Bool}, \text{Int}, \text{SecStruct}\}, \\ |u - v| & \tau = \text{Float}, \\ 1 - \mathrm{IoU}(u, v) & \tau \in \{\text{Region}, \text{ResidueSet}, \text{PairSet}\}. \end{cases} }\] These reduce to majority vote, sample median, and IoU-medoid respectively. Thus EV is not only self-consistency over text; it is voting in the executor’s answer space.

  • EV+CoT (language planning combined with executable voting): EV with the CoT prefix applied per sample, the self-consistency \(+\) CoT combination [25] on executed programs rather than free-form text.

  • ReAct [26] (tool-mediated denotation prosthesis): multi-turn agent interleaving reasoning, tool actions, and observations (<think>, <act>, <obs>, <answer> delimiters). Five DSL tools (point-residue lookup, residue-pair distance, mean PAE over a region, region summary stats, and raw DSL execution), four primer examples, \(\mathrm{\small max\_turns}{=}8\). Tool calls externalize structural access; the model need not internally compile the full question into a single expression. The final <answer> is free-form text (analyzed in §6.4).

5 Experimental Setup↩︎

Models and inference. We evaluate Qwen3-0.6B, Qwen3-1.7B, Qwen3-4B, and Qwen3-8B [41] via vLLM [42] v0.16.0 on a single H100-80GB in bfloat16. All baselines receive the same compact protein summary (length, mean pLDDT, helix and strand counts, secondary-structure bands, pLDDT bands) and four train-pool few-shot exemplars per question (families A–F, target template excluded); this design isolates inference-time behavior rather than supervised adaptation to ProtStructQA. EV and EV+CoT: temperature 0.7, top-\(p\) 0.95, \(k{=}3\), max_tokens=192, grammar enforcement via LLGuidance [39]. Standard and CoT: temperature 0, max_tokens=384. ReAct: temperature 0 (greedy, following [26]), max_tokens=384/turn, \(\mathrm{\small max\_turns}=8\). Overall GPU usage for the experiments is approximately \(150\) hours on H100.

Metrics. A prediction is scored under a type-specific tolerance, \[{!}{ M_\tau(\hat{y}, y) = \begin{cases} \mathbf{1}\bigl[|\hat{y} - y| \le \max(0.5,\;0.05 \cdot \max(|y|,|\hat{y}|))\bigr] & \tau = \text{Float}, \\ \mathbf{1}\bigl[|\hat{y} - y| \le \max(2, 0.10|y|)\bigr] & \tau = \text{Int}, \\ \mathbf{1}[\hat{y} = y] & \tau \in \{\text{Bool}, \text{SecStruct}, \text{Region}\}, \\ \mathbf{1}\bigl[\mathrm{IoU}(\hat{y}, y) \ge 0.9\bigr] & \tau \in \{\text{ResidueSet}, \text{PairSet}\}, \end{cases} }\] applied in each Float quantity’s native unit (Å for distance/PAE, pLDDT points for confidence, unitless for SASA fraction and contact density). Marginal accuracy is the mean, \(\operatorname{Acc} = \tfrac{1}{N}\sum_{i=1}^{N} M_{\tau_i}(\hat{y}_i, y_i)\). Following [43] we report bootstrap \(95\%\) CIs (1,000 resamples [44]; App. 19) on marginal accuracies and McNemar’s test [45] on matched-question pairs, with Bonferroni correction tied to the number of planned comparisons; per-cell statistical significance for Qwen3 is reported in App. 18 (Tables 9 and 10), and prompt-form robustness in App. 17. EV and EV+CoT run at three seeds; Standard, CoT, and ReAct are reported single-seed (seed 0).

6 Results: The Denotation Threshold↩︎

6.1 A Denotation Threshold Between 1.7B and 4B↩︎

Table 1 reports the full ablation: 5 methods, 4 splits, 4 Qwen3 scales. On the eight sub-threshold cells (0.6B and 1.7B), ReAct reaches the highest compositional accuracy (\(28.7\)\(31.1\) pp above the next-best method) and dominates on every other split. At 4B and above the picture inverts: free-form CoT wins six of eight cells outright, and grammar-constrained EV+CoT wins the remaining two (both at 8B on in-distribution and cross-species). The threshold sits between 1.7B and 4B.

The species-stratified cross-proteome shift (mammal, avian, invertebrate) does not flip any winner relative to in-distribution, and hard-negative changes non-agentic accuracy by less than three points uniformly (some splits up, some down). The denotation threshold therefore reflects model capability, not a quirk of the human-only test pool.

3pt

Table 1: Accuracy (%) across five inference-time methods, four splits, and four Qwen3 scales.Bold = best per (model, split); italic = negative \(\Delta\).Reasoning-prefix and grammar-planning effects:\(\Delta_{\mathrm{CoT}}(m,s) = A(m, \mathrm{CoT}, s) - A(m, \mathrm{Standard}, s)\) and\(\Delta_{\mathrm{EV+CoT}}(m,s) = A(m, \mathrm{EV+CoT}, s) - A(m, \mathrm{EV}, s)\),where \(A\) is the marginal accuracy at model \(m\) on split \(s\).EV/EV+CoT: 3-seed mean. Others: seed 0.
Model | Split | Standard | CoT | \(\Delta\)CoT | EV | EV+CoT | \(\Delta\)EV+CoT | ReAct :==========+:================+:============:+:=========:+:===============:+:========:+:==========:+:==================:+:=========: Qwen3-0.6B
in-distribution 21.15 20.21 \(-\)​0.94 15.55 14.22 \(-\)​1.33 27.62
compositional 4.93 3.40 \(-\)​1.53 12.49 6.34 \(-\)​6.15 43.57
cross-species 20.82 19.86 \(-\)​0.96 15.80 14.13 \(-\)​1.67 28.45
HN 19.90 19.14 \(-\)​0.76 17.93 15.71 \(-\)​2.22 29.15
Qwen3-1.7B ]{.smallcaps} |
in-distribution 28.44 26.49 \(-\)​1.95 35.41 36.59 \(+\)​1.18 51.84
compositional 3.52 5.42 \(+\)​1.90 13.17 8.67 \(-\)​4.50 41.83
cross-species 28.24 26.79 \(-\)​1.45 34.45 36.02 \(+\)​1.57 52.91
HN 28.69 25.45 \(-\)​3.24 35.08 34.54 \(-\)​0.54 52.05
Qwen3-4B .smallcaps} |
in-distribution 69.62 81.60 \(+\)​11.98 70.01 81.41 \(+\)​11.40 60.01
compositional 46.07 87.57 \(+\)​41.50 27.57 72.09 \(+\)​44.52 33.85
cross-species 70.33 81.88 \(+\)​11.55 70.52 81.44 \(+\)​10.92 59.81
HN 70.32 83.13 \(+\)​12.81 69.71 82.06 \(+\)​12.35 60.36
Qwen3-8B .smallcaps} |
in-distribution 67.73 82.19 \(+\)​14.46 75.98 82.53 \(+\)​6.55 67.32
compositional 56.55 86.12 \(+\)​29.57 53.96 74.58 \(+\)​20.62 38.13
cross-species 67.29 81.29 \(+\)​14.00 76.08 82.21 \(+\)​6.13 68.15
HN 68.05 82.76 \(+\)​14.71 75.38 80.78 \(+\)​5.40 63.71
Figure 3: The denotation threshold and its parseabilitymechanism. (a) Pooled accuracy across all four splits forStandard, CoT, and ReAct. (b) Parse-failure rate(1{-}P(\mathrm{valid})) per method on Qwen3. Per-cellparseability rates for in-distribution and compositional splits inApp. 20.

6.2 The Threshold is a Parseability Transition↩︎

The denotation threshold (Figure 3) is explained by a change in failure mode. Below threshold, small models fail before semantics: they emit malformed programs, invalid answer types, or free-form text that cannot be parsed into the required denotation. Above threshold, parseability improves sharply, and remaining errors are more often semantic or aggregation errors.

The threshold becomes mechanistic when we decompose accuracy as \[P(\mathrm{correct}) \;=\; P(\mathrm{valid}) \cdot P(\mathrm{correct}\mid\mathrm{valid}).\] \(P(\mathrm{valid})\) is the rate at which the model produces a parseable typed output, and \(P(\mathrm{correct}\mid\mathrm{valid})\) the rate at which a parseable output matches the gold. Below the threshold, models fail mainly on \(P(\mathrm{valid})\); above, the remaining headroom is in \(P(\mathrm{correct}\mid\mathrm{valid})\), which is what chain-of-thought improves.

Per-cell parse-failure rates (App. 20) make this concrete: between Qwen3-1.7B and Qwen3-4B, Standard and CoT parse-failure both drop sharply, and the pattern replicates between Gemma-3-1B and Gemma-3-12B. At Qwen3-8B compositional, grammar-constrained EV still has higher parse-failure than free-form CoT.

The result is therefore not “CoT always helps” or “grammar always helps.” Each method changes a different term in the decomposition: tools and grammar improve \(P(\mathrm{valid})\); CoT improves semantic planning only after the model can maintain a valid output channel; and constrained sampling can hurt long compositional programs when syntactic validity narrows the generation path too aggressively.

6.3 Grammar is Selectively Valuable↩︎

Family-level results (Table 3, App. 11) show that grammar and execution remain valuable even above the threshold, but not uniformly. Family C (PAE region-pair aggregation) and Family E (secondary-structure labels) continue to favor EV+CoT over free-form CoT at 8B because the correct program must preserve exact region boundaries, pair orientation, or discrete structural labels; deterministic execution prevents the arithmetic and formatting errors that free-form CoT can introduce.

In contrast, families that reduce to scalar lookup or arithmetic over AlphaFold-derived quantities (Families A (confidence), B (distance), D (solvent exposure), F (contact topology)) favor free-form CoT at 4B and 8B. Once a model can identify the correct primitive and scope, strict program generation becomes less necessary and may introduce sampling failure.

The compositional split is the clearest stress test. CoT succeeds when the model can reason through the operator composition in text and emit the final value, while EV+CoT can fail because generating a long nested grammar-valid program is itself difficult. Failure under EV+CoT in this regime does not mean the DSL cannot express the answer; it means the model struggles to generate the correct executable expression under constraints.

6.4 Agents as Denotation Prosthesis for Sub-Threshold Models↩︎

ReAct dominates at 0.6B and 1.7B because it supplies a denotation prosthesis: instead of requiring the model to internally compile the full question into an executable expression, tools expose local structural operations and raw DSL execution. For sub-threshold models, this externalises the part of the task they are least able to perform. At 4B and 8B, ReAct loses this advantage: once models can internally compile most questions, multi-turn tool use introduces over-deliberation, formatting errors, and lost turn budget.

ReAct’s compositional accuracy is highest at the sub-threshold scales, drops at \(4\)B, and partially recovers at \(8\)B. The 8B agent runs significantly longer and over-constructs candidate programs that fail to execute, so additional turns reduce rather than improve accuracy. We describe this non-monotonic trajectory cautiously: the evidence supports a minimum at 4B and a mechanism involving over-deliberation, but not a precise functional form across model scale. The 8B failure is sub-family-localized, concentrated on G1 and G3 (full decomposition in App. 10).

6.5 Replication on Gemma-3↩︎

The same flip replicates on Gemma-3-1B/12B [46] (ReAct wins at \(1\)B, CoT wins at \(12\)B), confirming the threshold is not Qwen3-specific (App. 21, Table 13).

7 Conclusion↩︎

Scientific QA should not stop at plausible answers. In structural biology, the meaning of a question is a measurement over a molecular object. ProtStructQA makes that measurement executable by pairing natural-language questions with hidden typed programs and deterministic answers over AlphaFold-predicted structures. This executable view reveals a denotation threshold: small models need tools to reach the structure, while larger models can use chain-of-thought as an internal compiler from words to structural measurements. By reframing protein QA as compilation from language to denotation, ProtStructQA provides both a benchmark and a diagnostic lens for scientific language grounding in the AlphaFold era. ProtStructQA highlights executable grounding as a useful direction for evaluating scientific QA beyond plausible answer generation.

8 Limitations↩︎

ProtStructQA tests structural reasoning under generated natural-language questions, not the full distribution of questions asked by practicing structural biologists. Although templates have multiple paraphrases and family-specific lexical variation, the language remains controlled. Families A–F share template identity between train and test (different proteins and parameter values), so the in-distribution split measures parameter-OOD, not template-OOD; Family G provides the only template-OOD test. Broader human-authored language generalization is left to future work.

Gold answers are correct relative to AlphaFold-predicted structures and the per-residue annotations derived from them, not relative to experimental crystal structures or dynamic biology. This is intentional: the benchmark evaluates whether models can query a specified predicted structural object, and low-confidence regions are kept to preserve a realistic uncertainty signal. ProtStructQA results should not be interpreted as validating AlphaFold predictions or as experimental claims about the underlying proteins.

The denotation threshold is observed across Qwen3-\(0.6\)B to Qwen3-\(8\)B and replicated on Gemma-3-\(1\)B and Gemma-3-\(12\)B (§6.5). We do not claim that the parameter-count location of the threshold is universal across model families, training recipes, or larger scales. The cross-family replication is limited to two Gemma scales and three baselines (Standard, CoT, ReAct), so broader cross-family evaluation, including more model families, more intermediate sizes, and the full five-baseline suite, is an important next step. Fine-tuning is out of scope.

The DSL covers single-chain monomeric structural measurements over coordinates, confidence, PAE, solvent exposure, secondary structure, and contacts. It does not model dynamics, ligand binding, allostery, multimeric assemblies, evolutionary covariation, or experimental uncertainty beyond AlphaFold-derived confidence quantities.

The non-monotonic ReAct-on-compositional trajectory in §6.4 rests on three Qwen3 data points; resolving the curve shape would require intermediate scales. We therefore describe the pattern as “non-monotonic with a minimum at \(4\)B” and interpret the mechanism (tool use helps sub-threshold models, but can introduce over-deliberation and formatting failures above threshold) rather than claiming a universal scaling law.

9 Ethics Statement↩︎

ProtStructQA is constructed from publicly released AlphaFold Database predictions [1], [3] (CC BY 4.0) and UniProt [27] reference proteomes, with attribution and licensing aligned to the upstream resources. The benchmark contains no human subjects or personally identifying information. Code is released under the MIT license; the derived dataset is released under CC BY 4.0, matching the upstream UniProt and AFDB licenses.

The benchmark evaluates question answering over existing predicted structures and does not provide design objectives for optimizing pathogenicity, toxicity, immune evasion, or experimental protocols. Protein-analysis tools can nevertheless be dual-use in broader settings, so we avoid framing the benchmark as a protein-design capability and preserve standard biosecurity caveats.

Because answers are relative to predicted structures, users should not treat benchmark outputs as experimental biological facts. The intended use is evaluation of structural QA and language-to-denotation reasoning, not wet-lab decision making.

10 Qualitative Evidence for the Denotation Threshold↩︎

Figure 4: Protein-panel composition. (a) per-species length distribution; (b) per-protein mean pLDDT; (c) DSSP H/E/C composition.

3pt

Table 2: Protein panel. Human anchors in-distribution; mouse,chicken, and fly define cross-proteome shifts.
Species Proteins Role
Human (H. sapiens) 4,000 in-distribution anchor
Mouse (M. musculus) 2,500 mammalian cross-proteome
Fly (D. melanogaster) 1,500 invertebrate cross-proteome
Chicken (G. gallus) 2,000 avian cross-proteome
Total 10,000

10.0.0.1 ReAct 8B sub-family failure decomposition.

At Qwen3-8B, ReAct fails almost entirely on the compositional sub-families G1 (set-valued, ResidueSet, \(\approx\)​13% accuracy) and G3 (nested-quantifier Boolean, \(\approx\)​0% accuracy), while reaching near-ceiling on the simpler Boolean sub-family G2 (\(\approx\)​100%). The two failure modes differ. G1 failures are formatting-driven: inspection of failing rollouts shows the agent identifies the correct residues during the tool loop but commits its final answer as free-form prose rather than a typed ResidueSet literal, so the deterministic executor never sees the answer (Example 4 below). G3 failures are not a formatting issue (the answer type is already Boolean); rather, the agent rarely completes the nested existential-with-distance check correctly within the available turn budget. Together these effects explain the 36-point 8B compositional gap between ReAct and EV+CoT.

We present four concrete examples drawn directly from the per-question output logs. The first three illustrate failure modes that aggregate into the denotation-threshold behavior reported in Section 6; the fourth illustrates the ReAct agent’s answer-formatting failure mode on Family-G1 questions (Section 6.4).

10.0.0.2 Example 1 (1.7B): Grammar+vote rescues a small model from ambiguous-question misinterpretation.

Question: “Average AlphaFold pLDDT, 75 to 130?”
Family A, type Float, gold: \(80.86\)

Failure mode (Standard/CoT): validity. The emitted program cannot be parsed. The phrase “75 to 130” is naturally read as a residue range (range(75, 130)). The free-form 1.7B model misinterprets “75” as a pLDDT threshold:

  • Standard 1.7B emits the malformed program mean_plddt(range(1,187) where plddt(r) >= 75 and plddt(r) <= 130) and a free-form “Answer: 82.6”; neither parses, so pred=None. \(\times\)

  • CoT 1.7B makes the same misinterpretation (mean_plddt(all_residues) where plddt(r) >= 75 and plddt(r) <= 130). \(\times\)

  • EV 1.7B samples three grammar-constrained programs; the consensus is mean_plddt(range(75, 130)) which executes to \(80.86\). \(✔\)

Grammar constraints prevent the small model from emitting syntactically near-valid but semantically wrong programs, and the \(k{=}3\) vote breaks ties when one of the three samples is correct.

10.0.0.3 Example 2 (8B compositional): Free-form CoT handles longer nested logic that grammar-constrained sampling fails to generate reliably.

Question: “Is at least one 40-residue stretch high-confidence (mean pLDDT \(>70\)) AND contact-rich (contact density \(>0.3\))?”
Family G, type Bool, gold: False

Failure mode (EV+CoT): validity. Grammar-constrained sampling cannot emit a parseable nested program. This is a Family G compositional question requiring (i) a sliding window over 40-residue stretches, (ii) two predicate evaluations per window, and (iii) an existential aggregator.

  • CoT 8B reasons step-by-step in free text and commits to False. \(✔\)

  • EV+CoT 8B fails to generate the required longer nested DSL expression under grammar-constrained sampling; all \(k{=}3\) samples emit unparseable or partial programs and pred=None. \(\times\)

This pattern, where grammar-constrained sampling fails on longer nested expressions that free-form CoT simulates in text, accounts for the \(\sim\)​11.5pp gap by which CoT beats EV+CoT on the compositional split at 8B.

10.0.0.4 Example 3 (8B Family C): Grammar wins on region-pair PAE aggregation even at large scale.

Question: “What is the average AlphaFold relative-position uncertainty between the 333–369 and 380–433 regions?”
Family C, type Float, gold: \(5.77\)

Failure mode (CoT): denotation. The free-form trace identifies the right primitive but computes the aggregation incorrectly. This is a single-step PAE aggregation, but 8B free-form CoT mis-arithmetics the result.

  • CoT 8B writes a multi-paragraph derivation and outputs \(2.99\) (a wrong arithmetic mean). \(\times\)

  • EV+CoT 8B samples mean_pae(range(333,369), range(380,433)), executes it deterministically, and returns \(5.77\). \(✔\)

This explains why even at 8B, Family C (PAE) is dominated by EV+CoT by 22.7pp (Table 3): aggregations over contiguous regions are simple to express in DSL but error-prone for the model to compute in free-form text.

10.0.0.5 Example 4 (1.7B ReAct on G1): Agent reasoning succeeds, answer formatting fails.

Question (Family G1, type ResidueSet): “Which residues are simultaneously buried (rel SASA \(<\) 0.2) AND poorly predicted (pLDDT \(<\) 70)?”
Gold: [188] (single-residue ResidueSet)

Failure mode (ReAct): answer-format. The agent’s tool observations identify the correct residue, but the final <answer> commit is in free-form prose rather than a typed ResidueSet literal. The 1.7B ReAct agent runs five turns: it iteratively calls run_dsl and inspect_residue, narrowing to a candidate region beginning at residue 188. But on the final turn it emits the free-form sentence:

“residues 188–293 have a mean pLDDT of 66.20…all residues in this region are simultaneously buried (rel SASA \(<\) 0.2) AND poorly predicted (pLDDT \(<\) 70).”

The parser cannot extract a ResidueSet literal from this string, so pred=None and the answer is scored wrong. The agent’s reasoning identifies residue 188 (the gold answer) at the start of its candidate region, but the final <answer> commit is in natural language rather than the expected [N,…] typed format. This illustrates a structural limitation of multi-turn agents on structured-output benchmarks: without the deterministic executor in the loop on the final commit (as in EV / EV+CoT), agent-generated answers can fail type-formatting checks even when the underlying reasoning is partially correct.

10.0.0.6 Summary of failure modes.

Across the per-question logs we observe four dominant patterns: (1) at small scale (1.7B), free-form text misinterprets ambiguous question fragments and fails to commit a parseable program; grammar + vote rescues it; (2) on compositional questions at any scale, grammar-constrained sampling becomes less reliable on longer nested expressions (an underlying generation difficulty, not a DSL expressivity limit), while free-form CoT can reason in text and emit only the final scalar; (3) on region-pair aggregations, free-form models produce internally inconsistent arithmetic, while the executor delivers a correct answer deterministically; (4) multi-turn ReAct agents reason correctly through the tool loop but fail to format the final <answer> when the expected output type is structurally ambiguous (e.g., Family G1 ResidueSet answers). The denotation-threshold finding is the aggregate of the first three patterns weighted by family composition; the fourth characterizes a distinct, complementary weakness of agentic methods.

Figure 5: Example questions across the seven question families,drawn from the paper-eval splits.Each row shows one question, the AlphaFold protein that grounds it(Hu=human, Mo=mouse, Dm=fly,Gg=chicken), the gold DSL program, and the gold answer. Atevaluation time, the model receives the question and a compactstructural summary of the protein. Family B is shown twice toillustrate that answers can be compact (single Float) or non-compact(a PairSet of residue pairs); other non-compact answer typesinclude Region and ResidueSet (§4). Rows A–D arefrom the in-distribution split, E–F from the cross-species split,and G from the compositional split(§3.6).

11 Per-Family Accuracy at 8B↩︎

Even at 8B where CoT wins overall, family-level inversion persists on the structured-output facets. Families C (PAE) and E (secondary structure) favor the grammar+execution branch (EV+CoT) by \(22.7\) and \(6.4\) pp respectively over CoT, while Families A (pLDDT aggregates), B (distance comparisons), D (SASA aggregates), and F (contact topology) favor CoT, whose answers reduce to small arithmetic comparisons the free-form chain can simulate directly. The per-family pattern shows that grammar constraints are not globally beneficial or globally harmful: their value depends on whether exact typed structure prevents the dominant error mode for that family.

Table 3: Per-family accuracy (%) on the in-distributionsplit at 8B. Bold = best per family. Interpretation in thesection preamble.
Family Standard EV EV+CoT CoT
A (Confidence) \(63.8\) \(77.5\) \(86.7\) \(\boldsymbol{93.2}\)
B (Distance) \(79.4\) \(82.5\) \(84.4\) \(\boldsymbol{88.1}\)
C (PAE) \(52.2\) \(73.8\) \(\boldsymbol{75.4}\) \(52.7\)
D (SASA) \(76.6\) \(71.9\) \(81.2\) \(\boldsymbol{87.2}\)
E (Secondary structure) \(57.9\) \(70.3\) \(\boldsymbol{83.7}\) \(77.3\)
F (Topology) \(68.0\) \(77.2\) \(82.3\) \(\boldsymbol{86.2}\)

12 Hard-Negative Sub-class Breakdown↩︎

The hard-negative split combines two construction types. HN1 (structural counterfactual, \(n{=}4{,}138\), \(95\%\)) keeps the template and protein fixed and resamples template parameters until the gold answer changes. HN2 (threshold flip, \(n{=}219\), \(5\%\)) keeps the protein, template, and residues fixed and changes only a numeric threshold. Table 4 reports the per-class accuracy for all five baselines at each scale.

HN2 is uniformly harder than HN1: all 20 (model, baseline) cells satisfy HN1\({>}\)HN2, with mean gap \(+10.3\) pp. The widest gaps occur for ReAct at supra-threshold scales (4B: \(+18.9\) pp; 8B: \(+22.9\) pp), indicating that the agent’s tool-call routine over-relies on the specific threshold value seen in the query. EV+CoT at 4B exhibits the narrowest gap (\(+2.9\) pp): grammar enforcement closes the threshold-sensitivity gap once the base model is fluent in the DSL. The HN2 sample size is small (\(n{=}219\) per (model, baseline); some per-template strata contain only \(\approx 44\) examples), so per-cell standard errors are roughly \(\pm 7\) pp at \(95\%\) confidence.

3.5pt

Table 4: Per-class accuracy (%) on the hard-negativesplit. Bold = best per (model, class) row. HN1/HN2 defined in thesection preamble; \(\Delta\) = HN1\({-}\)HN2. Interpretation in thesection preamble.
Model Class Standard CoT EV EV+CoT ReAct
0.6B HN1 \(20.4\) \(20.0\) \(18.6\) \(16.4\) \(\mathbf{29.6}\)
HN2 \(11.0\) \(\phantom{0}3.7\) \(\phantom{0}5.2\) \(\phantom{0}3.2\) \(\mathbf{20.6}\)
\(\Delta\) \(+9.4\) \(+16.3\) \(+13.4\) \(+13.2\) \(+9.1\)
1.7B HN1 \(29.0\) \(25.8\) \(35.5\) \(35.0\) \(\mathbf{52.4}\)
HN2 \(23.7\) \(18.7\) \(27.3\) \(26.8\) \(\mathbf{45.2}\)
\(\Delta\) \(+5.2\) \(+7.1\) \(+8.3\) \(+8.2\) \(+7.2\)
4B HN1 \(70.9\) \(\mathbf{83.5}\) \(70.5\) \(82.2\) \(61.4\)
HN2 \(60.3\) \(77.2\) \(55.0\) \(\mathbf{79.3}\) \(42.5\)
\(\Delta\) \(+10.6\) \(+6.3\) \(+15.6\) \(+2.9\) \(+18.9\)
8B HN1 \(68.6\) \(\mathbf{83.2}\) \(75.8\) \(81.0\) \(64.9\)
HN2 \(58.0\) \(\mathbf{75.3}\) \(67.1\) \(76.9\) \(42.0\)
\(\Delta\) \(+10.6\) \(+7.8\) \(+8.7\) \(+4.1\) \(+22.9\)

13 Gold-Answer Correctness Validation↩︎

We validate gold correctness at two levels, complementing the 6-gate sanity validator (§3.7): (i) paraphrase fidelity between the natural-language question and the gold DSL program, and (ii) cross-tool agreement between our pipeline’s per-primitive values and an independent reference toolchain. Paraphrase fidelity is run on \(n{=}500\) per family (\(n{=}3{,}500\) total); cross-tool agreement uses per-template subsamples detailed below.

13.0.0.1 Paraphrase fidelity.

For every sampled question, we verify (a) that every numeric literal in the gold DSL program (residue indices, range endpoints, thresholds) also appears in the paraphrase, and (b) that the paraphrase mentions at least one family-specific concept term from a hand-curated lexicon (e.g., “pLDDT” for A; “distance” for B; “PAE” for C; “SASA” or “neighbors” for D; “helix” or “DSSP” for E; “contact” or “radius of gyration” for F). On \(3{,}500\) sampled questions (\(500\) per family), \(3{,}500/3{,}500\) (\(100\%\)) pass both checks. The check is designed to catch obvious paraphrase/program mismatches (numeric drift, missing referents, wrong family concept) rather than to prove full semantic equivalence between every paraphrase and its canonical program.

13.0.0.2 Cross-tool agreement.

For each family that maps to a standard biophysical primitive, we re-compute the underlying quantity with an independent reference and compare to the value our pipeline stores. Implementations differ in code path; in some cases (e.g., SASA) the algorithm itself differs.

  • Family A (pLDDT). Reference: BioPython PDBParser reading the B-factor column from the AlphaFold PDB. Our pipeline uses a hand-written fixed-column parser. Agreement: \(500/500\) questions match the BioPython recomputation; max abs.difference \(1.5 \times 10^{-5}\) pLDDT, mean \(3.5 \times 10^{-6}\) (float-precision round-trip).

  • Family B (distance). Reference: BioPython CA-atom coordinates piped through numpy.linalg.norm. Our DSL operates on the cached ca_xyz array. Agreement: \(249/249\) (template B1, distance float); max abs.difference \(6.0 \times 10^{-6}\) Å.

  • Family C (PAE). Reference: AlphaFold per-pair PAE JSON loaded with stdlib json. AFDB delivers PAE as integer values, which our pipeline stores as a uint8 matrix (lossless re-encoding); agreement is measured after dequantization to float. Agreement: \(133/133\) (template C1, mean PAE over inter-region block); max abs.difference \(9.4 \times 10^{-7}\) (float-precision noise).

  • Family D (SASA / neighbor counts). SASA is validated against BioPython Bio.PDB.SASA.ShrakeRupley (pure-Python Shrake–Rupley) versus our pipeline’s FreeSASA C library [47] (different algorithm): per-residue Spearman \(\rho = 0.995\) (mean over \(104\) proteins, \(\rho_{\min} = 0.987\)); buried/exposed classification at threshold-far residues: \(96/96\) match. Neighbor counts are deterministic \(C_\alpha\)-distance computations and are independently recomputed from coordinates in the validation script.

  • Family E (DSSP H/E/C). Our extractor uses pydssp (pure-Python DSSP [28], H-bond based). Reference: biotite’s native P-SEA secondary-structure annotation [31], which classifies SS from \(C_\alpha\)-trace geometric criteria (inter-residue distances and dihedral angles) rather than backbone H-bonds (algorithmically independent). Across \(273\) proteins, \(94.2\%\) per-residue agreement on helix-vs-non-helix and \(79.6\%\) 3-state agreement (DSSP and P-SEA disagree at \(\alpha\)-helix capping boundaries by construction). Gold-answer match: \(273/273\) on templates E1, E2, E3.

  • Family F (contacts and topology). Contact-density templates reduce to \(C_\alpha\)-coordinate distance computations and inherit Family B agreement; the remaining geometric aggregates (e.g., radius of gyration, contact count) are deterministic coordinate functions independently recomputed in the validation script and matched within float precision.

  • Family G (compositional) inherits the primitive-level checks of A–F (each compositional gold answer is produced by composing already-validated A–F primitives).

14 Stratified Evaluation Subsampling Protocol↩︎

All four paper-eval splits are released. The three subsamples (cross-species, compositional, hard-negative) are stratified by template\(\times\)species (cross-species and compositional) and by template (hard-negative). They are rigorously train-disjoint, and the distribution shift is bounded by KL\(\,\leq 0.0037\) on every (family, species, template, answer-type) marginal (see manifest in the release), so subsample trends transfer to the full pool within statistical noise. Split sizes and pool sizes are listed in §[sec:benchmark:subsample].

6pt

Table 5: Full split inventory. The released benchmarkcontains \(382{,}200\) questions across six splits. The paperevaluates models on a \(32{,}357\)-question stratified subsampledrawn from the four evaluation splits: \(12\)K in-distribution,\(6\)K compositional, \(10\)K cross-species, and \(4{,}357\) HN.
Split Released Role
Train (A–F) 96,000 Prompt-example pool
Dev (A–F) 12,000 Prompt dev / sanity checks
In-distribution test 12,000 Eval (parameter generalization)
Compositional (Family G) 30,000 Eval (held-out compositions)
Cross-species (A–F) 180,000 Eval (cross-proteome shift)
Hard-negative robustness 52,200 Robustness probe
Total released 382,200
Paper evaluation subsample 32,357 Stratified eval subset

15 Family and Template Question Distribution↩︎

Table 6 summarises the full \(382{,}200\)-question release at the family level: each family contributes between \(3\) and \(6\) templates and roughly \(30\)K–\(60\)K questions across the active benchmark, with the \(52.2\)K hard-negative robustness pool counted on its own row.

2.5pt

Table 6: Template families and per-family question counts.Family G (held out) and the HN robustness pool are on their ownrows.
Family Domain #Templates #Questions
A pLDDT (confidence) 5 59,617
B Distance 4 60,145
C PAE 4 43,437
D SASA / packing 5 58,814
E Secondary structure 6 35,112
F Topology / contacts 4 42,875
G Compositional 3 30,000
HN robustness pool 52,200
Total 31 382,200

Table 7 breaks this down at the template level, restricted to the four evaluation pools (in-distribution test, full compositional pool, full cross-species pool, full hard-negative pool; \(274{,}200\) questions in total). Templates B1–B4 (Distance) and G1–G3 (Compositional) carry the largest mass (10K–13K each), while the secondary-structure templates E3–E6 are smaller (3.2K–3.4K) because they target rare topology patterns. Counts are determined by the per-protein sampling budget at question-generation time (§3).

4pt

Table 7: Per-template question counts across the four full releasedevaluation pools. In-distribution test (12K), full compositional pool(30K), full cross-species pool (180K), and full hard-negativerobustness pool (52.2K). Each column corresponds to one family A–G;empty cells in shorter families are blank. The 96K train and 12K devexemplar pools are not shown; together with these four pools theybring the full released benchmark to \(382{,}200\) questions(Table 5). Templates with smaller counts(E3–E6) target rare secondary-structure topologies and are sampledat lower frequency to reflect their natural distribution. Subtotal ofthe four evaluation pools shown above: \(274{,}200\) questions (of the\(382{,}200\)-question release; \(96{,}000\) train and \(12{,}000\) dev arenot shown in this table). Because the hard-negative pool is generatedfrom the same templates, per-family totals in this table includeHN-derived questions and therefore differ from the active-benchmarkper-family counts in Table 6 (e.g., Family G is\(30{,}000\) in Table 6 versus \(33{,}419\) here).
Family A Family B Family C Family D Family E Family F Family G
Template Count Template Count Template Count Template Count Template Count Template Count Template Count
A1 10,291 B1 12,724 C1 8,974 D1 9,661 E1 6,050 F1 8,941 G1 11,443
A2 9,986 B2 10,890 C2 8,793 D2 9,174 E2 5,992 F2 9,066 G2 12,025
A3 9,745 B3 12,376 C3 9,173 D3 9,352 E3 3,297 F3 9,116 G3 9,951
A4 9,640 B4 12,281 C4 8,891 D4 10,245 E4 3,353 F4 8,422
A5 8,083 D5 9,759 E5 3,220
E6 3,286

16 DSL Vocabulary and Complete Template Catalogue↩︎

This appendix is intended to make the abstract description in §3 concrete. We list (i) every operator in the DSL in plain English, and (ii) the exact program pattern of every one of the 31 templates the benchmark uses.

16.0.0.1 What is the DSL?

The DSL is a small formal language that lets us write a short program describing a question. A program takes a single protein as input and returns a single answer. The grammar is fixed, and the executor runs each program deterministically against the protein’s extracted features (pLDDT, distances, PAE, SASA, secondary structure).

16.0.0.2 What is a template?

A template is a parameterised question pattern. It bundles four things: a canonical DSL program with named placeholder slots, the expected answer type, the rules that decide which parameters are legal for a given protein, and a list of natural-language paraphrases that re-word the same question (\(26\)\(30\) for A–F, \(5\)\(6\) for G). The \(31\) templates are author-designed. The paraphrase pool was generated by an LLM (Claude Opus 4.7) and then author-verified to remove paraphrases that revealed the answer and to make sure every paraphrase kept the same slot names as its template. Every other step of the pipeline (protein selection, parameter sampling, gold-program slot-filling, DSL execution, paraphrase choice, and split assignment) is deterministic given the released random seeds.

16.0.0.3 How a question is built.

For every protein we pick a template, sample legal parameters, fill the template’s canonical DSL program with those parameters to obtain the gold program, execute it to obtain the gold answer, and fill one randomly chosen paraphrase to obtain the natural-language question text. At evaluation time, the model sees the question text together with a compact protein summary. For the non-agent baselines, the model must produce a valid DSL program. For ReAct, the model can call DSL tools and then return a final typed answer. Figure 6 walks through this end-to-end for one concrete question.

Figure 6: End-to-end pipeline for producing one ProtStructQAquestion, traced for a concrete example. Steps 1–5 produce thegold program and gold answer (no natural language involved).Steps 6–7 pick one of the template’s paraphrases (26–30 forA–F templates, 5–6 for G templates) and fill the same slotsto obtain the natural-language question text. Step 8 shows the actual JSON record stored in the releasedbenchmark file. All steps are deterministic given fixed randomseeds; the entire 382{,}200-question benchmark is reproduciblefrom the released paraphrase pool and seed configuration.

Plain-English DSL vocabulary↩︎

16.0.0.4 Per-residue values (one number per residue).

  • plddt(r): AlphaFold’s confidence for residue \(r\) (range \(0\)\(100\); higher is more confident).

  • ss(r): secondary structure of residue \(r\) as a DSSP letter ("H" helix, "E" strand, "C" coil).

  • rel_sasa(r): relative solvent-accessible surface area; values near \(0\) mean buried, near \(1\) mean exposed.

  • n_neighbors(r): how many other residues sit within \(8\) Å of residue \(r\) (a packing measure).

16.0.0.5 Per-pair values (one number per pair of residues).

  • distance(r1, r2): \(C_\alpha\)\(C_\alpha\) distance in Å.

  • pae(r1, r2): predicted aligned error in Å for the relative position of two residues (lower is more reliable).

16.0.0.6 Region-level aggregates (one number per contiguous span).

  • mean_plddt(reg), min_plddt(reg), max_plddt(reg): summary pLDDT over a span.

  • mean_rel_sasa(reg): average accessibility in a span.

  • contact_density(reg): fraction of in-span residue pairs that are in contact (\(<\) \(8\) Å).

  • radius_of_gyration(reg): how compact the span is.

  • mean_pae(reg1, reg2), max_pae(reg1, reg2), count_high_pae(reg1, reg2,\(\tau\)): inter-region PAE summaries.

16.0.0.7 Whole-protein scalars.

n_helices(), n_strands(), length(longest_run("H")).

16.0.0.8 Constructors (how to refer to residues or spans).

residue(i): a single residue. range(s, e): the contiguous span from \(s\) to \(e\). first(k) / last(k) – the first / last \(k\) residues. sliding_window(k): the set of all length-\(k\) contiguous spans. all_residues: the set of every residue. all_pairs(min_sep=k): the set of ordered residue pairs \((i, j)\) with sequence separation \(|i - j| > k\).

16.0.0.9 Comprehensions and operators (how to combine the above).

count / filter / exists / forall \(x\) in \(S\) where \(P\): iterate \(x\) over \(S\) and either count, collect, or test the predicate \(P\). argmin / argmax \(x\) in \(S\) by \(E\) – return the element of \(S\) that minimizes / maximizes the expression \(E\). Comparison operators (\(<\), \(\le\), \(==\), \(\ne\), \(>\), \(\ge\)) and Boolean operators (and, or, not) compose predicates.

Complete catalogue of the 31 templates↩︎

Table 8 lists every template, the canonical DSL program it produces (with named slots), the answer type, and one example paraphrase. Slot names match the variables the parameter sampler fills in. In template A2, the program slot w is a local alias for the parameter window, and term1 is the terminus ("N" or "C") sampled per question; the program shown in the table is the term1="N" branch. Family A–F templates are seen during training as few-shot exemplars; Family G is held out, so the compositional split tests genuinely unseen template types. The hard-negative split is generated by perturbing parameters within the existing \(31\) templates.

4pt

Table 8: Complete catalogue of the 31 ProtStructQAtemplates. Each row shows the canonical DSL program (namedslots), required answer type, and one of \(26\)\(30\) paraphrases(A–F templates; \(5\)\(6\) for G).Notation (w, term1) and the held-out / HNconventions are described in App. 16preamble.
ID Fam. Answer type Canonical DSL program Example paraphrase
A1 A Float mean_plddt(range({start}, {end})) What is the mean pLDDT of residues {start} to {end}?
A2 A Bool mean_plddt(first({window})) < mean_plddt(last({window})) Across the first and last {window} residues, is the {term1}-terminal pLDDT lower?
A3 A Region argmin reg in sliding_window({window}) by mean_plddt(reg) Which {window}-residue window has the lowest mean pLDDT?
A4 A Int count r in all_residues where plddt(r) > {threshold} How many residues have pLDDT > {threshold}?
A5 A Bool exists reg in sliding_window({window}) where mean_plddt(reg) > {threshold} Does this protein have a {window}-residue region with mean pLDDT above {threshold}?
B1 B Float distance(residue({i}), residue({j})) Distance between residues {i} and {j}?
B2 B Bool distance(residue({i}), residue({j})) < {threshold} Residues {i}, {j} within {threshold} Angstroms?
B3 B PairSet filter (i,j) in all_pairs(min_sep={sep}) where distance(i,j) < {threshold} Pairs with sep > {sep} and CA-CA < {threshold} Angstroms?
B4 B Int size(filter (i,j) in all_pairs(min_sep={sep}) where distance(i,j) < {threshold}) How many sep>{sep}, d<{threshold} Angstroms pairs?
C1 C Float mean_pae(range({a_start}, {a_end}), range({b_start}, {b_end})) Mean PAE, ({a_start}-{a_end}) vs ({b_start}-{b_end})?
C2 C Bool mean_pae(range({a_start},{a_end}), range({b_start},{b_end})) < {threshold} Boolean: mean inter-region PAE for ({a_start}-{a_end}, {b_start}-{b_end}) < {threshold}?
C3 C Float max_pae(range({a_start},{a_end}), range({b_start},{b_end})) Max PAE, ({a_start}-{a_end}) vs ({b_start}-{b_end})?
C4 C Int count_high_pae(range({a_start},{a_end}), range({b_start},{b_end}), {threshold}) Count of high-PAE pairs (> {threshold}), block ({a_start}-{a_end}) by ({b_start}-{b_end})?
D1 D Bool rel_sasa(residue({i})) < {threshold} Is residue {i}’s relative SASA below {threshold}?
D2 D Region argmax reg in sliding_window({window}) by mean_rel_sasa(reg) Which {window}-residue window has the highest average solvent accessibility?
D3 D Int count r in all_residues where rel_sasa(r) < {threshold} How many residues have relative SASA < {threshold}?
D4 D Int n_neighbors(residue({i})) Count the residues within 8 A of residue {i}.
D5 D Bool n_neighbors(residue({i})) > {threshold} Is residue {i}’s 8-A neighbor count above {threshold}?
E1 E SecStruct ss(residue({i})) What is the secondary structure at residue {i}?
E2 E Bool ss(residue({i})) == "H" Is residue {i} part of an alpha-helix?
E3 E Int count r in all_residues where ss(r) == "H" How many residues are in alpha-helices?
E4 E Int count r in all_residues where ss(r) == "E" How many residues are in beta-strands?
E5 E Int length(longest_run("H")) How long is the longest helical segment?
E6 E Int n_helices() Number of helix segments?
F1 F Float contact_density(range({start}, {end})) What is the contact density of residues {start}-{end}?
F2 F Bool exists reg in sliding_window({window}) where mean_plddt(reg) > 80 and contact_density(reg) > {cd_thr} Is there any {window}-window that is both mean pLDDT > 80 and contact density > {cd_thr}?
F3 F Float radius_of_gyration(range({start}, {end})) Rg for residues {start}-{end}?
F4 F Region argmin reg in sliding_window({window}) by radius_of_gyration(reg) Which {window}-residue window has the smallest radius of gyration (most compact)?
G1 G ResidueSet filter r in all_residues where rel_sasa(r) < {sasa_thr} and plddt(r) < {plddt_thr} List residues that satisfy both rel_sasa(r) < {sasa_thr} and plddt(r) < {plddt_thr}.
G2 G Bool exists reg in sliding_window({window}) where mean_plddt(reg) > {plddt_thr} and contact_density(reg) > {cd_thr} Is there a {window}-residue region with mean pLDDT > {plddt_thr} AND contact density > {cd_thr}?
G3 G Bool exists r in all_residues where ss(r)=="H" and exists s in all_residues where ss(s)=="E" and distance(r,s) < {threshold} Does any helix residue come within {threshold} A of a strand residue?

17 Prompt-Form Sensitivity at Sub-Threshold↩︎

To check whether the sub-threshold CoT result depends on our specific prompt design, we evaluate two alternative CoT formulations at Qwen3-1.7B alongside our task-decomposition variant: vanilla zero-shot CoT [38] (“Think step by step before answering”), and PAL-style CoT [23], [24], where reasoning is carried by inline “#”-comment annotations within the few-shot exemplars rather than by a prompt prefix. Pooled accuracy across all \(32{,}357\) paper-eval questions at \(1.7\)B:

  • No CoT (Standard): \(23.79\%\)

  • Vanilla zero-shot CoT (Kojima): \(18.62\%\) (worst)

  • Task-decomposition CoT (our published variant): \(22.54\%\)

  • PAL-style CoT (exemplar comments): \(24.47\%\) (best)

The three CoT variants span only \(5.9\)pp from worst to best; even the best CoT prompt (PAL, \(24.5\%\)) sits \(6.5\)pp below EV (\(31.0\%\)) and \(25.8\)pp below ReAct (\(50.3\%\)). Instruction-driven CoT (task-decomposition and Kojima) does not improve over no-CoT direct prompting at \(1.7\)B; PAL-style CoT delivers only a marginal lift over no-CoT (\(\Delta{=}+0.68\)pp pooled; \(p\!<\!10^{-5}\) on test_iid by McNemar). Prompt-engineering perturbations cannot close the gap to the structural methods that EV and ReAct realize; the sub-threshold capability ceiling is robust to prompt-form choice.

18 Statistical Significance Detail↩︎

EV and EV+CoT use three seeds; per-cell seed noise is much smaller than the threshold-defining accuracy gaps. We report per-cell McNemar’s paired-test results for all \(80\) planned pairwise comparisons (5 method-pairs \(\times\) 4 splits \(\times\) 4 model scales) with Bonferroni correction at \(\alpha = 0.05/80 = 6.25 \times 10^{-4}\). Because McNemar’s test requires matched per-question predictions while Table 1 reports EV and EV+CoT as three-seed means, the paired statistics in Tables 9 and 10 use the seed-0 EV and EV+CoT runs. Some \(\Delta\) values therefore differ from the three-seed means in Table 1 by less than one accuracy point. Table 9 covers the sub-threshold scales (Qwen3-0.6B and 1.7B) and Table 10 covers the supra-threshold scales (Qwen3-4B and 8B).

34 of 40 sub-threshold comparisons are significant; the 6 ties cluster where small models fail similarly or where EV and EV+CoT are close at 1.7B. 31 of 40 supra-threshold comparisons are significant; the 9 ties cluster at CoT vs EV+CoT and Standard vs EV at \(\ge 4\)B, where grammar adds little once the base model is capable enough. Columns in both tables follow the same convention: “A-only”/“B-only” = questions correct in exactly one method of the pair; \(\Delta\) accuracy \(=\) (B\(-\)A), so a positive \(\Delta\) favors method B and a negative \(\Delta\) favors method A; the final row per (model, split) cell compares ReAct to the strongest non-agentic baseline.

4pt

Table 9: McNemar paired-test results at sub-thresholdscales (0.6B and 1.7B), 40 comparisons. Bonferroni\(\alpha = 6.25{\times}10^{-4}\); \(^\star\) = significant.Column conventions and significance summary in the section preamble.
Model Split Pair (A vs B) \(\Delta\) (pp) A-only B-only McNemar \(p\)
Qwen3-0.6B in-distribution Standard vs CoT \(-0.94\) \(833\) \(720\) \(2.6{\times}10^{-3}\)  n.s.
EV vs EV+CoT \(-1.32\) \(574\) \(415\) \(4.8{\times}10^{-7}\) \(^\star\)
CoT vs EV+CoT \(-6.16\) \(1{,}277\) \(538\) \(3.8{\times}10^{-69}\) \(^\star\)
Standard vs EV \(-5.78\) \(1{,}283\) \(590\) \(6.9{\times}10^{-59}\) \(^\star\)
ReAct vs Standard \(-6.47\) \(2{,}445\) \(1{,}669\) \(8.4{\times}10^{-34}\) \(^\star\)
compositional Standard vs CoT \(-1.53\) \(265\) \(173\) \(1.3{\times}10^{-5}\) \(^\star\)
EV vs EV+CoT \(-6.67\) \(615\) \(215\) \(2.2{\times}10^{-45}\) \(^\star\)
CoT vs EV+CoT \(+2.78\) \(175\) \(342\) \(1.8{\times}10^{-13}\) \(^\star\)
Standard vs EV \(+7.92\) \(207\) \(682\) \(7.4{\times}10^{-60}\) \(^\star\)
ReAct vs EV \(-30.72\) \(1{,}980\) \(137\) \(<10^{-300}\) \(^\star\)
cross-species Standard vs CoT \(-0.96\) \(656\) \(560\) \(9.3{\times}10^{-3}\)  n.s.
EV vs EV+CoT \(-1.47\) \(485\) \(338\) \(3.4{\times}10^{-7}\) \(^\star\)
CoT vs EV+CoT \(-5.70\) \(1{,}024\) \(454\) \(8.2{\times}10^{-51}\) \(^\star\)
Standard vs EV \(-5.19\) \(1{,}043\) \(524\) \(7.8{\times}10^{-40}\) \(^\star\)
ReAct vs Standard \(-7.63\) \(2{,}144\) \(1{,}381\) \(5.5{\times}10^{-38}\) \(^\star\)
hard-negative Standard vs CoT \(-0.76\) \(261\) \(228\) \(0.15\)  n.s.
EV vs EV+CoT \(-2.16\) \(261\) \(167\) \(6.4{\times}10^{-6}\) \(^\star\)
CoT vs EV+CoT \(-3.10\) \(368\) \(233\) \(4.1{\times}10^{-8}\) \(^\star\)
Standard vs EV \(-1.70\) \(386\) \(312\) \(5.0{\times}10^{-3}\)  n.s.
ReAct vs Standard \(-9.25\) \(924\) \(521\) \(1.8{\times}10^{-26}\) \(^\star\)
Qwen3-1.7B in-distribution Standard vs CoT \(-1.95\) \(1,174\) \(940\) \(3.9{\times}10^{-7}\) \(^\star\)
EV vs EV+CoT \(+0.55\) \(991\) \(1,057\) \(0.15\)  n.s.
CoT vs EV+CoT \(+10.17\) \(840\) \(2,060\) \(5.6{\times}10^{-117}\) \(^\star\)
Standard vs EV \(+7.67\) \(754\) \(1,674\) \(1.5{\times}10^{-79}\) \(^\star\)
ReAct vs EV+CoT \(-15.18\) \(3{,}885\) \(2{,}063\) \(3.2{\times}10^{-125}\) \(^\star\)
compositional Standard vs CoT \(+1.90\) \(190\) \(304\) \(3.3{\times}10^{-7}\) \(^\star\)
EV vs EV+CoT \(-4.92\) \(517\) \(222\) \(5.6{\times}10^{-28}\) \(^\star\)
CoT vs EV+CoT \(+3.02\) \(268\) \(449\) \(1.4{\times}10^{-11}\) \(^\star\)
Standard vs EV \(+9.83\) \(204\) \(794\) \(1.0{\times}10^{-82}\) \(^\star\)
ReAct vs EV \(-28.48\) \(1{,}945\) \(236\) \(<10^{-300}\) \(^\star\)
cross-species Standard vs CoT \(-1.45\) \(920\) \(775\) \(4.7{\times}10^{-4}\) \(^\star\)
EV vs EV+CoT \(+1.53\) \(738\) \(891\) \(1.6{\times}10^{-4}\) \(^\star\)
CoT vs EV+CoT \(+9.11\) \(677\) \(1,588\) \(8.7{\times}10^{-84}\) \(^\star\)
Standard vs EV \(+6.13\) \(655\) \(1,268\) \(5.2{\times}10^{-45}\) \(^\star\)
ReAct vs EV+CoT \(-17.01\) \(3{,}348\) \(1{,}647\) \(2.2{\times}10^{-130}\) \(^\star\)
hard-negative Standard vs CoT \(-3.24\) \(446\) \(305\) \(3.0{\times}10^{-7}\) \(^\star\)
EV vs EV+CoT \(-0.78\) \(386\) \(352\) \(0.22\)  n.s.
CoT vs EV+CoT \(+9.43\) \(290\) \(701\) \(6.6{\times}10^{-40}\) \(^\star\)
Standard vs EV \(+6.98\) \(272\) \(576\) \(7.0{\times}10^{-26}\) \(^\star\)
ReAct vs EV \(-16.39\) \(1{,}374\) \(660\) \(1.8{\times}10^{-57}\) \(^\star\)

4pt

Table 10: McNemar paired-test results at supra-thresholdscales (4B and 8B), 40 comparisons. Bonferroni\(\alpha = 6.25{\times}10^{-4}\); \(^\star\) = significant. Columnconventions and significance summary in the section preamble(shared with Table 9).
Model Split Pair (A vs B) \(\Delta\) (pp) A-only B-only McNemar \(p\)
Qwen3-4B in-distribution Standard vs CoT \(+11.97\) \(487\) \(1,924\) \(6.2{\times}10^{-201}\) \(^\star\)
EV vs EV+CoT \(+11.80\) \(419\) \(1,835\) \(2.0{\times}10^{-210}\) \(^\star\)
CoT vs EV+CoT \(+0.48\) \(727\) \(785\) \(0.14\)  n.s.
Standard vs EV \(+0.66\) \(1,044\) \(1,123\) \(0.09\)  n.s.
ReAct vs EV+CoT \(+22.07\) \(513\) \(3{,}162\) \(<10^{-300}\) \(^\star\)
compositional Standard vs CoT \(+41.50\) \(142\) \(2,632\) \(<10^{-300}\) \(^\star\)
EV vs EV+CoT \(+45.08\) \(125\) \(2,830\) \(<10^{-300}\) \(^\star\)
CoT vs EV+CoT \(-15.22\) \(1,159\) \(246\) \(8.8{\times}10^{-142}\) \(^\star\)
Standard vs EV \(-18.80\) \(1,646\) \(518\) \(3.7{\times}10^{-136}\) \(^\star\)
ReAct vs CoT \(+53.72\) \(0\) \(3,223\) \(<10^{-300}\) \(^\star\)
cross-species Standard vs CoT \(+11.55\) \(371\) \(1,526\) \(7.6{\times}10^{-166}\) \(^\star\)
EV vs EV+CoT \(+10.99\) \(372\) \(1,471\) \(3.6{\times}10^{-154}\) \(^\star\)
CoT vs EV+CoT \(-0.38\) \(658\) \(620\) \(0.30\)  n.s.
Standard vs EV \(+0.18\) \(903\) \(921\) \(0.69\)  n.s.
ReAct vs CoT \(+22.07\) \(348\) \(2{,}555\) \(<10^{-300}\) \(^\star\)
hard-negative Standard vs CoT \(+12.81\) \(162\) \(720\) \(1.3{\times}10^{-84}\) \(^\star\)
EV vs EV+CoT \(+12.67\) \(141\) \(693\) \(3.1{\times}10^{-88}\) \(^\star\)
CoT vs EV+CoT \(-0.60\) \(270\) \(244\) \(0.27\)  n.s.
Standard vs EV \(-0.46\) \(426\) \(406\) \(0.51\)  n.s.
ReAct vs CoT \(+22.77\) \(130\) \(1{,}122\) \(2.1{\times}10^{-197}\) \(^\star\)
Qwen3-8B in-distribution Standard vs CoT \(+14.47\) \(681\) \(2,417\) \(5.1{\times}10^{-226}\) \(^\star\)
EV vs EV+CoT \(+5.25\) \(514\) \(1,144\) \(3.7{\times}10^{-55}\) \(^\star\)
CoT vs EV+CoT \(-0.19\) \(1,155\) \(1,132\) \(0.65\)  n.s.
Standard vs EV \(+9.02\) \(887\) \(1,970\) \(2.3{\times}10^{-93}\) \(^\star\)
ReAct vs CoT \(+14.88\) \(728\) \(2{,}513\) \(6.8{\times}10^{-228}\) \(^\star\)
compositional Standard vs CoT \(+29.57\) \(398\) \(2,172\) \(1.6{\times}10^{-294}\) \(^\star\)
EV vs EV+CoT \(+20.58\) \(307\) \(1,542\) \(1.5{\times}10^{-197}\) \(^\star\)
CoT vs EV+CoT \(-11.75\) \(1,151\) \(446\) \(7.8{\times}10^{-72}\) \(^\star\)
Standard vs EV \(-2.77\) \(1,237\) \(1,071\) \(5.9{\times}10^{-4}\) \(^\star\)
ReAct vs CoT \(+47.98\) \(504\) \(3{,}383\) \(<10^{-300}\) \(^\star\)
cross-species Standard vs CoT \(+14.00\) \(598\) \(1,998\) \(5.4{\times}10^{-175}\) \(^\star\)
EV vs EV+CoT \(+5.72\) \(376\) \(948\) \(2.7{\times}10^{-57}\) \(^\star\)
CoT vs EV+CoT \(+0.79\) \(901\) \(980\) \(0.07\)  n.s.
Standard vs EV \(+9.07\) \(715\) \(1,622\) \(2.1{\times}10^{-80}\) \(^\star\)
ReAct vs EV+CoT \(+13.93\) \(764\) \(2{,}157\) \(2.7{\times}10^{-152}\) \(^\star\)
hard-negative Standard vs CoT \(+14.71\) \(246\) \(887\) \(2.0{\times}10^{-85}\) \(^\star\)
EV vs EV+CoT \(+5.10\) \(183\) \(405\) \(2.8{\times}10^{-20}\) \(^\star\)
CoT vs EV+CoT \(-2.23\) \(504\) \(407\) \(1.5{\times}10^{-3}\)  n.s.
Standard vs EV \(+7.39\) \(377\) \(699\) \(6.2{\times}10^{-23}\) \(^\star\)
ReAct vs CoT \(+19.05\) \(217\) \(1{,}047\) \(1.2{\times}10^{-130}\) \(^\star\)

19 Bootstrap Confidence Intervals↩︎

Table 11 reports the bootstrap \(95\%\) CI half-width for each (model, method, split) cell in Table 1, computed by resampling question indices \(1{,}000\) times (EV/EV+CoT pool across the three seeds). Half-widths are typically below \(1\) pp on in-distribution and cross-species cells, and reach \(1.0\)\(1.5\) pp on the smaller hard-negative split (\(n{=}4{,}357\)) and on ReAct compositional cells where the agentic decoding has higher intrinsic variance.

4pt

Table 11: Per-cell bootstrap \(95\%\) CI half-widths (pp).Full \(95\%\) CI for any Table 1 cell is pointestimate \(\pm\) half-width. Split abbreviations: iid =in-distribution (\(n{=}12{,}000\)), comp = compositional(\(n{=}6{,}000\)), x-sp = cross-species (\(n{=}10{,}000\)), HN =hard-negative (\(n{=}4{,}357\)). Half-widths grow with smaller \(n\)and with intrinsic decoding variance.
Model Split Std CoT EV EV+CoT ReAct
0.6B iid 0.72 0.72 0.60 0.56 0.79
comp 0.57 0.46 0.62 0.41 1.24
x-sp 0.85 0.80 0.64 0.62 0.89
HN 1.21 1.22 1.02 0.92 1.30
1.7B iid 0.82 0.75 0.76 0.79 0.87
comp 0.45 0.58 0.75 0.56 1.28
x-sp 0.93 0.87 0.88 0.84 0.95
HN 1.39 1.25 1.38 1.23 1.43
4B iid 0.81 0.70 0.76 0.62 0.89
comp 1.28 0.85 0.88 1.04 1.15
x-sp 0.88 0.75 0.80 0.66 1.02
HN 1.31 1.04 1.19 0.98 1.48
8B iid 0.81 0.72 0.67 0.61 0.81
comp 1.20 0.83 1.13 0.93 1.20
x-sp 0.94 0.80 0.73 0.68 0.93
HN 1.32 1.11 1.12 1.08 1.42

20 Parse-Failure Rate Decomposition↩︎

To support the mechanism claims in §6.2, we measure the per-question parse-failure rate per (model, baseline) cell on the in-distribution and compositional splits. A parse failure is a question where the inference pipeline could not produce a usable answer (\(\texttt{pred\_answer} =\) None): for Standard and CoT this means the free-form output yielded no extractable DSL program; for EV and EV+CoT it means all \(k{=}3\) grammar-constrained samples failed to execute; for ReAct it means the agent never committed a parseable typed <answer> literal. Table 12 reports the overall rate by (model, baseline, split).

Two patterns support the §6.2 mechanism claim. (1) Between \(1.7\)B and \(4\)B on the in-distribution split, free-form parse-failure drops by \(40.9\) pp for Standard (\(64.8\% {\to} 23.9\%\)) and \(54.9\) pp for CoT (\(68.4\% {\to} 13.4\%\)); the capability threshold is in part a parseability threshold. (2) At \(8\)B on the compositional split, free-form CoT reaches a \(7.4\%\) parse-failure floor while grammar-constrained EV remains at \(29.9\%\) and EV+CoT at \(23.3\%\), consistent with grammar-constrained sampling becoming less reliable on longer nested expressions.

3pt

Table 12: Parse-failure rate (%) by (model, baseline,split). \(n{=}12{,}000\) for in-distribution; \(n{=}6{,}000\) forcompositional. Interpretation in the section preamble.
Model Split Standard CoT EV EV+CoT ReAct
Qwen3-0.6B in-distribution 56.4 62.4 71.7 73.3 38.0
compositional 69.6 89.0 74.5 85.2 33.3
Qwen3-1.7B in-distribution 64.8 68.4 48.9 55.7 21.5
compositional 95.7 92.3 68.5 80.7 12.1
Qwen3-4B in-distribution 23.9 13.4 23.9 11.5 30.2
compositional 44.9 11.8 68.6 25.4 39.9
Qwen3-8B in-distribution 22.1 14.6 14.7 12.1 22.1
compositional 34.8 7.4 29.9 23.3 40.2

21 Cross-Family Replication: Gemma-3 Detail↩︎

This appendix accompanies §6.5 with the full Gemma-3 per-cell accuracy.

6pt

Table 13: Replication on Gemma-3. Accuracy (%)pooled across all four splits (Overall) and on compositional only.Bold = winner per column. The 1B-ReAct \(\to\) 12B-CoT flipmatches Qwen3 (Table 1).
Model Baseline Overall Compositional
Gemma-3-1B Standard 12.73 2.37
CoT 12.61 1.68
ReAct 13.10 8.65
Gemma-3-12B Standard 67.37 51.55
CoT 83.15 75.67
ReAct 65.56 41.97

References↩︎

[1]
J. Jumper et al., “Highly accurate protein structure prediction with AlphaFold,” Nature, vol. 596, pp. 583–589, 2021, doi: 10.1038/s41586-021-03819-2.
[2]
M. Varadi et al., AlphaFold Protein Structure Database: Massively expanding the structural coverage of protein-sequence space with high-accuracy models,” Nucleic Acids Research, vol. 50, no. D1, pp. D439–D444, 2022, doi: 10.1093/nar/gkab1061.
[3]
D. Bertoni et al., AlphaFold protein structure database 2025: A redesigned interface and updated structural coverage,” Nucleic Acids Research, vol. 54, no. D1, pp. D358–D362, 2026, doi: 10.1093/nar/gkaf1226.
[4]
R. Rao et al., “Evaluating protein transfer learning with TAPE,” in Advances in neural information processing systems (NeurIPS), 2019, vol. 32, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2019/hash/37f65c068b7723cd7809ee2d31d7861c-Abstract.html.
[5]
M. Xu et al., PEER: A comprehensive and multi-task benchmark for protein sequence understanding,” in Advances in neural information processing systems (NeurIPS) datasets and benchmarks track, 2022, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2022/hash/e467582d42d9c13fa9603df16f31de6d-Abstract-Datasets_and_Benchmarks.html.
[6]
P. Notin et al., ProteinGym: Large-scale benchmarks for protein fitness prediction and design,” in Advances in neural information processing systems (NeurIPS) datasets and benchmarks track, 2023, vol. 36, pp. 64331–64379, [Online]. Available: https://papers.nips.cc/paper_files/paper/2023/hash/cac723e5ff29f65e3fcbb0739ae91bee-Abstract-Datasets_and_Benchmarks.html.
[7]
E. M. Carrami and S. Sharifzadeh, PQA: Zero-shot protein question answering for free-form scientific enquiry with large language models.” 2024, [Online]. Available: https://arxiv.org/abs/2402.13653.
[8]
Z. Liu et al., ProtT3: Protein-to-text generation for text-based protein understanding,” in Proceedings of the 62nd annual meeting of the association for computational linguistics (volume 1: Long papers), 2024, pp. 5949–5966, [Online]. Available: https://aclanthology.org/2024.acl-long.324.
[9]
Y. Fang et al., Mol-Instructions: A large-scale biomolecular instruction dataset for large language models,” in International conference on learning representations (ICLR), 2024, [Online]. Available: https://openreview.net/forum?id=Tlsdsb6l9n.
[10]
Z. Wang et al., InstructProtein: Aligning human and protein language via knowledge instruction,” in Proceedings of the 62nd annual meeting of the association for computational linguistics (ACL), 2024, pp. 1114–1136, [Online]. Available: https://aclanthology.org/2024.acl-long.62.
[11]
C. Wang, H. Fan, R. Quan, and Y. Yang, ProtChatGPT: Towards understanding proteins with large language models.” 2024, [Online]. Available: https://arxiv.org/abs/2402.09649.
[12]
Y. Xiao, E. Sun, Y. Jin, Q. Wang, and W. Wang, ProteinGPT: Multimodal LLM for protein property prediction and structure understanding.” 2024, [Online]. Available: https://arxiv.org/abs/2408.11363.
[13]
Z. Wang, Z. Ma, Z. Cao, C. Zhou, J. Zhang, and Y. Q. Gao, Prot2Chat: Protein large language model with early fusion of text, sequence, and structure,” Bioinformatics, vol. 41, no. 8, p. btaf396, 2025, doi: 10.1093/bioinformatics/btaf396.
[14]
B. Lake and M. Baroni, “Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks,” in Proceedings of the 35th international conference on machine learning (ICML), 2018, vol. 80, pp. 2873–2882, [Online]. Available: https://proceedings.mlr.press/v80/lake18a.html.
[15]
D. Keysers et al., “Measuring compositional generalization: A comprehensive method on realistic data,” in International conference on learning representations (ICLR), 2020, [Online]. Available: https://openreview.net/forum?id=SygcCnNKwr.
[16]
J. Johnson, B. Hariharan, L. van der Maaten, L. Fei-Fei, C. L. Zitnick, and R. Girshick, CLEVR: A diagnostic dataset for compositional language and elementary visual reasoning,” in Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), 2017, pp. 2901–2910, doi: 10.1109/CVPR.2017.215.
[17]
D. A. Hudson and C. D. Manning, GQA: A new dataset for real-world visual reasoning and compositional question answering,” in Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), 2019, doi: 10.1109/CVPR.2019.00686.
[18]
S. Geng, M. Josifoski, M. Peyrard, and R. West, “Grammar-constrained decoding for structured NLP tasks without finetuning,” in Proceedings of the 2023 conference on empirical methods in natural language processing (EMNLP), 2023, pp. 10932–10952, [Online]. Available: https://aclanthology.org/2023.emnlp-main.674.
[19]
B. T. Willard and R. Louf, “Efficient guided generation for large language models.” 2023, [Online]. Available: https://arxiv.org/abs/2307.09702.
[20]
T. Koo, F. Liu, and L. He, “Automata-based constraints for language model decoding,” in Proceedings of the first conference on language modeling (COLM), 2024, [Online]. Available: https://openreview.net/forum?id=BDBdblmyzY.
[21]
K. Park, T. Zhou, and L. D’Antoni, “Flexible and efficient grammar-constrained decoding,” in Proceedings of the 42nd international conference on machine learning (ICML), 2025, vol. 267, pp. 48262–48275, [Online]. Available: https://proceedings.mlr.press/v267/park25l.html.
[22]
S. Geng et al., JSONSchemaBench: A rigorous benchmark of structured outputs for language models.” 2025, [Online]. Available: https://arxiv.org/abs/2501.10868.
[23]
W. Chen, X. Ma, X. Wang, and W. W. Cohen, “Program of thoughts prompting: Disentangling computation from reasoning for numerical reasoning tasks,” Transactions on Machine Learning Research, 2023, [Online]. Available: https://openreview.net/forum?id=YfZ4ZPt8zd.
[24]
L. Gao et al., PAL: Program-aided language models,” in Proceedings of the 40th international conference on machine learning (ICML), 2023, vol. 202, pp. 10764–10799, [Online]. Available: https://proceedings.mlr.press/v202/gao23f.html.
[25]
X. Wang et al., “Self-consistency improves chain of thought reasoning in language models,” in International conference on learning representations (ICLR), 2023, [Online]. Available: https://openreview.net/forum?id=1PL1NIMMrw.
[26]
S. Yao et al., ReAct: Synergizing reasoning and acting in language models,” in International conference on learning representations (ICLR), 2023, [Online]. Available: https://openreview.net/forum?id=WE_vluYUL-X.
[27]
The UniProt Consortium, UniProt: The universal protein knowledgebase in 2025,” Nucleic Acids Research, vol. 53, no. D1, pp. D609–D617, 2025, doi: 10.1093/nar/gkae1010.
[28]
W. Kabsch and C. Sander, “Dictionary of protein secondary structure: Pattern recognition of hydrogen-bonded and geometrical features,” Biopolymers, vol. 22, no. 12, pp. 2577–2637, 1983, doi: 10.1002/bip.360221211.
[29]
Anthropic, Released April 16, 2026“Introducing Claude Opus 4.7.” https://www.anthropic.com/news/claude-opus-4-7, 2026.
[30]
P. J. A. Cock et al., Biopython: Freely available Python tools for computational molecular biology and bioinformatics,” Bioinformatics, vol. 25, no. 11, pp. 1422–1423, 2009, doi: 10.1093/bioinformatics/btp163.
[31]
G. Labesse, N. Colloc’h, J. Pothier, and J.-P. Mornon, P-SEA: A new efficient assignment of secondary structure from C\(_\alpha\) trace of proteins,” Computer Applications in the Biosciences, vol. 13, no. 3, pp. 291–295, 1997, doi: 10.1093/bioinformatics/13.3.291.
[32]
P. Kunzmann and K. Hamacher, Biotite: A unifying open source computational biology framework in Python,” BMC Bioinformatics, vol. 19, p. 346, 2018, doi: 10.1186/s12859-018-2367-z.
[33]
N. Shinn, F. Cassano, A. Gopinath, K. Narasimhan, and S. Yao, Reflexion: Language agents with verbal reinforcement learning,” in Advances in neural information processing systems (NeurIPS), 2023, vol. 36, pp. 8634–8652, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2023/hash/1b44b878bb782e6954cd888628510e90-Abstract-Conference.html.
[34]
S. Yao et al., “Tree of thoughts: Deliberate problem solving with large language models,” in Advances in neural information processing systems (NeurIPS), 2023, vol. 36, [Online]. Available: https://papers.nips.cc/paper_files/paper/2023/hash/271db9922b8d1f4dd7aaef84ed5ac703-Abstract-Conference.html.
[35]
A. Madaan et al., Self-Refine: Iterative refinement with self-feedback,” in Advances in neural information processing systems (NeurIPS), 2023, vol. 36, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2023/hash/91edff07232fb1b55a505a9e9f6c0ff3-Abstract-Conference.html.
[36]
T. B. Brown et al., “Language models are few-shot learners,” in Advances in neural information processing systems (NeurIPS), 2020, vol. 33, pp. 1877–1901, [Online]. Available: https://papers.nips.cc/paper_files/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html.
[37]
J. Wei et al., “Chain-of-thought prompting elicits reasoning in large language models,” in Advances in neural information processing systems (NeurIPS), 2022, vol. 35, pp. 24824–24837, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2022/hash/9d5609613524ecf4f15af0f7b31abca4-Abstract-Conference.html.
[38]
T. Kojima, S. S. Gu, M. Reid, Y. Matsuo, and Y. Iwasawa, “Large language models are zero-shot reasoners,” in Advances in neural information processing systems (NeurIPS), 2022, vol. 35, pp. 22199–22213, [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2022/hash/8bb0d291acd4acf06ef112099c16f326-Abstract-Conference.html.
[39]
Guidance AI, GitHub repositoryLow-level Guidance (llguidance).” https://github.com/guidance-ai/llguidance, 2024.
[40]
B. Eikema and W. Aziz, “Is MAP decoding all you need? The inadequacy of the mode in neural machine translation,” in Proceedings of the 28th international conference on computational linguistics (COLING), 2020, pp. 4506–4520, [Online]. Available: https://aclanthology.org/2020.coling-main.398.
[41]
A. Yang et al., Qwen3 technical report.” 2025, [Online]. Available: https://arxiv.org/abs/2505.09388.
[42]
W. Kwon et al., “Efficient memory management for large language model serving with PagedAttention,” in Proceedings of the 29th symposium on operating systems principles (SOSP), 2023, pp. 611–626, doi: 10.1145/3600006.3613165.
[43]
R. Dror, G. Baumer, S. Shlomov, and R. Reichart, “The hitchhiker’s guide to testing statistical significance in natural language processing,” in Proceedings of the 56th annual meeting of the association for computational linguistics (ACL), 2018, pp. 1383–1392, [Online]. Available: https://aclanthology.org/P18-1128.
[44]
B. Efron and R. J. Tibshirani, An introduction to the bootstrap. Chapman & Hall/CRC, 1994.
[45]
Q. McNemar, “Note on the sampling error of the difference between correlated proportions or percentages,” Psychometrika, vol. 12, no. 2, pp. 153–157, 1947, doi: 10.1007/BF02295996.
[46]
Gemma Team, “Gemma 3 technical report.” 2025, [Online]. Available: https://arxiv.org/abs/2503.19786.
[47]
S. Mitternacht, FreeSASA: An open source C library for solvent accessible surface area calculations,” F1000Research, vol. 5, p. 189, 2016, doi: 10.12688/f1000research.7931.1.