OFASys: A Multi-Modal Multi-Task Learning System for Building Generalist Models

Jinze Bai, Rui Men, Hao Yang, Xuancheng Ren, Kai Dang, Yichang Zhang, Xiaohuan Zhou, Peng Wang, Sinan Tan, An Yang, Zeyu Cui, Yu Han, Shuai Bai, Wenbin Ge, Jianxin Ma, Junyang Lin, Jingren Zhou, Chang ZhouarXiv 2022 · DOI

Introduction

The field of Artificial Intelligence is currently transitioning from "specialist" models—designed for single tasks like image classification or text translation—toward "generalist" models capable of handling dozens of tasks across diverse modalities. However, building these generalists presents a significant engineering challenge. Researchers must manually manage complex relationships between disparate data types, neural architectures, and training objectives. OFASys (One-For-All System) is a comprehensive framework designed to break this "complexity wall" by providing a unified, declarative interface for multi-modal multi-task learning.

The Multi-Modal Instruction Interface

The core innovation of OFASys is its Multi-Modal Instruction interface. Instead of writing custom data-loading and processing pipelines for every new task, users define tasks using a single line of declarative code. For example, a captioning task can be defined as: [IMAGE:img] what does the image describe? -> [TEXT:cap]

This approach decouples task definitions from model implementation, allowing researchers to experiment with new architectures without rewriting task-specific logic.

System Architecture

OFASys employs a modular architecture to handle the complexities of multi-modal data:

  1. Instruction Parser & Dispatcher: This component parses the declarative instruction and routes data to the appropriate modality-specific components.
  2. Modality-Specific Adapters: These "slots" convert raw data—such as pixels, audio waves, or bounding boxes—into a unified sequence of embeddings. This ensures the model's internal "brain" receives a consistent format regardless of input type.
  3. Universal Model: The system defaults to a Transformer-based encoder-decoder. It also supports a Mixture-of-Experts (MoE) version, which allows the model to scale its capacity efficiently by using specialized pathways within a shared backbone.
  4. Multi-Task Engine: A sophisticated scheduler manages batching and optimization across wildly different workloads, such as text-to-SQL and video classification.

Demonstrating Versatility: The OFA+ Model

To demonstrate the system's power, the authors trained OFA+, a generalist model spanning 7 modalities and 23 tasks. The training involved diverse datasets, including LibriSpeech for audio and Kinetics400 for video.

Figure 1: A spectrogram representing the audio modality, one of the seven modalities integrated into the OFA+ model via OFASys.
Figure 2: Video frames used for tasks like action recognition and captioning, illustrating the system's ability to process temporal visual data.

Key Results and Efficiency

The OFA+ (Generalist MoE) model achieved remarkable efficiency and performance:

  • High Performance: It reached 95% of the average performance of 15 specialized models.
  • Parameter Efficiency: It achieved this while using only 16% of the total parameters required by those 15 specialists combined.
  • Zero-Shot Capability: Because the model is trained on instructions, it can perform inference on unseen tasks simply by receiving a new instruction string at test time.

Conclusion and Future Work

OFASys successfully simplifies the development of generalist models by treating every task as a simple instruction. While currently optimized for Transformer-based architectures, future work aims to integrate other structures like U-Nets and refine the multi-task scheduling "recipe" for even larger sets of diverse tasks. The system reinforces the idea that almost any data—from human joint rotations to bounding boxes—can be tokenized and processed by a universal Transformer backbone.

Summary updated

BibTeX
@misc{bai2022ofasys,
  author = {Jinze Bai and Rui Men and Hao Yang and Xuancheng Ren and Kai Dang and Yichang Zhang and Xiaohuan Zhou and Peng Wang and Sinan Tan and An Yang and Zeyu Cui and Yu Han and Shuai Bai and Wenbin Ge and Jianxin Ma and Junyang Lin and Jingren Zhou and Chang Zhou},
  title = {{OFASys: A Multi-Modal Multi-Task Learning System for Building Generalist Models}},
  year = {2022},
  eprint = {2212.04408},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.04408},
}
Figure