English
meta-ai
meta-pytorch
eva-flow / README.md
bkmi's picture meta-bot's picture
initial commit
73e9f61
|
Raw History Blame Contribute Delete
21.2 kB
metadata
title: EVA-Flow
emoji: 🧪
colorFrom: blue
colorTo: purple
sdk: static
app_file: index.html
pinned: false
license: other
license-name: FAIR Noncommercial Research License
extra_gated_prompt: >-
  Please be sure to provide your full legal name, date of birth, and full
  organization name with all corporate identifiers. Avoid the use of acronyms
  and special characters. Failure to follow these instructions may prevent you
  from accessing this model and others on Hugging Face. You will not have the
  ability to edit this form after submission, so please ensure all information
  is accurate.

  The information you provide will be collected, stored, processed and shared in
  accordance with the [Meta Privacy
  Policy](https://www.facebook.com/privacy/policy/).

  ## EVA-Flow is provided under the FAIR Noncommercial Research License. ##

  ### FAIR Noncommercial Research License v1 Last Updated: August 18, 2025

  “Acceptable Use Policy” means the FAIR Acceptable Use Policy, applicable to
  Research Materials, that is incorporated into this Agreement.

  “Agreement” means the terms and conditions for use, reproduction, distribution
  and modification of the Research Materials set forth herein.


  “Documentation” means the specifications, manuals and documentation
  accompanying  Research Materials distributed by Meta.


  “Licensee” or “you” means you, or your employer or any other person or entity
  (if you are entering into this Agreement on such person or entity’s behalf),
  of the age required under applicable laws, rules or regulations to provide
  legal consent and that has legal authority to bind your employer or such other
  person or entity if you are entering in this Agreement on their behalf.


  “Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or,
  if you are an entity, your principal place of business is in the EEA or
  Switzerland) and Meta Platforms, Inc. (if you are located outside of the EEA
  or Switzerland).

  “Noncommercial Research Uses” means noncommercial research use cases related
  to research, development, education, processing, or analysis and in each case,
  is not primarily intended for commercial advantage or monetary compensation to
  you or others.

  “Research Materials” means, collectively, Documentation and the models,
  software and algorithms, including machine-learning model code, trained model
  weights, inference-enabling code, training-enabling code, fine-tuning enabling
  code, demonstration materials and other elements of the foregoing distributed
  by Meta and made available under this Agreement.

  By clicking “I Accept” below or by using or distributing any portion or
  element of the Research Materials, you agree to be bound by this Agreement.


  1. License Rights and Redistribution.


  a. Grant of Rights. You are granted a non-exclusive, worldwide,
  non-transferable and royalty-free limited license under Meta’s intellectual
  property or other rights owned by Meta embodied in the Research Materials to
  use, reproduce, distribute, copy, create derivative works of, and make
  modifications to the Research Materials.  
   
  b. Redistribution and Use.  
   i. You will not use the Research Materials or any outputs or results of the Research Materials in connection with any commercial uses or for any uses other than Noncommercial Research Uses;


  ii. Distribution of Research Materials, and any derivative works thereof, are
  subject to the terms of this Agreement. If you distribute or make the Research
  Materials, or any derivative works thereof, available to a third party, you
  may only do so under the terms of this Agreement. You shall also provide a
  copy of this Agreement to such third party.


  iii.  If you submit for publication the results of research you perform on,
  using, or otherwise in connection with Research Materials, you must
  acknowledge the use of Research Materials in your publication.


  iv. Your use of the Research Materials must comply with applicable laws and
  regulations (including Trade Control Laws) and adhere to the FAIR Acceptable
  Use Policy, which is hereby incorporated by reference into this Agreement. 2.
  User Support. Your Noncommercial Research Use of the Research Materials is
  done at your own discretion; Meta does not process any information nor provide
  any service in relation to such use.  Meta is under no obligation to provide
  any support services for the Research Materials. Any support provided is “as
  is”, “with all faults”, and without warranty of any kind.


  3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE RESEARCH
  MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS”
  BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF
  ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY
  WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A
  PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE
  APPROPRIATENESS OF USING OR REDISTRIBUTING THE RESEARCH MATERIALS AND ASSUME
  ANY RISKS ASSOCIATED WITH YOUR USE OF THE RESEARCH MATERIALS AND ANY OUTPUT
  AND RESULTS.
   
  4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE
  UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS
  LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS
  OR ANY DIRECT OR INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR
  PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE
  POSSIBILITY OF ANY OF THE FOREGOING.
   
  5. Intellectual Property.


  a. Subject to Meta’s ownership of Research Materials and derivatives made by
  or for Meta, with respect to any derivative works and modifications of the
  Research Materials that are made by you, as between you and Meta, you are and
  will be the owner of such derivative works and modifications.
   
  b. If you institute litigation or other proceedings against Meta or any entity
  (including a cross-claim or counterclaim in a lawsuit) alleging that the
  Research Materials, outputs or results, or any portion of any of the
  foregoing, constitutes infringement of intellectual property or other rights
  owned or licensable by you, then any licenses granted to you under this
  Agreement shall terminate as of the date such litigation or claim is filed or
  instituted. You will indemnify and hold harmless Meta from and against any
  claim by any third party arising out of or related to your use or distribution
  of the Research Materials.
   
  6. Term and Termination. The term of this Agreement will commence upon your
  acceptance of this Agreement or access to the Research Materials and will
  continue in full force and effect until terminated in accordance with the
  terms and conditions herein. Meta may terminate this Agreement if you are in
  breach of any term or condition of this Agreement. Upon termination of this
  Agreement, you shall delete and cease use of the Research Materials. Sections
  3, 4 and 7 shall survive the termination of this Agreement. 
   
  7. Governing Law and Jurisdiction. This Agreement will be governed and
  construed under the laws of the State of California without regard to choice
  of law principles, and the UN Convention on Contracts for the International
  Sale of Goods does not apply to this Agreement. The courts of California shall
  have exclusive jurisdiction of any dispute arising out of this Agreement. 


  8. Modifications and Amendments. Meta may modify this Agreement from time to
  time; provided that they are similar in spirit to the current version of the
  Agreement, but may differ in detail to address new problems or concerns. All
  such changes will be effective immediately. Your continued use of the Research
  Materials after any modification to this Agreement constitutes your agreement
  to such modification. Except as provided in this Agreement, no modification or
  addition to any provision of this Agreement will be binding unless it is in
  writing and signed by an authorized representative of both you and Meta.


  FAIR Acceptable Use Policy 

  The Fundamental AI Research (FAIR) team at Meta seeks to further understanding
  of new and existing research domains with the mission of advancing the
  state-of-the-art in artificial intelligence through open research for the
  benefit of all. 

  As part of this mission, Meta makes certain research materials available for
  noncommercial research use. Meta is committed to promoting the safe and
  responsible use of such research materials.  

  Prohibited Uses

  You agree you will not use, or allow others to use, Research Materials to:

   Violate the law or others’ rights, including to:
  Engage in, promote, generate, contribute to, encourage, plan, incite, or
  further illegal or unlawful activity or content, such as: Violence or
  terrorism Exploitation or harm to children, including the solicitation,
  creation, acquisition, or dissemination of child exploitative content or
  failure to report Child Sexual Abuse Material Human trafficking, exploitation,
  and sexual violence The illegal distribution of information or materials to
  minors, including obscene materials, or failure to employ legally required
  age-gating in connection with such information or materials. Sexual
  solicitation Any other criminal activity

  Engage in, promote, incite, or facilitate the harassment, abuse, threatening,
  or bullying of individuals or groups of individuals

  Engage in, promote, incite, or facilitate discrimination or other unlawful or
  harmful conduct in the provision of employment, employment benefits, credit,
  housing, other economic benefits, or other essential goods and services

  Engage in the unauthorized or unlicensed practice of any profession including,
  but not limited to, financial, legal, medical/health, or related professional
  practices

  Collect, process, disclose, generate, or infer health, demographic, or other
  sensitive personal or private information about individuals without rights and
  consents required by applicable laws

  Engage in or facilitate any action or generate any content that infringes,
  misappropriates, or otherwise violates any third-party rights, including the
  outputs or results of any technology using FAIR research materials

  Create, generate, or facilitate the creation of malicious code, malware,
  computer viruses or do anything else that could disable, overburden, interfere
  with or impair the proper working, integrity, operation or appearance of a
  website or computer system

  2. Engage in, promote, incite, facilitate, or assist in the planning or
  development of activities that present a risk of death or bodily harm to
  individuals, including use of research artifacts related to the following:

  Military, warfare, nuclear industries or applications, espionage, use for
  materials or activities that are subject to the International Traffic Arms
  Regulations (ITAR) maintained by the United States Department of State

  Guns and illegal weapons (including weapon development)

  Illegal drugs and regulated/controlled substances

  Operation of critical infrastructure, transportation technologies, or heavy
  machinery

  Self-harm or harm to others, including suicide, cutting, and eating disorders

  Any content intended to incite or promote violence, abuse, or any infliction
  of bodily harm to an individual

  3. Intentionally deceive or mislead others, including use of FAIR Research
  Materials related to the following:

   Generating, promoting, or furthering fraud or the creation or promotion of disinformation

   Generating, promoting, or furthering defamatory content, including the creation of defamatory statements, images, or other content

  Generating, promoting, or further distributing spam

   Impersonating another individual without consent, authorization, or legal right

  Representing that outputs of FAIR research materials or outputs from
  technology using FAIR research materials are human-generated

  Generating or facilitating false online engagement, including fake reviews and
  other means of fake online engagement

  4. Fail to appropriately disclose to end users any known dangers of your
  Research Materials.

  Please report any violation of this Policy or other problems that could lead
  to a violation of this Policy by submitting a report
  [here](https://docs.google.com/forms/d/e/1FAIpQLSeb11cryAopJ7LNrC4nxEUXrHY26hfkXQMf_uH-oFgA3WlYZQ/viewform).
extra_gated_fields:
  First Name: text
  Last Name: text
  Date of birth: date_picker
  Country: country
  Affiliation: text
  Job title:
    type: select
    options:
      - Student
      - Research Graduate
      - AI researcher
      - AI developer/engineer
      - Reporter
      - Other
  geo: ip_location
  Test request?: checkbox
  By clicking Submit below I accept the terms of the license and acknowledge that the information I provide will be collected stored processed and shared in accordance with the Meta Privacy Policy: checkbox
  I acknowledge that EVA-Flow is provided under the FAIR Noncommercial Research License, subject to the Acceptable Use Policy (AUP): checkbox
extra_gated_description: >-
  The information you provide will be collected, stored, processed and shared in
  accordance with the [Meta Privacy
  Policy](https://www.facebook.com/privacy/policy/).
extra_gated_button_content: Submit
extra_gated_heading: >-
  Please be sure to provide your full legal name, date of birth, and full
  organization name with all corporate identifiers. Avoid the use of acronyms
  and special characters. Failure to follow these instructions may prevent you
  from accessing this model and others on Hugging Face. You will not have the
  ability to edit this form after submission, so please ensure all information
  is accurate.
language:
  - en
tags:
  - meta-ai
  - meta-pytorch

EVA-Flow

Learning Shared Chemistry for Unified Environment-Aware Molecular Conformation Generation

Paper (arXiv)

Molecules adopt different 3D conformations depending on their surroundings: a drug molecule in vacuum, in solvent, in a crystal lattice, or bound to a protein pocket will look very different. Existing conformer generation methods typically train separate models for each setting.

EVA-Flow is a unified generative model that produces 3D molecular conformations conditioned on the environment. It introduces environment-aware variational encoding and multi-environment flow matching, enabling a single model to handle vacuum, protein-ligand docking, solvation, and crystal packing simultaneously. The model is pretrained on 445K molecules across five datasets and finetuned on four environments with weighted sampling.

EVA-Flow builds on the equivariant flow matching framework of ETFlow (Hassan et al., NeurIPS 2024), extending it with environment graph conditioning, a variational prior over conformer distributions, and a multi-dataset training pipeline.

Setup

conda env create -n evaflow -f env.yml
conda activate evaflow
pip install -e .

Data Preparation

Set the base data directory:

export DATA_DIR=/path/to/data

GEOM (QM9 + DRUGS)

Used by: drugs.yaml, pretrain.yaml, unify.yaml

# Download raw GEOM data
wget https://dataverse.harvard.edu/api/access/datafile/4327252 -O $DATA_DIR/rdkit_folder.tar
tar -zxvf $DATA_DIR/rdkit_folder.tar -C $DATA_DIR

# Preprocess with chemical cleaning (default)
python scripts/prepare_data.py -p $DATA_DIR/rdkit_folder -o $DATA_DIR/processed_drugs

# Or skip cleaning to reproduce the original (uncleaned) dataset
python scripts/prepare_data.py -p $DATA_DIR/rdkit_folder -o $DATA_DIR/processed_drugs --no-clean

Chemical cleaning follows GEOM-Drugs Revisited (Nikitin et al., 2025): RDKit sanitization + kekulization, multi-fragment rejection, and bond-length topology validation (40% covalent-radii tolerance). This removes ~0.01% of molecules with chemically unreasonable geometries.

SPICE + CREST

Used by: pretrain.yaml

Requires SPICE HDF5 files and pre-computed CREST conformers.

python scripts/prepare_data_spice.py \
    --hdf5_dir $DATA_DIR/spice \
    --crest_dir $DATA_DIR/crest_xyz \
    --output_dir $DATA_DIR/processed_spice

OE62

Used by: pretrain.yaml

Requires the OE62 JSON file (df_62k.json).

python scripts/prepare_data_oe62.py \
    --json_path $DATA_DIR/OE62/df_62k.json \
    --output_dir $DATA_DIR/processed_oe62

COD (Crystallography Open Database)

Used by: unify.yaml (as cod_env)

Requires COD molecular structures in Parquet format with space group and lattice parameters.

# Step 1: Process parquet files into .pt
python scripts/prepare_data_cod.py \
    --data_dir $DATA_DIR/cod_molecules \
    --output_dir $DATA_DIR/processed_cod

# Step 2: Add environment graphs with crystal info
python scripts/prepare_data_cod.py \
    --pt_dir $DATA_DIR/processed_cod/cod_env/train
python scripts/prepare_data_cod.py \
    --pt_dir $DATA_DIR/processed_cod/cod_env/val
python scripts/prepare_data_cod.py \
    --pt_dir $DATA_DIR/processed_cod/cod_env/test

Aquamarine Solvation

Used by: unify.yaml (as solv)

Requires the Aquamarine HDF5 file and metadata CSV.

python scripts/prepare_data_solv.py \
    --hdf5_path $DATA_DIR/aquamarine/AQM-sol.hdf5 \
    --csv_path $DATA_DIR/aquamarine/info-final-AQM.csv \
    --output_dir $DATA_DIR/processed_solv

PDBBind

Used by: unify.yaml (as pdb)

Requires PDBBind with ligand SDF and pocket PDB files, plus train/val/test split files.

python scripts/prepare_data_pdb.py \
    --data_dir $DATA_DIR/v2020-other-PL \
    --splits_dir $DATA_DIR/splits \
    --output_dir $DATA_DIR/processed_pdb

After processing, your DATA_DIR should look like:

$DATA_DIR/
├── processed_drugs/drugs/{train,val,test}/*.pt     # Vacuum (GEOM-DRUGS)
├── processed_drugs/qm9/{train,val,test}/*.pt       # Vacuum (GEOM-QM9)
├── processed_spice/spice/{train,val,test}/*.pt     # SPICE conformers
├── processed_oe62/oe62/{train,val,test}/*.pt       # OE62 conformers
├── processed_crest/crest/{train,val,test}/*.pt     # CREST conformers
├── processed_cod/cod_env/{train,val,test}/*.pt     # Crystal packing (COD)
├── processed_solv/solv/{train,val,test}/*.pt       # Solvation (Aquamarine)
└── processed_pdb/pdb/{train,val,test}/*.pt         # Docking (PDBBind)

Config files reference ${DATA_DIR} which is expanded from the environment variable at load time.

Training

# Single-dataset training on GEOM-DRUGS
python scripts/train.py -c configs/drugs.yaml

# Multi-dataset pretraining
python scripts/train.py -c configs/pretrain.yaml

# Multi-dataset unified training
python scripts/train.py -c configs/unify.yaml

Override any config value from the command line:

python scripts/train.py -c configs/drugs.yaml --trainer_args.devices=1 --no_logger

Evaluation

Single-dataset evaluation

python scripts/eval.py --config=configs/drugs.yaml --checkpoint=path/to/checkpoint.ckpt

Unified checkpoint (vacuum + packing + solvation + docking)

Evaluate across all four environments with a single unified checkpoint:

python scripts/eval.py -c configs/eval/drugs.yaml -k path/to/checkpoint.ckpt   # vacuum
python scripts/eval.py -c configs/eval/cod.yaml   -k path/to/checkpoint.ckpt   # crystal packing
python scripts/eval.py -c configs/eval/solv.yaml  -k path/to/checkpoint.ckpt   # solvation
python scripts/eval.py -c configs/eval/pdb.yaml   -k path/to/checkpoint.ckpt   # docking

Or run all four at once:

CKPT=path/to/checkpoint.ckpt bash scripts/run_eval_unify.sh

Compute RMSD coverage metrics

# For molecules (vacuum, solvation, docking)
python scripts/eval_cov_mat.py --path=logs/samples/<task_name>/<datetime>/generated_files.pkl

# For crystals (packing)
python scripts/eval_cov_mat.py --path=logs/samples/<task_name>/<datetime>/generated_files.pkl --tgt_type=crystal

Model Architecture

EvaFlow uses a small equivariant transformer (TorchMD-NET backbone):

Parameter Value
Hidden channels 160
Layers 20
Attention heads 8
CV latent dim 128
Environment dim 128

License

FAIR Noncommercial Research License

Citation

If you use this code, please cite:

@misc{yan2026evaflowlearningsharedchemistry,
      title={EVA-Flow: Learning Shared Chemistry for Unified Environment-Aware Molecular Conformation Generation},
      author={Bing Yan and Anuroop Sriram and Zachary Ward Ulissi and Kyunghyun Cho and Ricky T. Q. Chen and Benjamin Kurt Miller},
      year={2026},
      eprint={2610.36280},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2610.36280},
}