google-deepmind/synthidbio
Captured source
source ↗google-deepmind/synthidbio
Description: SynthID Bio is a family of methods developed by Google DeepMind for embedding highly detectable yet function-preserving watermarks directly into AI-generated biological sequences and structures.
License: Apache-2.0
Stars: 8
Forks: 1
Open issues: 1
Created: 2026-09-29T15:22:45Z
Pushed: 2026-09-30T15:03:34Z
Default branch: main
Fork: no
Archived: no
README:
SynthID Bio: Biological Sequence and Structure Watermarking
SynthID Bio is a family of methods developed by Google DeepMind for embedding highly detectable yet function-preserving watermarks directly into AI-generated biological sequences and structures.
For more details, please refer to our paper: **"Function-preserving watermarking of AI-generated proteins"**.
Overview
SynthID Bio provides watermarking for autoregressive inverse folding models (such as ProteinMPNN) and structure prediction models (such as AlphaFold 3):
- [SynthID Bio-structure](#synthid-bio-structure): Fine-tuned AlphaFold 3
model that embeds imperceptible watermarks into generated 3D biomolecular structures.
- [SynthID Bio-sequence](#synthid-bio-sequence): Watermarking protein
sequences during autoregressive decoding with ProteinMPNN while preserving function and expressivity.
SynthID Bio-Structure
SynthID Bio-structure is a fine-tuned AlphaFold 3 (AF3) model that embeds an imperceptible watermark into biomolecular structures during sampling.
For full instructions on downloading model weights and running watermarked structure predictions with AlphaFold 3, please refer to the AlphaFold 3 Repository.
SynthID Bio-Sequence
SynthID Bio-sequence introduces watermarked sampling into ProteinMPNN.
> [!NOTE] > Drop-in Integration: This watermarked version of ProteinMPNN is designed to be a drop-in replacement for existing protein design pipelines. With minimal installation overhead, it can be integrated into your current workflows, enabling the generation of watermarked protein sequences by simply enabling the watermarking flags.
Installation
We recommend using `uv` or standard Python virtual environments (venv) to manage dependencies.
Follow these steps to set up the environment from scratch on a Linux system:
1. Create and activate a virtual environment:
uv venv synthid_bio --python 3.9 source synthid_bio/bin/activate
*(Or using standard venv: python3.9 -m venv synthid_bio && source synthid_bio/bin/activate)*
2. Install dependencies:
cd synthidbio_sequence uv pip install -r requirements.txt
*(Or using pip: pip install -r requirements.txt)*
3. Install SynthID Text package:
uv pip install -e third_party/synthid-text
*(Or using pip: pip install -e third_party/synthid-text)*
Quick Start
Navigate to the ProteinMPNN directory before running generation scripts:
cd third_party/ProteinMPNN
Generate Normal (Non-Watermarked) Sequences
Run Example 1 to generate baseline unwatermarked sequences and pre-parsed inputs:
(cd examples && bash submit_example_1.sh)
Outputs are stored in `outputs/example_1_outputs/seqs/` and include baseline g-values (~0.5) for detection:
>T=0.1, sample=1, score=0.8581, global_score=0.8581, seq_recovery=0.4151, mean_g_value=0.5037 SIDEDTQKALDFVKALEEANPELMKKVITPDTEMEVNGKKYKGEEIVEFVKELAAKGVK...
Generate Watermarked Sequences
When comparing watermarked to unwatermarked sequences, the watermarking arguments should remain identical across runs so that comparative g-values can be evaluated. Without the --watermark flag, watermarks are not embedded into generated sequences, but detection g-values are still computed so you can measure the watermark's signal strength against the unwatermarked baseline.
> [!TIP] If you have not run submit_example_1.sh above, you can substitute > --jsonl_path outputs/example_1_outputs/parsed_pdbs.jsonl with the pre-parsed > dataset at --jsonl_path test_data/helper_outputs/parsed_pdbs.jsonl.
##### Example 1: Distortionary Watermarking, Low Sampling Temperature
Use repeating keys for a stronger watermark signal, best suited for low-temperature generation (e.g., 0.1):
python protein_mpnn_run.py \ --jsonl_path outputs/example_1_outputs/parsed_pdbs.jsonl \ --out_folder outputs/example_1_watermark_outputs \ --num_seq_per_target 2 \ --sampling_temp 0.1 \ --seed 37 \ --batch_size 1 \ --watermark \ --ngram_len 4 \ --watermark_keys 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Output includes high g-values (>>0.5):
>T=0.1, sample=1, score=1.1907, global_score=1.1907, seq_recovery=0.3868, mean_g_value=0.8902 TIDDDTAIALKYVESLELADPALMSKVITPNTKMEYNGREFVGEEIVAYVEEVKKEGVK...
##### Example 2: Unwatermarked with Distortionary G-Values (Temperature 0.1)
To run an equivalent unwatermarked sequence with distortionary g-values, remove --watermark while keeping the same watermarking arguments:
python protein_mpnn_run.py \ --jsonl_path outputs/example_1_outputs/parsed_pdbs.jsonl \ --out_folder outputs/example_1_unwatermarked_outputs \ --num_seq_per_target 2 \ --sampling_temp 0.1 \ --seed 37 \ --batch_size 1 \ --ngram_len 4 \ --watermark_keys 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
##### Example 3: Non-Distortionary Watermarking, Medium Sampling Temperature
Use non-repeating keys for minimal impact on sequence quality at medium-to-higher sampling temperatures (e.g., 0.5):
python protein_mpnn_run.py \ --jsonl_path outputs/example_1_outputs/parsed_pdbs.jsonl \ --out_folder outputs/example_3_watermark_outputs \ --num_seq_per_target 2 \ --sampling_temp 0.5 \ --seed 37 \ --batch_size 1 \ --watermark \ --ngram_len 4 \ --watermark_keys 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
Output with moderate g-values:
>T=0.5, sample=1, score=1.2134, global_score=1.2134, seq_recovery=0.4150, mean_g_value=0.5892 SVDPDTKRAHDFVDALELADPALMREVITPDTQMEYNGQRFVGEEIVEFVKQIAAEGR...
##### Example 4: Unwatermarked with Non-Distortionary G-Values (Temperature 0.5)
Similarly, to run an equivalent unwatermarked sequence with non-distortionary g-values, remove --watermark while keeping the same watermarking arguments:
python protein_mpnn_run.py \ --jsonl_path...
Excerpt shown — open the source for the full document.