explaingit

lxiangyue/rosetta

Analysis updated 2026-05-18

12PythonAudience · researcherComplexity · 5/5LicenseSetup · hard

TLDR

A research codebase from HKUST and Tencent for training multimodal AI models that handle text, image understanding, and image generation together without forgetting language skills.

Mindmap

mindmap
  root((Rosetta))
    What it does
      Trains multimodal models
      Avoids catastrophic forgetting
      Shares knowledge across tasks
    Tech stack
      Python
      PyTorch
      CUDA and Flash Attention
    Use cases
      Research multimodal pretraining
      Compare against MoE and MoT
      Run benchmark evaluations
    Audience
      ML researchers
      Multimodal model builders
      Academic labs

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Reproduce the catastrophic forgetting comparison between Rosetta, MoE, and MoT architectures.

USE CASE 2

Train a multimodal model that combines text, image understanding, and image generation.

USE CASE 3

Run evaluation benchmarks like MMLU and ARC Challenge against the released checkpoints.

USE CASE 4

Study the Rosetta FFN architecture as a reference for building non-destructive multimodal models.

What is it built with?

PythonPyTorchCUDAFlash AttentionHugging Face

How does it compare?

lxiangyue/rosettaaim-uofa/reasonmatchairbone42/360-data-athlete
Stars121212
LanguagePythonPythonPython
Setup difficultyhardhardhard
Complexity5/55/54/5
Audienceresearcherresearchergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires CUDA 12.8+, Flash Attention compiled from source, and tens of gigabytes of downloaded checkpoints and datasets.

You can use, modify, and distribute this project freely, including for commercial purposes, as long as you keep the copyright and license notices.

In plain English

Rosetta is a research project and codebase from HKUST and Tencent Hunyuan for training AI models that can handle text, images, and image generation together, rather than bolting these abilities on separately. Many models that try to add new abilities, like generating images, on top of an existing language model end up forgetting some of what they already knew about language, a problem the authors call catastrophic forgetting. Rosetta is built to avoid this by sharing a core of knowledge across all the tasks, while still letting each type of task, text, image understanding, and image generation, use specialized parts of the network suited to it. The paper behind this repository describes an architecture called Rosetta FFN with three main ideas. Attention layers are shared globally so information can flow between different types of input. Feed forward layers are split into specialized experts for text, images, and image generation, but all of them connect back to one shared expert that anchors the model's foundational knowledge. Finally, an optimization technique described in the paper resolves conflicting training signals between tasks without needing extra memory. Using this repository requires a serious machine learning setup. It expects Python 3.12 and a recent CUDA toolkit for GPU acceleration, plus PyTorch, Flash Attention, and several gigabytes of downloaded model weights, tokenizers, and evaluation datasets from Hugging Face. The authors provide a one command demo that reproduces the forgetting problem directly, training a model to generate images for just 100 steps and then comparing how much its language ability drops compared to two competing designs, called MoE and MoT. According to the README, Rosetta holds onto its language ability far better than either alternative in this test. The repository also includes scripts for full training runs, both on a single GPU and across multiple machines with multiple GPUs each, along with instructions for running evaluation benchmarks like MMLU and ARC Challenge. This is research code aimed at people already working on large multimodal models rather than a beginner friendly tool, and it is released under the Apache 2.0 license.

Copy-paste prompts

Prompt 1
Set up Rosetta's environment and run the one command demo that reproduces catastrophic forgetting.
Prompt 2
Explain how Rosetta's shared expert and modality specific experts prevent forgetting during multimodal training.
Prompt 3
Help me configure multinode training for Rosetta across 8 machines using the provided launch scripts.
Prompt 4
Download the Rosetta-3.8B-A1B checkpoint and run the ARC-Challenge evaluation.

Frequently asked questions

What is rosetta?

A research codebase from HKUST and Tencent for training multimodal AI models that handle text, image understanding, and image generation together without forgetting language skills.

What language is rosetta written in?

Mainly Python. The stack also includes Python, PyTorch, CUDA.

What license does rosetta use?

You can use, modify, and distribute this project freely, including for commercial purposes, as long as you keep the copyright and license notices.

How hard is rosetta to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is rosetta for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.