Visual Autoregressive Modeling (VAR)
시각적 자기회귀 모델링(VAR)을 탐색합니다. 차세대 스케일 예측이 기존 방식 및 확산 모델보다 이미지 생성 속도와 품질을 어떻게 향상하는지 배웁니다.
Visual Autoregressive Modeling (VAR) is an advanced computer vision paradigm that adapts the autoregressive learning strategies popularized by Large Language Models (LLMs) to image generation tasks. Traditional visual autoregressive methods encode an image into a 1D sequence and predict it token-by-token in a raster-scan order, which is computationally expensive and ignores the natural 2D structure of visual data. In contrast, VAR introduces a coarse-to-fine "next-scale prediction" approach. It generates images by progressively predicting higher-resolution feature maps or scales, rather than predicting individual tokens row-by-row. This methodology preserves structural integrity while significantly improving both image quality and inference speed.
Link to this sectionVisual Autoregressive Modeling의 작동 원리#
핵심적으로 VAR은 전통적인 다음 토큰 예측을 다음 스케일 예측으로 대체합니다. 이미지는 먼저 VQ-VAE(Vector Quantized Variational AutoEncoder)와 유사한 아키텍처를 사용하여 다중 스케일 이산 토큰 맵으로 압축됩니다. 생성 단계에서 Transformer 모델은 가장 작은 해상도(예: 1x1 그리드)부터 목표 해상도(예: 16x16 또는 32x32 그리드)까지 이 토큰 맵을 순차적으로 예측합니다. VAR은 각 스케일에서 공간 구조를 동시에 처리하므로 2D 이미지에 내재된 양방향 상관관계를 성공적으로 보존합니다.
This novel approach allows VAR models to establish predictable scaling laws comparable to text-based architectures like OpenAI GPT-4. As researchers scale up model parameters, performance improves consistently. According to the NeurIPS 2024 paper on Visual Autoregressive Modeling, VAR successfully surpasses competing architectures across the demanding ImageNet benchmark. It achieves better metrics in both Frechet Inception Distance (FID) and inception scores while executing much faster.
Link to this sectionVAR 대 디퓨전 모델#
VAR을 디퓨전 기반 생성형 AI와 구분하는 것은 중요합니다. 디퓨전 모델은 시작 캔버스에서 연속적인 노이즈를 반복적으로 제거하여 이미지를 생성하는 법을 학습합니다. 하지만 VAR은 이산 토큰에서 작동합니다. 노이즈 제거 대신, 해상도별로 이미지를 자기회귀 방식으로 구축합니다. 디퓨전 Transformer(DiT)가 시각 합성의 주요 표준이었지만, VAR의 토큰 기반 접근 방식은 Transformer 모델에 쏟아진 최적화 연구의 혜택을 직접적으로 받으며 확장성과 데이터 효율성 측면에서 DiT를 능가할 수 있게 합니다.
Link to this section실제 애플리케이션 사례#
LLM의 추론 능력과 고충실도 비전을 결합함으로써 Visual Autoregressive Modeling은 다음과 같은 실용적인 기능을 제공합니다:
- 제로샷 이미지 편집 및 인페인팅: VAR은 네이티브하게 제로샷 조작을 지원합니다. 특정 스케일이나 영역을 마스킹함으로써 개발자는 기본 아키텍처를 재학습하거나 미세 조정할 필요 없이 원활하게 이미지를 편집하거나 확장할 수 있습니다.
- 소매업을 위한 확장 가능한 자산 생성: VAR의 뛰어난 추론 속도는 실시간 고품질 이미지 합성을 가능하게 하여, 대규모로 동적인 제품 배경 생성 및 개인화된 마케팅 자산 제작을 지원합니다.
Link to this section자기회귀 워크플로 구현#
VAR 모델은 콘텐츠 생성에 초점을 맞추고 있지만, Ultralytics YOLO26과 같은 강력한 인식 모델과 결합하여 포괄적인 다중 모드 파이프라인을 구축할 수 있습니다. 예를 들어, YOLO26을 사용하여 정확한 객체 감지(object detection)로 대상을 분리한 다음, 해당 특정 영역을 자기회귀 모델에 전달하여 향상시키거나 스타일을 변경할 수 있습니다.
다음은 다중 스케일 자기회귀 루프가 어떻게 반복적으로 토큰 맵의 다음 스케일을 예측하는지 보여주는 개념적인 PyTorch 스니펫으로, 표준 PyTorch Transformer 모듈을 사용하여 VAR의 기본 논리를 시뮬레이션합니다:
import torch
import torch.nn as nn
# Conceptual VAR Next-Scale Prediction Loop
class SimpleVARGenerator(nn.Module):
def __init__(self):
super().__init__()
# Simulated transformer to predict next resolution token map
self.transformer = nn.TransformerEncoderLayer(d_model=256, nhead=8)
def forward(self, initial_scale_token):
current_tokens = initial_scale_token
# Iteratively generate next scales (e.g., 1x1 -> 2x2 -> 4x4)
for scale in [1, 2, 4]:
# Model predicts the structural layout for the higher resolution
next_scale_tokens = self.transformer(current_tokens)
# Expand and update tokens for the next iteration
current_tokens = torch.cat((current_tokens, next_scale_tokens), dim=1)
return current_tokens
model = SimpleVARGenerator()
seed_token = torch.randn(1, 1, 256) # 1x1 starting scale
final_output = model(seed_token)
print(f"Generated multi-scale tokens shape: {final_output.shape}")데이터셋 큐레이션부터 복잡한 아키텍처 평가까지 엔드 투 엔드 비전 파이프라인 구축을 원하는 연구자를 위해, Ultralytics Platform은 자동 주석, 추적 및 클라우드 배포를 위한 강력한 도구를 제공합니다. 비전 언어 모델(VLM)을 최적화하든 다음 스케일 예측을 실험하든, 통합된 시각 지능 생태계는 실제 사용 사례 전반에서 혁신을 가속화합니다.






