Twins: Learn to Predict Unified Representations with Focal Loss

Kaixiong Gong, Xin Cai, Bin Lin, Hao Wang, Yunlong Lin +7 more
7/24/2026
cs.CV
diffusion-flowtransformer-attention

No confident code implementation found for this paper.

Abstract

Unified multimodal models seek a shared visual token space that supports both multimodal understanding and image generation. Discrete methods unify the interface via a shared codebook, whereas continuous pipelines often rely on two disparate representations -- semantic features (e.g., ViT) for understanding and low-level latents (e.g., VAE) for synthesis -- resulting in mismatched latent spaces.

Show full abstract

We propose Twins, a unified continuous token space formed by channel-wise concatenating ViT and VAE features on the same token grid, so the sequence length is unchanged and attention cost does not increase. However, jointly modeling Twins in a Diffusion Transformer exposes a severe optimization imbalance: the model fits the ViT component well but struggles to match the VAE latent distribution. We trace this imbalance to three sources of heterogeneity: frequency bias, intrinsic dimensionality, and condition-aligned vs condition-independent uncertainty. To address it, we adapt a focal regression objective for flow matching that upweights large-error VAE dimensions, better balancing optimization across the ViT and VAE components. On ImageNet, this yields up to 10.57 gFID gain over naive MSE loss without classifier-free guidance. Twins also performs competitively on multimodal understanding benchmarks and improves reconstruction fidelity, narrowing the gap between understanding- and generation-oriented representations.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gong2026twins,
  title  = {Twins: Learn to Predict Unified Representations with Focal Loss},
  author = {Kaixiong Gong and Xin Cai and Bin Lin and Hao Wang and Yunlong Lin and Mingzhe Zheng and Bohao Li and Jian-Wei Zhang and Miles Yang and Zhao Zhong and Liefeng Bo and Xiangyu Yue},
  year   = {2026},
  eprint = {2607.22531},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.22531v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.22531.svg)](https://codeofpaper.com/paper/2607.22531)

Discussion