Auditing Agentic LLM Tool Trajectories: Source Localization and Counterfactual Dependence TestsAuditing Tool Traces in Agentic LLMs: Source Localization and Counterfactual Dependence Testing
PT2D plus deletion audit: after removing PDB on TCR–pMHC, Qwen3-4B's AUROC drops from 0.8136 to 0.4972.
- Serialized tool results may contain identifiers or template traces that correlate with labels but do not carry the intended scientific semantics. When only the concatenated full trace is examined, heterogeneous results dilute the shortcut within a single tool, and benchmark gains may be taken as scientific reasoning.
- The audit has two steps. PT2D performs TF-IDF and balanced logistic regression separately on each tool result, using cross-split AUROC to locate label-prediction patterns, with the full trajectory used only as a control. Token-Class Redaction removes that class from all prompt fields, re-evaluates with the same frozen LLM, and compares against non-overlapping control classes.
- Under PT2D, Tool 3's character 3–5-gram AUROC is 0.6365, and the full trajectory is 0.4876. The five-tool fine-tuned Qwen3-4B has a clusters 1–5 joint AUROC of 0.8136; after removing PDB identifiers it is 0.4972, and after removing peptide sequences it is 0.8152.
- The authors state that the experiments were done only on one TCR–pMHC benchmark, one 4B backbone, and one set of tools; the audit detects shortcuts post hoc, and the conclusions stop at input–output dependencies without addressing internal mechanisms. The fitting partition must align with the target evaluation protocol. The paper does not report the number of repeated training runs.
- Evaluated models
- Qwen3-4B
- Benchmarks
- TCR–pMHC binding (Slone et al., 2025)peptide-disjoint cluster splits (Abeer et al., 2026)
- Metrics
- AUROC∆Ac
The researchers propose a two-stage audit method to locate and test hidden label shortcuts in agentic LLM tool results. In the first stage, PT2D performs a TF-IDF decomposition of individual tool results, locating label-predictive patterns to specific tool results and avoiding dilution in concatenated tool trajectories; the second stage uses token-category ablation as a counterfactual test to check whether a frozen LLM relies on the located shortcut. On the TCR-pMHC binding prediction task, tool augmentation clearly outperforms an evidence-free baseline, but the audit overturns this interpretation: the strongest signal is located to an identifier in one tool result, and removing it drops performance to chance level. The authors therefore note that hidden label shortcuts can masquerade as scientific reasoning or discovery, and that source-level audits should be performed before accepting benchmark gains.
Paper analysis
What problem does this paper attempt to solve?
Identifier shortcuts hidden in tool results make benchmark gains look like scientific reasoning.
Hidden label shortcuts in tool trajectories can make tool-augmented benchmark gains look like scientific reasoning.
- Setting: The authors describe agentic LLMs using external tool results to make scientific predictions. Tool trajectories are serialized results fed into the model, distinct from reasoning trajectories generated by the model itself.
- Importance: The authors state that parametric knowledge may be outdated and models still hallucinate; injected evidence looks like fact-based reasoning and makes predictions auditable against trajectories.
- Limitation: The authors state that identifiers, paths, or template traces can correlate with labels without intended semantics and can cross semantic splits. When only concatenated trajectories are screened, heterogeneous results dilute patterns within a single tool.
- Hypothesis: The authors believe irrelevant tool results mask shortcuts that exist in only one component, so shortcuts should first be located per tool, then tested counterfactually on a frozen model.
- Approach: The authors propose PT2D, which locates label-prediction patterns per tool; then Token-Class Redaction removes that class on a frozen LLM and re-evaluates. The case is five-tool TCR–pMHC binding prediction.
What related research exists?
The authors separate localization from behavioral tests on the frozen model; the related discussion centers on tool augmentation and shortcut learning.
The related work discussed by the authors is mainly tool-augmented pipelines, shortcut learning, and TF-IDF and input erasure.
Tool use and domain systems
- General paradigms: The authors group Toolformer (Schick et al., 2023), ReAct (Yao et al., 2023), retrieval-augmented generation (Lewis et al., 2020), and HuggingGPT (Shen et al., 2023) as tool use, retrieval, and agent pipelines that return multiple tool results to the model.
- Domain systems: GeneGPT (Jin et al., 2024) uses domain tools to obtain biomedical information; Bran et al. (2024) augment LLMs with chemistry tools. The authors state that domain systems have implemented these ideas with genomic databases and chemistry tools.
- Motivation for citation: The authors cite Lewis et al., Jin et al., and Bran et al., stating that parametric knowledge may be incomplete or outdated and that LLMs still hallucinate.
Shortcut learning and evaluation failures
- shortcut learning: Geirhos et al. (2020) discuss shortcut learning in deep networks. The authors use it to refer to text patterns that correlate with labels but do not carry the intended scientific semantics.
- Leakage and Clever Hans: Kapoor and Narayanan (2023) discuss leakage and reproducibility in scientific machine learning; Lapuschkin et al. (2019) discuss Clever Hans predictors. The authors cite both, stating that evidence-augmentation pipelines have an evaluation failure mode that ordinary benchmark checks may miss.
Analysis techniques followed in this paper
- TF-IDF: Term weighting of Salton and Buckley (1988). PT2D uses it to construct features for each tool scope.
- Input erasure: Li et al. (2016) understand neural networks through representation erasure. The authors state that the removal experiments follow this analysis and test one class at a time on the frozen checkpoint.
Baselines and data
- Controls: No-evidence baseline; TF-IDF logistic regression on the full trace; peptide sequence removal; format removal. The authors state that format removal is a sensitivity check, not a clean token-class attribution.
- Data: TCR–pMHC data from Slone et al. (2025), and the peptide-disjoint cluster partition of Abeer et al. (2026).
The authors state that screening only the full trace misses single-tool shortcuts due to dilution, so source localization and counterfactual removal on the frozen model must be separated.
How does the paper address this problem?
PT2D localizes label-predictive text by tool, then performs counterfactual tests by token-class removal on the frozen model.
Overall, PT2D locates label-related text patterns in each tool result, and Token-Class Redaction then tests whether the frozen LLM relies on the located class.
Problem Setup
- Samples: Each sample contains an input xi, a binary label yi, and a trajectory Ei composed of T serialized results. The audit splits Dfit and Deval aligned with the target evaluation protocol; the method itself is not tied to a particular split.
- Target patterns: What is sought is text in tool results that correlates with yi but lacks intended task semantics. The authors state the correlation may come from data construction, identifier assignment, or serialization.
- Running example: Binary TCR–pMHC binding. The downstream LLM predicts from the candidate TCR, peptide–MHC context, and results of five structural biology tools. Tool contents are in §3 and Table 3.
PT2D
- Why separate: The authors state that concatenating irrelevant results masks shortcuts that exist in only one component, causing full-trajectory classifiers to miss them. Therefore each tool is audited separately, with the full trajectory used only as a control.
- Classifier: Build TF-IDF for scope s, fit a balanced logistic regression on Dfit, then score on Deval. The diagnostic metric is As=AUROC(y,ŷ(s)), the AUROC of that scope's predictions against labels.
- Features and ranking: Word n-grams capture surface wording, character n-grams expose identifier fragments. Carriers are ranked by comparison with the full trajectory, chance level, and other tools, with no unified threshold. The authors state the evidence is correlational: predictive patterns are not necessarily used by the downstream LLM, and no retraining or parameter access is needed.
- Settings for this case: Fit on cluster 0, evaluate on clusters 1–5. Word 1–2-gram up to 30,000 features; character 2–5-gram up to 60,000; character 3–5-gram up to 50,000; min_df all 3, character analyzer char_wb. Logistic regression C=1, liblinear, class weight balanced, up to 4,000 iterations (Appendix C).
Token-Class Redaction
- How classes are formed: Trace suspicious sources and substrings back to serialized fields, and group values that generate the same semantics into one class, such as entry identifiers, version strings, or path components. Isolated n-grams may cover only part of a shortcut value, so the whole class is deleted; repeated and non-overlapping classes serve as controls. The authors state PT2D only proposes what to test.
- Intervention: For class c, replace each occurrence in all prompt-bearing fields with that class's placeholder, leaving labels and reference answers unchanged. Same frozen model, generation, parsing, and scoring unchanged. One class is deleted at a time; global replacement prevents the same value from remaining in other fields. The performance change is Δ Ac=Aorig−ARc, with positive values indicating an AUROC drop.
- Interpretation boundary: The authors interpret a performance drop after deleting the target class, together with control stability, as the model relying on that shortcut. The authors state the conclusion is limited to observable behavior, because deletion may also remove correlated signals or change the input distribution.
Trajectory and Scoring in the Case
- Five-segment order: (1) CDR3β biophysical descriptors; (2) McPAS-TCR retrieval and similarity; (3) ThermoMPNN mutation-level stability; (4) position stability and hotspots derived from (3), adapted from Biomni; (5) interface descriptors, with buried surface area using FreeSASA. Tools receive candidate fields and modeled complexes, not labels.
- Identifier appears twice: Tool 3 writes the source filename as ThermoMPNN_inference_ plus the PDB identifier plus .csv; Tool 5 writes the same value again as complex_id. The authors therefore apply deletion to every prompt-bearing field, not just the segment that looks suspicious (Appendix B). Appendix F gives a real trajectory after redaction.
- Fine-tuning and scores: Qwen3-4B is supervised fine-tuned on task fields plus full five-tool trajectories: 10 epochs, rank-16 LoRA on all linear layers (α=32), learning rate 10^-5, global batch 32. Formal deletion uses update-4040. The model generates an integer a from 1 to 10 within the answer marker, and evaluation maps it to (a-1)/9 before computing AUROC. Label balancing refers to sampling with replacement in SFT and class weighting in PT2D, not discarding negative examples.
What experiments did the paper conduct?
The joint AUROC of the five-tool Qwen3-4B is 0.8136; after removing PDB identifiers it is 0.4972, and after removing peptide sequences it is 0.8152.
On peptide-disjoint TCR–pMHC, the five-tool fine-tuned Qwen3-4B has a clusters 1–5 joint test AUROC of 0.8136; after removing PDB identifiers it is 0.4972.
Experimental Setup
- Model under test: Qwen3-4B, checkpoint update-4040. The control is the label-balanced no-evidence model of §3.1; the paper does not state whether its backbone is also Qwen3-4B.
- Data: TCR–pMHC from Slone et al., peptide-disjoint clusters from Abeer et al. Cluster 0 training 12,940 (positive 3,483), validation 1,438 (positive 397); clusters 1–5 test 4,898 (positive 264, negative 4,634). Per-cluster counts are in Table 2.
- Trajectory: Fixed five segments, order in Table 3. Tools do not receive labels. Both Tool 3 and Tool 5 serialize the same PDB identifier.
- Metric: AUROC. Unless otherwise stated, computed jointly on the 4,898 rows; deletion experiments also report per cluster. ∆Ac is original AUROC minus post-deletion AUROC. Generated integers 1–10 are mapped to (a-1)/9. No LLM judge.
- Deletion conditions: Same frozen checkpoint, same 4,898 rows, no assistant prefill, same decoding and parsing. Original, PDB deletion, peptide deletion, and format deletion formats are all valid (Appendix B). The paper does not give sampling parameters such as temperature.
- Diagnostic model: PT2D is a balanced logistic regression, not the downstream LLM. The 95% CI for real dilution comes from 2,000 label-stratified bootstrap resamples. Synthetic dilution uses five seeds per K (20260517–20260521). The paper does not report repeated training.
Main Results
Swipe horizontally to read the table
Condition AUROC ∆Ac Source Original 0.8136 — Table 1 PDB-ID redacted 0.4972 +0.3163 Table 1 Peptide redacted 0.8152 −0.0017 Table 1 - Authors' interpretation: The authors state that after PDB deletion performance falls to chance level, peptide deletion causes no loss, and that this rules out direct reuse of the literal epitope sequence. The authors state that behavior depends on dataset-specific identifiers rather than only on intended biological evidence. The short-prefix attribution comes only from PT2D weights; the deletion supports the full identifier class.
- Between-cluster differences: According to Table 8, the original checkpoint gives C1 0.5746, and C2 to C5 0.8298, 0.8324, 0.8686, 0.8322. After PDB deletion the five clusters are 0.5126, 0.5241, 0.4818, 0.4963, 0.4858. The authors do not separately explain C1.
- No-evidence number: §3.1 cites the no-evidence model's test AUROC of 0.4928 in the development comparison as context for the above joint result. The paper does not state whether 0.4928 uses the same clusters 1–5 joint protocol.
PT2D Localization
- Setup: Dfit is cluster 0, Deval is clusters 1–5, the same as the LLM test clusters. Three feature sets are multiplied by the full trajectory and five tools (Table 4). The Figure 1 caption states Tool 3 is the strongest cross-split carrier; bar heights are not visible in plain text.
- Numbers: Full trajectory is 0.4818, 0.4677, 0.4876. Tool 3 word features 0.4946, character 2–5-gram 0.6288, character 3–5-gram 0.6365. The authors report A3 minus Afull of 0.1489 for the latter setting. Tool 5 character features are 0.5259 and 0.5310. The authors state Tools 1, 2, 4 are near chance.
- Authors' interpretation: The authors state that screening only the concatenated trajectory would suggest little transferable leakage; character features localize the signal to PDB identifier fragments in Tool 3's filename, not to biological statements. The authors state this only shows an exploitable shortcut exists in tool results, and does not yet establish whether the LLM uses it. The authors state _21 leans toward binding and _17 toward non-binding; the fragment list is in Appendix C.
Dilution Experiments
- Protocol: Fix Tool 3, append real tools at 1, 2, 4, 5, refitting the character 3–5-gram classifier at each point (Table 9, Figure 2A). The synthetic pool is 53,512 segments of Tool 1, 2, 4 text from training and test, averaging 1,845.9 characters; sampling uses neither target labels nor clusters (Table 10, Figure 2B).
- Numbers: The real sweep goes from 0.6365 (95% CI [0.6008, 0.6704]) through 0.6049, 0.5284, 0.4956 to 0.4876 (CI [0.4553, 0.5221]). Synthetic K=0 mean 0.6365; K=5 mean 0.5064 (SD 0.0259). The authors state the real sweep decreases monotonically, and synthetic addition reaches chance level at K=5.
- Authors' interpretation: The authors state dilution explains the full-trajectory false negative and supports per-tool decomposition. The Figure 2 caption states adding real or synthetic results dilutes Tool 3's cross-split signal; curve shapes are not visible in plain text.
Format Sensitivity and Prefix Lookup
- Format deletion: Joint AUROC 0.5189, ∆Ac +0.2947; five clusters are 0.4787, 0.4829, 0.4343, 0.5747, 0.5184 (Table 8). The authors state it removes multiple overlapping structural cues, and the drop indicates sensitivity to trajectory scaffolding, not an independent token-class attribution.
- Prefix lookup: Learn prefix-to-binding-rate on cluster 0, use as test score. Positions 1, 2, 3 give C1–C5 joint AUROC of 0.6725, 0.6967, 0.6793 (Table 6). The authors state the two-position prefix is a transferable label correlation, but do not claim the LLM relies only on these two positions; behavioral evidence comes from full identifier deletion in Appendix D.
- Per-cluster exceptions: The two-position prefix gives 0.4967 on C5, and three-position gives 0.4820 on C1 (Table 6). Tool 3 character 3–5-gram gives 0.6999 on C4 and 0.4874 on C5 (Table 5). The authors do not explain these differences.
Other Ablations and Analyses
- Synthetic dilution K=1 mean 0.5701 (SD 0.0121), K=2 mean 0.5429 (SD 0.0218) (Table 10).
- Synthetic dilution K=10 mean 0.4749 (SD 0.0302), K=20 mean 0.4900 (SD 0.0209) (Table 10).
- Replacement counts on the 4,898 rows and their repeated fields: PDB 50,778, peptide 63,674, format 3,582,603 (Table 7).
- Peptide deletion per-cluster AUROC: C1 0.5763, C2 0.8535, C3 0.8437, C4 0.8646, C5 0.8295 (Table 8).
- Full-trajectory character 3–5-gram per cluster: C3 0.6359, C4 0.4565, C5 0.4216 (Table 5).
- Tool 1 character 3–5-gram AUROC on C1 is 0.3769 (Table 5).
What are some points that can be further explored?
The authors state that the audit is post-hoc detection, and the experiments were done on one benchmark, one 4B model, and one set of tools.
The authors write the limitations in Appendix A as post-hoc detection, input–output dependencies, and a single benchmark, a single 4B backbone, and a single tool suite.
Limitations and future directions noted by the authors
- Scope: The experiments were conducted on a single TCR–pMHC benchmark, one 4B backbone, and one set of tools. The authors state that the exact dilution behavior may vary with the length, format, and content of evidence in other settings (Appendix A).
- Partition: The authors state that although PT2D is partition-agnostic, its fitting and evaluation partitions must still align with the evaluation protocol of the target application (Appendix A).
- Post hoc: The authors state that the audit is post hoc: it detects shortcuts rather than preventing them (Appendix A).
- Mechanism: The authors state that the conclusions concern dependencies observable at the input–output level, not how that dependency arises internally (Appendix A).
- Call: The authors want source-wise provenance analysis and counterfactual validation before interpreting behavior as scientific reasoning (Conclusion). This is a call, not follow-up experiments already conducted.
Experimental coverage
- Generation results come from one checkpoint of Qwen3-4B, update-4040; training is 10 epochs, rank-16 LoRA, α=32, learning rate 10^-5, global batch 32 (Appendix B).
- Data counts are in Table 2: 12,940 training, 1,438 validation, 4,898 test; the test reports joint and per-cluster AUROC over five peptide-disjoint clusters.
- Traces are five tool results in a fixed order, and the tools do not receive labels (§3, Appendix F). Removal conditions are PDB identifiers, peptide sequence, and a format sensitivity check (Appendix D, Table 8).
- PT2D covers three sets of n-grams, the full trace, and five tools (Table 4, Table 5). Real dilution has 2,000 stratified bootstrap iterations; synthetic dilution has five seeds, with K up to 20 (Appendix E).
- The paper does not report the number of repeated training runs, does not report decoding temperature or specific sampling parameters, and does not report a statistical significance test for AUROC differences. Table 9 gives 95% CIs for the dilution sweep.
Summarize the main content of the paper
The audit traces the tool gain on this TCR task to PDB identifiers; after removal, the joint AUROC is 0.4972.
This is a two-stage audit of hidden-label shortcuts in tool traces, with TCR–pMHC binding prediction as the case.
- Problem: Identifiers or template traces in serialized tool results can correlate with labels without carrying the intended scientific semantics; heterogeneous results concatenated together can also mask a signal that exists in only one tool.
- Method: PT2D performs TF-IDF and balanced logistic regression separately for each tool, and finds carriers by cross-partition AUROC. Token-Class Redaction removes that class from all prompt fields, re-evaluates with the same frozen model, and compares against non-overlapping controls such as peptide sequence.
- Surface gain: Qwen3-4B fine-tuned on five-tool traces has an AUROC of 0.8136 on the joint test of clusters 1–5 (§3.1). The no-evidence model in the development comparison is 0.4928; the paper does not state whether the protocol is the same.
- Audit numbers: Under character 3–5-grams, Tool 3 has a diagnostic AUROC of 0.6365, and the full trace 0.4876 (Table 4). After removing PDB identifiers, the generation AUROC is 0.4972; after removing peptide sequence, 0.8152 (Table 1).
- Authors' conclusion: The authors state that the apparent generalization comes from dataset-specific PDB identifiers, not only from the intended biological evidence. The authors want source-level provenance and counterfactual validation before interpreting tool-augmented gains as scientific reasoning.