Git Product home page Git Product logo

vlca's Introduction

Do Vision and Language Models Share Concepts? A Vector Space Alignment Study

In this work (Li et al., 2024), we have studied the question of whether LMs and VMs learn similar representations of the world, despite being trained on independent data from independent modalities. We present an empirical evaluation across four families of LMs (BERT, GPT-2, OPT, and LLaMA-2) and three vision model architectures (ResNet, Segformer, and MAE). Our experiments show that LMs partially converge towards representations isomorphic to those of VMs.

Getting Started

You can clone this repository issuing:

git clone [email protected]:jiaangli/VLCA.git
cd VLCA
git submodule update --init MUSE

1. Create a fresh conda environment and install all dependencies.

conda create -n vlca python=3.11
conda activate vlca
pip install -r requirements.txt

2. Datasets As part of this work, we release the following datasets:

Dataset Dataset HF Alias
Common Words 79K jaagli/common-words-79k
IMAGENET with Unique Labels (coming soon) jaagli/imagenet-ul
English CLDI (coming soon) jaagli/en-cldi

How to run

Check available model configurations in config.py under MODEL_CONFIGS, available saving paths of datasets under DataConfig, runtime parameters under MuseConfig, and various experimental types under ExperimentType.

Set the corresponding paths in all the files in conf folder.

Example to sequentially run GPT2 and OPT-125m models on ImageNet-21K dataset:

python main.py \
    --multirun \
    +model=gpt2,opt-125m \
    +dataset=imagenet \
    muse.exp_type=BASE

Or only run GPT-2 model on EN-CLDI dataset:

python main.py \
    +model=gpt2 \
    +dataset=cldi \
    muse.exp_type=BASE

Findings

LMs converge toward the geometry of visual models as they grow larger.

convergence.png

We also investigate the effects of incorporating text signals during vision pretraining by comparing pure vision models against selected CLIP vision encoders.

Forest Snow

Citation

If you find our code, data or ideas useful in your research, please consider citing the paper:

@misc{li2024visionlanguagemodelsshare,
      title={Do Vision and Language Models Share Concepts? A Vector Space Alignment Study}, 
      author={Jiaang Li and Yova Kementchedjhieva and Constanza Fierro and Anders Søgaard},
      year={2024},
      eprint={2302.06555},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2302.06555}, 
}

Acknowledgement

Our codebase heavily relies on these excellent repositories:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.