Skip to content
cjpcoolPublic

About

COLM 2026: Public Code and Interface for MetaSymbO

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MetaSymbO

Multi-Agent Language-Guided Metamaterial Discovery via Symbolic Latent Evolution

MetaSymbO turns natural-language design goals into three-dimensional metamaterial lattices. A Designer interprets a design brief, a Generator constructs candidates through symbolic latent operations and optimization, and a Supervisor evaluates predicted elastic properties and proposes refinements. Supported symbolic operations are union, mix, int, and neg.

Paper · Pretrained checkpoints · MetaModulus dataset · Live Design Studio

Citations

We sincerely appreciate for citing the relevant work if you feel helpful on our framework, datasets, or physics-verification tools: MetaSymbO, MetamatBench, and PhyVer.

@inproceedings{chen2026metasymbo,
  title     = {{MetaSymbO}: Multi-Agent Language-Guided Metamaterial Discovery via Symbolic Latent Evolution},
  author    = {Chen, Jianpeng and Zhan, Wangzhi and Fu, Dongqi and Zhang, Junkai and Jia, Zian and Li, Ling and Wang, Wei and Zhou, Dawei},
  booktitle = {Third Conference on Language Modeling},
  year      = {2026},
  url       = {https://openreview.net/forum?id=XccQjdb8wh}
}

@inproceedings{chen2025metamatbench,
  title     = {{MetamatBench}: Integrating Heterogeneous Data, Computational Tools, and Visual Interface for Metamaterial Discovery},
  author    = {Chen, Jianpeng and Zhan, Wangzhi and Wang, Haohui and Jia, Zian and Gan, Jingru and Zhang, Junkai and Qi, Jingyuan and Chen, Tingwei and Huang, Lifu and Chen, Muhao and Li, Ling and Wang, Wei and Zhou, Dawei},
  booktitle = {Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2},
  year      = {2025},
  publisher = {ACM},
  doi       = {10.1145/3711896.3737416},
  url       = {https://doi.org/10.1145/3711896.3737416}
}

@inproceedings{chen-etal-2026-phyver,
  title     = {{PhyVer}: Physics-Grounded Material Claim Verification with Multi-Fidelity Physical Evidence},
  author    = {Chen, Jianpeng and Zhan, Wangzhi and Wang, Haohui and Mayer, Brian and Fu, Dongqi and Zhou, Dawei},
  booktitle = {Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)},
  year      = {2026},
  publisher = {Association for Computational Linguistics},
  pages     = {546--555},
  doi       = {10.18653/v1/2026.acl-demo.54},
  url       = {https://aclanthology.org/2026.acl-demo.54/}
}

Model reproduction · Deployment guidance

Part 1 — Model reproduction

Code organization

All paths below are relative to the repository root:

MetaSymbO/
├── run_modal_agent.py          # Entry point for text-guided structure generation
├── train_ae.py                 # Geometric VAE training
├── train_predictor.py          # Property prediction evaluation and training
├── model/
│   ├── modal_agents.py        # Designer, Generator, and Supervisor collaboration
│   └── symb_logi_ops.py       # Symbolic latent operations: union, mix, int, neg
├── modules/
│   ├── geom_autoencoder.py    # Geometric VAE and property predictor
│   └── ldm/                  # Latent diffusion components for alternative workflows
├── datasets/
│   ├── dataset_truss.py       # LatticeModulus/LatticeStiffness preprocessing
│   └── baseDataset.py         # Dataset paths, cache loading, and data splits
├── evaluation/                # Property metrics and generated-structure evaluation
├── baselines/                 # Prompt-guided and property-guided baselines
├── ablations/                 # Ablation experiments, including pure LLM agents
├── utils/                     # Geometry, graph, latent, and LLM-response utilities
├── visualization/             # Lattice visualization, voxelization, and homogenization
├── checkpoints/               # Downloaded model weights (not included in Git)
├── results/                   # Generated lattice NPZ files (created by generation)
├── predictions_export/        # Exported property predictions and targets
├── metamaterial_design_prompts.csv  # Design prompts for experiments
├── WebInterface/              # Browser interface, API, and isolated model worker
└── deploy/                    # Service configuration and deployment scripts

datasets/ contains loader code; the actual data lives under $METASYMBO_DATASET, which points to a separate LatticeModulus/ directory. The main workflow is run_modal_agent.py → model/modal_agents.py → the models in modules/, using weights from checkpoints/ and saving structures to results/.

Follow these steps from the repository root: activate the environment → download weights and data → run inference or evaluation. Training is optional.

1. Set up the environment

The project uses Python 3.11 · PyTorch 2.6.0 · CUDA 12.4 · PyG 2.6.1. If mat_env is already installed:

conda activate mat_env
cd /path/to/MetaSymbO
First-time installation on Linux
git clone https://github.com/cjpcool/MetaSymbO.git
cd MetaSymbO
conda create -n mat_env python=3.11 -y
conda activate mat_env

python -m pip install "torch==2.6.0+cu124" \
  --index-url https://download.pytorch.org/whl/cu124 \
  --extra-index-url https://pypi.org/simple
python -m pip install torch-geometric==2.6.1
python -m pip install --only-binary=:all: \
  torch_scatter==2.1.2+pt26cu124 torch_sparse==0.6.18+pt26cu124 \
  torch_cluster==1.6.3+pt26cu124 torch_spline_conv==1.2.2+pt26cu124 \
  pyg_lib==0.4.0+pt26cu124 \
  -f https://data.pyg.org/whl/torch-2.6.0+cu124.html

python -m pip install \
  numpy==2.2.0 scipy==1.16.1 pandas==2.3.2 scikit-learn==1.7.1 \
  networkx==3.4.2 sympy==1.13.1 ase==3.26.0 click==8.2.1 \
  matplotlib==3.10.5 plotly==6.3.0 pyvista==0.46.2 seaborn==0.13.2 \
  tqdm==4.67.1 wandb==0.21.1 diffusers==0.35.1 transformers==4.30.2 \
  openai==1.102.0 google-genai==1.32.0

Use matching Torch/PyG builds; see the PyTorch installation reference. These pins follow the existing runtime, with published ASE 3.26.0 replacing its 3.26.0b1 prerelease. A clean installation has not been independently tested.

2. Download weights and data

Checkpoints: download from Google Drive and extract to:

checkpoints/vae_cond_128_beta001_dis_same_100_frac/
├── best_ae_model.pt
└── best_predictor_model.pt

Both files are required. They use the 100-node VAE/predictor configuration with latent dimension 128 and 12 property components.

Dataset: use MetaModulus from MetamatBench, called LatticeModulus in this code. Download the raw pickle and prepare the cache:

export METASYMBO_DATASET="$HOME/datasets/metamaterial/LatticeModulus"
mkdir -p "$METASYMBO_DATASET/data/raw"
curl --fail --location \
  https://huggingface.co/datasets/cjpcool/metamaterial-MetaModulus/resolve/main/data/raw/data.pkl \
  --output "$METASYMBO_DATASET/data/raw/data.pkl"
python -c 'import os; from datasets import LatticeModulus; LatticeModulus(os.environ["METASYMBO_DATASET"], file_name="data")'

The loader creates data/processed/data.pt beneath METASYMBO_DATASET. Keep this variable pointed at the LatticeModulus root directory. The Hugging Face Parquet export is not a direct input to this loader. Property order is Young (3), shear (3), then Poisson (6).

3. Run pretrained inference

Set OPENAI_API_KEY in your process environment, then run:

python run_modal_agent.py \
  --prompt "Design a connected lattice with high stiffness along Z and fewer nodes." \
  --dataset_path "$METASYMBO_DATASET" \
  --cuda -1 \
  --logic_mode union \
  --max_collaboration_num 2 \
  --max_evaluate_num 2 \
  --save_dir results/lattices

This uses the downloaded weights and the default Designer/Supervisor (gpt-4o-mini / gpt-4.1) and makes paid API requests. The CLI reads OPENAI_API_KEY from the environment, not .env. Use --cuda 0 for GPU; -1 runs on CPU. Other operators are mix, int, and neg. See python run_modal_agent.py --help for all options.

Generated NPZ files are saved in results/lattices. Their prop_list stores the input condition, not predicted properties. For repeatable comparisons, record all random seeds, LLM responses, and experiment settings; the CLI's --seed only controls its dataset split.

4. Test the models

These research scripts store configuration in source. Make the edits below before running their commands. Prediction and structure evaluation do not require an API key.

Test Required configuration Command
Property prediction In train_predictor.py, set data_root to the parent of LatticeModulus; keep the default 100-node checkpoint; change test_loader to use test_dataset; retain the first exit() for evaluation-only execution. python train_predictor.py
Generated structures In the main block of evaluation/generation_eval.py, set the dataset path and eval_file_path; change test_datset=dataset[:1000] to test_datset=test_data. python evaluation/generation_eval.py

Property evaluation reports R², NRMSE, and MAE and writes NPZ/CSV files to predictions_export/. Structure evaluation reports validity, coverage, and repetition. Use the intended experiment split: the predictor example uses 8,000/40/remainder; the structure example uses 8,000/1/remainder (train/valid/test).

Verified in mat_env on CPU: property evaluation completed for 840 held-out samples; structure evaluation completed for five existing generated structures against 879 reference structures. These checks used temporary script copies with the edits above and existing local weights/data; they did not include fresh downloads, retraining, or paid LLM generation.

5. Train from scratch

Train the VAE first, then the property predictor. Both scripts need the configuration changes below; the unedited AE script targets 30 nodes and the predictor script exits before training.

Required training configuration and script adjustments

Set these values in both train_ae.py and train_predictor.py:

data_root = os.path.dirname(os.environ["METASYMBO_DATASET"])
MAX_NODE_NUM = sample_max_num_nodes = 100
train_size, valid_size = 8000, 40
latent_dim, condition_dim = 128, 12
load_name = save_name = 'metasymbo_retrain_100'
use_wandb = False

Use a new output directory for a fresh run; existing checkpoints under load_name are loaded automatically. In train_predictor.py, also:

  1. Remove the first exit() after the initial evaluation/export block.
  2. Remove y = y[:, :3] from the training loop to retain all 12 targets.
  3. In the later evaluate() function, change pred_young.append(y_pred) to pred_young.append(young) and add return r2, nrmse, mae at its end.
  4. Use valid_dataset in test_loader during training and reserve test_dataset for final evaluation.

The scripts default to batch size 512, Adam learning rate 5e-4, and 5,000 VAE / 10,000 predictor epochs. Reduce batch size to fit your GPU. These settings match the main model's architecture; exact paper reproduction additionally requires matching the original data filtering, split, prompts, and experiment settings.

After applying those changes:

python train_ae.py
python train_predictor.py

Weights are saved under checkpoints/metasymbo_retrain_100/. Use --save_name_ae checkpoints/metasymbo_retrain_100 for inference with the new pair. For final prediction evaluation, restore the evaluation-only setup in Step 4 and set load_name='metasymbo_retrain_100'.

Part 2 — Deployment guidance

Try MetaSymbO online

Watch the demo introduction video

Explore existing designs or generate a lattice directly in your browser. No installation, SSH tunnel, account, or personal API key is required. The hosted service already has its model environment, checkpoints, and dataset configured.

MetaSymbO Design Studio showing an interactive lattice, predicted elastic properties, and geometry checks

Workflow What you can do
Explore Browse saved lattices; rotate, zoom, inspect nodes, and repeat unit cells in 3D.
Generate Describe a mechanical design goal and follow asynchronous generation.
Predict Inspect predicted Young's modulus, shear modulus, and Poisson-ratio components.
Compare Inspect up to four candidates with synchronized cameras and geometry/property tables.
Review evidence Examine connectivity checks, supervisor scores, and suggested refinements.
Keep results Reopen runs, import NPZ lattices, and export geometry, CSV, images, and JSON reports.

Start with Explore Existing Designs or Generate New Design. Example brief:

Design a simple connected lattice that is stiffer along Z than X and Y, with fewer than 20 nodes.

The shared demo runs one model job at a time. Generation is limited to two requests per hour per IP, with bounded attempts and runtime. Public runs belong to your browser session; export important results before the seven-day cleanup window. The service currently uses HTTP, so avoid confidential inputs.

Interface guide · Deployment and operations · Service health

Run the interface locally

Complete Part 1's environment, checkpoint, and dataset setup, then install the web dependencies and start the server:

conda activate mat_env
python -m pip install fastapi==0.119.0 uvicorn==0.37.0 pydantic==2.11.7
export METASYMBO_CHECKPOINT="$PWD/checkpoints/vae_cond_128_beta001_dis_same_100_frac"
export METASYMBO_DATASET="$HOME/datasets/metamaterial/LatticeModulus"
export METASYMBO_DEVICE=cpu
python -m WebInterface.app --port 18766

Open http://127.0.0.1:18766. Run this command from the repository root. The frontend uses plain HTML/CSS/JavaScript and the installed Plotly bundle; no frontend build step or CDN is required. Port 18765 is reserved for the existing deployed backend on zhoulab-1.

For generation, configure OPENAI_API_KEY in a server-side environment variable or the Git-ignored root .env, and restrict the file to its owner:

chmod 600 .env

The server reads the key without executing the file, and credentials never reach browser JavaScript. Prediction does not require an API key or the reference dataset; generation requires both. Browsing alone needs only NumPy, FastAPI, Uvicorn, Plotly, and saved lattices.

The web worker defaults to CPU, gpt-4o-mini for the Designer, and gpt-4.1 for the Supervisor. See the configuration table for paths and model overrides. It uses 30 lattice-optimization steps, 50 geometry-optimization steps, and bounded provider requests, so its defaults differ from the research CLI.

Persistent hosting and application checks

The hosted demo uses Caddy on public port 5559 → FastAPI on 127.0.0.1:18765 → an asynchronous model worker. User systemd services keep it running after logout and reboot. The supplied service files target the existing checkout and mat_env environment on zhoulab-1; update their absolute paths, Python executable, and deploy/public.env before installing on another machine.

After adapting those files, the deployment commands are:

deploy/service.sh install
deploy/service.sh start
deploy/service.sh status

See the deployment guide for stop/restart commands, logs, resource limits, retention, public access, and HTTPS certificate configuration. Model weights, credentials, deployment binaries, and private run data are not published as web assets.

Application checks are separate from scientific model evaluation:

python -m unittest WebInterface.test_app -v
node --check WebInterface/static/app.js

The Python suite makes no paid API requests. Node is needed for the JavaScript syntax check; Playwright and Chromium are only needed for the optional browser tests. Production validation describes the live-model, browser, persistence, and off-host connectivity checks.

Scientific interpretation and simulation

The interface distinguishes geometry, model predictions, supervisor feedback, and physical simulation. Conditioning vectors are not predictions. Physical units and directional mapping remain unverified in the interface. Symbolic operators do not guarantee exact geometric Boolean operations, and connectivity checks or supervisor scores do not establish mechanical stability, manufacturability, or validated material performance.

The Validate tab records simulation assumptions; it does not execute a solver. Existing lattice voxelization and homogenization utilities are in visualization/. The separate PhyVer demo is a reference for physics-based workflows using atomistic UMA optimization and optional ORCA DFT.

About

COLM 2026: Public Code and Interface for MetaSymbO

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages