Add a robustness benchmark for homology-class data poisoning#213
Open
teerthsharma wants to merge 1 commit into
Open
Add a robustness benchmark for homology-class data poisoning#213teerthsharma wants to merge 1 commit into
teerthsharma wants to merge 1 commit into
Conversation
This adds a self-contained robustness benchmark to examples/robustness/ that measures how Graphormer behaves under homology-class data poisoning. The benchmark includes: - Synthetic dataset with Betti-1 trigger variants - Graphormer adapter producing OGB-shaped tensors - Minimal Graphormer-style model in plain PyTorch - Signature vs homology detector comparison - End-to-end CLI and pytest suite (31 tests) Headline results (default config): - clean_accuracy: 1.0 - attack_success_rate: 0.96 - signature_detection_rate: 0.4 - homology_detection_rate: 1.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Add a robustness benchmark for homology-class data poisoning
Summary
This PR adds a small, self-contained robustness benchmark to
examples/. It measures how Graphormer behaves when a fractionof training graphs is poisoned with a homology-class trigger —
a substructure whose defining feature is its Betti-1 (cycle rank)
rather than its shape — and contrasts two detectors: a fixed
signature detector (the standard subgraph-isomorphism baseline)
and a homology detector that flags Betti-1 above a threshold.
The contribution is research tooling, not a security claim.
The framing matches how
examples/is used elsewhere in therepo.
What's in the PR
examples/robustness/— the benchmark packagetopology.py— Betti numbers, girth, signature helperstriggers.py— the homology-class trigger generatordataset.py— synthetic two-class graph datasetadapter.py— converts synthetic samples to Graphormer'sOGB-shaped input schema
model.py— minimal Graphormer-style modeldefenses.py— signature and homology detectorsevaluation.py— end-to-end harnesscli.py—python -m graphormer_redteam.cliexamples/robustness/README.md— quickstart and headlinenumbers
examples/robustness/tests/— pytest suite, 31 testsexamples/robustness/docs/METHODOLOGY.md— threat model andrecommended ablations
examples/robustness/requirements.txt— pinned dependenciesWhy a topological benchmark?
Existing graph-classifier robustness benchmarks (e.g. the
GNNBackdoor line of work) fix a subgraph shape as the trigger.
The corresponding defenses look for that shape. The trigger class
in this benchmark is defined by a topological invariant —
Betti-1 — so the trigger family is infinite and the signature
defenses fail systematically. A defense that targets the
invariant catches every variant.
This is a different research question, not a new attack on
Graphormer specifically: the goal is to put the architecture
under the same microscope and to make the comparison cheap to
reproduce.
Headline numbers (default config)
These are reproduced byte-for-byte from a fresh checkout with
seed 0.
What we don't claim
Microsoft product. The benchmark is synthetic and measures
model robustness to a known data distribution, not the
security posture of a deployed system.
change to Graphormer's training pipeline. The change proposed
here is additive (a new
examples/directory) and does nottouch the core model.
benchmark against the real
microsoft/Graphormer, swap theGraphormerClassifierimport forGraphormerModel; theadapter output is field-compatible with the upstream data
loader.
Why this lives in
examples/the repo to work.
use of the model.
reproduce the result.
Testing
pytest -qin the new directory runs 31 tests in ~10s on CPUand produces the same numbers as the CLI run.
Reviewer checklist
(
examples/robustness/is importable in isolation).fresh checkout.
upstream Graphormer data loader.
Follow-ups we are happy to take in subsequent PRs
reproduce a specific run from a single file.
ogbg-molhivandogbg-ppa.uses Betti-1 only).
Looking forward to your feedback.