Skip to content

Repository files navigation

ProtTeX-CC & Prot2Text-V2-C

Official implementation of ProtTeX-CC: Activating In-Context Learning in Protein LLM via Two-Stage Instruction Compression

Quick Start

1. ProtTeX-CC

Training & Inference of Joint Embed Model

# Setup
conda env create -f prottex_joint_embed.yml
# Replace transformers with version in conda_env_transformers/

# Train
bash run_train.sh

# Inference
bash infer.sh
# Or use: infer_prottex_joint_embed.py (official transformers compatible)

Build Compressed Vector Pool

# Setup
conda env create -f save_embedding.yml
# Replace transformers with /compressed_vector_pool_construction/conda_env_transformers/ version

# Pipeline
bash run_save_embedding.sh                    # Save embeddings to H5
python calculate_h5_sim_gpu.py                # Retrieve top-k similar embeddings
python make_sft_dataset_with_compressed_embedding_index.py  # Build SFT dataset

Train ProtTeX-CC

# Setup: prottex_cc.yml / prottex_cc_infer.yml (replace transformers accordingly)

bash run_sft.sh      # Train
bash run_infer.sh    # Inference

2. Prot2Text-V2-C

bash run_step1_build_demo_pool_ddp.sh         # Build demo pool
bash run_step2_build_retrieval_ddp.sh         # Retrieve similar vectors
bash run_step3_train_prefix_projector_ddp.sh  # Train model
bash run_step4_generate_ddp.sh                # Inference

Resources

Resource Link
Full PFUD Dataset Zenodo
Models (ProtTeX-CC) HuggingFace

Acknowledgments

Citation

@misc{fan2025prottexcc,
  title={ProtTeX-CC: Activating In-Context Learning in Protein LLM via Two-Stage Instruction Compression},
  author={Fan, Chuanliu and Ma, Zicheng and Gao, Jun and Yu, Nan and Zhang, Jun and Cao, Ziqiang and Gao, Yi Qin and Fu, Guohong},
  year={2025},
  eprint={2508.12212},
  archivePrefix={arXiv}
}

@misc{ma2025prottex,
  title={ProtTeX: Structure-In-Context Reasoning and Editing of Proteins with Large Language Models},
  author={Ma, Zicheng and Fan, Chuanliu and Wang, Zhicong and Chen, Zhenyu and Lin, Xiaohan and Li, Yanheng and Feng, Shihao and Zhang, Jun and Cao, Ziqiang and Gao, Yi Qin},
  year={2025},
  eprint={2503.08179},
  archivePrefix={arXiv}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages