OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Ligo

LiGO is a Python research implementation of a method for growing pretrained transformer models by learning an operator from a smaller model and using it to initialize a larger one for training. Its repository accompanies an ICLR 2023 paper and provides BERT and RoBERTa training examples.

Independent OpenViST project profile, based on linked sources.

Ligo — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use LiGO when you want to investigate the documented process of growing a pretrained BERT or RoBERTa model and have the required data, checkpoint and training environment available.

Who it is for

  • Researchers studying efficient transformer training and pretrained-model reuse.
  • Practitioners who want to reproduce the repository's documented BERT or RoBERTa model-growth workflows.

Documented uses

  • Prepare and tokenize English Wikipedia data for the documented BERT or RoBERTa workflows.
  • Train a LiGO operator from a smaller pretrained model checkpoint.
  • Apply a saved operator while training a larger BERT or RoBERTa model.
Before you choose

Requirements & limits

The public GitHub repository displays an MIT license.

  • The documented recipes focus on BERT and RoBERTa, with distinct corpus-processing pipelines for each.
  • The workflow requires both a source-model checkpoint and prepared, tokenized training data.
  • The README lists Transformers 4.21.0 and several supporting libraries; faiss-gpu is listed, with a PyTorch GPU-indexing alternative noted if faiss is unavailable.
  • The repository provides command-line training examples rather than a hosted API.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Prepare Wikipedia data for BERT or RoBERTa

Download, preprocess and tokenize the English Wikipedia corpus for the selected model family.

Before you start

  • The repository's Python dependencies, including PyTorch, torchvision, Transformers 4.21.0 and h5py 2.10 or later.
  • A checkout of the LiGO repository and the required configuration and data scripts.

Steps

  1. For BERT, run the command below; for RoBERTa, run the command below.

    Documented command
    bash data/wiki/get_data_cased.bash en
    Documented command
    bash data/wiki/get_data_cased_untokenized.bash en
  2. For BERT, run the command below; for RoBERTa, run the command below.

    Documented command
    bash tokenization/tokenize_wiki_bert.bash
    Documented command
    bash tokenization/tokenize_wiki_roberta.bash
  3. Use the generated tokenized corpus files in the subsequent training workflow.

Expected outcome

The README says tokenization saves corpus, HDF5 and line files locally for use in training.

Guide limitations

  • BERT and RoBERTa require different data preparation and tokenization pipelines.
  • This guide covers data preparation only, not training or validation.
Source-based practical guide

Train and apply a LiGO operator for BERT

Follow the documented two-stage command sequence to train an operator from a small BERT checkpoint and use it during larger-model training.

Before you start

  • A prepared and tokenized BERT corpus and the repository configuration files.
  • A small BERT checkpoint and writable paths for saving the LiGO operator and training output.
  • The listed Python dependencies, including PyTorch, torchvision and Transformers 4.21.0.

Steps

  1. Run the command below

    Documented command
    python run_grow_distributed.py --config configs/bert_wiki.txt --config_name configs/bert-12L-768H.json --output_dir --tune_width --tune_depth --source_model_path --fuse_init_scheme stackbert_noisy rand --max_steps 100 --logging_steps 100 --ckpt_steps 100 --should_continue
  2. Run `python run_lm_distributed.py --config configs/bert_wiki.txt --config_name configs/bert-12L-768H.json --output_dir --grow_scheme ligo --source_model_path --pretrained_ligo_path --fuse_init_scheme stackbert_noisy rand --learning_rate 2e-4 --warmup_steps 0 --sho

  3. Replace the documented path placeholders with the local checkpoint and output locations.

Expected outcome

The commands are intended to train a LiGO operator and then use it to grow and train a 12-layer, 768-hidden-size BERT model.

Guide limitations

  • The README gives this recipe for its stated configuration and flags; it does not establish results for other models or environments.
  • The sequence assumes data preparation and a source-model checkpoint are already available.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
17 October 2026
Original website title
VITA-Group/LiGO · Official homepage title · retained in its source language